---
title: 'AlphaQubit 2: Streaming Neural Decoder for QEC'
url: https://www.emergentmind.com/topics/alphaqubit-2
type: topic
---

# AlphaQubit 2: Streaming Neural Decoder for QEC

AlphaQubit 2 (AQ2) is a neural-network decoder for topological quantum error-correcting codes, introduced as a decoder designed to satisfy three requirements that are usually in tension: high decoding accuracy, high speed or real-time throughput, and scalability to larger code distances and long experiments [2512.07737]. It is presented as a discriminative decoder that takes the history of stabilizer-measurement information from a topological-code memory experiment and predicts the relevant logical observable(s) at the end of the experiment, thereby determining the logical frame update implied by the observed syndrome history [2512.07737]. The paper studies AQ2 on both the XZZX rotated surface code and the Bell-flagged triangular colour code under realistic circuit-level noise, and introduces a compact real-time variant, AQ2-RT, for sustained sub-\(1~\mu\mathrm{s}\)-per-cycle surface-code decoding on commercial machine-learning accelerators [2512.07737].

## 1. Historical position and problem formulation

AQ2 is positioned after the original AlphaQubit line as an attempt to improve the practical accuracy–speed tradeoff of neural quantum decoders while extending applicability beyond the surface code to the more difficult Bell-flagged colour code [2512.07737]. The central problem is not decoding in the abstract, but decoding under the operational constraints of fault-tolerant quantum computation: a practical decoder must exploit long-range and temporal correlations in realistic circuit-level noise, keep up with hardware cycle time, and remain usable at large code distance and over very long syndrome streams [2512.07737].

The paper emphasizes that prior decoders typically occupied only one part of this design space. Real-time matching and PyMatching were faster but less accurate, whereas Libra and Tesseract were stronger high-accuracy baselines but slower or harder to scale [2512.07737]. For colour codes, the paper states that the lack of a decoder simultaneously achieving speed, accuracy, and scalability had become a major bottleneck, particularly because colour codes are attractive for more resource-efficient logical operations [2512.07737].

AQ2 addresses this by adopting a streaming spatiotemporal architecture with per-stabilizer latent states, temporal recurrence, spatial transformer self-attention, temporal compression, and a readout network with pooling and cross-attention [2512.07737]. This suggests that AQ2 is best understood not simply as a higher-capacity successor to AlphaQubit 1, but as a systems-oriented redesign intended to preserve strong logical decoding performance while making deployment at larger scales more plausible.

## 2. Code families, syndrome structure, and noise models

The paper evaluates AQ2 on two planar topological code families [2512.07737]. For the surface code, the setting is the XZZX rotated surface code, where a logical qubit is encoded on a grid of \(d \times d\) data qubits, with \(d^2-1\) measure qubits performing repeated X- and Z-type stabilizer checks [2512.07737]. A detection event is defined as a disagreement between consecutive measurements of the same stabilizer, and the final data-qubit measurement induces the last syndrome slice [2512.07737]. The reported simulations evaluate the surface-code decoder up to distance 23 [2512.07737].

For the colour code, the paper focuses on the Bell-flagged triangular colour code, in which data qubits lie on the vertices of a honeycomb lattice and each hexagonal face has an X stabilizer and a Z stabilizer [2512.07737]. A full correction cycle reads all X stabilizers and then all Z stabilizers, using two ancillas per hexagon, one of which serves as a flag to signal dangerous readout faults [2512.07737]. AQ2 is evaluated on this code up to distance 27 [2512.07737].

The principal synthetic benchmark uses Stim with the SI1000 circuit-level depolarizing noise model at target physical error rate
\[
p = 0.15\%.
\]
The paper states that this is a realistic circuit-level noise model intended to approximate superconducting-hardware noise, including gate, measurement, reset, and idle noise at the circuit level, with the updated SI1000 interpretation including post-measurement and reset noise terms and treating measurement and reset as separate operations [2512.07737].

In addition to simulation, AQ2 is evaluated on experimental Willow surface-code data at distances 3, 5, and 7 [2512.07737]. The transfer pipeline for these experiments consists of pretraining on SI1000, fine-tuning on a fitted detector error model (DEM), and further fine-tuning on real hardware data [2512.07737].

## 3. Architectural organization

