When “Close Enough” Isn’t Enough: A Study of Autoregressive Drift in Learned Quantum Circuit Optimization on AMD Instinct™ GPUs

Aug 05, 2026

Glowing teal and gold particle globe over digital matrix with binary code and flowing data wave lines, representing AI and data analytics

As quantum computing moves toward practical, fault-tolerant systems, optimizing quantum circuits has become one of the field’s most important challenges. Every unnecessary operation increases execution cost, so efficient circuit optimization is essential to getting useful performance out of future quantum hardware.

Large language models have learned to write code, prove theorems, and fold proteins. So it is natural to ask: can a neural network learn to optimize quantum circuits, the way a compiler learns to optimize a program, directly from data, instead of relying on hand-written rewrite rules?

In our recent paper accepted at the IEEE International Conference on Quantum Computing and Engineering (QCE 2026), we study exactly that question with a compact encoder–decoder transformer trained on AMD Instinct™ MI300X GPUs, and we systematically evaluate how model size, training data, and inference-time compute affect optimization quality.

The results show both the promise and the current limits of learned quantum circuit optimization. The model performs remarkably well on continuous-parameter circuits, but it consistently struggles on fully discrete Clifford+T circuits. We identify a previously uncharacterized failure mode we call autoregressive drift, and we show that adding training data has a far greater impact on correctness than simply adding more inference-time compute.

Key takeaways

  1. AI models can successfully learn to optimize parameterized quantum circuits with high fidelity.
  2. Fully discrete Clifford+T circuits expose a new failure mode we call autoregressive drift, where small prediction errors compound throughout sequence generation.
  3. Increasing inference-time sampling improves results, but additional training data delivers significantly larger gains.
  4. AMD Instinct™ MI300X GPUs enabled large-scale experimentation across model size, dataset scale, and inference strategies, helping isolate which approaches meaningfully improve exact correctness.

The problem: exact equivalence under a discrete resource budget

Fault-tolerant quantum computers can only run a restricted set of operations. The standard universal set is Clifford+T. Its non-Clifford T gates are especially expensive because they require magic-state distillation. T-count is simply the number of T and T† gates in a circuit, so reducing that count is a central compilation objective.

We frame this as sequence-to-sequence translation. Given an input circuit Cin on n qubits over the gate set G = {H, S, S, T, T,CNOT,CZ,X,Z}, we want a circuit Cout over G that is exactly equivalent: it may contain a different gate sequence, but it must perform the same quantum operation as the input, up to an unobservable global phase. We test this by comparing the two unitary matrices and accepting matches within a small floating-point tolerance, while preferring the match with the lowest T-count.

For n ≤ 6 the unitary is at most 64 × 64, so this check is inexpensive. That enables generate-and-verify: let the model propose several circuits, reject every proposal that does not implement the original operation, and keep the lowest-cost verified result.

Classical tools such as PyZX and the Qiskit transpiler already provide the reliable baseline. Our question is narrower: can a model learn their optimization behavior end-to-end, and what prevents it from producing exact results consistently?

Approach: a compact model with circuit-aware tokens

We use a deliberately compact 44.8M-parameter encoder–decoder transformer. Instead of treating a circuit as QASM text, we give each gate and qubit a typed token, so the model learns circuit operations rather than punctuation and syntax. For parameterized circuits, a small regression head also predicts rotation angles. This same model design lets us directly compare parameterized circuits, whose continuous angles can be refined after generation, with fully discrete Clifford+T circuits, which offer no such correction step.

Parameterized circuits: “close enough” is enough

For parameterized circuits we decouple the two things the model is good and bad at. The transformer predicts circuit structure (which gates, on which qubits); a separate 3-layer MLP head regresses each rotation angle as a (sin θ, cos θ) pair on the unit circle (recovered via atan2, side- stepping the 0/2π discontinuity).

The asymmetry is stark: structure is essentially perfect (100% structurally valid, correct gate counts), while raw angle predictions are only approximate (validation MAE from 77° at 2 qubits down to 6.4° at 6 qubits). Because the structure is correct, we hold it fixed and let Nelder–Mead refine the angles to maximize fidelity. That post-processing rescues the output:

Qubits

F > 0.99 (%)

Median F

Val. token acc. (%)

2

58.5

0.999

92.2

3

81.0

1.000

97.9

4

85.5

1.000

98.6

5

90.0

1.000

99.2

6

95.0

1.000

99.3

