# GFlowQEC: Generative Flow Networks that Learn to Sample Quantum LDPC Codes

Quantum.world

> Frozen GFlowNet code search more than doubles new top-scoring lifted-product QLDPC codes per costly circuit-level evaluation, changing how QEC candidates are found.

**arXiv**: 2611.06819 · Preprint · not peer-reviewed

**Published**: 2026-11-04

**Authors**: Nuno Batista, Gabriel Falcao, Penousal Machado

## In plain words

Choosing a quantum error-correcting code for a real device requires scoring candidate codes with circuit-level simulations that take minutes to hours each, so a search can only afford a few hundred evaluations — every call counts.

## AI summary

## Overview

**Research area:** Quantum error correction and machine learning for code design — specifically generative flow networks (GFlowNets) applied to quantum low-density parity-check (LDPC) codes.

**Technical level:** Advanced. The paper assumes familiarity with CSS codes, stabilizer distances, lifted-product constructions over finite groups, and GFlowNet training objectives (trajectory balance). The conceptual argument is accessible; the machinery is not.

**Scope (one sentence):** The paper introduces GFlowQEC, a GFlowNet policy that builds lifted-product quantum LDPC codes one group element at a time and is trained offline on stored scores, then benchmarks how many top-scoring codes it delivers per paid oracle call against tuned parallel tempering, a supervised screen, soft Q-learning, MAP-Elites, Bayesian optimisation and uniform sampling at 180 physical qubits.

## What This Paper Is About

Choosing a quantum error-correcting code for a real device requires scoring candidate codes with circuit-level simulations that take minutes to hours each, so a search can only afford a few hundred evaluations — every call counts. Quantum LDPC codes built from a short list of group elements protect many logical qubits in one block, but the space of such lists is enormous (lists of ten elements over a sixty-element group give up to about 3×10⁸ inequivalent codes) and good codes are rare. The paper asks whether a learned model that *proposes* good codes directly — rather than screening random candidates — can convert a fixed evaluation budget into more good codes.

## Key Contributions

1. **A GFlowNet for quantum code design (GFlowQEC).** To the authors' knowledge this is the first GFlowNet applied to quantum error-correcting codes. Its policy is a causal transformer that fills ten slots one group element per step and is trained with trajectory balance so that it produces each code with probability proportional to max(s(x), 0.01)^β.
2. **A trained-once, frozen, conditional proposer.** The model is trained with no oracle calls on scores from 42 earlier runs (126,000 paid calls covering 116,972 distinct canonical forms), takes the noise bias γ as a condition vector z with its own learned normaliser Z_θ(z), and is frozen before deployment, where it draws μN candidates and pays only for the N it ranks highest by log p_θ(x|z).
3. **A matched-budget comparison protocol.** All methods share one oracle, one search space and a budget of 1,000 paid calls, paired by random seed, with both a "novel" count (canonical form not among the stored forms) and an "inequivalent" count (equivalence classes, decided by graph isomorphism on Tanner graphs), plus pooled ratios with 95% log-ratio intervals.
4. **Ablations isolating where the gain comes from.** Controls compare ranking the policy's own draws against ranking uniform candidates, rank-by-probability against paying in draw order, and the GFlowNet loss against soft Q-learning, which shares its optimal policy on this construction.

## Main Findings

