AG-CoT: Verified Algorithmic Traces for LLM Program Synthesis on Clifford Circuits
cs.LG, cs.CL, quant-ph
Submitted: 2026-09-27
Updated: 2026-09-27
Comments: 27 pages, 7 figures, 25 tables
License: http://creativecommons.org/licenses/by/4.0/
The gist: Scientific code generation can produce executable programs that fail to compute the intended scientific object.
Terminology
Abstract
Scientific code generation can produce executable programs that fail to compute the intended scientific object. We study this problem in language-model synthesis of Clifford circuits, which prepare the stabilizer states used in quantum error correction and admit exact classical verification. In our target-conditioned framework, each target is given as compact signed stabilizer generators, and an exact verifier checks the generated OpenQASM circuits. We supervise models with Aaronson-Gottesman chain-of-thought (AG-CoT) traces checked by the verifier, and continue training on model generations that the verifier accepts. Across two independently trained model families (3B and 7B), AG-CoT supervision multiplies greedy-decode state-equivalence accuracy by four to six times over circuit-only baselines, and verifier-filtered continuation training adds a further consistent gain atop both. A complementary 32B study shows that supervised models achieve near-perfect syntax and Clifford validity while the strongest direct model reaches 6.14% state equivalence per target, rising to over 10% under verifier-guided selection with multiple candidates. These results show that algorithmic trace supervision gives a large, statistically significant gain in both model families and that verifier-filtered continuation adds a further repeated gain. The persistent gap between Clifford validity and state equivalence confirms that exact verification is necessary: a circuit can be syntactically and physically valid yet prepare the wrong quantum state.
Sources
- Improved Simulation of Stabilizer Circuits
- Program Synthesis with Large Language Models
- Large Language Monkeys: Scaling Inference Compute with Repeated Sampling
- Evaluating Large Language Models Trained on Code
- Aligning Quantum Operators with Large Language Models
- Stabilizer Codes and Quantum Error Correction
- Qwen2.5-Coder Technical Report
- Quantum computing with Qiskit
- Agent-Q: Fine-Tuning Large Language Models for Quantum Circuit Generation and Optimization
- Mistral 7B
- Measurement-driven entanglement transition in hybrid quantum circuits
- Quantum Circuit Generation via test-time learning with large language models
- StabilizerBench: A Benchmark for AI-Assisted Quantum Error Correction Circuit Synthesis
- DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models
- Qwen2.5 Technical Report
- QUASAR: Quantum Assembly Code Generation Using Tool-Augmented LLMs via Agentic RL
- Scaling Relationship on Learning Mathematical Reasoning with Large Language Models
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks