Sizing and Capacity Boundaries of a 3D Convolutional Surface-Code Decoder

A guided tutorial and self-check for the paper “Sizing and Capacity Boundaries of Spatial Convolutional Decoders for Surface-Code Quantum Error Correction”
Written so a technically literate non-specialist can verify they understand every concept the paper relies on, and read its claims like a skeptical reviewer. All numbers below are taken directly from the paper’s LaTeX source and its reproduction JSONs — nothing is invented.

1. In one sentence — and why it matters

In one sentence: The paper takes a single, deliberately simple kind of neural network — a 3D convolutional net that looks at the surface code’s error-detection events as a little 3D image — and carefully measures how big the network has to be at each code size, and exactly where the simple approach stops working.

It is explicitly not trying to set a new accuracy record, and it explicitly does not claim a clean “scaling law.” It is a sizing-and-boundary study: a map of which problem sizes the simple decoder wins, ties, or loses, and how much network you need to spend to get there.

Why it matters Quantum computers make errors constantly. To run a useful computation you must decode a stream of error-detection signals in real time and figure out what correction to apply. The community already knows that neural decoders can beat the standard classical decoder (minimum-weight perfect matching, MWPM). What nobody had pinned down is the boring-but-load-bearing engineering question: how much network do you need as the code gets bigger, and does the network’s internal design matter once you’ve sized it right? Prior neural decoders pick their model sizes ad hoc. This paper measures the requirement, with full multi-seed rigor, and reports the honest place where the pure-convolutional idea runs out of room.

2. Background you need (from first principles)

Everything below is defined from scratch. If you already know quantum error correction you can skip to Section 3, but the short version of each idea is here so the results section reads cleanly.

2.1 Qubits, errors, and why we cannot just copy

A classical bit is 0 or 1. A qubit is a quantum two-level system; its state can be a superposition. Two facts make protecting qubits hard: (1) you cannot copy an unknown quantum state (no cloning), so the classic “store three copies and take a majority vote” trick is illegal; and (2) measuring a qubit collapses it, so you cannot just look at the data to check for errors. Quantum error correction (QEC) is the set of tricks that get around both problems.

2.2 Stabilizer codes and the surface code

A stabilizer code spreads one piece of logical quantum information across many physical qubits, and protects it with a set of carefully chosen parity-style checks called stabilizers. The key idea: a stabilizer is an operator you can measure without disturbing the encoded information. Its measurement returns +1 if “no error detected here” and −1 if “something is wrong nearby,” and crucially the measurement never reveals the logical data itself.

The rotated surface code is the workhorse stabilizer code, because it only needs local, nearest-neighbour operations — ideal for real chips. At code distance $d$ it lays out $d^2$ data qubits on a 2D grid with $d^2-1$ stabilizers arranged like a checkerboard. Each stabilizer in the bulk touches 4 adjacent data qubits (weight-4); at the edges it touches 2 (weight-2). The code encodes exactly one logical qubit.

Intuition: code distance The distance $d$ is the minimum number of physical errors needed to corrupt the logical qubit without tripping any alarm. Bigger $d$ = more redundancy = better protection. Below a critical physical error rate (the threshold), the logical error rate shrinks exponentially as you raise $d$. That is the entire reason to build bigger codes — and the reason a decoder has to keep working as $d$ grows.

One more useful fact the paper leans on: $X$-type errors flip $Z$-type stabilizers and vice-versa, so the two error types decode independently under the simple noise models used here. You can think of the decoder as solving one of these two mirror-image problems.

2.3 Detectors and detector events (the decoder’s input)

In a real experiment you do not measure the stabilizers once; you measure them round after round while the computation runs. A detector is the parity (XOR) of two consecutive measurements of the same stabilizer. In a perfect world consecutive measurements agree, so the detector is 0. If an error occurred between the two rounds, the detector fires (= 1). A fired detector is a detector event.

