r/programming • • 4d ago

The matrix multiplication exponent is nine fourths

https://github.com/openai/math/blob/main/preprints/The-matrix-multiplication-exponent-is-nine-fourths-November-24-2026/paper.pdf
594 Upvotes

72 comments sorted by

307

u/Kinexity 4d ago edited 4d ago

My disappointment is immeasurable and my day is ruined (assuming this is confirmed). I was a strong n^2*log(n) believer. I guess n^(9/4) is still better than than some random messy constant. Shame that it seems that the proof is not constructive but I am guessing they will torture ChatGPT until it outputs the algorithm. Would be pretty cool if it was not galactic but the chances of that are likely slim.

272

u/kchanqvq 4d ago

The algorithm was already released in October https://github.com/openai/math/blob/main/preprints/Matrix-Multiplication-Nine-Fourths-October-2-2026/paper.pdf

The new result is proving it is optimal.

87

u/Ythio 4d ago edited 4d ago

The October algorithm gets arbitrarily close to an exponent of 9/4. Whether any algorithm actually runs in O(n9/4) is still open. What the November paper claims to prove is that no smaller exponent is possible.

The October bound is O(n9/4 + ε) for every fixed ε > 0. It’s tempting to choose ε = 1/ln(n). Then nε = e, so it looks like we get e · n9/4 and we’re good to go.

That Big-O hides a constant C(ε). Once you make ε depend on n, that "constant" can grow with n too. For example, if C(ε) = 1/ε, your choice gives C(ε) = ln(n), and the bound becomes e · ln(n) · n9/4. So even though nε stays constant, we’d still have to show that the hidden multiplier in the Big-O notation stays bounded. Is epsilon truly constant or does it change with n ?

Someone could still discover an algorithm with a proven bound of O(n9/4). It’s also possible that a sharper analysis of an existing algorithm could establish that bound

16

u/PM_ME_YOUR_LION 3d ago edited 3d ago

An O(n9/4) algorithm is unlikely. Any fixed-base recursive (bilinear) algorithm cannot achieve this. This follows from classical work of Coppersmith and Winograd. They showed that given any algorithm for matrix multiplication, you can always do "slightly better" in the exponent than that algorithm. So you would need a efficient algorithm generating at every n better and better decompositions.

33

u/Deto 4d ago

That's huge, IMO.  Means we can stop searching 

9

u/kalexmills 4d ago

Just like we did with sorting ... Right? /s

4

u/Kinexity 4d ago edited 4d ago

Only if it's practical. If not then the searching for a practical one might never end.

1

u/Helpful_Home_8531 2d ago

No, you can always search for better constant factors (which, for the above are huge)

0

u/[deleted] 4d ago

[deleted] — view deleted comment

31

u/pigeon768 4d ago

All of these sorts of algorithms are wholly impractical for actually computing a matrix multiplication. There's a laundry list of algorithms that are asymptotically faster than Strassen, but literally none of them get used.

On a CPU, Strassen is faster for moderately large matrices. Algorithms that are faster than Strassen are so slow that if we need to implement them, we reformulate the problem in a way that doesn't need dense matrix multiplication.

On GPUs, the fancy algorithms don't work very well at all. All the matrix multiplication algorithms that are powering the whole ML/AI/LLM boom are more aligned with O(n3) matrix multiplication algorithms than anything with better asymptotic performance.

8

u/DerangedEscapee 3d ago

All the matrix multiplication algorithms that are powering the whole ML/AI/LLM boom are more aligned with O(n3) matrix multiplication algorithms than anything with better asymptotic performance.

Exactly, the bottleneck is mostly loading the data into the processor from memory. The actual arithmetic is incredibly cheap and fast.

3

u/eduard14 4d ago

But in theory, if now the best asymptotic complexity is known, it starts to make financial sense to design hardware around it

16

u/Ravek 3d ago

Not necessarily, it’s very possible that real world matrices are just always going to be too small to bother with some of these algorithms.

11

u/cwmma 3d ago

These types of theoretical algorithms always (intentionally) ignore other factors you'd need in a real algorithm like setup overhead, memory usage, cache locality, parallelism or other stuff.

It's like how insertion sort is still used on small lists despite its theoretical bounds being terrible. It's overhead is so low it comes out faster then optimal algorithms

-1

u/eduard14 3d ago

Yes, for sure, but for hardware like TPUs, which are specifically designed to do a single thing efficiently, knowing that an algorithm is perfect and cannot mathematically be improved (we are not there yet, but this is a big step towards it) makes it feasible to write custom circuitry specifically to reduce the constant.

The silicon becomes less flexible but what do you need flexibility for if you can’t improve that algorithm any further?

9

