Source-linked AI summary

Fast and accurate AI-based pre-decoders for surface codes

Christopher Chamberland, Jan Olle, Muyuan Li, Scott Thornton, Igor Baratta

arXiv:2604.12841v1quant-ph

TL;DR

Real-time surface-code decoding needs low-latency, scalable architectures, while existing AI decoders face challenges with scale and parallel block-wise operation. This paper combines an AI pre-decoder with global decoding and learns matching weights from syndrome statistics, reporting runtime and LER gains alongside data-driven weight estimates.

  • Problem

    Real-time fault-tolerant computing requires fast decoding, but AI-based decoders face training-data and compatibility challenges for scaling and parallel block-wise decoding.

    Source: §I · p. 1
  • Method

    The paper pairs a local AI pre-decoder with global decoding and infers PyMatching weights from syndrome statistics without an explicit noise model.

    Source: §I · p. 2
  • Results

    At d = 31 and p = 0.006, the combined pipeline achieves speedups of up to 3.4× over uncorrelated PyMatching and 3.5× over correlated PyMatching; at d ≥ 21 it lowers LER and runtime versus uncorrelated matching.

    Source: §II · p. 3
  • Takeaways & Limitations

    Raw-syndrome weight learning nearly matches uncorrelated PyMatching and improves correlated PyMatching LER relative to weights from the known noise model.

    Source: §I · p. 2

Abstract

from arXiv · show

Fast, scalable decoding architectures that operate in a block-wise parallel fashion across space and time are essential for real-time fault-tolerant quantum computing. We introduce a scalable AI-based pre-decoder for the surface code that performs local, parallel error correction with low decoding runtimes, removing the majority of physical errors before passing residual syndromes to a downstream global decoder. This modular architecture is backend-agnostic and composes with arbitrary global decoding algorithms designed for surface codes, and our implementation is completely open source. Integrated with uncorrelated PyMatching, the pipeline achieves end-to-end decoding runtimes of order $\mathcal{O}(1 \mu\text{s})$ per round at large code distances on NVIDIA GB300 GPUs while reducing logical error rates (LERs) relative to global decoding alone. In a block-wise parallel decoding scheme with access to multiple GPUs, the decoding runtime can be reduced to well below $\mathcal{O}(1 \mu\text{s})$ per round. We observe further LER improvements by training a larger model, outperforming correlated PyMatching up to distance-13. We additionally introduce a noise-learning architecture that infers decoding weights directly from experimentally accessible syndrome statistics without requiring an explicit circuit-level noise model. We show that purely data-driven graph weight estimation can nearly match uncorrelated PyMatching and exceed correlated PyMatching in certain regimes, enabling highly-optimized decoding when hardware noise models are unknown or time-varying, as well as training pre-decoders with realistic noise models. Together, these results establish a practical, modular, and high-throughput decoding framework suitable for large-distance surface-code implementations.

I. INTRODUCTION

The introduction frames real-time surface-code decoding as a latency and scalability problem, then presents an AI pre-decoder and syndrome-statistics noise learning as complementary approaches. It reports runtime and logical-error improvements alongside data-derived decoding weights.

I. INTRODUCTION

  • Existing AI decoders face scaling and parallelism challenges, and a pre-decoder plus state-of-the-art global decoder had not been shown to combine O(1µs) per-round runtime with lower LER.Spatial parallelism matters for lattice-surgery patches with effective distances much greater than 100.Source: §I · pp. 1–2