For distance $d$ run for $d$ measurement rounds, there are roughly $d \times (d^2-1)$ detectors — this grows like $d^3$, a number that will matter a lot. After all the rounds, one extra bit per shot, the observable flip, records whether the logical qubit ended up flipped relative to where it started. That single bit is what the decoder is ultimately trying to predict.

Mental model Picture a $d\times d$ checkerboard of alarm sensors, photographed once per round for $d$ rounds. Stack the photos into a 3D block: two spatial axes plus one time axis. A “1” voxel means “this sensor flipped at this moment.” A physical error shows up as a small, local cluster of lit voxels. Decoding = looking at the lit voxels and guessing whether the net effect flipped the logical bit.

2.4 Cosets: why predicting one bit is legitimate

Many different physical error patterns produce the exact same detector events and the exact same logical outcome — they differ only by a stabilizer, which by definition does nothing observable. The set of errors equivalent in this way is a coset. A decoder does not need to name the exact error; it only needs the coset, i.e. the final logical effect. Because this paper’s decoder predicts the single observable-flip bit directly, stabilizer-equivalent errors automatically get identical labels. The decoder is invariant to coset choice for free, with no special data augmentation. (AlphaQubit relies on the same property.)

2.5 The decoder, and the MWPM baseline

A decoder takes the detector events and outputs the correction (here: the predicted logical flip). The standard classical baseline is Minimum-Weight Perfect Matching (MWPM), used here via PyMatching v2. MWPM models the problem as a graph: detector events are vertices, and the decoder pairs them up so that the total “cost” of the connecting paths is minimized — the most likely set of errors that explains the alarms. It is fast, principled, and the universal yardstick in QEC.

The number to beat is the logical error rate (LER): the fraction of shots where the decoder gets the logical bit wrong. Lower is better. A “+16%” improvement in this paper means the neural decoder’s LER is 16% lower than MWPM’s on the same shots.

2.6 The unifying framing: “the decoder is the Hamiltonian”

The paper opens with a conceptual lens that is worth understanding because it explains why the authors think this whole family of problems is one problem. Any probability distribution can be written as a Boltzmann distribution:

$$ p(x) \;\propto\; \exp\!\big(-H(x)\big), $$

where $H$ is an “energy.” Reconstructing a signal from corrupted observations = finding the low-energy (high-probability) state of some $H$. Under this lens:

They differ only in where $H$ lives and how you evaluate it. This is framing, not a result — but it is why the authors care about “how much capacity the learned $H$ needs.”

2.7 What a 3D convolution and a ResNet block are

A convolution slides a small learnable filter over the input and computes local weighted sums; in 3D the filter is a little cube that sweeps the $(x,y,t)$ volume. This is exactly the right tool here because errors create local voxel clusters. A ResNet block is a pair of conv layers wrapped in a residual skip connection: the block computes $y = x + f(x)$ instead of $y = f(x)$, which makes deep networks trainable. Width $W$ = number of feature channels; depth $N$ = number of residual blocks. The product $W\times N$ is the paper’s proxy for capacity.

GroupNorm + SiLU
Standard stabilizing ingredients: GroupNorm normalizes activations within channel groups; SiLU ($x\cdot\text{sigmoid}(x)$) is a smooth activation.
FiLM conditioning
“Feature-wise Linear Modulation”: a side input (here, the noise rate $p$) is turned into per-channel scale/shift factors applied inside the block, letting one model behave differently at different noise rates.
Squeeze-Excite (SE)
A lightweight attention-like gate that reweights channels based on a global summary of the feature map.
ReZero
A learnable scalar in front of the residual branch, initialized to 0, so a fresh deep network starts as the identity and trains more stably.

3. What the paper actually does

3.1 The core idea: detector events as a 3D image

Stim (the simulator) gives each detector a coordinate $(x,y,t)$. The authors discretize these to integer grid indices and build, for each shot, a sparse binary volume

$$ V \in \{0,1\}^{D_x \times D_y \times D_t}, \qquad V[i,j,k]=1 \iff \text{detector }(i,j,k)\text{ fired}. $$

