用智能体强化学习让大模型精准生成量子电路代码
QUASAR: Quantum Assembly Code Generation Using Tool-Augmented LLMs via Agentic RL
- 用工具增强的LLM+强化学习,自动优化量子电路参数
- 生成电路通过率99.31%(单次尝试)和100%(十次尝试)
- 适合量子算法开发与自动化设计人员使用
设计和优化特定任务的量子电路对于发挥量子计算优势至关重要。基于大语言模型(LLM)的量子电路自动生成成为有前景的解决方案,但仍面临根本挑战:(i) 参数化量子门需精确数值以实现最优性能,而该值依赖于门数量、参数及电路布局/深度等多重因素;(ii) LLM因缺乏量子领域专业知识,常生成低质量或错误的量子电路。我们提出QUASAR,一种基于工具增强型LLM的智能体强化学习(RL)框架,用于量子电路生成与优化。为对齐LLM与量子领域知识并提升生成质量,QUASAR设计了:(i) 借助外部量子模拟器的电路验证方法;(ii) 复杂分层奖励机制。大量评估显示,生成电路在语法与语义层面均有提升。当增强40亿参数的LLM时,QUASAR在Pass@1下达到99.31%有效性,在Pass@10下达100%,优于GPT-4o、GPT-5、DeepSeek-V3等工业级LLM以及多个仅监督微调(SFT)或仅强化学习(RL)基线。
原文摘要 · Abstract (English)
Designing and optimizing task-specific quantum circuits are crucial to leverage the advantage of quantum computing. Recent large language model (LLM)-based quantum circuit generation has emerged as a promising automatic solution. However, the fundamental challenges remain unaddressed: (i) parameterized quantum gates require precise numerical values for optimal performance, which also depend on multiple aspects, including the number of quantum gates, their parameters, and the layout/depth of the circuits. (ii) LLMs often generate low-quality or incorrect quantum circuits due to the lack of quantum domain-specific knowledge. We propose QUASAR, an agentic reinforcement learning (RL) framework for quantum circuits generation and optimization based on tool-augmented LLMs. To align the LLM with quantum-specific knowledge and improve the generated quantum circuits, QUASAR designs (i) a quantum circuit verification approach with external quantum simulators and (ii) a sophisticated hierarchical reward mechanism in RL training. Extensive evaluation shows improvements in both syntax and semantic performance of the generated quantum circuits. When augmenting a 4B LLM, QUASAR has achieved the validity of 99.31% in Pass@1 and 100% in Pass@10, outperforming industrial LLMs of GPT-4o, GPT-5 and DeepSeek-V3 and several supervised-fine-tuning (SFT)-only and RL-only baselines.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。