II. SUMMARY OF CONTRIBUTIONS

  • The fully convolutional 3D pre-decoder predicts spacelike and timelike corrections locally, then passes residual syndromes to a backend-agnostic global decoder.Its model size and training configuration can be adjusted for noise models, code distances, and runtime budgets.Source: §II · p. 3
  • A larger model improves LER over correlated PyMatching at distances up to d = 13.The model uses residual connections.Source: §II · p. 3
  • At d = 31 and p = 0.006, the combined pipeline reaches speedups of up to 3.4× over uncorrelated PyMatching and 3.5× over correlated PyMatching.At d ≥ 21, the pre-decoder plus uncorrelated PyMatching also lowers both LER and total runtime relative to uncorrelated PyMatching alone.Source: §II · p. 3
  • Syndrome-statistics learning infers near-optimal edge and hyperedge weights without a circuit-level noise model; on raw syndromes, it nearly matches uncorrelated matching and improves correlated-matching LER versus known-model weights.Distance-independent probability formulas let a model trained at one code distance generalize to arbitrary distances.Source: §I · p. 2, §II · p. 3
  • Increasing GPU batch size in parallel block-wise decoding reduces the parallel classical resources required for real-time decoding by up to 12.5×.The paper notes this is relevant to decoding very large merged patches in lattice-surgery operations.Source: §II · p. 3

III. BRIEF REVIEW OF THE SURFACE CODE

  • Parallel window decoding processes commit and cleanup regions concurrently, while a pre-decoder reduces syndrome density to lower the runtime of a downstream global decoder.MWPM runtime depends on syndrome density, which is defined from the number of non-trivial detection events.Source: §III · p. 4

IV. PRE-DECODER ARCHITECTURE

The pre-decoder reduces syndrome density before global decoding, trading its local runtime and communication costs against faster downstream decoding. Its fully convolutional 3D architecture applies local corrections across space and time, using syndrome and geometric information as training inputs.

A. Motivation for using pre-decoders

  • A pre-decoder applies local space–time corrections before global decoding, reducing syndrome density and potentially lowering total decoding time when the savings exceed added runtime and communication costs.The pre-decoder runtime is independent of input syndrome density; the speedup depends on the reduced-density global decoder saving more time than pre-decoding and communication add.Source: A. Motivation for using pre-decoders · p. 5

B. Neural network architecture and hyperparameters

  • The pre-decoder is a fully convolutional 3D network whose outputs match the input space–time dimensions, enabling local corrections across the syndrome volume.The receptive field bounds the local window influencing each output; error chains extending beyond it cannot generally be fully corrected by local operations alone.Source: B. Neural network architecture and… · pp. 5–6

1. Input training data

  • Training inputs encode detector events and stabilizer geometry on a 2D grid for each round, with explicit geometric channels accounting for boundary stabilizers.For the quantum-memory setting, the input tensor has four channels; more general settings such as lattice surgery require additional channels.Source: §1 · pp. 6–7
  • Training samples are generated by sampling circuit faults under the underlying noise model and propagating them through the syndrome-extraction circuit.Samples contain syndrome-measurement rounds and record detector events and differences between data-qubit errors across consecutive rounds.Source: §1 · p. 6

2. Output training data

The output training targets teach the pre-decoder to predict both data-qubit and stabilizer-measurement corrections. Timelike labels isolate measurement-round fault contributions so the model can reduce residual detection events passed to the global decoder.

2. Output training data

  • The four output channels encode Z- and X-type data-qubit corrections and timelike corrections for X- and Z-type stabilizers.Training targets include both spacelike and timelike corrections to reduce the syndrome density passed to a global decoder.Source: §2 · p. 8
  • Spacelike output channels track changes in Z- and X-type Pauli errors on data qubits between consecutive rounds.These labels are obtained by sampling circuit faults and propagating them through the syndrome-extraction circuit.Source: §2 · p. 8
  • Timelike labels isolate stabilizer-measurement changes caused by faults within a single round, and are defined only before the final measurement round.Comparing syndromes before and after an additional round isolates timelike contributions; these labels help the pre-decoder suppress time-correlated detection events.Source: §2 · p. 8

3. Data processing

The data-generation protocol defers errors whose syndrome appears in a later round, avoiding artificial timelike events in training labels. It also decomposes Y-containing faults into X- and Z-only components before propagation.

3. Data processing

  • Faults can create a data-qubit error in round k whose syndrome appears only in round k+1, producing spurious space–time pairs if handled naively.For example, a late-round fault can place the error in trainY at round k while its syndrome appears in trainX at round k+1.Source: §3 · p. 8
  • Training labels are updated only when a fault produces a non-trivial syndrome in the same round; otherwise, the error is deferred to the next round.This data-generation rule is intended to prevent artificial timelike detection events.Source: §3 · p. 8