For distance $d$ with $d$ rounds this is a $(d{+}1)\times(d{+}1)\times(d{+}1)$ grid with checkerboard (sparse) occupancy. A 3D ResNet then maps this volume to a single logit predicting the observable flip:

  1. Input conv lifts the 1-channel binary volume to width $W$.
  2. $N$ residual blocks (Conv3d ×2, GroupNorm, SiLU, skip).
  3. Error-rate conditioning: a small MLP turns the scalar $p$ into a vector added into each block’s features — exactly like the timestep embedding in diffusion models.
  4. Global average pool over space, then an MLP head → one logit (logical flip yes/no).

3.2 One model, many noise rates (mixed-rate training)

Instead of training a separate model per physical error rate, they train a single model on a uniform mixture of rates $p \in \{0.001, 0.002, \ldots, 0.007\}$, feeding each sample its true $p$ as conditioning. One learned $H$ then serves a continuous range of operating points. Training: AdamW, LR $10^{-3}$, cosine annealing over 30 epochs, BCE loss, batch 2,048, 200K samples per rate × 7 rates = 1.4M total, generated by Stim under circuit-level depolarizing noise.

3.3 The two block designs being compared

3.4 The sizing rule: find the “knee” per distance

The detector volume grows like $d^3$, so the authors expect capacity must grow with $d$. To pick a size without cheating, they run a capacity scan: a small grid of $(\text{width}\times\text{depth})$ cells at each distance, trained short. The knee is the smallest cell whose validation LER is within a predeclared tolerance of the best cell. The selection rule — minimize mean validation LER across eval rates, equally weighted — is fixed before any test-set evaluation. The chosen knees:

Table 1 (paper Tab. 1). Selected per-distance knee cells, width×depth.
Block$d{=}3$$d{=}5$$d{=}7$$d{=}9$$d{=}11$
Classic16×464×864×896×1296×12
LC016×464×896×12128×1296×12
Crucial honesty point The paper deliberately refuses to fit a closed-form law like $W\cdot\text{depth} \approx \alpha\, d^3$. The $d^3$ volume motivates why capacity should grow, but the multi-seed data show a boundary — a regime where seed variance explodes and the decoder falls below MWPM — not a clean power law. So they report an empirical operating map and a boundary location, and call a first-principles capacity bound an open problem.

3.5 The rigor scaffolding (why you can trust the numbers)

4. The results, explained

4.1 The headline operating map (at $p=0.003$)

This is the paper’s central table. “Improv.” is positive when the neural decoder beats MWPM. (It is the seed-mean of per-seed relative improvements, which at the high-variance $d=9,11$ rows differs from the ratio of the mean LERs — that is why, e.g., the $d=9$ classic improvement reads $-5.6\%$ even though the mean LER is only slightly above MWPM.)

Table 2 (paper Tab. 2). Three-seed mean test LER vs. paired MWPM at $p=0.003$. Verified against qec_clean_knee_multiseed.json.
$d$MWPM LERClassic LERClassic improv.LC0 LERLC0 improv.
30.0065870.005681+13.7%0.005657+14.1%
50.0032900.002734+16.9%0.002667+18.9%
70.0013960.001237+11.4%0.001037+25.6%
90.0005570.000588−5.6%0.000827−49.3%
110.0002030.001049−453%0.002455−1192%

Read it as three regimes:

Why “boundary,” not “trend” The tell-tale sign is variance, not just the mean. At $d\le7$ the seeds agree tightly; at $d=9,11$ the standard error of the mean (SEM) is an order of magnitude larger, and individual seeds disagree on whether MWPM is beaten. A clean power law would not look like that. This is the honest reason the paper refuses to fit $\alpha\, d^3$.

4.2 The $d=9$ “boundary” is under-resourcing, not a wall

