Cargando…

Discovering faster matrix multiplication algorithms with reinforcement learning

Improving the efficiency of algorithms for fundamental computations can have a widespread impact, as it can affect the overall speed of a large amount of computations. Matrix multiplication is one such primitive task, occurring in many systems—from neural networks to scientific computing routines. T...

Descripción completa

Detalles Bibliográficos
Autores principales: Fawzi, Alhussein, Balog, Matej, Huang, Aja, Hubert, Thomas, Romera-Paredes, Bernardino, Barekatain, Mohammadamin, Novikov, Alexander, R. Ruiz, Francisco J., Schrittwieser, Julian, Swirszcz, Grzegorz, Silver, David, Hassabis, Demis, Kohli, Pushmeet
Formato: Online Artículo Texto
Lenguaje:English
Publicado: Nature Publishing Group UK 2022
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9534758/
https://www.ncbi.nlm.nih.gov/pubmed/36198780
http://dx.doi.org/10.1038/s41586-022-05172-4
_version_ 1784802617577177088
author Fawzi, Alhussein
Balog, Matej
Huang, Aja
Hubert, Thomas
Romera-Paredes, Bernardino
Barekatain, Mohammadamin
Novikov, Alexander
R. Ruiz, Francisco J.
Schrittwieser, Julian
Swirszcz, Grzegorz
Silver, David
Hassabis, Demis
Kohli, Pushmeet
author_facet Fawzi, Alhussein
Balog, Matej
Huang, Aja
Hubert, Thomas
Romera-Paredes, Bernardino
Barekatain, Mohammadamin
Novikov, Alexander
R. Ruiz, Francisco J.
Schrittwieser, Julian
Swirszcz, Grzegorz
Silver, David
Hassabis, Demis
Kohli, Pushmeet
author_sort Fawzi, Alhussein
collection PubMed
description Improving the efficiency of algorithms for fundamental computations can have a widespread impact, as it can affect the overall speed of a large amount of computations. Matrix multiplication is one such primitive task, occurring in many systems—from neural networks to scientific computing routines. The automatic discovery of algorithms using machine learning offers the prospect of reaching beyond human intuition and outperforming the current best human-designed algorithms. However, automating the algorithm discovery procedure is intricate, as the space of possible algorithms is enormous. Here we report a deep reinforcement learning approach based on AlphaZero(1) for discovering efficient and provably correct algorithms for the multiplication of arbitrary matrices. Our agent, AlphaTensor, is trained to play a single-player game where the objective is finding tensor decompositions within a finite factor space. AlphaTensor discovered algorithms that outperform the state-of-the-art complexity for many matrix sizes. Particularly relevant is the case of 4 × 4 matrices in a finite field, where AlphaTensor’s algorithm improves on Strassen’s two-level algorithm for the first time, to our knowledge, since its discovery 50 years ago(2). We further showcase the flexibility of AlphaTensor through different use-cases: algorithms with state-of-the-art complexity for structured matrix multiplication and improved practical efficiency by optimizing matrix multiplication for runtime on specific hardware. Our results highlight AlphaTensor’s ability to accelerate the process of algorithmic discovery on a range of problems, and to optimize for different criteria.
format Online
Article
Text
id pubmed-9534758
institution National Center for Biotechnology Information
language English
publishDate 2022
publisher Nature Publishing Group UK
record_format MEDLINE/PubMed
spelling pubmed-95347582022-10-07 Discovering faster matrix multiplication algorithms with reinforcement learning Fawzi, Alhussein Balog, Matej Huang, Aja Hubert, Thomas Romera-Paredes, Bernardino Barekatain, Mohammadamin Novikov, Alexander R. Ruiz, Francisco J. Schrittwieser, Julian Swirszcz, Grzegorz Silver, David Hassabis, Demis Kohli, Pushmeet Nature Article Improving the efficiency of algorithms for fundamental computations can have a widespread impact, as it can affect the overall speed of a large amount of computations. Matrix multiplication is one such primitive task, occurring in many systems—from neural networks to scientific computing routines. The automatic discovery of algorithms using machine learning offers the prospect of reaching beyond human intuition and outperforming the current best human-designed algorithms. However, automating the algorithm discovery procedure is intricate, as the space of possible algorithms is enormous. Here we report a deep reinforcement learning approach based on AlphaZero(1) for discovering efficient and provably correct algorithms for the multiplication of arbitrary matrices. Our agent, AlphaTensor, is trained to play a single-player game where the objective is finding tensor decompositions within a finite factor space. AlphaTensor discovered algorithms that outperform the state-of-the-art complexity for many matrix sizes. Particularly relevant is the case of 4 × 4 matrices in a finite field, where AlphaTensor’s algorithm improves on Strassen’s two-level algorithm for the first time, to our knowledge, since its discovery 50 years ago(2). We further showcase the flexibility of AlphaTensor through different use-cases: algorithms with state-of-the-art complexity for structured matrix multiplication and improved practical efficiency by optimizing matrix multiplication for runtime on specific hardware. Our results highlight AlphaTensor’s ability to accelerate the process of algorithmic discovery on a range of problems, and to optimize for different criteria. Nature Publishing Group UK 2022-10-05 2022 /pmc/articles/PMC9534758/ /pubmed/36198780 http://dx.doi.org/10.1038/s41586-022-05172-4 Text en © The Author(s) 2022 https://creativecommons.org/licenses/by/4.0/Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ (https://creativecommons.org/licenses/by/4.0/) .
spellingShingle Article
Fawzi, Alhussein
Balog, Matej
Huang, Aja
Hubert, Thomas
Romera-Paredes, Bernardino
Barekatain, Mohammadamin
Novikov, Alexander
R. Ruiz, Francisco J.
Schrittwieser, Julian
Swirszcz, Grzegorz
Silver, David
Hassabis, Demis
Kohli, Pushmeet
Discovering faster matrix multiplication algorithms with reinforcement learning
title Discovering faster matrix multiplication algorithms with reinforcement learning
title_full Discovering faster matrix multiplication algorithms with reinforcement learning
title_fullStr Discovering faster matrix multiplication algorithms with reinforcement learning
title_full_unstemmed Discovering faster matrix multiplication algorithms with reinforcement learning
title_short Discovering faster matrix multiplication algorithms with reinforcement learning
title_sort discovering faster matrix multiplication algorithms with reinforcement learning
topic Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9534758/
https://www.ncbi.nlm.nih.gov/pubmed/36198780
http://dx.doi.org/10.1038/s41586-022-05172-4
work_keys_str_mv AT fawzialhussein discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT balogmatej discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT huangaja discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT hubertthomas discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT romeraparedesbernardino discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT barekatainmohammadamin discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT novikovalexander discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT rruizfranciscoj discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT schrittwieserjulian discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT swirszczgrzegorz discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT silverdavid discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT hassabisdemis discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning
AT kohlipushmeet discoveringfastermatrixmultiplicationalgorithmswithreinforcementlearning