else

  • Before propagation, faults containing Y errors are decomposed into equivalent X- and Z-only components to avoid artificial spacelike–timelike correlations.For two-qubit faults, the decomposition relates the data-qubit error to the error detectable by the ancilla; the resulting components are propagated independently.Source: else · p. 9

4. Homological equivalence function

The homological-equivalence procedure canonicalizes training labels through spacelike and timelike simplifications while preserving syndrome history and logical equivalence. Its iterative sequence combines spatial reductions with temporal transformations across rounds.

4. Homological equivalence function

  • Canonical representatives are chosen within each homological equivalence class to reduce training-label complexity while preserving syndrome history and logical equivalence.The transformations preserve the induced syndrome history and the error's logical equivalence class.Source: §4 · p. 11
  • Spacelike simplification uses stabilizer equivalence to reduce supported X-error patterns, including reducing weight-three errors to weight one and removing weight-four errors.The procedure also removes weight-two X errors supported on boundary weight-two X stabilizers.Source: §4 · p. 11
  • Timelike equivalence can treat the same data-qubit error in two consecutive rounds, with associated measurement errors in the first round, as a trivial operation with no net syndrome change.Using this freedom simplifies labels by introducing structure that is easier for CNNs to learn.Source: §4 · p. 13
  • Without timelike simplification, a round-k error masked by measurement errors can remain labeled in round k and encourage a correction in the wrong round, leaving residual timelike failures for the global decoder.Such errors may be detected only in round k+1.Source: §4 · p. 13
  • The timelike protocol is extended to include weight-two X or Z data errors that can arise from a single fault.For the weight-two Z case, the convention adds a horizontal error across two consecutive rounds with associated measurement errors in the first round.Source: Figure 10 · p. 11, §4 · p. 13
  • The complete protocol applies spacelike simplification to all rounds, timelike simplification for weight-one errors, then a final spacelike cleanup pass.The cleanup pass addresses new spacelike simplification opportunities created by timelike transformations.Source: §4 · p. 13, Figure 11 · p. 13

5. Loss function

The loss function trains the pre-decoder on independent voxel-level probabilities across four output channels. It sums binary cross-entropy across those channels and voxels.

5. Loss function

  • The network predicts independent per-voxel probabilities for spacelike Pauli corrections and timelike syndrome flips using a binary cross-entropy objective.The network has four output channels, each passed through a sigmoid to produce probabilities in [0, 1].Source: §5 · p. 13
  • Four output channels represent the pre-decoder's correction predictions, with sigmoid nonlinearities mapping each channel to probabilities in [0, 1].Source: §5 · p. 13
  • The loss sums binary cross-entropy terms over all channels and voxels, for a total of 4D^2dm terms.Source: §5 · p. 13

6. Inference step

At inference, the pre-decoder predicts local spacelike and timelike corrections from syndrome data and modifies the syndrome history. The residual syndromes are then passed to a global decoder.

6. Inference step

  • Given syndrome data, the trained pre-decoder predicts local spacelike and timelike corrections, modifies the syndrome history, and passes residual syndromes to a global decoder.Source: §6 · p. 14
  • The pre-decoder applies predicted spacelike corrections to the syndrome using the maps from data-qubit errors to stabilizer syndromes.The inference procedure defines those maps for X- and Z-type corrections.Source: §6 · p. 14
  • A predicted timelike correction flips the same stabilizer measurement outcome in rounds k and k+1.The inference procedure specifies this for both X- and Z-stabilizer outcomes.Source: §6 · p. 14
  • After both correction types are applied, the resulting residual syndromes are passed to the global decoder.Source: §6 · p. 14
  • A logical error is recorded when the accumulated correction anticommutes with the corresponding logical operator.The passage defines the X and Z logical-error conditions using the accumulated corrections and logical operators.Source: §6 · p. 14

V. NOISE LEARNING ARCHITECTURE FROM SYNDROME STATISTICS

