TL;DR

On 5 October 2026, Josh Alman and Virginia Vassilevska Williams posted a 76-page preprint with the first polynomial speedups for 3SUM and All-Pairs Shortest Paths (APSP). Integer 3SUM now runs in O(n^1.9992) time and APSP in O(n^2.9995). Both results refute hypotheses that fine-grained complexity had relied on for about 30 years. The paper credits Claude with discovering the core algorithm in a single 16M-output-token session with no human input. In the 8 weeks since, follow-up work has pushed the 3SUM exponent to 1.965 in a written paper. A Lean-verified leaderboard reports about 1.92. None of it changes the two-pointer loop in your code. At n = 10^9 the original exponent saves 1.7% of the work, and that’s before the constant factors, which are large.

FactValueSourceVerified
3SUM, original preprintO(n^1.9992), deterministicarXiv:2610.067832026-11-29
APSP, original preprintO(n^2.9995) (Theorem 22: 2.99942)arXiv:2610.067832026-11-29
3SUM, best written boundO(n^1.965), randomizedarXiv:2610.420122026-11-29
3SUM, best Lean-verified boundO(n^1.920279408) (reported)bigospeedrun.com/3sum2026-11-29
APSP, best Lean-verified boundO(n^2.995560713) (reported)bigospeedrun.com/apsp2026-11-29
Peer reviewNone yet; all results are preprintsarXiv listings2026-11-29

The 30-year-old assumption behind dozens of lower bounds

3SUM asks a simple question: given n integers, do three of them sum to zero? Every algorithms course teaches the O(n²) answer. Sort the list, then for each element walk two pointers inward from the ends. A hash-set version is just as short. On Hacker News, one commenter described finding the hash version in about 15 seconds and being puzzled that something so obvious could be optimal.

Researchers had the same puzzle for decades. Gajentaan and Overmars built a theory of “3SUM-hard” geometry problems around 3SUM in 1995, and nobody beat n² by more than polylogarithmic factors afterwards. Baran, Demaine and Pătraşcu, then Grønlund and Pettie, then Chan each removed a few log factors from the bound. The exponent never moved. Researchers turned that stubbornness into a tool, the 3SUM hypothesis: on a word RAM, integer 3SUM needs n^(2−o(1)) time. APSP got the same treatment. Floyd–Warshall and Johnson’s algorithm run in O(n³), and the best previous result, by Ryan Williams in 2018, only removes a 2^Ω(√log n) factor.

Fine-grained complexity built a large web of reductions on top of those two hypotheses. If problem B could be solved fast, then 3SUM could be solved fast, so B is “3SUM-hard”. Dozens of computational-geometry problems, string problems and dynamic data structures got their lower bounds this way. Another HN commenter put the cultural weight plainly: “every grad student who has thought about geometry problems will have spent more time than they’re proud to admit thinking about better algorithms only to realize it’s 3sum hard.”

The Alman–Vassilevska Williams paper breaks both hypotheses at once, with one algorithm.

The textbook O(n²) algorithm, timed

I ran the two classroom versions of 3SUM on Python 3.12.3 to see the quadratic cost that the paper beats. The inputs are all odd integers, so no triple can sum to zero (odd + odd + odd is odd). That forces both algorithms through the full search space, which is the worst case.

import random
import sys
import time


def three_sum_sorted(nums):
    """O(n^2) deterministic: sort once, then two pointers per element."""
    s = sorted(nums)
    n = len(s)
    for i in range(n - 2):
        lo, hi = i + 1, n - 1
        while lo < hi:
            t = s[i] + s[lo] + s[hi]
            if t == 0:
                return (s[i], s[lo], s[hi])
            if t < 0:
                lo += 1
            else:
                hi -= 1
    return None


def three_sum_hash(nums):
    """O(n^2) expected: for each pair, look up the third value in a dict."""
    pos = {}
    for i, x in enumerate(nums):
        pos.setdefault(x, []).append(i)
    n = len(nums)
    for i in range(n):
        a = nums[i]
        for j in range(i + 1, n):
            need = -(a + nums[j])
            for k in pos.get(need, ()):
                if k != i and k != j:
                    return (i, j, k)
    return None


