aiqbench analysis
This study demonstrates that execution-based verification loops significantly outperform fine-tuning alone for translating Qiskit to CUDA-Q, achieving near-perfect accuracy on real quantum kernels when combined with a verifier-gated cascade strategy. The research highlights that models lacking tool-use post-training cannot benefit from such loops, while API knowledge and iterative checking are the critical factors enabling reliable code generation in this domain.
Harness or Fine-Tuning? Execution-Verified Agents for Qiskit-to-CUDA-Q Porting
From arXiv
Full textA previous study found that fine-tuning a small open model for Qiskit-to-CUDA-Q translation ties a 4-shot prompt and that no model translated any of 27 real QED-C kernels. We ask whether an agent harness – a loop in which the model runs code and checks its result – is an alternative to fine-tuning, which parts matter, what each option costs, and when to use both. With the same execution-based verifier (correct only if the kernel matches the Qiskit reference state), a 3B-active mixture-of-experts model (Nemotron Cascade 2 30B-A3B) reaches 97% [89-99] on 60 tasks and 93.8% on all 640 with the full harness, against 0% in a single attempt.
API knowledge and verification in the loop are what matter; a weak run-only verifier keeps most of the gain. Models without tool-use post-training do not gain from the loop (dense 4B/7B; Llama 4 Scout, 17B active). A fine-tuned 7B code model matches the harness on the sample at a fifth of the compute, but drops on unseen style (80% vs. 90.5%) and real QED-C kernels (where the harness reaches 63-100%).
A verifier-gated cascade – fine-tuned 7B first, harness only on rejection – reaches 98.9% on all 640 tasks, 5 points above either system alone, at a third of the harness compute. Translating every prompt from Portuguese to English changed no result significantly on 60 tasks. The choice depends on whether the base model can use the loop and on how far inputs drift from training.
Full text under the publisher's open licence · 244 words