Source-linked AI summary
Learning to Decode the Surface Code with a Recurrent, Transformer-Based Neural Network
Johannes Bausch, Andrew W Senior, Francisco J H Heras, Thomas Edlich, Alex Davies, Michael Newman, Cody Jones, Kevin Satzinger, Murphy Yuezhen Niu, Sam Blackwell, George Holland, Dvir Kafri, Juan Atalaya, Craig Gidney, Demis Hassabis, Sergio Boixo, Hartmut Neven, Pushmeet Kohli
TL;DR
Reliable quantum computation requires correcting physical-level errors, motivating accurate decoding of the surface code. The paper presents a neural-network decoder that achieves state-of-the-art error suppression, outperforming a tensor-network decoder on experimental data and correlated matching at distances up to 11, while real-time superconducting-architecture throughput remains challenging.
Problem
Practical quantum computation requires accurate decoding because quantum processors must contend with physical-level errors and rich noise induced by quantum circuits.
Method
A neural-network decoder with inductive biases motivated by quantum error correction learns to decode the surface code, incorporating analog readouts and noise effects including leakage and crosstalk.
Results
The decoder achieves state-of-the-art error suppression, outperforms the previous best-in-class tensor-network decoder on experimental data, and outperforms correlated matching at distances up to 11.
Takeaways & Limitations
The results support machine learning as a decoder for surface-code quantum error correction across experimental data and larger-scale realistic-noise settings.
Takeaways & Limitations
Achieving real-time throughput rates of a superconducting architecture remains a challenge.
Abstract
from arXiv · showhide
Quantum error-correction is a prerequisite for reliable quantum computation. Towards this goal, we present a recurrent, transformer-based neural network which learns to decode the surface code, the leading quantum error-correction code. Our decoder outperforms state-of-the-art algorithmic decoders on real-world data from Google's Sycamore quantum processor for distance 3 and 5 surface codes. On distances up to 11, the decoder maintains its advantage on simulated data with realistic noise including cross-talk, leakage, and analog readout signals, and sustains its accuracy far beyond the 25 cycles it was trained on. Our work illustrates the ability of machine learning to go beyond human-designed algorithms by learning from data directly, highlighting machine learning as a strong contender for decoding in quantum computers.
1. Quantum error correction
Quantum error correction uses redundant physical qubits and syndrome histories to protect logical qubits, but decoding is difficult under realistic correlated noise. Machine-learning decoders aim to exploit this structure, and the presented recurrent transformer decoder improves accuracy in realistic surface-code settings.
- Motivation: Fault-tolerant quantum computation requires correcting physical errors so deep circuits can run reliably.Surface-code protection groups physical qubits into logical qubits, while practical decoders must process syndrome information quickly enough to avoid backlogs.
- Surface-code structure: The surface code encodes a logical qubit in a d × d grid of data qubits monitored by X and Z stabilizer checks.A detection event occurs when consecutive measurements of one stabilizer have different parity outcomes; code distance d is the minimum observable length and side length of the grid.
- Decoding challenge: Decoding uses the history of stabilizer measurements to correct noisy logical outcomes, but degeneracy and circuit-induced noise make the task hard.Relevant complications include crosstalk, leakage, circuit-level correlations, and other error patterns that challenge methods developed for classical codes.
- Decoder requirements: Improving decoder inference accuracy reduces the required code size or processor gate fidelity, while logical errors are suppressed approximately as Λ^-d/2.The decoder’s speed also matters because it must keep pace with syndrome information produced by the quantum computer.
- Machine-learning approach: The proposed recurrent architecture combines transformers and convolutions to learn surface-code decoding from circuit-level data.It is evaluated on Sycamore experimental data and on larger-distance simulations incorporating leakage, crosstalk, and analog readout.
2. A recurrent syndrome transformer
The decoder uses a recurrent architecture with a fixed-size state updated from stabilizer measurements and a Syndrome Transformer that learns structured information flow. It accepts richer inputs and achieves lower logical error rates than leading alternatives across experimental and simulated settings.
- Model architecture: The recurrent architecture repeatedly applies a fixed computational block, maintaining a fixed-size decoder state that stores stabilizer information across cycles.The state is updated with each cycle’s stabilizers.
- Input representation: The model can use measurements and detection events together, with richer inputs including probabilistic I/Q readouts and leakage information.Using both measurements and events provides more stable training than events alone.
- Syndrome Transformer: The Syndrome Transformer combines multi-headed attention, attention bias, and spatial convolutions to modulate information flow according to stabilizer relationships and types.A readout network converts the decoder state into a probability of logical error.
- Experimental decoding: 2.901 ± 0.023% and 2.748 ± 0.015% LER at distances 3 and 5, respectively, outperform the tensor network decoder’s 3.028 ± 0.023% and 2.915 ± 0.016%.For the ML decoder, the corresponding error-suppression factor is Λ = 1.056 ± 0.010.
- Scaling and realistic noise: At distance 11, the ML decoder achieves 5.37 ± 0.01 × 10^-6 logical error per round versus 6.74 ± 0.02 × 10^-6 for MWPM-Corr.Across distances 3–9, it is more accurate than MWPM-Corr and reaches parity at distance 11.
3. Conclusions and outlook
The decoder achieves state-of-the-art error suppression across experimental and larger-scale settings, while learning directly from rich experimental data. Its main remaining boundaries are real-time throughput and continued error suppression beyond distance 11.
- The neural-network decoder achieves state-of-the-art error suppression for surface-code decoding.
- On experimental data, it outperforms the previous best-in-class tensor-network decoder, despite the latter taking orders of magnitude longer to run.
- Its accuracy advantage over correlated matching persists at code distances up to 11 and across error-correction cycles far exceeding training.
- The architecture can run at larger code distances with only a moderate runtime increase, but training it to suppress errors beyond distance 11 remains challenging.
- Learning from rich inputs such as I/Q noise and leakage lets the decoder use novel experimental features without designing an explicit algorithm for each.
- The results provide evidence that machine-learning decoders may achieve the error suppression and speed needed for practical quantum computing.
Authors contributions
The paper’s contributors covered model development, realistic-noise modeling, experimental analysis, software, supervision, and research direction. Contributions also included methodology, validation, visualization, data curation, and writing.
- Contributors developed models and software for modeling realistic noise in superconducting processors.
- Contributors supplied expertise in decoder theory, leakage, measurement, soft information, crosstalk error modeling, and configuring noise models.
- Multiple contributors provided project supervision, coordination, software tools, resource provision, and direction of priorities for scalable decoding.
- The research included conceptualization, methodology, investigation, formal analysis, validation, and visualization of results.
- The work also included data curation and writing of the paper.
A.1.3. Sycamore memory experiment dataset
The Sycamore memory dataset combines code-distance, cycle-count, and measurement-noise settings to evaluate surface-code decoding. It also motivates simulated pre-training because experimental data are limited.
- The dataset contains four 3 × 3 regions and one 5 × 5 region from Google’s Sycamore surface-code experiment.
- Experiments span 1, 3, 5, …, 25 error-correction cycles, with 50 000 shots per cycle count.
- Even and odd subsets support two-fold cross-validation, with detector error models fitted to one subset and used to decode the other.
- Stim-generated detector-error-model samples are used for machine-learning pre-training because the available experimental data are insufficient for training alone.
- Analog readout simulations model |0⟩, |1⟩, and |2⟩ signals with distributions controlled by signal-to-noise ratio and normalized measurement duration.
A.1.8. Pitfalls for training on soft information
Soft measurement inputs provide richer information than discretized outcomes, but training must prevent final-round data from revealing the logical label. The decoder also uses realistic noise models containing crosstalk and leakage processes.
- Soft inputs can leak the logical label when final-round data-qubit measurements are used directly to recompute stabilizers.
- Thresholding final-round data-qubit and leakage measurements keeps the decoder’s input information aligned with a standard non-soft memory experiment.
- The realistic noise model includes correlated Pauli channels, coherent crosstalk, leakage, and leakage-removal mechanisms.
A.2.3. Experiment across multiple rounds
Across multiple rounds, the decoder maintains a recurrent state while processing stabilizer measurements and event representations. Its transformer combines local convolutions with attention over stabilizer pairs, using learned spatial biases.
- Scope: The decoder is designed for varying code distances and experiment durations, with architectural features becoming more important at larger code sizes.
- Architecture: The recurrent decoder state stores information from previous stabilizers and can represent histories of arbitrary duration.
- Inputs: Measurement inputs outperform event inputs in practice, although the two representations contain the same information.
- Architecture: Dense attention enables reasoning over all stabilizer pairs, while dilated convolutions model local spatial correlations.
- Attention bias: The learned attention-bias heads distinguish local, distant, same-basis, and non-neighboring stabilizer relationships.
A.5. Implementation details
The implementation uses standard machine-learning frameworks and includes an architecture for predicting labels at every measurement round. Stabilizer representations are computed from experiment-basis measurements in the final round.
- The decoder is implemented and trained with JAX, Haiku, and JAXline.
- The per-round prediction architecture uses stabilizer representations as inputs to the network.
- Final-round embeddings are computed from stabilizers in the experiment basis derived from final data-qubit measurements.
A.6.1. Sycamore data
The Sycamore-data workflow combines cross-validation, DEM pre-training, noise curricula, and experimental fine-tuning. Models are trained across code distances with auxiliary prediction objectives and evaluated using held-out data and development-set LER.
- Data preparation: 2-fold cross-validation separates odd- and even-indexed Sycamore experiments.
- Pre-training: 25,000 samples per experiment length from half the data are used to fit the DEM for pre-training.Examples are sampled from lengths 1, 3, ..., 25.
- Noise curriculum: A noise curriculum transitions training from lower to higher noise strength using scaled error-event probabilities.The scaling factors range from 0.5 to 1.0.
- Fine-tuning: 19,880 experimental samples are used for fine-tuning, 5,120 for early stopping, and 25,000 held-out samples for final evaluation.
- Training and evaluation: Training retains parameters with the lowest development-set LER, while larger-distance models were not fully converged after 2 billion examples.Continued training of the 11 × 11 model reduced LER after extending training to 10 billion examples.
A.8. Decoding speed
The decoder was designed for strong error suppression rather than optimized inference speed. Its runtime scaling can become favorable at larger code distances, although current hardware remains too slow for practical quantum computers.
- Measured speed: Runtime measurements compare per-round computation and exclude latency for delivering the final answer after the last stabilizer round.
- Measured speed: The current implementation is slower than required for a practical quantum computer, despite better code-distance scaling than PyMatching at moderate noise.
- Optimization opportunities: Distillation, lower-precision inference, pruning, sparse attention, and specialized hardware are proposed routes to reduce computation or increase throughput.
- Runtime characteristics: The decoder’s fixed runtime is independent of physical noise level, unlike matching whose runtime increases with noise.
- Scaling: The attention blocks have per-cycle computational cost scaling approximately as d^4, although the components are intrinsically parallelizable.
- Scaling: At code distances up to 25, generally available GPUs and TPUs achieve sub-quadratic runtime scaling with code distance.The authors suggest a possible crossover with single-threaded MWPM at larger distances.
B.1. Further details of scaling experiments
Scaling experiments show strong error suppression through distance 11, reduced sensitivity to leakage, and sustained decoding performance far beyond the 25 cycles used for training. The recurrent design also avoids growing per-round memory and time costs, while comparisons with streaming decoders remain open.
- Error suppression: The ML decoder achieves the strongest error suppression through distance 11, with LER 5.37 ± 0.01.
- Leakage robustness: The ML decoder’s performance degrades significantly less than comparator decoders as leakage inputs increase.
- Long experiments: Networks trained for up to 25 cycles maintain performance on experiments lasting up to 100,000 cycles or until fidelity drops below 10%.
- Comparison scope: The study leaves comparisons with streaming decoder implementations and leakage-aware matching decoders for future work.
B.4. Ablations
Ablations test recurrent, convolutional, attention, readout, input, and auxiliary-loss components across Sycamore and Pauli+ settings. Component effects are modest at distance 5 but more pronounced at distance 11, and removed performance may be recoverable through retuning.
- Ablation design: The study removes or simplifies individual architecture components and compares mean test-set LER across five random seeds.
- Interpretation: Ablation results may underestimate recoverable performance because other hyperparameters were not changed to compensate for removed components.
- Results: Ablation effects are generally small at 5 × 5 but more marked at 11 × 11.
- Recurrent core: A recurrent-core ablation replaces the full recurrent core with six LSTMs and adjusts hidden-layer width with code distance.
- Architecture components: Other ablations remove convolutions, attention bias, event or embedding features, or simplify Syndrome Transformer and ResNet depth.
- Inputs: Input ablations provide only detection events or only raw qubit measurements instead of both information types.
B.5. Choice of data and noise model for pre-training
The study compares hardware-fitted and simpler noise models for pre-training, then evaluates fine-tuning on experimental data. Matched noise performs best initially, while fine-tuning makes simpler-model decoders competitive and highlights the value of real data.
- Noise-model comparison: A hardware-matched detector error model provides a significant advantage over SD6 and SI1000 noise during pre-training.The advantage also carries over to the fine-tuned setting.
- Noise-model comparison: Fine-tuning SD6- and SI1000-pre-trained models brings them close to the tensor network decoder’s performance.This supports competitiveness without access to a carefully tuned noise model.
- Fine-tuning: Fine-tuning on real experimental data is important for improving performance across the evaluated noise-model choices.The fine-tuned models used only a very limited amount of experimental data.
- Limitations: In the limited-data regime, more experimental data or better training noise models may further improve decoding performance.The passage presents both possibilities as likely avenues for improvement.
B.6. Training Data Efficiency
The section examines how training-data requirements scale with code distance and reports continued performance gains when additional simulator data are sampled. At distances 9 and above, the architecture requires substantially fewer examples than prior work to reach parity with algorithmic decoders.
- Scaling with code distance: At certain code distances, performance continues increasing when new simulator data are sampled beyond the fixed training budget.The reported experiments otherwise limited training to 2 billion examples regardless of code distance.
- Training-data efficiency: At code distance 9 or larger, the architecture needs several magnitudes fewer training examples than prior work for decoder parity.Parity is evaluated against PyMatching and MWPM-Corr as a rough guide to required training data.
- Distributed decoding: The decoder’s scaling advantage can be combined with distributed decoding that applies deep learning locally and deterministic algorithms globally.The proposed combination includes algorithms such as union find.
- Training-data efficiency: Figure S18 reports the number of examples required to achieve parity with PyMatching and MWPM-Corr.The figure provides a rough guide to training-data requirements across code distances.