def odd_instance(n, rng):
    bound = n ** 2
    return [2 * rng.randrange(-bound, bound) + 1 for _ in range(n)]

The timing loop doubles n each round and prints the ratio to the previous round:

rng = random.Random(2026)
print(f"python {sys.version.split()[0]}")
print(f"{'n':>6} {'sorted+2ptr s':>14} {'ratio':>6} {'hash s':>8} {'ratio':>6}")
prev = None
for n in (500, 1000, 2000, 4000):
    nums = odd_instance(n, rng)
    t0 = time.perf_counter()
    r1 = three_sum_sorted(nums)
    t1 = time.perf_counter()
    r2 = three_sum_hash(nums)
    t2 = time.perf_counter()
    assert r1 is None and r2 is None
    a, b = t1 - t0, t2 - t1
    ra = f"{a / prev[0]:.2f}" if prev else "-"
    rb = f"{b / prev[1]:.2f}" if prev else "-"
    print(f"{n:>6} {a:>14.3f} {ra:>6} {b:>8.3f} {rb:>6}")
    prev = (a, b)
python 3.12.3
     n  sorted+2ptr s  ratio   hash s  ratio
   500          0.022      -    0.024      -
  1000          0.095   4.29    0.102   4.27
  2000          0.345   3.64    0.538   5.29
  4000          2.027   5.87    2.372   4.41

Doubling n roughly quadruples the time. That’s n² at work. The ratios wobble between 3.6 and 5.9 because of cache effects and timer noise at these small sizes, but the trend is clear. At n = 4,000 a pure-Python scan already takes 2 seconds. For decades the question was whether any algorithm at all could push that ratio below 4 for large n.

What the paper proves

The abstract claims more than two speedups. Through known reductions, one new algorithm speeds up a long list of problems:

ProblemPrevious bestNew bound in arXiv:2610.06783
3SUM, integers of polynomial sizen² / polylog nO(n^1.9992), deterministic
3SUM, real numbersn² / polylog nO(n^1.998) expected, Las Vegas
APSP, polynomial integer weightsn³ / 2^Ω(√log n)O(n^2.9995), deterministic
APSP, real weightsn³ / 2^Ω(√log n)O(n^2.998) expected, Las Vegas
Directed unweighted APSPO(n^2.5275), ZwickO(n^(2+μ−ε)) for a constant ε > 0
Tree edit distance, integer costscubic, up to subpolynomial factorsO(n^2.9995)

The paper also refutes the Exact Triangle hypothesis, the Zero-Weight k-Clique hypotheses, and three hinted Online Matrix–Vector conjectures. For directed unweighted APSP, the authors call it the first improvement over Zwick’s 2002 algorithm that uses a method other than faster rectangular matrix multiplication.

Some hypotheses survive. The paper gives no speedup for the Strong Exponential Time Hypothesis (SETH) or for Orthogonal Vectors, and HN commenters were quick to confirm that SETH still stands. Problems that are only 3SUM-hard don’t get faster either, because their reductions point the other way. The paper’s own example is deciding whether n points in the plane contain three on a line. The authors say the fastest known time for it is still O(n²), “without even any polylogarithmic improvements.”

How the trick works: compute only the wanted entries

Every result in the paper comes from one theorem about multiplying thin matrices. Take an N × D matrix X and a D × N matrix Y. D is a small power of N. You don’t want the whole product XY. You want only a prescribed set W of entries, with |W| ≤ N²/√D.

Two obvious methods exist. You can compute each wanted entry as an inner product, which costs |W| · D = N² · √D operations. Or you can compute the full product with fast rectangular matrix multiplication, which costs about N² and then throws most of it away. Theorem 1 of the paper does both better: with N ≥ D^18, it computes the wanted entries in O(N²/D^0.063) operations. That cost is polynomially less than one operation per entry of the full product.

The graph view makes the subproblem concrete. Build a tripartite graph. Parts A and B each have N vertices, and the middle part has D vertices. X is the adjacency between A and the middle, and Y is the adjacency between the middle and B. Then (XY)[a, b] counts the middle vertices adjacent to both a and b, which is the number of triangles through the pair (a, b). The paper calls this the lopsided All-Edges Sparse Triangle problem. Here is a toy check of that equivalence:

import math
import random

rng = random.Random(7)
N, D = 400, 16
p = 0.3  # edge density between outer parts and the middle part

X = [[1 if rng.random() < p else 0 for _ in range(D)] for _ in range(N)]
Y = [[1 if rng.random() < p else 0 for _ in range(N)] for _ in range(D)]

wanted_size = int(N * N / math.sqrt(D))
W = rng.sample([(a, b) for a in range(N) for b in range(N)], wanted_size)

# 1) brute force over the graph: for each wanted pair, scan all middle vertices
tri = {(a, b): sum(1 for m in range(D) if X[a][m] and Y[m][b]) for (a, b) in W}

# 2) the same numbers as entries of the matrix product XY
ops_inner = 0
entries = {}
for a, b in W:
    s = 0
    for m in range(D):
        s += X[a][m] * Y[m][b]
        ops_inner += 1
    entries[(a, b)] = s

assert entries == tri
print(f"N={N}, D={D}, |W|={len(W)} wanted pairs (N^2/sqrt(D))")
print(f"triangle counts == wanted entries of XY: {entries == tri}")
print(f"one-by-one inner products: {ops_inner:,} multiplications (= |W|*D = N^2*sqrt(D))")
print(f"writing the full N x N product: {N*N:,} entries, at least that many operations")
print()

# 3) where the paper's Theorem 1 starts to apply: N >= D^18
print("Theorem 1 needs N >= D^18. Operation counts relative to N^2:")
print(f"{'D':>4} {'min N':>12} {'one-by-one':>11} {'new: N^2/D^0.063':>17}")
for d in (4, 16, 64, 256):
    print(f"{d:>4} {'10^%.1f' % (18 * math.log10(d)):>12} {math.sqrt(d):>10.2f}x {1 / d ** 0.063:>16.3f}x")

Running it prints:

N=400, D=16, |W|=40000 wanted pairs (N^2/sqrt(D))
triangle counts == wanted entries of XY: True
one-by-one inner products: 640,000 multiplications (= |W|*D = N^2*sqrt(D))
writing the full N x N product: 160,000 entries, at least that many operations

Theorem 1 needs N >= D^18. Operation counts relative to N^2:
   D        min N  one-by-one  new: N^2/D^0.063
   4      10^10.8       2.00x            0.916x
  16      10^21.7       4.00x            0.840x
  64      10^32.5       8.00x            0.770x
 256      10^43.3      16.00x            0.705x

The last table is the part that made me laugh. With D = 16, the theorem applies only once N reaches about 10^21.7. At that size the new method costs 0.84 N² operations. The one-by-one approach costs 4 N². The headline speedup is a 16% cut below the cost of just writing the answer down, on matrices with about 5 × 10^21 rows. (The table ignores the big-O constants, which only make it worse.)

Pruning a matrix-multiplication recursion

The algorithm itself starts from old material. Strassen’s 1969 algorithm multiplies 2 × 2 matrices with 7 products instead of 8 and applies that identity recursively, so all the multiplications happen at the leaves of a recursion tree that grows with the size of the matrices. The additions that prepare the leaves (encoding) and assemble the output (decoding) are comparatively cheap. Coppersmith’s 1982 rectangular algorithm does the same with a ten-term identity from Schönhage’s 1981 paper. That identity computes an inner product and an outer product at the same time.

The new idea, in the paper’s Section 2.4, is to visit only the leaves that some wanted entry needs, and to prune every recursive call whose outputs aren’t in W. Two facts make that cheap. First, the encoding additions depend on X alone or on Y alone, so the algorithm can compute them once per block and share them across calls. Second, the authors show that every output entry has one private leaf, while all its other leaves are shared with many other entries. The paper characterizes each leaf by how often the path to it picks each of the two products in Schönhage’s identity. Balancing the two choices, a set of N²/√D wanted entries needs only about N²/D^(1/18) leaves in total.

