Execution-Verified Agents Reshape Qiskit-to-CUDA-Q Porting
Summary:The authors compare an execution-and-verification agent harness with supervised fine-tuning for translating Qiskit quantum kernels into CUDA-Q. With the same state-level oracle, the tool-use-post-trained Nemotron Cascade 2 30B-A3B MoE reaches a reported 97% on 60 tasks and 93.8% across all 640 tasks, compared with a 0% single-attempt baseline on the reported sample. A verifier-gated cascade is the strongest configuration: a fine-tuned 7B model handles the first attempt, and only rejected output
This preprint does not treat Qiskit-to-CUDA-Q porting as a one-shot code-generation problem. Instead, it separates three questions: whether the model can use tools, whether execution results form a reliable feedback signal, and whether a fine-tuned model remains effective when the input distribution changes. The results suggest that execution-verified agents can deliver large gains, but only when the model is genuinely tool-capable. More parameters do not automatically produce a better agent loop.
Core Findings
- Nemotron Cascade 2 30B-A3B is a MoE model with 30B total parameters and roughly 3B active parameters per token. With the full execution-verification harness, the authors report 97% on 60 tasks, accompanied by a [89, 99] interval, and 93.8% across all 640 tasks. The single-attempt baseline is reported as 0% on the sample.
- Models that received tool-use post-training and understand the relevant APIs benefit from the loop. Dense 4B and 7B models without that post-training, along with Llama 4 Scout at 17B active parameters, receive no meaningful gain from the same loop.
- A weak verifier that only checks whether the code runs retains most of the benefit. This indicates that compilation and runtime feedback already eliminate a large class of invalid candidates, while stricter reference-state matching adds protection against executable but semantically incorrect kernels.
- A fine-tuned 7B code model matches the harness on the 60-task sample at roughly one-fifth of its compute. Its success rate falls to 80% on unseen code styles, compared with 90.5% for the harness. On real QED-C kernels, the full harness reports a range of 63% to 100%.
- A verifier-gated cascade—fine-tuned 7B first and the agent harness only after rejection—reaches 98.9% across 640 tasks. It is about five percentage points above either system alone while consuming roughly one-third of the full harness compute.
How the Execution-Verified Loop Works
The abstract supports reconstructing at least four stages. The model generates a candidate CUDA-Q kernel; the candidate is executed in a controlled environment; its execution state is compared with a Qiskit reference implementation; and only accepted results pass the verifier, while failed results inform subsequent corrections. Unlike a syntax- or process-level check, reference-state matching approximates a semantic correctness oracle. It is also more dependent on a trustworthy Qiskit reference implementation.
The mechanism is not merely repeated sampling. The agent must receive an actionable failure signal and use it to change the next output. The paper also finds that models without tool-use post-training fail to benefit from the loop. Three capabilities therefore appear necessary: knowledge of the Qiskit and CUDA-Q APIs, the ability to produce executable code, and the ability to act on execution feedback.
A counterintuitive result is that even the weak run-only verifier preserves most of the gain. The agent first needs to eliminate candidates that fail to compile or start, while stricter numerical or state-equivalence checks remove programs that run but produce the wrong result. The abstract does not provide a complete ablation showing how much each verifier contributes.
A 3B-Active MoE Does Not Mean a 3B Deployment
Nemotron Cascade 2 30B-A3B activates roughly 3B parameters per token. This primarily reduces conditional computation; it does not automatically compress the deployed model to 3B. If inference must keep all expert weights resident, memory demand is still determined by the 30B total weights, quantization format, and KV Cache. Expert offloading, tiered caching, and more aggressive quantization are required to turn low active compute into a proportionally lower deployment footprint.
The harness also introduces multiple serial generation, execution, and verification rounds. End-to-end latency depends on decoding, sandbox startup, GPU execution, reference computation, and orchestration, rather than only on per-token FLOPs. Low MoE activation cost therefore coexists with a system-level trade-off: each round may be cheaper, but repeated tool calls magnify scheduling, networking, and sandbox overhead.
Fine-Tuning, Full Harness, and Gated Cascade
| Configuration | Compute profile | Reported performance | Main limitation | |---|---|---|---| | Single attempt | Lowest | 0% baseline on the 60-task sample | No execution feedback or runtime correction | | Fine-tuned 7B code model | About one-fifth of the full harness | Matches the harness on the 60-task sample | Falls to 80% on unseen styles and generalizes less well to real kernels | | Full agent harness | Repeated generation, execution, and verification | 97% on 60 tasks and 93.8% on 640 | Higher latency and requires tool-use capability | | Verifier-gated cascade | About one-third of the full harness | 98.9% on 640 tasks | More routing logic and two model paths to operate |
If single-pass fine-tuning costs C_f, the average full-harness cost is C_h, and the rejection rate is r, a simplified model is approximately n·C_h for the full harness versus C_f+r·C_h for the gated cascade. The reported one-third compute cost indicates that routing routine inputs to a cheaper model and reserving the expensive loop for difficult cases has substantial practical value.
How to Read the Benchmark
The study covers a 60-task sample, the complete 640-task set, unseen code styles, and real QED-C kernels. That is more informative than a single in-distribution benchmark. The fine-tuned model remains cost-effective near its training distribution, but its performance degrades under style shift; real QED-C kernels impose an even stronger distribution shift. The aggregate 640-task result should therefore not replace task-specific acceptance testing.
Translating every prompt from Portuguese into English did not significantly change results on the 60-task sample, suggesting that surface prompt language was not the main driver. The evidence is nevertheless too narrow to establish broad multilingual robustness.
The available material remains a preprint abstract. It does not disclose dataset composition, contamination checks, repeated-run variance, random seeds, attempt limits, prompt templates, numerical tolerances, or significance tests. Hardware configuration, GPU hours, dollar cost, the exact reference-state comparison, and the availability of code, prompts, and evaluation scripts are also unknown. An aggregate 98.9% may conceal a small number of production-critical failures, so results should be broken down by kernel class and failure impact.
Matching the Qiskit reference state establishes consistency relative to that reference; it does not automatically establish numerical stability, GPU performance, portability, or production reliability on real hardware. Errors in the reference implementation can also be inherited by the verifier.
Deployment Recommendations
- Build a trusted oracle first. Generate reference states with a tested Qiskit implementation and define numerical tolerances, random seeds, device backends, and failure classes in advance. An unreliable verifier lets the agent amplify errors.
- Test tool use separately. Do not select models only from coding leaderboards. Require the model to invoke tools, read failures, and adjust subsequent actions; the paper indicates that tool-use post-training matters more than parameter count alone.
- Adopt gated routing by default. Call the fine-tuned 7B model first for in-distribution work, then escalate compilation failures, runtime errors, or state mismatches to the full harness. Rejection reasons can also select targeted repair prompts or models.
- Isolate untrusted execution. Run generated CUDA-Q code in a least-privilege sandbox with timeouts, memory limits, restricted device access, and blocked network access, while retaining every candidate and verifier result.
- Measure accepted-task economics. Track total GPU time, tokens, latency, and human-review cost per correct kernel rather than relying on per-call prices or raw generation length.
- Retain out-of-distribution evaluation. Include unseen styles, historical project kernels, and real QED-C tasks before deployment. A strong aggregate benchmark cannot replace domain-shift testing.
- Define a safe fallback. If the trusted reference environment is unavailable, the pipeline should degrade to static checks or human review rather than emit semantically unverified kernels.
— END —Source: ArXiv Machine Learning (cs.LG) (2026-12-04)
Tags: #Code Agents #Execution Verification #Qiskit #CUDA-Q #Fine-Tuning
Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.
Community Comments