Median fidelity reaches 1.000 on 3–6 qubits. Counter-intuitively, accuracy improves with qubit count because larger circuits expose more structural regularity for the model to latch onto.

Clifford+T: there is no “close enough”

Now remove the continuous escape hatch. Clifford+T circuits are entirely discrete. A single wrong gate token yields a completely different unitary, and there is nothing for a classical optimizer to refine. We train on 200K PyZX-optimized pairs (sample 10–50 gate random circuits, inject identity-equivalent redundancy, apply PyZX full_reduce + basic_optimization, decompose RZ(kπ/4) to discrete gates, verify equivalence; average T-count drops 8.10 → 2.83, ~65%).

The model learns the distribution well: 100% of outputs are valid Clifford+T sequences, and predicted T-count (2.89) closely matches the PyZX target (2.83). But exact functional equivalence degrades sharply with target length:

Strategy

1-9

10-14

15-25

26+

Greedy

62.5

8.0

0.0

0.0

Beam (w=5)

87.5

22.0

2.8

0.0

Temp N =100

97.5

38.0

8.4

0.0

Exact-equivalence rate (%) by target gate-count bin, 200 test samples.

Notably, qubit count is a much weaker predictor than length: under greedy decoding, per-qubit rates span only 7.2% (4q) to 15.2% (5q). The bottleneck is sequence length, not problem dimensionality.

That strength on short circuits suggests a possible deployment path: a peephole-style optimization pass within a production compiler. The compiler could divide a larger circuit into small windows, ask the model for a cheaper replacement, and accept it only after confirming equivalence. When verification fails, it would retain the original window or fall back to PyZX. In this role, the model would complement classical tooling rather than replace it.

Autoregressive drift: the mechanism

Why does the model succeed on parameterized circuits but struggle on discrete Clifford+T circuits?

The answer is a failure mode we call autoregressive drift. During sequence generation, each predicted gate is conditioned on all previous predictions. When the model makes an early mistake, even within the first one or two gates, that error propagates through the remainder of the sequence, causing subsequent predictions to drift farther from the correct solution.

Unlike parameterized circuits, where continuous rotation angles can be refined after generation, discrete Clifford+T circuits offer no opportunity for correction. A single incorrect gate changes the circuit’s functionality entirely, leaving no notion of “almost correct.” The result is the sharp drop in exact equivalence as circuit length increases that we saw above.

Per-sample diagnostics make the mechanism concrete. Token-position accuracy under greedy decoding shows the very first content token is correct only 56.2% of the time, falling to ~16% by position 30. The median first-error position is at just 3.1% of the target sequence, within the first one or two gates. Once a wrong token is emitted, every subsequent token is conditioned on that error, which cascades irrecoverably.

Three intertwined symptoms accompany it: (i) 87% of failures have the wrong output length (average deviation ~3 gates); (ii) early divergence, as above; and (iii) bimodal fidelity. Clifford+T outputs cluster at F ≈ 1 or F ≈ 0 with almost nothing in between, unlike the smooth parameterized distribution that Nelder–Mead can rescue.

This is the discrete-output cousin of exposure bias in neural machine translation, but it is far less forgiving. In translation a slip degrades quality smoothly; here one wrong gate corrupts the unitary entirely, with no partial credit. It is architectural, not a capacity limit: a 133.6M-parameter variant improves greedy only to 9.5%, and the position-accuracy curve keeps the same shape.

Token-position accuracy
Figure 1: Token-position accuracy under greedy decoding across three models (44.8M/200K, 133.6M/200K, 44.8M/500K). All share the same degradation shape; more data lifts the curve uniformly (56.2%→63.2% at position 1) without changing its slope.

Two levers: inference-time compute and data

Drift explains why generate-and-verify works. For per-sample success probability p, drawing N independent samples and keeping any verified success yields 1 − (1 − p)N, which saturates once Np ≫ 1. Simply sampling more candidates and letting the verifier keep the best can therefore rescue circuits with p > 0.

Temperature sampling (τ=0.8, top-p=0.95) with verifier-first reranking lifts exact equivalence from 7.0% with greedy decoding to 22.5% with 200 candidates, a greater than 3× gain. Returns clearly diminish beyond N=100: doubling candidate generation from 100 to 200 adds only 1.5 percentage points, the same pass@k behavior seen in code generation.

Strategy

n

Exact %

95% CI

Avg Fid

s/circ

Greedy

200

7.0

[4.2, 11.4]

0.103

0.2

Beam (w=5)

200

14.0

[9.9, 19.5]

0.194

1.3

Temp N =50