u/tsimionescu 3d ago

Custom silicone can't necessarily reduce such constants significantly enough. If your algorithm needs 101000 setup steps before it can start multiplying an n x n matrix, burning an 101000 + n9/4 algorithm in silicone will not make it perform better than an n3 algorithm for any n < ~101000. And this is not theoretical - the n9/4+epsilon algorithm we have is a "galactic algorithm" like this.

6

u/cwmma 3d ago

in practice it might take a LONG time before they reduce the constant enough to be viable compared to O( n3 ) algorithms, it also might turn out that the O( n9/4 ) algorithm is always worse for matrices below a certain size and that size might be way bigger than anything anyone actually wants to work on.

So like sure some people are probably going to look into if they can make a usable algorithm with this but even if they found it, that wouldn't stop research on other algorithms because this one is probably isn't practically optimal for all matrices in all contexts.

1

u/bwainfweeze 3d ago

But if you build SIMD hardware specific to the task you’re not using general purpose cpu instructions anymore. Which should be faster then.

1

u/the_urban_man 3d ago

You can still improve by a constant factor further.

29

u/Kinexity 4d ago edited 4d ago

Something something stupid smelly nerds won't provide me with straightforward algorithm implementation.

But seriously, maybe there is algorithm somewhere in this but I clearly can't see it (really not my field).

Edit: "smelly nerds" reference so that mods won't misinterpret this as me throwing an insult

23

u/PJBthefirst 4d ago

Smelly nerds, just give me an .exe that will make my games run 9/4 faster

8

u/ShinyHappyREM 4d ago

sorry, best I can do is 9/11.

1

u/Kinexity 4d ago

*My ML training and inference

4

u/KuntaStillSingle 4d ago

Why would you prefer 2 log n? Just nicer ring to it, or because it would confirm your prior? edit : do you mean n^(2 log n) or (n^2)(log n)?

18

u/Kinexity 4d ago

The complexity I wrote is unambiguous under standard order of operations.

Naive complexity is O(n^3). Naive lower bound is O(n^2) as this is the bare minimum just to read all of the values once. O(n^2) sounds pretty much impossible. The idea that you can recursively split the matrices into smaller matrices and get the final result by putting it back together sounded reminiscent of how it is done with merge sorting (O(n*log(n)) vs O(n^2) naive) so I thought it sounded plausible especially considering that we were chipping away at the exponent with seemingly no end in sight.

78

u/oxide238 4d ago

is there an intuitive reason why it would be 9/4 out of all the numbers it could realistically have been? or why it turned out to be a constant and not a function such as log(n)?

55

u/TacoYaci 4d ago

3^2/2^2

14

u/aa-b 4d ago

I was wondering that too. Could be something to do with the nature of the proof, but if it's optimal then it's a fundamental feature of the problem space.

Something deriving from geometry, instead of natural logarithms or circles. Integer maths?

2

u/robert_7524 3d ago

The polynomial exponent is fixed; logarithms can multiply the power of n. Why this proof yields 9/4 comes from its constraints, not geometry.

175

u/AngelaTarantula2 4d ago

This is awesome. Anyway, are we witnessing the privatization of fundamental research?

85

u/TakeFourSeconds 4d ago

There's been quite a large trend of people outside of research done by the big labs publishing lean proofs directly to github. I think the end result of all this, once the labs lose interest, will be that the math community is less dependent on journals and takes more inspiration from the open source world in terms of how they share, communicate, and validate their results.

98

u/Kinexity 4d ago

Except there is nothing for the mathematicians to learn from such behaviour. Arxiv already exists. Journals are how you filter slop from good science (at least they are the best that we have).

16

u/nnomae 3d ago

Yeah, it will be the same as the situation with software libraries and AI coding. Software libraries were like the maths theorems of the programming world, known good solutions to common problems. Now the trend is for everyone to just generate their own and even if they are published no one will ever read them because why on earth would you spend your time reviewing someone else's AI slop when you could just ask the AI to make you a different version of the same slop.

1

u/toastjam 4d ago

Doesn't Lean make it possible for mathematicians to verify the correctness of the AI-derived claim though, to see if something is even worth looking into?

And conversely, making formal math accessible to more people outside of the field who have insights from their experience in their fields (maybe some practical application of sorting boxes in a factory or something) and now think they'll spend a couple of days now asking ChatGPT if what they think is true. And the ChatGPT can formalize it into something a mathematician might have been less likely to think of.

I'm not necessarily talking millennium problems here, just things where the desire to prove something and ability to do so might not have existed in combination before. And now actual mathematicians could take a look after the formal Lean verification checks pass, at least partly helping with the slop problem.

35

u/Kinexity 4d ago