The noise-learning framework estimates effective noise parameters from syndrome statistics, avoiding dependence on a fully known circuit-level noise model. Its distance-independent pooling architecture can be trained at one code distance and generalized to others.

V. NOISE LEARNING ARCHITECTURE FROM SYNDROME STATISTICS

  • The model infers effective noise parameters from two consecutive bulk syndrome rounds, enabling PyMatching weights to reflect residual syndromes or experimentally observed data.The estimates support standard and correlated matching.Source: §V · pp. 14–15
  • Distance-independent edge and hyperedge probability formulas, combined with global average pooling, let a model trained at one code distance generalize to arbitrary distances.The architecture extracts local spatial features and pools them into global statistics before mapping them to parameter estimates.Source: §V · p. 15, Figure 12 · p. 15

A. Architecture

  • The network processes two consecutive bulk rounds on a 2D grid through a convolutional feature extractor, global average pooling, and an MLP prediction head.Pooling produces a feature vector whose dimensionality is independent of code distance.Source: A. Architecture · p. 15
  • At inference, estimates from many syndrome pairs are aggregated in logit space and mapped through bounded log-space transformation to valid-range noise probabilities.Training uses the same aggregation procedure as inference, avoiding a train–test mismatch.Source: A. Architecture · pp. 15–16

B. Edge and hyperedge probability formulas

The framework derives distance-independent edge and hyperedge probabilities from circuit-level noise parameters, then trains a network to estimate those parameters by matching predicted and known graph probabilities. Inference converts the estimates into a detector error model for either uncorrelated or correlated PyMatching.

B. Edge and hyperedge probability formulas

  • The 18 edge types are formed by tracing single-Pauli faults and combining independent mechanisms that flip the same detector pair via XOR.The same edge formulas apply for all d ≥5; only the number of instances changes with distance.Source: B. Edge and hyperedge probability… · p. 16
  • Correlated two-pass matching uses decomposed hyperedges and conditional probabilities P(E2 | E1) = Pjoint/P(E1) to reweight edges after an initial matching solution.The method identifies 43 distinct hyperedge type compositions, with formulas verified against Stim’s detector error model.Source: B. Edge and hyperedge probability… · p. 16

C. Loss function

  • The loss combines count-weighted mean-squared errors over 18 edge types and 43 hyperedge compositions, with differentiable probability formulas enabling gradient-based training.Including hyperedge terms supplies conditional probabilities for correlated matching and regularizes parameter degeneracy in edge-only optimization.Source: C. Loss function · p. 16
  • A variance-stabilizing weight corrects loss bias from log-uniform base-rate sampling, using the geometric mean p0 = √pmin · pmax.The resulting edge and hyperedge losses are described as unbiased.Source: C. Loss function · p. 16

D. Training procedure

  • Training samples base error rates log-uniformly, generates independent syndrome samples, predicts noise parameters, and minimizes the combined edge and hyperedge loss.Hierarchical noise sampling spans multiple orders of magnitude while retaining physically reasonable parameter correlations.Source: D. Training procedure · p. 17

E. Inference strategy

  • At inference, the network aggregates estimates from consecutive bulk-round pairs and uses them to construct a detector error model for standard or correlated PyMatching.The procedure avoids first- and last-round temporal boundary effects and can operate on pre-decoder output syndromes.Source: E. Inference strategy · p. 17

VI. NUMERICAL RESULTS AND PERFORMANCE BENCHMARKS

The numerical evaluation compares pre-decoder architectures under a depolarizing circuit-level noise model and finds a tradeoff between inference speed and logical performance. Model 5 generally improves logical error rates over uncorrelated PyMatching alone, while faster model and activation choices have more qualified outcomes.

VI. NUMERICAL RESULTS AND PERFORMANCE BENCHMARKS

  • The evaluated pre-decoders use fully convolutional 3D CNNs, with width, depth, and kernel size varied to assess architectural tradeoffs in expressiveness and runtime.The simulations use a depolarizing circuit-level noise model, and the model configurations and training hyperparameters are summarized in Tables II and III.Source: §VI · p. 17, Table II · p. 18