This is the most important nuance, and it is well-supported. A follow-up probe (k8s tag qec-bnd-may30) re-ran $d=9$ with the same architecture (classic, $w{=}96$, depth $12$) but 5× the training data, on the same disjoint test split over three seeds. It beats MWPM at every rate (numbers from data/d9_dataarm_reproduction.json):

Table 3 (paper ยง4.2 follow-up). $d=9$ 5×-data probe, 3 seeds, disjoint test split. Verified against d9_dataarm_reproduction.json.
$p$Neural LERMWPM LERImprov.per-seed McNemar $p$
0.0010.0000010.000003+75%n.s. (too few events)
0.0030.0002320.000537+56.5%~1e−7 … 1e−11
0.0050.003460.006785+49%~0
0.0070.02010.0312+36%~0
What this resolves Same network, more data, decisive win with tight cross-seed agreement. So the $d=9$ tie in Table 2 was an under-training / under-data artifact of the selected knee, not a fundamental capacity wall. The paper is careful to attach this only to $d=9$ — it does not claim the same for $d=11$, which stays under-capacity at the budget run.

4.3 Block design is distance-dependent (the surprising bit)

The authors had hypothesized that, once you size capacity correctly, the block design would be second-order. The data refute the strong form of that:

So block design matters, and matters most at intermediate distance. It extends the useful regime at $d=7$ but offers no rescue at the boundary.

4.4 Full per-rate picture and inference cost

The qualitative story is rate-stable across $p\in\{0.001,0.003,0.005,0.007\}$: the win at $d\le7$, the $d=9$ boundary, and the $d=11$ collapse all persist, and the SEM at $d=9,11$ is an order of magnitude larger than at $d\le7$ — quantifying the instability. On cost, the 3D-conv decoder is $O(d^3)$ per shot, matching MWPM and Mamba and strictly better than AlphaQubit by a factor of $d$ (AlphaQubit’s attention is $O(d^4)$). Measured latency on an RTX 4070 Ti scales as $\sim d^{2.9}$. Honest caveat: the prototype is still roughly two orders of magnitude too slow for real-time hardware (~180× slower than the cycle time at $d=5$); the authors only project a path via TensorRT/quantization/FPGA, they do not demonstrate it.

5. How to read it like a skeptical reviewer

5.1 The exact claims, and what would falsify each

5.2 Baselines — is the comparison fair?

MWPM is decoded on the same test shots as the neural decoder, which is exactly right and enables paired McNemar tests. The disjoint test split (seed ×1000+800) is genuinely separated from train/val. Good marks here.

5.3 The limitations the paper states about itself

Read these before believing anything

5.4 What is genuinely not surprising, and what is

Not surprising: that a neural decoder beats MWPM at small distances — prior work (AlphaQubit, Lange et al.’s GNN, Mamba, NMWPM) already established this, often by larger margins. The paper says so plainly and does not claim SOTA. Genuinely informative: (1) the explicit per-distance sizing map and boundary location for a pure-spatial decoder — the gap left open by Gicev et al., who use one fixed-size translation-invariant model across distance; and (2) that block design is not second-order, contradicting the authors’ own prior hypothesis. A result that overturns your own expectation is the kind worth reporting.

5.5 The questions to push on in review

  1. Is the $d=9$ fix really “under-resourcing” if the resource you added was data, not network capacity? The paper’s own headline framing is “sizing,” so be precise: this is an under-training/under-data artifact at fixed width×depth. (The paper does say exactly this.)
  2. Could $d=11$ also be rescued by 5× data? The paper doesn’t test it and doesn’t claim it — an obvious next experiment, and a fair thing to ask for.
  3. Without the paired LC0-vs-classic test and the component ablation, how much weight should the “distance-dependent block design” claim carry?

6. Glossary

