Revisiting Quantum Code Generation: Where Should Domain Knowledge Live?
Oscar Novo, Oscar Bastidas-Jossa, Alberto Calvo, Antonio Peris, Carlos Kuchkovsky

TL;DR
This paper demonstrates that general-purpose large language models, enhanced with retrieval-augmented generation and execution feedback, outperform specialized fine-tuned models in quantum code generation, offering a more flexible and maintainable approach.
Contribution
It shows that inference-time augmentation techniques like RAG and execution feedback can surpass domain-specific fine-tuning for quantum code generation tasks.
Findings
General-purpose LLMs outperform fine-tuned models on Qiskit-HumanEval.
Execution feedback improves performance significantly, up to 85%.
RAG provides modest, model-dependent gains.
Abstract
Recent advances in large language models (LLMs) have enabled the automation of an increasing number of programming tasks, including code generation for scientific and engineering domains. In rapidly evolving software ecosystems such as quantum software development, where frameworks expose complex abstractions, a central question is how best to incorporate domain knowledge into LLM-based assistants while preserving maintainability as libraries evolve. In this work, we study specialization strategies for Qiskit code generation using the Qiskit-HumanEval benchmark. We compare a parameter-specialized fine-tuned baseline introduced in prior work against a range of recent general-purpose LLMs enhanced with retrieval-augmented generation (RAG) and agent-based inference with execution feedback. Our results show that modern general-purpose LLMs consistently outperform the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMachine Learning in Materials Science · Quantum Computing Algorithms and Architecture · Quantum many-body systems