A footnote adds a human detail. Before this work, the authors had tried similar pruning with the Coppersmith–Winograd identities “and more, without success”. Schönhage’s identity works because of its sparsity: each linear form in it has at most three terms.

From triangles back to 3SUM

The second half of the paper reuses reductions that already existed. Earlier work showed that 3SUM and APSP both reduce to Exact Triangle: find a triangle whose three edge weights sum to zero. For APSP the reduction is by Vassilevska Williams and Ryan Williams (2010). For 3SUM it comes from their 2013 paper and from Chan and He (2020). Pătraşcu (2010) and Kopelowitz, Pettie and Porat (2016) reduced 3SUM to sparse triangle problems directly. Vassilevska Williams and Xu (2020) did the same for Exact Triangle. Researchers built these reductions to prove hardness. Run forwards, they become algorithms.

They’re lossy algorithms, though. In the authors’ accounting, the step from Exact Triangle to the lopsided problem keeps half of the exponent saving. The steps from 3SUM and from APSP to Exact Triangle keep a half and a third. As a result, 3SUM keeps only a quarter of the matrix theorem’s saving, which is a big reason the first exponent was as close to 2 as 1.9992. The authors also derandomized the lopsided reduction by hashing the weights modulo a prime that they pick with fast matrix multiplication, so the integer results are deterministic.

How Claude found it

The paper’s “Acknowledgments and Methodology” section tells the origin story in 4 sentences. An Anthropic employee used an internal research model to look at open problems in the theory of cryptography. One problem concerned cryptographic constructions based on the average-case hardness of Zero-k-Clique. Claude “was tasked with verifying and improving the constructions, but instead developed this algorithm, first for the average case, then for the worst case. The session used 16M output tokens with no human input.” The algorithm was a side effect.

Anthropic then shared the algorithm with the two authors in September 2026 under a confidentiality agreement and offered compensation. The authors write that the shared algorithm is “essentially the algorithm in Section 2”, with a different presentation and other parameters. Anthropic also shared a different reduction from Exact Triangle, but the authors used known reductions instead. They derived the data-structure version themselves. They take full responsibility for the paper.

The verification story is the part I find most useful for anyone who builds with LLMs. After the paper was written, Anthropic used an internal model to formalize the main results in Lean 4 with Mathlib. The formalization repository states the five headline claims in one file, EndStatement.lean. The README describes it as 139 lines that import nothing, not even Mathlib, and contain no proofs. A reader who trusts Lean’s kernel only has to read that file. Lean checks the rest. The 3SUM claim looks like this:

def ThreeSum : Problem where
  Instance n := Fin n → Int
  input x := List.ofFn x
  yes x := ∃ i j k, i ≠ j ∧ j ≠ k ∧ i ≠ k ∧ x i + x j + x k = 0

def Theorem_22_3SUM : Prop :=
  ThreeSum.SolvedInTime 1.9992

SolvedInTime is defined over a toy word RAM in the same file: nine instruction types, no division, no shifts, no bitwise operations. The README is also frank about the limits. The real-input results aren’t proved for any machine. The Lean files state running times only and never define the hypotheses that the paper calls refuted. And “the constants of the time bounds are not optimized; they are large, and for most theorems no value is given.” I’d love to see more AI-produced math ship with a “what is not proved” section this explicit.

Claude has done public research work before. Back in April I covered Claude finding 500 zero-day vulnerabilities, and the gap between that and refuting a complexity hypothesis is large. If you’re choosing between current models for your own work, the AI coding models ranking covers the public Claude lineup. The paper only says the authors got “the public version of Claude”. It doesn’t name the internal research model.

8 weeks of follow-ups

Once the reduction chain existed, the field moved fast:

DateWorkResult
5 Oct 2026Alman, Vassilevska Williams3SUM O(n^1.9992), APSP O(n^2.9995), deterministic
11 Oct 2026Karingula, LovettSimplified proof with weaker exponents
12 Oct 2026Majdoddin3SUM n^(1.9945+o(1)), APSP n^(2.9945+o(1)), deterministic, reductions that keep the full saving
30 Oct 2026Chan, Itakura, Ma, Yu3SUM O(n^1.965) randomized, no matrix multiplication; k-SUM hypothesis refuted for odd k
28 Nov 2026bigospeedrun leaderboard3SUM O(n^1.920279408), Lean-verified (reported)