Qubit
A quantum bit; cannot be copied or freely inspected without disturbance.
Stabilizer code
An encoding that protects logical information with parity-like checks (stabilizers) measured without revealing the data.
Stabilizer
An operator whose measurement returns ±1 and signals nearby errors; weight-4 in the surface-code bulk, weight-2 at boundaries.
Rotated surface code
The standard local 2D stabilizer code; at distance $d$ uses $d^2$ data qubits, $d^2-1$ stabilizers, encodes one logical qubit.
Code distance $d$
Minimum number of physical errors that can cause an undetected logical error. Larger $d$ → exponentially better protection below threshold.
Logical qubit / logical error
The protected information; a logical error is a corruption of it that survives correction.
Detector
The XOR of two consecutive measurements of the same stabilizer; should be 0 if no error occurred between them.
Detector event
A detector that fired (=1). The decoder’s input is the pattern of these over space and time.
Observable flip
The single bit per shot recording whether the logical qubit ended up flipped. The prediction target.
Coset
A set of error patterns that differ only by a stabilizer, hence have identical syndrome and identical logical effect.
Decoder
Algorithm mapping detector events to a correction (here: a predicted logical flip).
MWPM
Minimum-Weight Perfect Matching; the classical baseline decoder (via PyMatching v2) that pairs detector events at minimum total cost.
LER
Logical Error Rate; fraction of shots the decoder gets wrong. The metric to minimize.
Threshold
The physical error rate below which increasing $d$ suppresses logical errors; the regime of interest here ($p\le 0.007$).
Circuit-level depolarizing noise
A realistic-ish simulated noise model with errors after each gate, on resets, and on measurements, all at rate $p$. Generated by Stim.
Stim
Fast stabilizer-circuit simulator used to generate all syndromes here.
3D convolution
A learnable local filter swept over the $(x,y,t)$ detector volume.
ResNet block
Two conv layers with a residual skip ($y=x+f(x)$); width = channels, depth = number of blocks.
Classic vs LC0 block
Classic = standard ResNet block. LC0 = pre-activation + dual-output squeeze-excite + FiLM conditioning + ReZero, bundled.
FiLM
Feature-wise Linear Modulation; conditions features on a side input (the noise rate $p$).
Capacity knee
The smallest width×depth cell within a predeclared tolerance of the best validation LER; the chosen per-distance size.
McNemar’s test
Paired significance test for two binary classifiers on the same items (here, same test shots).
SEM / 95% CI
Standard error of the mean / 95% confidence interval; the paper reports both, and uses SEM blow-up at $d=9,11$ to diagnose the boundary.
Hamiltonian framing
Viewing every decoder as evaluating or descending the energy $H$ of $p(x)\propto e^{-H(x)}$; a conceptual lens, not a result.

7. Key takeaways

  1. This is a sizing-and-boundary study, not a record attempt. The contribution is a per-distance capacity map for a pure spatial 3D conv decoder, plus an honest boundary location — the gap prior work left open.
  2. Win / tie / fail map: beats MWPM at $d=3,5,7$ (+11% to +26% at $p=0.003$); statistically tied at $d=9$ at the selected knee; under-capacity at $d=11$.
  3. The $d=9$ tie is fixable. Same network + 5× data beats MWPM by +36% to +56.5% across three seeds, with McNemar $p$ to $10^{-11}$ — so that boundary is an under-data artifact of the knee, not a wall.
  4. Block design is distance-dependent. LC0 is neutral at $d=3,5$, a clear +16% win at $d=7$, and no help (worse) at $d=9,11$. This overturns the authors’ own “block design is second-order” hypothesis.
  5. The honesty is the strength. Three seeds, disjoint test split, paired McNemar, predeclared knee selection, single reproduction script, and a frank limitations list (simulation only, unpaired block comparison, un-ablated LC0, under-capacity $d=11$, not real-time). Read those before citing any single number.

All quantitative claims above were transcribed directly from main.tex and cross-checked against data/qec_clean_knee_multiseed.json and data/d9_dataarm_reproduction.json in the paper directory. Per the project’s reproducibility policy, every paper number is emitted by reproduce_qec_results.py over seeds 42/43/44.