A. Logical error rates and syndrome densities for uncorrelated PyMatching

B. Logical error rates and syndrome densities for a correlated matching global decoder

For correlated PyMatching, the larger model 6 improves logical error rates at smaller tested distances but has a limitation at larger distances. Runtime measurements show the pre-decoder’s tradeoffs alongside gains from reduced syndrome density, with end-to-end outcomes depending on model, decoder, distance, and physical error rate.

C. GPU runtimes and optimizations

B. Logical error rates and syndrome densities for a correlated matching global decoder

C. GPU runtimes and optimizations

  • For (21, 21, 21) inputs at p = 0.006, model 1 reduces uncorrelated PyMatching runtime from 29.95 µs to 11.30 µs, a ≈2.65× global-decoder speedup.Including model 1’s 1.872 µs pre-decoder runtime gives 13.17 µs total, or ≈2.27× speedup over PyMatching alone.Source: C. GPU runtimes and optimizations · p. 24
  • At p = 0.003, model 1’s total speedup falls to ≈1.88× because PyMatching is faster and pre-decoder overhead is relatively larger.Across the tested settings, speedups rise with code distance and physical error rate; for (31, 31, 31), model 4 has the largest overall speedup.Source: C. GPU runtimes and optimizations · p. 25
  • Considering runtime results alongside logical error-rate improvements reported in Section VI A, deeper architectures with 3 × 3 × 3 convolutional kernels offer a more favorable runtime–decoding-performance tradeoff than shallower architectures with larger kernels.Source: C. GPU runtimes and optimizations · p. 25
  • Batch sizes above one support parallel processing of logical qubits or decoding blocks, and pre-decoders jointly predict spacelike and timelike corrections for parallel windows in space and time.The paper identifies multiple-GPU block-wise decoding and resource-cost reduction as applications of this parallelism.Source: C. GPU runtimes and optimizations · p. 25, Table XI · p. 26
  • At p = 0.006, model 5 plus uncorrelated PyMatching reduces both LER and runtime relative to correlated PyMatching alone for d ≥13.Fig. 19 compares end-to-end LER and single-shot runtime at p = 0.003 and p = 0.006.Source: Figure 19 · p. 25, C. GPU runtimes and optimizations · p. 26

D. Faster pre-decoders with parallel-window decoding in time

The paper combines local pre-decoding with global matching, reports speed and LER gains, and evaluates time-window parallelism, batching, and data-driven noise learning. Noise learning works well on raw syndromes but adds no LER improvement on Model 5 residual syndromes; future work targets rare errors and broader decoding settings.

D. Faster pre-decoders with parallel-window decoding in time

  • All tested parallel time-window configurations stayed well below 1 µs per round; larger batches reduced GPU requirements but increased decoding time.The reported setup decodes commit and cleanup blocks in parallel; it assumes GPU reuse between stages and neglects their communication latency.Source: D. Faster pre-decoders with… · p. 26

E. Numerical results with noise learning

  • At p = 0.003, the biased model trained at d = 21 performed best across code distances; at p = 0.006, the unbiased d = 31 model performed best overall.The comparison covers correlated and uncorrelated matching using noise-learning models trained at d = 21 and d = 31.Source: Figure 20 · p. 27, E. Numerical results with noise learning · p. 28
  • From raw syndrome statistics, learned weights nearly matched known-model LER for uncorrelated matching and improved correlated matching; true DEM probabilities bound uncorrelated performance.The authors attribute the correlated result to the learned probabilities sometimes producing a more effective first-pass solution for heuristic reweighting.Source: E. Numerical results with noise learning · pp. 28–29
  • Applying noise learning to Model 5 residual syndromes slightly worsened LER; many logical-fault residuals are long strings parallel to the logical observable.The reported strings exceed (d − 1)/2, so minimum-weight correction produces a logical fault; the authors cite this as motivating the larger Model 6.Source: E. Numerical results with noise learning · p. 29