The Chan–Itakura–Ma–Yu paper is the one to read if you want the idea without the tensor algebra. It swaps matrix multiplication for a selected-entries version of subset convolution, built on the fast zeta transform and inclusion–exclusion. The authors say the whole solution is “about 5 pages long” and doesn’t even need the fast Fourier transform. The same approach refutes the k-SUM hypothesis for every odd k, and new deterministic reductions give a truly subquadratic Real 3SUM in O(n^1.9998).

Majdoddin’s 130-page paper uses a five-term partial-product tensor from Schönhage to push the thin-matrix theorem from D ≤ N^0.1204 up to D ≤ N^0.172. It rebuilds the reductions so that 3SUM keeps all of the saving instead of a quarter. It also classifies coordinate-wise three-list problems with a Boolean relation, or a functional relation over three letters: each one is either truly subquadratic or as hard as Orthogonal Vectors.

The leaderboard numbers come with a caveat. Big O Speedrun is a community site that sorts results into “Claimed”, “Human Verified” and “Lean Verified” tiers. Its 3SUM page lists a Lean-verified O(n^1.920279408) as of 28 November, which combines proofs from several contributors. The Chan et al. paper cites that page and notes there is “no accompanying human-written manuscript”. The APSP page lists a Lean-verified O(n^2.995560713) and a claimed O(n^2.992947919). Both pages change weekly. Treat them as machine-checked statements about the site’s word-RAM machine definition. None of them has gone through peer review.

What a smaller exponent buys at real input sizes

An exponent below 2 doesn’t mean faster code. To see the gap, I computed how much each bound saves over n² at realistic sizes, and how big n must get before it saves 2× or 10×. Every constant factor is set to 1, which favors the new algorithms.

import math

RESULTS = [
    ("Alman & V. Williams, Oct 5 (det.)", 1.9992),
    ("Majdoddin, Oct 12 (det.)", 1.9945),
    ("Chan, Itakura, Ma, Yu, Oct 30 (rand.)", 1.965),
    ("bigospeedrun Lean-verified, Nov 28", 1.920279408),
]

def n_for_speedup(alpha, factor):
    # n^2 / n^alpha = factor  ->  log10(n) = log10(factor) / (2 - alpha)
    return math.log10(factor) / (2.0 - alpha)

def fmt(e):
    return f"{10 ** e:,.0f}" if e < 7 else f"10^{e:.1f}"

print(f"{'result':<40}{'exponent':>12}{'gain @ n=1e6':>14}{'gain @ n=1e9':>14}{'n for 2x':>12}{'n for 10x':>12}")
for name, a in RESULTS:
    g6 = (1e6) ** (2 - a)
    g9 = (1e9) ** (2 - a)
    print(f"{name:<40}{a:>12.6f}{g6:>13.3f}x{g9:>13.3f}x{fmt(n_for_speedup(a, 2)):>12}{fmt(n_for_speedup(a, 10)):>12}")
result                                      exponent  gain @ n=1e6  gain @ n=1e9    n for 2x   n for 10x
Alman & V. Williams, Oct 5 (det.)           1.999200        1.011x        1.017x    10^376.3   10^1250.0
Majdoddin, Oct 12 (det.)                    1.994500        1.079x        1.121x     10^54.7    10^181.8
Chan, Itakura, Ma, Yu, Oct 30 (rand.)       1.965000        1.622x        2.065x      10^8.6     10^28.6
bigospeedrun Lean-verified, Nov 28          1.920279        3.008x        5.218x       5,971     10^12.5

The original exponent needs n ≈ 10^376 for a 2× gain, which is far past the roughly 10^80 atoms in the observable universe. Follow-up work over 8 weeks moved that break-even point to about 6,000 elements, but only if every constant is 1. The Lean README says outright that the real constants are large, and Theorem 1 itself only applies when N ≥ D^18. This is a galactic algorithm in the Lipton–Regan sense, and the paper says nothing to suggest otherwise.