- **Against tuned parallel tempering:** On inequivalent top-scoring codes, GFlowQEC found 2.4 [2.2, 2.6] times as many at γ = +1 and 2.8 [2.6, 3.0] times as many at γ = −1, and more than twice as many in 19 of its 20 runs. Starting tuned PT from the stored forms did not close the gap: the policy still found 2.8 and 2.7 times as many.
- **Against the supervised screen at μ = 10:** The policy found 3.6 and 3.8 times as many top-scoring codes and led in each of ten seeds. The authors attribute this to rarity: only about one random code in a hundred is top-scoring here, so a screen shown ten random candidates per paid call rarely sees one.
- **But the screen wins at μ = 100:** When both oversample a hundredfold, the screen found more in each of ten seeds, and the policy found only 0.45 [0.44, 0.47] and 0.62 [0.61, 0.64] times its count.
- **Better draws and better ranking combine:** A screen ranking the policy's draws at μ = 100 found 1.27 and 1.30 times its own count, more in every seed; conversely, the policy ranking the screen's uniform candidates at μ = 10 found a fifth as many as from its own draws, and fewer than the screen.
- **Ranking beats draw order:** Paying for draws in the order drawn had trailed an earlier, smaller supervised screen in every seed at both biases; ranking by log-probability found more than five and a half times as many top-scoring codes as draw order.
- **The gain does not depend on the GFlowNet loss:** Soft Q-learning trained offline found 1.01 and 1.15 times the policy's novel count — not separated at γ = +1, ahead at γ = −1 where the interval [1.10, 1.19] excludes 1 — leading in 7 and 8 of ten seeds.
- **Simple baselines are weak here, but exhaustion is not the bottleneck:** Uniform sampling found about ten top-scoring codes per 1,000 paid calls (12 and 8 inequivalent at the two biases), BO 49 and 52, MAP-Elites (five bins) 88 and 74, tuned PT 92 and 79.
- **The policy mostly finds new partners for known good halves:** In each of its runs, 87 to 93 per cent of its neighbourhoods (codes agreeing on the h_i, or the g_i at γ = −1, up to conjugation) also hold a stored top-scoring code.
- **The lead disappears per CPU second:** The policy's paid calls ran the exact distance ladders 3.5 and 4.2 times as often as tuned PT's, and those ladders dominate call cost. On seeds 0 to 2, per CPU second of exact ladders, the policy and tuned PT found top-scoring codes at the same rate within five per cent at both biases, and tuned PT was ahead on inequivalent counts.
- **The obvious cheap quantity does not rank codes:** k, the number of logical qubits, would raise the top-scoring share of the stored scores by at most 1.4 times if used for sorting.
- **Score definition:** The "failure exponent" is min(c_X d_X, c_Z d_Z) with c = ½ log₁₀(1/p); a score of 10 means the lightest uncorrectable error has probability about 10⁻¹⁰. At γ = ±1 the likelier flip has probability 10⁻² and coefficient 1.0, the rarer one coefficient 1.5. The top-scoring threshold is 10.0, the highest score in the 666-of-1,000 uniform reference sample whose elements generate G, reached by 6 of the 666; the best certified codes are [[180, k, 10]] with k ≥ 36.

## Methodology in Plain English

The researchers fix a code family — lifted-product codes over the non-abelian group G = Z₆ × S₃ (36 elements), giving n = 5|G| = 180 physical qubits — where each code is just a list of ten group elements. They relax the mitten-code construction of Bhardwaj et al. by dropping the invertibility requirement on a₂ and b₂ (only 123 of 595 choices meet it over this group), which enlarges the family and admits codes with k > |G|.

They treat code quality as a black-box score and charge for every genuinely new code scored: a repeated canonical form is answered from memory for free, so a method's cost is its number of paid calls. Distances are computed by a "SAT ladder" that asks, for w = 1, 2, …, whether a logical operator of weight at most w exists; a cheap and slightly optimistic bound score from classical-code distances comes first, with exact ladders run only when the bound reaches the threshold. A bound score takes 0.8 s median and 1.5 s mean on one CPU core; exact ladders take about 10 s on a uniform draw and about 2 min on a certified code.

A transformer with three blocks of width 128 and four heads (605,863 parameters) is trained with the trajectory-balance loss on the stored scores only — no oracle calls during training — using data augmentation (shuffling free elements, conjugating the g_i and h_i separately) and, with probability one half, mirroring a tuple, which trains the opposite bias at the same reward. The exponent β = 8 was chosen by a fixed rule over {1, 2, 4, 8, 16, 27, 40, 64}: the smallest at which the best tenth of the uniform reference sample and its mirrors holds at least four fifths of total reward. Ten models, one per seed, are trained for 315,280 updates of 256 tuples (about 690 passes over the stored forms) and then frozen. At deployment the policy draws until it has μN distinct canonical forms, discards failures of a cheap generation check, ranks by log p_θ(x|z), and pays for the top N.

## Why This Matters

**Impact on research.** The paper reframes code search as a budget-allocation problem and reports the comparison at a cost unit that transfers to real devices (the paid oracle call) rather than at wall-clock time or best-code-found. It also delivers a deliberately sober result: a trained proposer's advantage is real against weak-per-call baselines but vanishes per CPU second and against a simpler screen at a hundredfold oversampling. That is a useful calibration for a literature where learned code searches are often reported without matched budgets.