AQ2 is described as a streaming spatiotemporal neural architecture organized around per-stabilizer representations, temporal recurrence for each stabilizer independently, spatial transformer self-attention across all stabilizers at a given time, temporal compression over groups of cycles, and a readout network with pooling and cross-attention [2512.07737]. For AQ2-full, one processing block uses the layer sequence
\[
\text{RNN; RNN; 3 transformer layers; RNN; 3 transformer layers; RNN; 3 transformer layers; RNN}.
\]
The paper identifies this as a key design change relative to AlphaQubit 1: transformer computation is no longer buried inside a large recurrent core, and instead lightweight recurrent updates are interleaved with transformer layers, allowing more parallelism across time blocks during inference [2512.07737].

For the surface code, the embedding for each stabilizer includes measurement information, detection event information, and spatial position information [2512.07737]. For the colour code, the embedding includes stabilizer measurement outcomes, corresponding flag outcomes, basis information, and spatial coordinates [2512.07737]. AQ2 also includes explicit geometry through normalized \(x\) and \(y\) coordinates embedded linearly, rotational positional encodings (RoPE) in spatial self-attention, and learned basis embeddings for colour-code measurements where X and Z occur at the same location [2512.07737].

Temporal compression is a prominent architectural feature. Instead of processing every cycle separately, AQ2 groups several consecutive cycles: 6 cycles for simulated surface code, 3 cycles for simulated colour code, and 5 cycles for Willow data [2512.07737]. These grouped cycles are concatenated and projected into a compressed representation, while the final data-qubit-readout-derived syndrome slice is embedded separately but processed by the same network [2512.07737].

The temporal layers are recurrent and operate independently per stabilizer with shared parameters; for AQ2-full, the previous hidden state and current input are concatenated, projected back to hidden dimension, followed by GELU and RMSNorm, and the result becomes both the layer output and the next recurrent state [2512.07737]. State is initialized to zero at the start of the experiment [2512.07737]. AQ2-RT replaces this recurrence with a faster element-wise gated recurrence chosen specifically for throughput [2512.07737].

The spatial layers are transformer blocks over stabilizers at a single time step, each containing RMSNorm, multi-head self-attention across stabilizer embeddings, a residual connection, second normalization, and a gated dense block for further update [2512.07737]. The paper explicitly states that AQ2 uses no convolutions [2512.07737].

The readout stage proceeds after the final cycle by mean-pooling the final per-stabilizer representations, replicating the pooled representation once per logical observable, adding a learned logical-observable embedding, applying two cross-attention transformer layers and two residual dense layers, and projecting to one channel with logistic activation [2512.07737]. Operationally, the decoder outputs an estimate of the probability that the logical observable is 1 [2512.07737].

## 4. Training methodology and objectives

AQ2 is trained with binary cross-entropy on the final logical observable bit, but a major feature of training is the use of privileged simulated labels unavailable in real operation [2512.07737]. The four auxiliary labels per cycle are fake intermediates, noiseless observable, noiseless delta, and noiseless-to-intermediate delta [2512.07737]. The total loss is a weighted sum,
\[
\mathcal{L} = 1.2\,\mathcal{L}_{\text{final}} +1\,\mathcal{L}_{\text{fake}} +1\,\mathcal{L}_{\text{noiseless}} +1\,\mathcal{L}_{\text{noiseless-delta}} +8\,\mathcal{L}_{\text{noiseless-to-intermediate-delta}}.
\]
This auxiliary supervision is used only during training and is described as accelerating and stabilizing optimization [2512.07737].

The principal synthetic training regime uses data generated by Stim from memory circuits under SI1000 circuit-level depolarizing noise [2512.07737]. Training does not use a single noise point, but a mixture of noise levels sampled from code-specific distributions. For the main surface-code models, the paper gives
\[
(0.001,1),\ (0.0015,5),\ (0.002,2),\ (0.0025,3),\ (0.003,3),\ (0.0035,2),\ (0.004,2),
\]
where the second entry is the relative sampling weight [2512.07737].

Optimization uses Lion for most training and Muon for fine-tuning, with batch sizes generally 1024, a 1M-example linear warmup, and fixed learning rate with optional cosine decay [2512.07737]. The learning-rate scaling rule is given as
\[
\mathrm{learning\_rate} = \mathrm{base\_learning\_rate} \times 0.8^{\log_2 N_s/8} \times 2^{\log_2 R/24},
\]
where \(N_s\) is the number of stabilizers and \(R\) is the number of cycles, with the effective number of cycles doubled for the colour code [2512.07737].

A code-distance curriculum is used to improve convergence: early training emphasizes small distances and short durations, and later training gradually shifts toward larger distances [2512.07737]. The paper reports very large training scale, with many models trained on \(2\times 10^9\) examples, the large-distance colour model on \(7\times 10^8\) examples, surface-code \(d=23\) fine-tuning on \(3\times 10^9\) examples, and colour-code \(d=27\) fine-tuning on \(1.3\times 10^9\) examples [2512.07737].