The faster-than-Dijkstra result from 2025 followed a similar arc. A theory paper broke a decades-old bound, and plain Dijkstra stayed faster on real hardware. That shortest-path result removed a log factor through a clever recursion. The 3SUM result removes a polynomial factor and voids the conditional lower bounds of many problems that were built on it.

What changes for working developers

For code you write this year, nothing changes. If an interviewer gives you LeetCode’s “3Sum” problem, write the two-pointer version. LeetCode’s problem 15 asks you to list every zero-sum triple, and that output can be Θ(n²) long anyway.

Three things do change, and they’re worth knowing:

  1. Lower-bound arguments in papers and design docs now need care. A claim that “X is 3SUM-hard, so expect n²” is now only a claim that X is as hard as a problem solvable in n^1.92. For 3SUM-hard problems like three-points-on-a-line, the bound is open again, so a better algorithm might exist.
  2. Long, unattended model sessions now produce research-grade algorithms. The paper, its Lean artifact, and a leaderboard with agent-claimed results for matrix multiplication, Subset Sum and 3-SAT all show it. The bottleneck moves to verification.
  3. Formal verification is the trust layer. The most credible version of every number in this post is a Lean statement that a human can read in a few minutes. The four-color theorem paper I covered in March came with Python proof checkers you could run yourself. The Lean artifact for the 3SUM paper goes further: a short trusted statement, with the machine-checked proof kept separate from it.

On HN, some theorists worried about the field’s direction. One argued that if AI can “routinely generate marginal improvements”, conditional lower bounds tied to one exact exponent become a weak research investment. I disagree with the bleak reading. The reductions that fine-grained complexity spent 20 years building are the reason one algorithm sped up a long list of problems at once. The authors say the same: “reductions are also algorithms.”

FAQ

Is the 3SUM conjecture false?

Yes, for the standard version: integer 3SUM on n numbers of polynomial size, on a word RAM. The Alman–Vassilevska Williams algorithm runs in O(n^1.9992) deterministic time, and an Anthropic model formalized the paper’s main results in Lean 4. The real-valued version also falls, through a Las Vegas algorithm in O(n^1.998) expected time. All of these results are still preprints, not peer-reviewed papers.

What is the fastest algorithm for 3SUM?

In a written paper, it’s the randomized O(n^1.965) algorithm of Chan, Itakura, Ma and Yu (arXiv:2610.42012). The best deterministic paper bound is Majdoddin’s n^(1.9945+o(1)). The Big O Speedrun leaderboard reports a Lean-verified O(n^1.920279408) as of 28 November 2026, without a human-written manuscript. For any input you can store, the O(n²) sort-and-two-pointers algorithm is still the fastest one in practice.

What is the time complexity of 3SUM?

The true exponent is open again. The best upper bound is now about n^1.92 to n^1.965, depending on which results you accept. The only unconditional lower bound is the trivial Ω(n) for reading the input. Before October 2026, most researchers believed n² was optimal up to subpolynomial factors.

Did Claude really discover the 3SUM algorithm?

The paper says so: “Claude, an AI model developed by Anthropic, discovered the algorithm that refutes the 3SUM, APSP, and Exact Triangle hypotheses.” The methodology section says it happened in a single session of 16M output tokens, with no human input, while the model worked on a cryptography problem. The human authors simplified, strengthened and extended the result, and they take responsibility for the paper.

Does this refute SETH or affect P vs NP?

No. The paper lists the Strong Exponential Time Hypothesis and Orthogonal Vectors as problems that its techniques don’t speed up. P vs NP is about polynomial versus superpolynomial time, and 3SUM was always in P.

Sources

Bottom line

Fine-grained complexity used the 3SUM and APSP hypotheses as its two main “nobody can do better” assumptions. An AI session aimed at a different problem broke both. A model produced the idea. Two experts turned it into a readable paper within weeks, and a Lean artifact made the main claims checkable by anyone who can read 139 lines. Then a crowd of humans and agents cut the 3SUM exponent from 1.9992 to about 1.92 in under 2 months. I expect the next hypothesis to fall the same way, with the Lean file arriving before the peer review.