arXiv:2609.33192
AG-CoT: Verified Algorithmic Traces for LLM Program Synthesis on Clifford Circuits
Lu Wei, Yufeng Wang, Chenfeng Cao, Lu Pang, Haibin Ling
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.
AI Summary
The paper asks whether supervising language models with algorithmic derivations improves Clifford state-preparation code beyond circuit-only training. Targets are specified by signed stabilizer generators, and outputs are OpenQASM circuits preparing the requested state from $|0\rangle^{\otimes n}$. Aaronson–Gottesman tableau reduction supplies deterministic traces and corresponding circuits. Exact stabilizer verification filters supervision, selects successful model generations for rejection-sampling fine-tuning (RFT), and evaluates outputs. Controlled comparisons use paired training examples with identical prompts and final circuits, differing in whether the derivation is included. On 3,661 target-distinct, training/development-disjoint test states spanning 3–12 qubits, one greedy output per target succeeds on 33 targets (0.90%) with Qwen-3B circuit-only supervision versus 201 (5.49%) with trace supervision. Mistral-7B improves from 71 (1.94%) to 316 (8.63%). Paired McNemar tests establish these differences. RFT reaches 210–215 Qwen successes and 322 Mistral successes; these smaller continuation gains are not uniformly statistically significant. A complementary 32B study finds approximately 99.9% syntax and Clifford validity after supervision, but at most 6.14% direct state-equivalence accuracy. Sampling 64 candidates with Basic trace supervision yields 10.07% state-equivalent target coverage. Requiring identical saved generator labels instead of equivalent states roughly halves measured success. Limitations include persistently low semantic accuracy, no separate verification of model-generated intermediate trace rows, and protocols that cannot support model-size comparisons. The 32B split excludes duplicate circuit strings rather than duplicate target states. Extensions beyond stabilizer states would require different representations and verification criteria.
A large language model assisted the authors in polishing the language of the manuscript.
Error found: The abstract describes AG-CoT traces as verifier-checked, although acceptance verifies final-circuit correctness rather than independently checking every intermediate trace row. The abstract calls 6.14% the strongest direct-model result without excluding the exploratory QASM-only model, whose reported state-equivalence accuracy is 7.68% under a different generation protocol. The abstract presents 6.14% direct accuracy as rising above 10% with candidate selection, although the two numbers come from different checkpoints and no corresponding state-equivalence search result is reported for the 6.14% checkpoint.
Written by gpt-6.1-sol from the paper's full text. Automated: it can be wrong.
- Comments
- 27 pages, 7 figures, 25 tables