Submitted by ykilcher t3_xycz6y in MachineLearning

https://youtu.be/3N3Bl5AA5QU

Matrix multiplication is the most used mathematical operation in all of science and engineering. Speeding this up has massive consequences. Thus, over the years, this operation has become more and more optimized. A fascinating discovery was made when it was shown that one actually needs less than N^3 multiplication operations to multiply to NxN matrices. DeepMind goes a step further and creates AlphaTensor, a Deep Reinforcement Learning algorithm that plays a single-player game, TensorGame, in order to find even more optimized algorithms for matrix multiplication. And it turns out, there exists a plethora of undiscovered matrix multiplication algorithms, which not only will make everything from computers to smart toasters faster, but also bring new insights into fundamental math and complexity theory.

OUTLINE:

0:00 - Intro

1:50 - Sponsor: Assembly AI (link in description)

3:25 - What even is Matrix Multiplication?

6:10 - A very astounding fact

8:45 - Trading multiplications for additions

12:35 - Matrix Multiplication as a Tensor

17:30 - Tensor Decompositions

20:30 - A formal way of finding multiplication algorithms

31:00 - How to formulate this as a game?

39:30 - A brief primer on AlphaZero / MCTS

45:40 - The Results

48:15 - Optimizing for different hardware

52:40 - Expanding fundamental math

53:45 - Summary & Final Comments

​

Paper: https://www.nature.com/articles/s41586-022-05172-4

Title: Discovering faster matrix multiplication algorithms with reinforcement learning

​

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.

​

Authors: Alhussein Fawzi, Matej Balog, Aja Huang, Thomas Hubert, Bernardino Romera-Paredes, Mohammadamin Barekatain, Alexander Novikov, Francisco J. R. Ruiz, Julian Schrittwieser, Grzegorz Swirszcz, David Silver, Demis Hassabis & Pushmeet Kohli

255

Comments

You must log in or register to comment.

uneaknayum t1_irgvj6v wrote

As someone who works with quantum algorithms, literally matrix multiplication, I have super high hopes of this making its way to the QA sector and helping open up new classes of algorithms and tackle some huge problems in computation complexity.

I was very excited when I saw this yesterday.

Good post. Thanks OP.

54

nomadiclizard t1_irh1khu wrote

I wonder if there's a faster fourier transform algorithm out there o.o

30

uneaknayum t1_irh65rm wrote

Of the subspace of Algos that exist, we have only discovered a handful.

It is statistically likely that there will be, within that same space, an algorithm exists to do most things faster.

Addition might be pretty solved by this point, but no one has said solving a 100k digit addition problem by hand would be efficient.

Faster FT means a faster QTF. Gangbusters!

17

carlthome t1_irhwo6z wrote

FFT is already O(n*log(n)) though so what could be improved? Linear time?

4

_Ruffy_ t1_iri6u60 wrote

I'd say the multiplicative factors left out in the O-notation actually matter in practice..

20

jpopham91 t1_irmwio4 wrote

Isn't what people thought about matrix multiplication before Strassen's algorithm too?

1

-xylon t1_irjih2c wrote

Relax this is just better compilation for algorithms that exist, not new algos.

0

master3243 t1_irhd9dj wrote

When the article was first posted here the top comment was insulting the paper and questioning how Nature reviewers were not scrutinizing enough simply because it was by Google.

I was having long discussions fighting for the paper and hopefully a video like this by Yannic will make people recognize that it's not all fluff and hype but actually a big deal.

22

rlvsdlvsml t1_iri172p wrote

It’s misleading tho bc it’s the same time complexity as current approaches but optimized more for gpu kernel compilation. Arguably the end result is just using a known algorithm to find a more gpu compiler friendly approach since the solution space started with all the operations used in the current approaches.

6

antiquemule t1_iriosbr wrote

Well, it took the editors a year to “not scrutinize carefully enough” so it’s not like they just waved it through.

3

Small_Stand_8716 t1_iria1yl wrote

Informative video, thanks! Although I don't believe this is as groundbreaking as some paint it to be, it is still opens up numerous new avenues to explore.

2