Enhancing LLM-based Quantum Code Generation with Multi-Agent Optimization and Quantum Error Correction
On the map: LLM agents and tool use → Medical and scientific domain agents
Abstract (arXiv)
Multi-agent frameworks with Large Language Models (LLMs) have become promising tools for generating general-purpose programming languages using test-driven development, allowing developers to create more accurate and robust code. However, their potential has not been fully unleashed for domain-specific programming languages, where specific domain exhibits unique optimization opportunities for customized improvement. In this paper, we take the first step in exploring multi-agent code generation for quantum programs. By identifying the unique optimizations in quantum designs such as quantum error correction, we introduce a novel multi-agent framework tailored to generating accurate, fault-tolerant quantum code. Each agent in the framework focuses on distinct optimizations, iteratively refining the code using a semantic analyzer with multi-pass inference, alongside an error correction code decoder. We also examine the effectiveness of inference-time techniques, like Chain-of-Thought (CoT) and Retrieval-Augmented Generation (RAG) in the context of quantum programming, uncovering observations that are different from general-purpose code generation. To evaluate our approach, we develop a test suite to measure the impact each optimization has on the accuracy of the generated code. Our findings indicate that techniques such as structured CoT significantly improve the generation of quantum algorithms by up to 50%. In contrast, we have also found that certain techniques such as RAG show limited improvement, yielding an accuracy increase of only 4%. Moreover, we showcase examples of AI-assisted quantum error prediction and correction, demonstrating the effectiveness of our multi-agent framework in reducing the quantum errors of generated quantum programs.
Key facts. Cited by 11 papers in the map (data through 14 Oct 2026). Placed in Medical and scientific domain agents, one of 16 directions in LLM agents and tool use. Builds on 24 of its 43 references that are in the map. First posted on arXiv 20 Apr 2025.
Builds on
24 of 43 references.
References · 24
- 2017Attention Is All You Needcited by 60,361
- 2023GPT-4 Technical Reportcited by 18,396
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,297
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameterscited by 1,986
- 2023StarCoder: may the source be with you!cited by 799
- 2024A Survey on Large Language Models for Code Generationcited by 658
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
12 more
- 2023Multi-Agent Collaboration: Harnessing the Power of Intelligent LLM Agentscited by 333
- 2021A Survey of Embodied AI: From Simulators to Research Taskscited by 261
- 2022Efficient Training of Language Models to Fill in the Middlecited by 255
- 2024A Survey on Efficient Inference for Large Language Modelscited by 205
- 2023Structured Chain-of-Thought Prompting for Code Generationcited by 138
- 2024Synthetic continued pretrainingcited by 60
- 2024Qiskit HumanEval: An Evaluation Benchmark For Quantum Code Generative Modelscited by 30
- 2018Reinforcement Learning Decoders for Fault-Tolerant Quantum Computationcited by 28
- 2024Qiskit Code Assistant: Training LLMs for generating Quantum Computing Codecited by 25
- 2024Progressive Mixed-Precision Decoding for Efficient LLM Inferencecited by 18
- 2024Hardware-Aware Parallel Prompt Decoding for Memory-Efficient Acceleration of LLM Inferencecited by 16
- 2025Exploring Code Language Models for Automated HLS-based Hardware Generation: Benchmark, Infrastructure and Analysiscited by 10
Built on by
Citing papers per year: 2025: 6; 2026: 5.
11 papers.
- 2025QAgent: An LLM-based Multi-Agent System for Autonomous OpenQASM programmingcited by 11
- 2025QUASAR: Quantum Assembly Code Generation Using Tool-Augmented LLMs via Agentic RLcited by 11
- 2025Artificial intelligence for representing and characterizing quantum systemscited by 10
- 2025cuPilot: A Strategy-Coordinated Multi-agent Framework for CUDA Kernel Evolutioncited by 7
- 2025Quantum Verifiable Rewards for Post-Training Qiskit Code Assistantcited by 6
- 2026QBugLM: An Agentic Benchmarking Framework for LLM-based Quantum Software Debuggingcited by 2
- 2025Advancing AI-assisted Hardware Design with Hierarchical Decentralized Training and Personalized Inference-Time Optimizationcited by 0
- 2026QASM-Eval: A Dataset to Train and Evaluate LLMs on OpenQASM-3 Beyond Quantum Circuitscited by 0
- 2026Fine-Tuning Large Language Models for Quantum Reasoningcited by 0
- 2026Leveraging LLM-Based Agentic Systems to Generate Quantum Applications for Test Optimizationcited by 0
- 2026QTestBench: A Test Framework for Evaluating LLM-Generated Quantum Codecited by 0
- 2026QTestBench: A Test Framework for Evaluating LLM-Generated Quantum Code9 Oct 2026
- 2026Leveraging LLM-Based Agentic Systems to Generate Quantum Applications for Test Optimization1 Jul 2026
- 2026Fine-Tuning Large Language Models for Quantum Reasoning20 Jun 2026
- 2026QBugLM: An Agentic Benchmarking Framework for LLM-based Quantum Software Debugging5 Jun 2026
- 2026QASM-Eval: A Dataset to Train and Evaluate LLMs on OpenQASM-3 Beyond Quantum Circuits28 Apr 2026
- 2025cuPilot: A Strategy-Coordinated Multi-agent Framework for CUDA Kernel Evolution18 Dec 2025
- 2025QUASAR: Quantum Assembly Code Generation Using Tool-Augmented LLMs via Agentic RL1 Oct 2025
- 2025Artificial intelligence for representing and characterizing quantum systems5 Sep 2025
- 2025Quantum Verifiable Rewards for Post-Training Qiskit Code Assistant28 Aug 2025
- 2025QAgent: An LLM-based Multi-Agent System for Autonomous OpenQASM programming26 Aug 2025
- 2025Advancing AI-assisted Hardware Design with Hierarchical Decentralized Training and Personalized Inference-Time Optimization21 Apr 2025
Similar, not cited
Close in wording, no citation either way
- 2026Revisiting Quantum Code Generation: Where Should Domain Knowledge Live?
- 2025QHackBench: Benchmarking Large Language Models for Quantum Code Generation Using PennyLane Hackathon Challenges
- 2025Agent-Q: Fine-Tuning Large Language Models for Quantum Circuit Generation and Optimization
- 2025A PennyLane-Centric Dataset to Enhance LLM-based Quantum Code Generation using RAG
- 2026PennySynth: RAG-Driven Data Synthesis for Automated Quantum Code Generation
- 2025PennyCoder: Efficient Domain-Specific LLMs for PennyLane-Based Quantum Code Generation
- 2026Generative AI for Quantum Circuits and Quantum Code: A Technical Review and Taxonomy
- 2026El Agente Forjador: Task-Driven Agent Generation for Quantum Simulation