VII. IMPROVED PARALLELIZATION THROUGH BATCHING

  • Batch size 2 used 3.2x fewer parallel resources and was 1.993x faster; batch size 64 cut resources 12.49x but ran about 80% slower.The comparison uses p = 0.006, input volumes of size (13, 13, 13), and Model 1 with ReLU.Source: §VII · p. 29, Table XIII · p. 29

VIII. CONCLUSION

  • The pre-decoder pipeline was up to 3.42x faster than uncorrelated and 3.5x faster than correlated PyMatching, while improving LER relative to both.The conclusion reports these results at moderate-to-large code distances.Source: §VIII · p. 30
  • Future work targets rare-error LER gaps, teacher–student distillation, 4-bit quantization-aware training, color codes, and space-time lattice-surgery decoding.The paper reports evaluations through d = 31 and identifies block-size constraints for lattice-surgery operations as one reason not to go farther.Source: §VIII · pp. 30–31

Appendix A: Edge weight calculations

Appendix A derives surface-code matching-graph edge weights from circuit-level faults and describes how edge types map to data and measurement errors. It combines probabilities for shared detector patterns and converts edge probabilities into PyMatching weights.

Appendix A: Edge weight calculations

  • The appendix derives edge-weight calculations from a d = 5 circuit that contains edge types used at arbitrary distances.The matching graphs have distance-independent edge types, although their counts change with distance.Source: Appendix A · p. 31, • Diagonal edges · p. 32

1. Notation and methodology

  • The circuit-level noise model uses 25 probabilities covering preparation, measurement, idle, and CNOT errors.The listed parameters distinguish Pauli-error types and the relevant operation or measurement setting.Source: §1 · p. 31
  • When independent faults produce the same detector pair, their probabilities are combined with XOR; PyMatching uses edge weight w = −log P.Contributions from a single fault location can also sum over Paulis that produce the same detector pattern.Source: §1 · p. 31

2. Edge classification

• Spacelike edges:

• Timelike edges:

  • Timelike edges connect the same stabilizer across adjacent rounds and arise from ancilla or measurement errors.Source: • Timelike edges · p. 32

• Diagonal edges:

  • Diagonal edges connect different stabilizers across adjacent rounds, while boundary edges connect one stabilizer to the logical boundary.Diagonal edges arise from combined data and measurement errors; boundary edges arise from measurement errors near the boundary.Source: • Diagonal edges · p. 32

3. X-stabilizer graph edge formulas

The X-stabilizer matching graph detects Z and Y data-qubit errors. The appendix supplies edge formulas, including boundary formulas expressed as XOR components.

3. X-stabilizer graph edge formulas

  • The X-stabilizer matching graph detects Z and Y errors on data qubits.Source: §3 · p. 33

b. Timelike edges

d. Boundary edges

4. Z-stabilizer graph edge formulas

The Z-stabilizer graph detects X and Y data-qubit errors, and its formulas follow from the X-stabilizer formulas by exchanging X- and Z-type Paulis. The appendix derives and verifies local edge-probability formulas that apply across code distances.

4. Z-stabilizer graph edge formulas

  • The Z-stabilizer graph detects X and Y errors on data qubits and has 18 edge types.These comprise three spacelike, four timelike, five diagonal, and six boundary types.Source: §4 · p. 34
  • The Z-stabilizer formulas follow from the X-stabilizer formulas by replacing Z-type Paulis with X-type Paulis.This uses the X/Z symmetry of the surface-code circuit.Source: §4 · p. 34

5. Summary and verification

  • The derivation traces each possible Pauli fault through the syndrome-extraction circuit to find its detector pattern.Source: §5 · p. 34
  • For each CNOT, idle, or preparation fault location, the procedure activates one Pauli error and generates a detector error model with Stim.Source: §5 · p. 34
  • The procedure selects DEM patterns containing the target edge’s detector pair, then groups contributions by pattern and sums Paulis from the same location.Source: §5 · p. 34
  • XOR-combining the grouped contributions yields formulas that remain unchanged with distance because edge probabilities depend on local stabilizer geometry.Only the count of each edge type changes with code distance.Source: §5 · p. 35
Loading 2604.12841v1…