Regularization includes input masking or dropout: 50% of stabilizer representations in each cycle are zeroed on 80% of training examples [2512.07737]. The paper explicitly compares this to BERT-style masking and states that it improves training [2512.07737].

For Willow data, the transfer-learning workflow is staged: pretrain on SI1000, fine-tune on a DEM fitted to hardware data, then fine-tune on real experimental samples [2512.07737]. This training philosophy preserves a core feature of the AlphaQubit line, but AQ2 extends it to a broader architectural and code-family setting.

## 5. Reported decoding performance

For simulated 120-cycle surface-code memory experiments at \(p=0.15\%\) SI1000 noise, the paper reports that AQ2 reaches, at distance 23,
\[
\mathrm{LER} = 7.3\times 10^{-11}
\]
per cycle [2512.07737]. The paper characterizes this as close to Libra and states that AQ2 substantially outperforms both uncorrelated PyMatching and correlated PyMatching on this benchmark [2512.07737]. For the Bell-flagged colour code, AQ2 is reported to track an idealized Tesseract-derived trend closely up to distance 23, and at distance 27, with a 3-model ensemble, reaches
\[
\mathrm{LER} = 8.0\times 10^{-11}
\]
per cycle [2512.07737].

The paper defines logical error per cycle for fixed-length shots as
\[
\mathrm{LER} = \frac{1}{2}\left(1-\sqrt[n]{1-2E(n)}\right),
\]
where \(E(n)\) is the fraction of incorrectly decoded shots of length \(n\) [2512.07737]. For experimental data with multiple durations, it defines
\[
F(n) := 1 - 2E(n),
\]
and fits
\[
\log F(n) = \log F_0 + n\log(1-2\epsilon),
\]
where \(\epsilon\) is the inferred per-cycle logical error rate [2512.07737].

On Willow distances 3, 5, and 7, the paper states that AQ2 achieves logical error rates comparable to the previous slower AQ1 and better than Libra, while AQ2-RT is close to AQ2-full and better than the original Willow real-time matching decoder and Libra [2512.07737]. The text excerpt does not provide the full numeric Willow LER table, so the comparison is qualitative at that level.

The real-time surface-code result emphasized in the paper concerns distance 11, where AQ2-full reports
\[
1.89\times 10^{-6}
\]
and AQ2-RT reports
\[
3.73\times 10^{-6}
\]
for the relevant logical error metric in the paper’s real-time benchmark [2512.07737]. AQ2-RT is therefore described as slightly less accurate than AQ2-full, but still more accurate than other decoders that can meet the same throughput target [2512.07737].

A broader significance claim follows from these numbers. AQ2 is not presented as formally optimal; rather, “near-optimal logical error rates” is an empirical claim relative to strong baselines such as Libra on the surface code and Tesseract or an extrapolated Tesseract trend on the colour code [2512.07737]. This suggests that the main novelty lies in moving the practical Pareto frontier rather than eliminating the underlying speed–accuracy tradeoff.

## 6. Real-time decoding, scalability, and relation to subsequent AlphaQubit-style work

AQ2 is explicitly a streaming decoder: it does not need to wait until the entire experiment has finished before doing most of its work, because the architecture is causal and only recurrent states carry history [2512.07737]. The paper defines throughput approximately as total decoding duration divided by number of cycles, measured using very long experiments of 100,800 cycles so that fixed overheads such as final readout are amortized [2512.07737]. Latency is defined as
\[
\text{latency} = \text{time\_prediction\_done} - \text{time\_last\_cycle}.
\]
The paper states that AQ2 and AQ2-RT have constant throughput and latency because the computation per block is fixed and does not depend on syndrome weight or detection fraction [2512.07737].

The strongest real-time result is that AQ2-RT decodes surface-code experiments faster than \(1~\mu\mathrm{s}\) per cycle up to distance 11 on Trillium TPUs [2512.07737]. For the real-time Willow models, the measured average times per cycle are \(896.6~\mathrm{ns} \pm 1.1\) at distance 3, \(854.3~\mathrm{ns} \pm 7.1\) at distance 5, and \(965.2~\mathrm{ns} \pm 3.4\) at distance 7 [2512.07737]. At distance 11, the paper states that AQ2-full is \(9.6\times\) faster than AlphaQubit 1, and AQ2-RT is another \(6\times\) faster than AQ2-full [2512.07737].

