IDEAS home Printed from https://ideas.repec.org/a/nat/nature/v610y2022i7930d10.1038_s41586-022-05172-4.html
   My bibliography  Save this article

Discovering faster matrix multiplication algorithms with reinforcement learning

Author

Listed:
  • Alhussein Fawzi

    (DeepMind)

  • Matej Balog

    (DeepMind)

  • Aja Huang

    (DeepMind)

  • Thomas Hubert

    (DeepMind)

  • Bernardino Romera-Paredes

    (DeepMind)

  • Mohammadamin Barekatain

    (DeepMind)

  • Alexander Novikov

    (DeepMind)

  • Francisco J. R. Ruiz

    (DeepMind)

  • Julian Schrittwieser

    (DeepMind)

  • Grzegorz Swirszcz

    (DeepMind)

  • David Silver

    (DeepMind)

  • Demis Hassabis

    (DeepMind)

  • Pushmeet Kohli

    (DeepMind)

Abstract

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 AlphaZero1 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 ago2. 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.

Suggested Citation

  • Alhussein Fawzi & Matej Balog & Aja Huang & Thomas Hubert & Bernardino Romera-Paredes & Mohammadamin Barekatain & Alexander Novikov & Francisco J. R. Ruiz & Julian Schrittwieser & Grzegorz Swirszcz & , 2022. "Discovering faster matrix multiplication algorithms with reinforcement learning," Nature, Nature, vol. 610(7930), pages 47-53, October.
  • Handle: RePEc:nat:nature:v:610:y:2022:i:7930:d:10.1038_s41586-022-05172-4
    DOI: 10.1038/s41586-022-05172-4
    as

    Download full text from publisher

    File URL: https://www.nature.com/articles/s41586-022-05172-4
    File Function: Abstract
    Download Restriction: Access to the full text of the articles in this series is restricted.

    File URL: https://libkey.io/10.1038/s41586-022-05172-4?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to search for a different version of it.

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Wentao Zhang & Yilei Zhao & Shuo Sun & Jie Ying & Yonggang Xie & Zitao Song & Xinrun Wang & Bo An, 2023. "Reinforcement Learning with Maskable Stock Representation for Portfolio Management in Customizable Stock Pools," Papers 2311.10801, arXiv.org, revised Feb 2024.
    2. O’Malley, Cormac & de Mars, Patrick & Badesa, Luis & Strbac, Goran, 2023. "Reinforcement learning and mixed-integer programming for power plant scheduling in low carbon systems: Comparison and hybridisation," Applied Energy, Elsevier, vol. 349(C).
    3. Weifan Long & Taixian Hou & Xiaoyi Wei & Shichao Yan & Peng Zhai & Lihua Zhang, 2023. "A Survey on Population-Based Deep Reinforcement Learning," Mathematics, MDPI, vol. 11(10), pages 1-17, May.
    4. Tomaž Kosar & Željko Kovačević & Marjan Mernik & Boštjan Slivnik, 2023. "The Impact of Code Bloat on Genetic Program Comprehension: Replication of a Controlled Experiment on Semantic Inference," Mathematics, MDPI, vol. 11(17), pages 1-20, August.
    5. El Amine Cherrat & Snehal Raj & Iordanis Kerenidis & Abhishek Shekhar & Ben Wood & Jon Dee & Shouvanik Chakrabarti & Richard Chen & Dylan Herman & Shaohan Hu & Pierre Minssen & Ruslan Shaydulin & Yue , 2023. "Quantum Deep Hedging," Papers 2303.16585, arXiv.org, revised Nov 2023.

    More about this item

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:nat:nature:v:610:y:2022:i:7930:d:10.1038_s41586-022-05172-4. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Sonal Shukla or Springer Nature Abstracting and Indexing (email available below). General contact details of provider: http://www.nature.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.