200

19.0

[14.2, 25.0]

0.301

10.3

Temp N =100

200

21.0

[15.9, 27.2]

0.333

21.1

Hybrid N =100

200

21.5

[16.4, 27.7]

0.326

20.5

Temp N =200

200

22.5

[17.3, 28.8]

0.360

45.1

PyZX (oracle)

200

100.0

N/A

N/A

0.006

The table makes the quality–latency tradeoff explicit: additional decoding compute helps, but it remains far from closing the correctness gap. PyZX is both fully reliable on this benchmark and much faster. These results therefore diagnose the learned model’s behavior; they do not yet argue for replacing the classical optimizer.

The bigger lever, though, is training data. Holding the 44.8M architecture fixed and going 200K → 500K pairs (2.5×) raises Temp N=100 from 21.0% to 39.5% and lifts every length bin. The largest gain appears in the 10–14 gate range, but the drift signature persists: circuits with 26+ gates remain near zero.

Critically, we tested five interventions and only data scaling helped materially. Long-circuit finetuning (22.5%), weighted sampling (20.0%), hybrid pooled search (21.5%), and ensembling the 44.8M + 133.6M models (24.5%) all land within the confidence interval of the 21.0% baseline; the ensemble result suggests errors are correlated across architectures trained on the same data. Data scaling (39.5%) is the outlier.

Enabling large-scale AI research with AMD Instinct™ MI300X GPUs

This work required more than training a single model. It demanded systematic experimentation across model architectures, dataset sizes, and inference strategies to understand which factors genuinely improve correctness.

AMD Instinct™ MI300X GPUs provided the memory capacity and compute needed to evaluate these variables at scale. The platform let us compare multiple model sizes, expand training datasets, and generate hundreds of candidate solutions per circuit during inference, making it possible to distinguish improvements driven by model capacity, additional data, and inference-time compute. Concretely, the 44.8M-parameter Clifford+T model trains for 40 epochs in about 3.7 hours,

Exact-equivalence
Figure 2: Exact-equivalence by target gate-count bin, comparing 200K vs. 500K training data across greedy/beam/temperature. More data raises the whole distribution but does not remove the length ceiling.

and the same environment supports the larger-model, 2.5×-data, and repeated-decoding runs behind every table above.

At inference, candidate generation dominates cost; exact verification on these small circuits is comparatively inexpensive. This asymmetry lets us spend GPU compute generating alternatives while retaining a deterministic correctness gate before any output is accepted. The verifier’s cost grows as O(4n) with qubit count, so larger problems increasingly favor high-bandwidth, high-capacity accelerators.

These experiments demonstrate how AMD Instinct accelerators support demanding AI workloads that extend beyond traditional LLM serving, providing researchers with the flexibility to explore new approaches in scientific machine learning and quantum computing. The workload’s latency and throughput profile differs sharply from LLM serving, which also makes it a useful benchmark for co-designing future ROCm™ software and hardware. For more on the platform, see the AMD Instinct MI300X product page, the ROCm documentation, and the AMD quantum computing hub.

Conclusion

This research demonstrates both the potential and the current limitations of applying AI to quantum circuit optimization. While learned models can accurately optimize parameterized circuits, achieving exact correctness for fully discrete Clifford+T circuits remains a significant challenge. By identifying autoregressive drift as a key source of failure, the paper provides new insight into why current approaches struggle and where future research should focus.

Equally important, the work shows that scaling training data delivers substantially greater improvements than simply increasing inference-time compute or model size. These findings establish a clearer path toward more reliable learned quantum compilers while illustrating how AMD Instinct™ MI300X GPUs enable the large-scale experimentation needed to advance AI-driven scientific research.

Read the full paper to explore the methodology, experimental results, and detailed analysis presented at IEEE QCE 2026.

Get started with AMD Instinct™ MI300X

Interested in experimenting with similar AI workloads? The AMD AI Developer Program is free to join and offers cloud credits, premium AI training, expert support, and developer resources. The program currently includes $100 in AMD Developer Cloud credits for eligible members. After joining, follow the AMD guide to claim your cloud credits, then sign in to the AMD Instinct Developer Cloud to start building, fine-tuning, and running inference on AMD Instinct accelerators with ROCm software.

Links and further reading

Footnotes

AMD, the AMD Arrow logo, AMD Instinct, ROCm, and combinations thereof are trademarks of Advanced Micro Devices, Inc. Other product names are for identification purposes only and may be trademarks of their respective owners.

Related Blogs