For larger distances, AQ2-full is reported to run below
\[
100~\mu\mathrm{s}
\]
per cycle up to distance 23, and the Methods state that unoptimized AQ2-full at surface-code distance 23 achieves
\[
30~\mu\mathrm{s}
\]
per cycle [2512.07737]. AQ2-RT at distance 23 runs at
\[
6.02 \pm 0.013~\mu\mathrm{s}
\]
per cycle, but the paper states that this compact model is not accurate enough there [2512.07737].

The paper also reports generalization in time: models trained on lengths up to 168 cycles are evaluated up to 1,080,000 cycles, with stable LER per cycle and only modest degradation at the largest tested distances [2512.07737]. This supports the claim that recurrent, time-invariant state propagation enables arbitrarily long streaming operation with fixed memory [2512.07737].

AQ2 should be distinguished from related AlphaQubit-style efforts published in the same period. “Scalable Neural Decoders for Practical Real-Time Quantum Error Correction” replaces the Transformer attention core in an AlphaQubit-style recurrent decoder with a Mamba state-space core, reducing the dominant scaling from \(\mathcal{O}(d^4)\) to \(\mathcal{O}(d^2)\), matching Transformer accuracy on Sycamore memory data while improving the simulated effective threshold from \(0.0097\) to \(0.0104\) under a decoder-induced-noise model [2510.22724]. “Learning Neural Decoding with Parallelism and Self-Coordination for Quantum Error Correction” and its later version “Learning to Decode in Parallel: Self-Coordinating Neural Network for Real-Time Quantum Error Correction” instead preserve an AlphaQubit-like recurrent-transformer backbone but redesign the supervision and deployment pipeline for sliding-window parallel decoding, with the later paper reporting a TPU v6e throughput of \(0.979 \pm 0.021\,\mu s\) per syndrome round at distance 25 and hardware results on Zuchongzhi 3.2 up to distance 7 [2509.03815; 2601.09921]. In a different direction, “AI-Enabled Decoding of Qubit Loss for Quantum Error-Correcting Codes” shows that a parallel spatiotemporal GNN can perform nearly identically to a modified AlphaQubit baseline for joint Pauli decoding and qubit-loss localization, while reducing aggregate inference time for a 10-round window from \(4.10\) ms to \(0.595\) ms [2604.14269].

These neighboring works clarify AQ2’s place in the literature. AQ2 is not the only “next-generation AlphaQubit-style” direction, but it is the one that explicitly unifies surface-code and colour-code decoding, very large-scale synthetic training, streaming recurrence, and a compact real-time variant within a single framework [2512.07737]. A plausible implication is that the post-AlphaQubit design space is no longer centered on a single architectural motif, but on multiple orthogonal strategies: temporal compression and interleaved recurrence-attention in AQ2, state-space substitution in Mamba-based decoders, and window-level parallelization in self-coordinating sliding-window systems.

## 7. Limitations and open questions

The paper states several important limitations directly. The strongest real-time result is only up to surface-code distance 11, so extending real-time decoding beyond that regime remains future work [2512.07737]. At the highest distances, especially colour-code distance 27 and long million-cycle runs, training becomes harder and performance deviates somewhat from ideal scaling [2512.07737]. The paper also explicitly says that it has not yet addressed minimizing end-of-experiment latency between the final measurement and the final decoding result, even though such latency matters for some applications [2512.07737].

The real-time demonstrations are performed on Trillium TPUs, which provides strong evidence of deployability on commercial accelerators but also means that throughput depends on the hardware and software stack used in evaluation [2512.07737]. Although the architecture is code-agnostic in spirit, the demonstrated models are trained and evaluated for specific code families, circuit layouts, and noise models, so broader generalization should not be assumed beyond what is shown [2512.07737].

For the Bell-flagged colour code, the paper notes that the studied circuit is not planar in its two-qubit interaction graph and therefore is not directly implementable on planar superconducting hardware, though it could suit all-to-all platforms such as neutral atoms [2512.07737]. Finally, the paper states that reaching and reliably evaluating logical error rates around \(10^{-12}\) and below remains challenging and would require more compute or more advanced rare-event estimation [2512.07737].

Taken together, these caveats delimit the scope of AQ2’s contribution. AQ2 establishes that a streaming neural decoder can jointly approach near-optimal logical performance, large-distance scaling, and sub-\(1~\mu\mathrm{s}\)-per-cycle throughput in a practically relevant regime [2512.07737]. It does not establish that the decoding problem is solved in general, nor that a single architecture dominates all alternatives. Instead, it marks a specific point in the evolution of neural QEC decoders: from proof-of-principle high-accuracy models toward deployable, accelerator-compatible decoders for surface and colour codes at the scales relevant to fault-tolerant quantum computation.

Source: https://www.emergentmind.com/topics/alphaqubit-2