**Real-world applications:**

- Selecting a quantum error-correcting code for a specific device, where the best code changes with the device's noise and connectivity and calibration must be repeated.
- Quantum compilers that choose the code themselves — the paper cites a strategic plan for neutral-atom quantum computing that calls for compiler-side code selection and names generative neural networks as candidates.
- Shortlisting candidates for expensive circuit-level simulation with faulty measurements and a real decoder, where a search scores only hundreds of codes.
- Rapid re-proposal after recalibration via conditioning, without rerunning a full search.

**Industry relevance.** Hardware groups and compiler/toolchain teams facing expensive per-candidate characterisation are the natural consumers. The result that good codes are "not rare enough" at 180 qubits — and that searches already run at 600 to 1,500 physical qubits, past the few hundred where exhaustive catalogues stop — identifies where a trained proposer would actually pay off.

## Future Directions

- Re-score the top-scoring 180-qubit codes under circuit-level noise, with faulty check measurements and a real decoder, and test whether their distance-based ranking survives; then grade the proposer at that cost, against Chengyu et al.'s method at the few-hundred-call budget it is built for.
- Condition the policy on measured noise through multi-objective GFlowNets, so one policy proposes a new set of good codes after each calibration.
- Build hard request constraints (device connectivity, check weight, a floor on k) into the action mask, turning the policy into a conditional generator for a quantum compiler.
- Extend a single policy across code families by having each action choose one level of the construction in turn — family, group, base matrices, sums — rather than mutating a fixed grammar.
- The authors also flag an untested question: whether the policy actually samples in proportion to its reward, since it is used only as a proposer that ranks its own draws.

## Target Audience

Quantum-information researchers working on LDPC code construction and fault tolerance; machine-learning researchers interested in generative models for structured scientific design and in honest matched-budget benchmarking; compiler and architecture engineers who must pick codes under expensive characterisation; and graduate students who want a worked example of how a generative proposer compares with tempered MCMC, screening, and quality-diversity search on a real combinatorial design problem. Readers should already be comfortable with stabilizer formalism and basic reinforcement-learning vocabulary.

## Authors’ abstract

Choosing a quantum error-correcting code for a real device means scoring candidates with circuit-level simulations so slow that only a few hundred can be run. So every evaluation counts, and a search is judged by how many good codes it finds per paid evaluation. Quantum LDPC codes built from a few group elements protect many logical qubits, but good ones are rare in a huge space. We introduce GFlowQEC, to our knowledge the first generative flow network (GFlowNet) for quantum…

[The full abstract on arXiv](https://arxiv.org/abs/2611.06819)

[Read the original paper](https://arxiv.org/abs/2611.06819)

## Related papers

- [Distilling Knowledge from Search: Decoder Model Factory for Quantum LDPC Codes](https://quantum.world/paper/distilling-knowledge-from-search-decoder-model-factory-for-quantum-ldpc-2610.41398) 2026-10-30 · quant-ph · Key terms of the title in common
- [Syndrome extraction for quantum LDPC codes in silicon: Distributed entanglement and mobile ancillas](https://quantum.world/paper/syndrome-extraction-for-quantum-ldpc-codes-in-silicon-distributed-2611.13371) 2026-11-09 · quant-ph · Key terms of the title in common
- [PriorTilt: Decoding quantum LDPC codes with sparse perturbations of belief propagation priors](https://quantum.world/paper/priortilt-decoding-quantum-ldpc-codes-with-sparse-perturbations-of-2611.13373) 2026-11-09 · quant-ph · Key terms of the title in common
- [Fast and accurate neural triage decoding of ultra-high-rate quantum LDPC codes](https://quantum.world/paper/fast-and-accurate-neural-triage-decoding-of-ultra-high-rate-quantum-2610.40490) 2026-10-29 · quant-ph · Key terms of the title in common
- [Proxima: Optimizing Syndrome Extraction Circuit Scheduling for Practical Quantum LDPC Codes](https://quantum.world/paper/proxima-optimizing-syndrome-extraction-circuit-scheduling-for-practical-2611.19715) 2026-11-15 · quant-ph · Key terms of the title in common

---

Canonical: https://quantum.world/paper/gflowqec-generative-flow-networks-that-learn-to-sample-quantum-ldpc-2611.06819
