The AI That Babysits Qubits

Under every “quantum computers don't work yet” headline sits a pattern-recognition problem, and an AI now reads that pattern better than the rules people wrote for it. Pick a depth below. The depth you pick is part of the link, so a page you share opens at the same depth for whoever you send it to.

You'll be able to say why a quantum computer needs constant error correction, and what an AI decoder adds.

A square silicon quantum chip set in a grey metal mount engraved with the words Google and Sycamore.
What a quantum chip looks like: Google's Sycamore processor in its mount, on display at the Deutsches Museum in Munich. The chip sits at the centre of the mount. Photo: Coldupnorth, cropped, CC BY-SA 4.0, source.
Plain

One analogy, no equations, about two minutes. The Working tier builds the machinery and Formal carries the derivation.

A quantum computer is a choir in which every singer slowly drifts off key, and glancing at any one of them to check makes that singer forget the song. (Singer = qubit, the machine's basic unit of information. Off key = the small error every qubit collects simply by existing. Those are the only two terms you need.)

Read that twice, because it is the knot every quantum engineer is trying to untie: you cannot fix what you are not allowed to look at.

Error correction hires a conductor who never listens to a soloist. The only question they put, to one neighbouring pair at a time, is do you two match? Since nobody is heard alone, nobody forgets the song, and two clashes side by side still point straight at the singer who drifted.

♪♪ ♪ ♪♪ this one drifted agree clash! clash! agree the conductor hears only these four verdicts two clashes side by side → the drift is the singer between them

← swipe the diagram to see all of it →

Nobody was ever heard alone. The conductor asks only “do these two match?”, and two neighbouring clashes are enough to pin the culprit. A real quantum computer follows the same rule for the same reason: listening to a single qubit destroys the thing you were trying to protect. (The real machine compares across a grid instead of a single row, but the rule doesn't change.) The same thing with its real name ▸

For thirty years the conductor's rulebook was written by hand. In 2024 Google DeepMind trained an AI, AlphaQubit, to write its own, by listening to one real choir's recordings until it learned that choir's bad habits. It makes about 30% fewer wrong calls than correlated matching, a hand-written rulebook that is fast enough to run on a live machine, and about 6% fewer than a tensor-network decoder, the most careful rulebook but far too slow to run live. Two separate facts, then: it is more accurate than both of them, and it is itself still too slow to conduct a live performance. Making it fast enough is the race everyone is now running.

So what?

Every promise you have read about quantum computers (breaking encryption, designing drugs, cracking optimisation) stands on this one unglamorous job, the way a skyscraper stands on plumbing nobody photographs. None of it happens on a machine that forgets its own state halfway through.

What is finally making the job work is a machine-learning model doing what it does best: noticing a pattern nobody wrote down. A technology famous for being roughly right is rescuing one that only works when it is exactly right. That odd partnership is why this site exists.

Check yourself · 1 of 3

Five singers stand in a row and the conductor compares each neighbouring pair. The pairs 2-3 and 3-4 both clash and the others agree. Who drifted?

A clash means one of the two singers in that pair drifted. Only singer 3 is in both clashing pairs, so one drift explains both clashes and nothing else does. Nobody was heard alone, which is the whole point.

The tempting wrong answers.

  • “Either singer 2 or singer 4, and there is no way to tell which.” Picking this assumes each clash blames only one of its two singers, so a single clash can never be pinned to a person.
  • “Singers 2 and 4: each is part of one clash.” Picking this counts everyone who touches a clash as guilty, instead of asking who is common to both.
  • “Nobody can be named without hearing singer 3 alone.” Picking this believes you need a solo to find the culprit, which is exactly the thing the conductor must never do.
Working

The mechanism, one worked number, and the picture you should have in your head. No derivations; those are in Formal.

The same story with its real names: the singers are physical qubits, a clash between neighbours is a parity check that fired, and the conductor is the decoder. From here those pieces get numbers.

The mechanism

Physical qubits fail constantly, roughly 1 error per 1,000 operations on good hardware. The fix is not a better qubit; it is redundancy with a twist. You encode one logical qubit across many physical ones in a surface code, then never measure the data at all.

Instead, extra measurement qubits sitting between the data qubits run parity checks, the syndrome measurements. Each one asks only whether its neighbours agree, never what they are. Everything hangs on that distinction: a parity check extracts the fact that something flipped without extracting the value that would collapse the superposition. A decoder then infers the most likely error pattern from the history of those checks, the way a doctor diagnoses from symptoms rather than by opening the patient.

The picture to hold in your head

Draw a checkerboard. Every corner is a data qubit, holding part of your one logical qubit. Every square is a measurement qubit that watches the four corners touching it and reports a single bit: even or odd. The squares alternate between two flavours (one watches for bit flips, the other for phase flips) because a qubit can fail in two independent ways and you need to catch both.

Run every square once and you get a snapshot: mostly zeros, with a few squares lit up. A single flipped data qubit lights the squares around it. A chain of flips lights only the two squares at its ends; everything in the middle cancels. So the decoder never sees the error, it sees a scattering of endpoints and has to guess the cheapest set of chains that would produce exactly those endpoints. That is why decoding is a matching problem, and why a 1965 graph algorithm ended up inside a quantum computer.

Three numbers that explain the overhead

Here is the one calculation worth doing by hand, because it shows where "about a thousand qubits to make one" comes from, and why the honest figure depends on how good the hardware is. It is a ladder of three numbers. Climb one rung at a time.

  1. Rung 1, where you start: 1 error in 1,000 operations (10−3). That is the physical error rate this site uses throughout.
  2. Rung 2, where you need to be: 1 error in a billion (10−9). A useful algorithm runs on the order of a billion logical operations, and for fewer than one expected failure across the whole run the logical error rate has to be below about 10−9. From 10−3 down to 10−9 is six factors of ten, a gap of one million.
  3. Rung 3, what one step of the code buys: Λ = 2.14. Each increase of the code distance d by two divides the logical error rate by Λ. Google measured Λ = 2.14 on Willow, fitted across its whole d = 3, 5, 7 series. Since 2.14 is about a third of a factor of ten, it takes roughly three steps to gain one factor of ten.

Now climb, starting from the distance-5 patch Google measured. A rotated surface-code patch of distance d costs 2d² − 1 physical qubits.

The first thousandfold (three of the six factors of ten) costs log(1000)/log(2.14) ≈ 9.08, so nine whole steps: 2.149 ≈ 941. Nine steps takes you from d = 5 to d = 23, and one logical qubit now occupies 1,057 physical qubits. That is where the familiar "about a thousand" lives, and by itself it is only halfway up: you have bought roughly 1,000×, not the full million.

The full million (all six factors) costs 19 steps, d = 5 to d = 43, and 3,697 physical qubits at today's Λ. That is the exchange rate.

What you buyΛStepsDistancePhysical qubits per logical qubit
The first 1,000× (not the full million)2.1495 → 231,057
The full 1,000,000×2.14195 → 433,697
The full 1,000,000× on hardware good enough that Λ = 101065 → 17577

The last row is why Λ is the single most important number in the field: it is the interest rate on every qubit you will ever build. Better hardware does not make the surface code a little cheaper, it removes most of the steps. None of these counts include routing or magic-state factories, and all of them are back-of-envelope: they round to whole steps, ignore the prefactor, count the whole million from a distance-5 patch, and assume Λ stays constant far past the d = 7 where it was measured. The Formal tier shows where the exponent comes from.

1 · DRIFT qubits pick up errors constantly, on their own 2 · SYNDROME measure the parity of neighbours, not the data 3 · DECODE infer the likeliest error behind that pattern ▲ AI walked in here 4 · CORRECT apply the fix, often just bookkeeping one lap ≈ a millionth of a second, repeating for as long as the machine runs

← swipe the diagram to see all of it →

Step 3 is where the drama is. Steps 1, 2 and 4 are physics and plumbing; step 3 is inference, and inference is what machine learning is for. There is a hard constraint hiding in that return arrow: the decoder has to finish inside the lap. Fall behind and the backlog grows forever, which is why an accurate decoder that is too slow does not count. How the checks work ▸

Where the AI walked in

The classic decoder, minimum-weight perfect matching, assumes errors are independent and simple. Real hardware is not: errors correlate across neighbours, qubits leak out of the computational space entirely, and the noise drifts between calibrations. Matching cannot express any of that, because its model has no vocabulary for it.

AlphaQubit is a recurrent transformer trained first on hundreds of millions of simulated samples, then fine-tuned on thousands of samples from the real chip, so it learns the actual noise rather than the idealised model, and it reads the analog "soft" readout signal instead of a hard 0/1. Result: about 30% fewer logical errors than correlated matching, a hand-written decoder fast enough to run live, and about 6% fewer than a tensor-network decoder, which is very accurate but impractically slow. AlphaQubit itself is not yet fast enough to run live on a superconducting chip.

The catch is the return arrow in the diagram above. The decoder has to finish inside the cycle, or the backlog grows forever, so an accurate decoder that is too slow does not count. That, not accuracy, is the open engineering problem.

Check yourself · 2 of 3 · a new case

A lab is at code distance d = 7 with Λ = 2.14 and wants about 100 times fewer logical errors. Roughly what distance does it need?

Each step of d → d+2 divides the logical error rate by 2.14. Six steps give 2.14⁶ ≈ 96, close to 100, since log(100)/log(2.14) ≈ 6.05. Six steps of two take d from 7 to 19.

The tempting wrong answers.

  • “d = 13: six steps, each adding one to the distance.” Picking this forgets that Λ is earned per two-step increase in d; adding one changes nothing.
  • “d = 9: one step of Λ = 2.14 buys the hundredfold.” Picking this takes one factor of 2.14 to be the whole gain, rather than a gain that compounds with every step.
  • “d = 101: about forty-seven steps of two.” Picking this divides 100 by 2.14 instead of asking how many times 2.14 must be multiplied to reach 100.
Formal

Formalism, one derivation carried through, primary sources, and the problems still open. Assumes stabilizer formalism. The Working tier carries the same content without the algebra. Independently verified 2026-07-13.

Rotated surface code with code distance d: d² data qubits, d²−1 syndrome qubits, so a patch costs 2d²−1 physical qubits. Stabilizers are weight-4 X/Z plaquette operators in the bulk (weight-2 on boundaries), measured each cycle. Decoding is inference over the syndrome volume: given syndrome history σ, find the most probable logical equivalence class of errors, not the most probable error, which is a different and worse objective.

Where the exponent comes from

The scaling law quoted everywhere is worth deriving once, because the exponent is where the recurring off-by-one in this field lives.

A distance-d code corrects any error of weight t = ⌊(d−1)/2⌋. So the lowest-order event the decoder cannot fix requires t+1 = ⌊(d+1)/2⌋ physical faults. Below threshold each independent fault carries probability ∝ p, and the number of weight-(t+1) fault patterns is a binomial prefactor in the patch size. Summing the lowest-order term:

pL ≈ A (p / pth)⌊(d+1)/2⌋

with A and pth absorbing the combinatorics and the decoder's quality. Two consequences follow immediately, and both are routinely stated wrong:

Working the exchange rate the other way: buying 10³ suppression at Λ = 2.14 needs log(10³)/log(2.14) ≈ 9.08 steps, so nine steps gives 2.149 ≈ 941×, taking d = 5 → 23 and one logical qubit to 2(23²)−1 = 1,057 physical qubits. The million-fold suppression a billion-operation algorithm needs costs 19 steps on the same count: d = 43 and 3,697 physical qubits, as the Working tier's table shows.

Note what the ratio construction buys you: expressing everything relative to d = 3 cancels the unknown prefactor A exactly, so the suppression curve is a parameter-free prediction rather than a fit. Real devices depart from it near threshold, where the lowest-order truncation stops being enough.

X̄ 012 345 678 9 data qubits = d² 4 Z-checks 4 X-checks  → d²−1 = 8 weight-4 in the bulk weight-2 on a boundary logical operator, weight 3 Every check commutes with every other; the yellow chain commutes with all of them, so no syndrome ever fires, and the logical qubit flips silently.

← swipe the diagram to see all of it →

d = 3, drawn exactly. Nine data qubits and eight stabilizers: four weight-4 plaquettes in the bulk, four weight-2 checks on the boundary, alternating X and Z so that every pair overlaps in an even number of qubits and commutes. The yellow chain is a logical X̄ operator: it commutes with all eight stabilizers, so it is undetectable, and the shortest such chain has weight 3, which is why this code is called distance 3. Verified by exhaustive search over all 2⁹ Pauli supports: no nontrivial logical operator of weight 1 or 2 exists. Layout per Tomita & Svore, arXiv:1404.3747; the same lattice drives the interactive decoder.

Decoders

MWPM solves the inference on a decoder graph with edge weights drawn from an assumed independent-Pauli plus phenomenological noise model: provably good under that model, degraded under correlated noise, leakage, cross-talk and non-Markovian drift. The failure is structural rather than computational: the model has no term for the thing that is happening.

AlphaQubit: recurrent transformer over per-round syndrome inputs, including analog "soft" readout rather than binarized measurements, which hands it more information to work with, on top of being a bigger model. Pretrained on hundreds of millions of simulated samples, fine-tuned on thousands of experimental samples from a Sycamore processor. Reported ~6% fewer logical errors than tensor-network decoders (near-optimal, far too slow for real time) and ~30% fewer than correlated matching. The real-device data is d = 3 and d = 5; the d = 11 result is simulation only, a distinction frequently lost in secondary coverage, and one we got wrong here once — caught in editing, before the corrections log started counting; the earlier record holds what was written up.

Below threshold, a decoder that effectively raises pth or sharpens the exponent compounds through every future distance increase. Decoder quality is hardware you do not have to build, which is the entire economic argument for this site's thesis.

What is still open

Stated as problems rather than as a roadmap, because for most of them the truthful answer is that nobody knows yet.

  1. Real-time decoding at scale. "NN decoders are too slow for the ~1 μs cycle" is no longer simply true: an FPGA neural decoder hit 550 ns system latency (124 ns inference) inside a 1.25 μs cycle on superconducting hardware (arXiv:2605.04892, May 2026). But that is small d. Latency and bandwidth both grow with patch size while the cycle budget does not, and no published learned decoder runs in real time at the distances fault tolerance requires.
  2. Whether the learned margin survives scale. Every reported advantage for learned decoders is measured at small distance. There is no result showing the ~30% margin holds at d = 25 or beyond, and there is no theory saying it must.
  3. Leakage and non-Markovian noise. Both sit outside the Pauli model that the threshold theorem's guarantees are stated in. Leakage-reduction units exist and cost cycles; the accounting for how much they cost at scale is not settled.
  4. Magic states dominate the real bill. Clifford operations are the easy half, essentially free under the code. Non-Clifford gates need distilled magic states, and T-count, not qubit count, sets the wall-clock time for any real algorithm. Resource estimates move by orders of magnitude when distillation architectures change, which is exactly what happened to the Bitcoin numbers between 2022 and 2026.
  5. Threshold versus pseudo-threshold. The single number "pth ≈ 1%" is model-, decoder- and geometry-dependent. Quoting it without those three qualifiers is the most common way this field's own literature is misread.

Primary sources

• AlphaQubit: Bausch et al., "Learning high-accuracy error decoding for quantum processors," Nature 635, 834 (2024). arXiv:2310.05900 · Google announcement
• Below-threshold surface code (Willow): Google Quantum AI, "Quantum error correction below the surface code threshold," Nature 638, 920 (2025). arXiv:2408.13687. Source of Λ = 2.14 ± 0.02, regressed across d = 3, 5, 7
• Rotated surface-code layout: Tomita & Svore, arXiv:1404.3747. The d = 3 lattice drawn above
• Surface codes, practical: Fowler et al., arXiv:1208.0928. The standard reference for thresholds and the d→d+2 convention
• Topological memory: Dennis, Kitaev, Landahl & Preskill, quant-ph/0110143 (2001). Where matching-based decoding of the surface code begins
• Real-time FPGA neural decoder: arXiv:2605.04892 (2026). 550 ns system latency inside a 1.25 μs cycle

Check yourself · 3 of 3 · from What is a qubit?

A qubit sits in an even combination of 0 and 1. You measure it and read 0, then apply H and measure again. What do you expect?

A measurement leaves the qubit in the state it found, here 0. H then turns an arrow at the north pole into one on the equator, which reads 0 or 1 with equal odds. H undoing itself needs two Hs with nothing between them.

The tempting wrong answers.

  • “0 again for certain, because a measurement fixes the qubit’s value for good.” Picking this treats measurement as permanent; the first lesson shows a gate after it can reopen a combination.
  • “1 for certain, because H flips 0 to 1 just as an X gate would do.” Picking this mixes up H with X: H moves the arrow to the equator, X moves it to the other pole.
  • “Whatever it read first, because H is its own inverse and undoes the step.” Picking this forgets that H undoes itself only when applied twice in a row, and a measurement sits between these two.
The full explainerWhat is error correction?The pillar page, with a surface code you can break yourself. Or play itThe Decoder DuelTen rounds against the textbook decoder, on a chip it was never told about. The exchange rateWhat is a logical qubit?A calculator that turns an error rate into a real qubit count. The race it decidesThe thresholdDrag Λ and watch the cliff flip into a climb. Where we were wrongCorrectionsEvery published mistake, printed louder than the original.
Next in this trackWhat is quantum error correction?Prove itThe Decoder Duel: you are the AIJudge a claimWho is actually ahead in the race?