logoalt Hacker News

zahlman • today at 3:18 PM • 0 replies • view on HN

All of the big-O notation (and variants) is a way to measure how the demands of a task grow as the input size grows. We care about this because if one program simply does a task twice as fast as another, or one has a bit less startup time than the other, then we could always make up that difference with a faster computer. That is, if the two algorithms are in the same "complexity class" then the problem size doesn't matter and the performance just depends on our hardware. But if one of them uses an algorithm with a lower complexity, then we can — in principle — always make that program come out ahead, regardless of the hardware, by simply making the problem bigger.

Of course, that's at a hand-wavy, theoretical level. We assume that a bunch of smaller pieces simply take a set amount of time (for example, in this matrix multiplication result, we don't care about how long it takes to multiply really big numbers together compared to small ones, mainly because a really big matrix doesn't necessarily have bigger numbers in it than a small one). And we don't care, when we do these proofs, about whether the algorithms are practical. (In fact it's common in the real world that we use a "slow" algorithm because the "faster" one requires impossibly large problem sizes to show its benefit; maybe we'd have to wait past the end of the heat death of the Universe even in the best case). And most importantly, we have to be able to measure the size of the problem in a consistent way. (For matrix multiplication, we choose n as either dimension of a square matrix. This is arguably non-standard, since it means we have n^2 elements of input data!)

We use this notation to mean that we're throwing away constant factors. For example, "show the first million bytes of a file" is O(1): no matter how long the file gets, we just ignore everything after the first million bytes, so it takes the same amount of time for those longer files. And similarly it doesn't matter how much work is involved in "showing" a byte, nor my choice of "million" for the problem description (since it isn't coupled to n). But "show the first half of a file" is O(n): the longer the file gets, the more we have to show, and the amount we have to show is proportional to that input size.

Anyway, with our standard definitions, the obvious way to multiply matrices needs on the order of n^3 operations. That means that the number of operations we have to do, grows as the cube of the matrix side length. This is the textbook algorithm you would have learned in high school, and it's pretty straightforward to find that o(n^3) result: there are exactly n^2 values in the result, and for each of them, we take a column and a row, match up and multiply each pair (n of them), and add those results (n-1 additions to do; of course the bigger n gets, the less the 1 matters).

On the other hand, we could set an a priori theoretical minimum complexity of n^2, because there's that much output data: we have to compute each value in the result somehow, and computing a value involves stating it (which takes at least a specific constant amount of time no matter what).

Progress on this problem has generally involved finding better algorithms that reduce that exponent from 3, towards 2 (i.e. through non-integer values). In early October, OpenAI showed (to my understanding) that there must be a way to get it arbitrarily close to 2.25, then other mathematicians figured out the way. Now OpenAI has (apparently) shown that we can reach 2.25 exactly, and also that we cannot do any better than that.