Transformer生成量子线路时,长线路因自回归误差累积而失效。
When Close Enough Is Not Enough: Autoregressive Drift in Quantum Circuit Synthesis

- 用结构化令牌化+Transformer生成量子线路,结合经典优化提升精度。
- 短线路(≤9门)精确等价率88%,超26门后降至近零。
- 多候选生成与数据量扩充可缓解问题,但无法根本解决长度依赖缺陷。
容错量子计算要求电路优化在保持功能等价的同时最小化昂贵的非克利福德资源(如T门)。我们使用一个4480万参数的编码器-解码器Transformer,结合结构化电路标记法,在参数化电路(2-6量子比特)和克利福德+T电路(3-6量子比特)上进行评估。在参数化电路上,混合方法(模型提供结构,经典优化调整角度)在3-6量子比特电路上实现中位保真度1.000。在克利福德+T电路中,所有门为离散操作,无后处理空间,模型学习到有效语法规则和准确的T门计数,但精确等价性随目标长度急剧下降:≤9门时为88%,超过26门后趋近于零。我们归因于自回归漂移——早期标记偏差通过左至右解码不可逆地传播。两种策略部分缓解该问题:推理时生成多个候选并以等价验证筛选,使精确匹配率从7%提升至22.5%;训练数据量扩大2.5倍,提升至39.5%。然而,长度依赖性仍存在——即使数据增加,短线路(≤26门)精确等价率从94%降至26门以上不足4%。核心发现在于:当近似输出可通过后处理修正时,Transformer表现良好;而当必须保证离散精确正确性时,自回归漂移限制了可靠性,且仅推理搜索与数据扩展有效,训练微调与模型多样性改进无效。
原文摘要 · Abstract (English)
Quantum circuit optimization for fault-tolerant computing requires exact functional equivalence while minimizing expensive non-Clifford resources such as T gates. We study this problem using a compact 44.8M-parameter encoder-decoder transformer with structured circuit tokenization, evaluating on parameterized circuits (2-6 qubits) and Clifford+T circuits (3-6 qubits). On parameterized circuits, a hybrid approach -- structure from the transformer, angles from classical optimization -- achieves median fidelity 1.000 on 3-6 qubit circuits. On Clifford+T circuits, where all gates are discrete and no post-processing is possible, the model learns valid syntax and accurate T-Count statistics, yet exact equivalence degrades sharply with target length -- from 88% on circuits with <=9 gates to near zero beyond 26 gates. We trace this failure to autoregressive drift: early-token divergence cascading irrecoverably through left-to-right decoding. Two levers partially mitigate the drift: inference-time strategies that generate multiple candidates and select via equivalence verification raise exact-match rates from 7% to 22.5%, while scaling training data by 2.5x pushes them to 39.5%. Yet the degradation with target length persists -- even with more data, exact equivalence drops from 94% on short circuits to under 4% beyond 26 gates. The contrast between settings is our central finding: when approximate outputs can be rescued by post-processing, the transformer succeeds; when exact discrete correctness is required, autoregressive drift limits reliability, with both inference-time search and data scaling as effective levers while training-side fine-tuning and model-level diversification are not.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。