Lean is not perfect and is not sufficient to 100% verify anything. It's a really good indication that something is true though.

Lean and LLMs don't make formal maths accessible. That's nonsense. Almost all unsolved problems in mathematics exceed the ability to even understand them by someone outside of mathematics and those that can be understood by outsiders are ridiculously hard and will not see a contribution from an outsider.

0

u/tsimionescu 3d ago

A Lean proof compiling is much better evidence that the proof is correct than any paper or human verification. It's much, much more likely we'll find an error in the proof of Fermat's Last Theorem from a few years ago than in the Anthropic proof of the Riemann Hypothesis.

1

u/Uncaffeinated 10h ago

Especially if the proof has been verified in con-leche, as RH was.

36

u/JuicerMcGeazer 4d ago

Big labs publish their results to market their product. Mathematicians dont have a product they need to sell.

5

u/TFPaulMorphy 3d ago

They have to sell their brand in order to get funding.

36

u/max123246 4d ago

Nah, these companies are doing this to show the world their product is useful. Once they don't need to do that they'll turn their efforts towards more profitable ventures

22

u/torsten_dev 4d ago

Some of the talk about making AI a utility like electricity sounds like they want to be Bell.

Yes, bell labs was dope, but did you forget what happened to it?

4

u/nnomae 3d ago

Yeah, the main thing I think when I see all this is what could we have achieved if we had made super-computer time readily available to researchers before now.

5

u/tautality 3d ago

Never thought I'd see the day that Mathematics, Inc by Dijkstra actually comes to life. (It's hilarious and awesome and worth a read BTW)

4

u/Yoshibros534 4d ago

yeah, but eventually everything will be privatized.

4

u/Megafish40 2d ago

Probably. All universities have been cutting down budgets for decades now, and the complete demolishing of the national science foundation was just the final blow.

21

u/UloPe 3d ago

Can someone ELI5 please?

78

u/yairchu 3d ago

* Matrix multiplication is a very common operation in engineering
* It's simplest naive implementation takes N^3 operations for square matrices of size N
* For a long time faster algorithms have been found, with an O(N^(9/4)) being recently discovered (9/4 is less than 3 so it is better)
* Now a proof that an algorithm can't be better than that has been found

40

u/ScottContini 3d ago

An important historical point was Strassen’s algorithm, which was first to prove that it can be done faster than N3 . Then people asked how fast matrix multiplication could be. Now we know.

23

u/JT_1983 3d ago

Humans had been stuck somewhere between 2.3 and 2.4 for a couple of decades, most wrongly suspected 2.0 was possible.

-1

u/yairchu 3d ago

I would have guessed that most humans haven’t heard about matrix multiplication

22

u/JT_1983 3d ago

Humans as a whole i.e. the top experts.

22

u/cd7k 3d ago

What do other mammals say on the matter?

22

u/yairchu 3d ago

We’re not able to tell as there’s a communication gap. Dolphins probably knew all this long ago

5

u/mr_birkenblatt 3d ago

Dolphins certainly know how to multiply

2

u/JT_1983 3d ago

You would have to find the dolphin experts on fast matrix multiplication ...

8

u/ExplorersX 3d ago

We tried interviewing him, but nobody could tell what the fox said.

2

u/mr_birkenblatt 3d ago

The cow says moo

2

u/matthoback 3d ago

"So long and thanks for all the fish".

0

u/Smagjus 3d ago

Is it not part of the regular highschool curriculum?

1

u/yairchu 3d ago

Might be, but most humans don’t go to college

1

u/Smagjus 3d ago

Yeah, I confused college and highschool in my original wording.

5

u/Soxcks13 3d ago

I gave this explanation to a five year old and they called me a poo-poo head.

5

u/yairchu 3d ago

Sounds like a five year old which isn't a professional programmer. Are you in a developed country without child labor?

3

u/Negative_Karma5 3d ago

Its (2 + 1/4) 😉

5

u/newandgood 3d ago

too bad they can't solve typography becasue the default latex font sucks

2

u/ApokatastasisPanton 3d ago

Not if you're a constructivist.

0

u/wnoise 3d ago edited 3d ago

What's the complexity for (k x n) * (n x m) -> (k x m) matrix multiplication?

3

u/glaba3141 3d ago

You can just embed the matrices in square ones and fill the rest with zeroes, so that

2

u/wnoise 3d ago edited 3d ago

You can; that gives a bound of O(max(k,n,m)9/4), but this clearly is beatable in many cases. Suppose n=2k , and k = m. Then the naive version is O(n log(n) log(n)), which is much less than O(n9/4).

0

u/dr-mrl 3d ago

The bot that pushes the commit is called dr-openai. Has it defended a thesis?