A 3B-active mixture-of-experts model, Nemotron Cascade 2 30B-A3B, achieved 97% accuracy on 60 tasks and 93.8% on all 640 tasks when paired with a system that runs code and checks its results, a full execution-based harness, after previously failing to translate any of 27 real QED-C kernels. Researchers at Red Hat investigated whether this “agent harness” offers an alternative to fine-tuning language models for translating quantum programs from Qiskit to CUDA-Q.
The work demonstrates that API knowledge and verification within the loop are critical. A combination of fine-tuning and a harness reaches 98.9% accuracy on all 640 tasks, exceeding the performance of either method alone.
Nemotron Cascade 2 30B-A3B Performance with Execution-Verified Harness
Nemotron Cascade 2, using a 3B-active parameter mixture-of-experts model, solved 47% of tasks within two computational turns, escalating to 93% within four and achieving 97% accuracy within eight turns, demonstrating the speed of its execution-verified harness. This contrasts with GLM-5.3 Flash, which reached 88%, 98% and 100% respectively under the same turn constraints, highlighting comparable efficiency in task completion. The system’s effectiveness is evident in its consistent verification of tasks, occurring in 98% of instances for Nemotron Cascade 2 and 100% for GLM-5.3 Flash, indicating a robust internal check during operation.
These results, mirroring a 97% success rate on a 60-task sample and 93.8% across all 640 tasks, highlight the system’s adaptability and reliability. A “verifier-gated cascade” combining a fine-tuned 7B code model with the harness, activated only upon initial failure, reached 98%. The data demonstrates that the choice between fine-tuning and a harness depends on the base model’s capacity to use the loop and the degree to which inputs deviate from the training data.
Qiskit-to-CUDA-Q Translation: Fine-tuning Versus Agent Harness
The study focused on identifying which components of the harness are critical, whether it depends on a model’s ability to use tools, and if it can successfully translate previously untranslatable real-world quantum programs. The research highlights a clean verification process unique to quantum code translation. The Qiskit program is the definitive specification, allowing for exact state computation and error detection. Initial findings revealed that fine-tuning a Nemotron 3 Nano 4B model, while achieving 83.9% accuracy, lowered its overall Qiskit score, suggesting a trade-off between performance on specific tasks and broader competency.
This prompted exploration of the agent harness, which allows for iterative refinement through code execution and result checking, mirroring approaches like ReAct and CodeAct. The team’s work demonstrates that an agent harness can enable open models to translate almost every task, including those 27 previously untranslatable QED-C kernels, without requiring fine-tuning.
The cost-benefit analysis reveals that a small, fine-tuned model remains the most computationally efficient solution for familiar inputs. But the harness justifies its ten-fold increase in compute cost when faced with inputs that deviate from the training data.
API Knowledge and Verification Impact on Harness Effectiveness
The ability of an agent harness to translate previously untranslatable quantum code hinges on more than simply running code; the system’s understanding of application programming interfaces (APIs) and a robust verification process are critical components. This demonstrates that the harness itself is a mechanism for unlocking performance gains. The study further delineated the importance of verification, finding that even a basic verification system, one that confirms the translated code matches the original Qiskit reference state, significantly improves results.
A “weak run-only verifier” still provided substantial gains, indicating that the ability to check for correct execution, even without deeper analysis, is a key benefit. However, models lacking the capacity for tool-use post-training, including dense 4B/7B models and Llama 4 Scout with 17B active parameters, failed to benefit from the iterative loop, highlighting the need for a model capable of using the harness’s capabilities.
This suggests that the harness is not a universal solution, but rather one that requires a base model with specific characteristics. While a fine-tuned 7B code model matched the harness’s performance on familiar code, it faltered on unseen coding styles, achieving 80% accuracy compared to the harness’s 90.5%, and on real QED-C kernels, where the harness reached 63-100% success. This performance gap emphasises the harness’s ability to generalize to new situations, a capability that fine-tuning alone struggles to replicate.
The research showed that GLM-5.3 Flash, a model already familiar with the CUDA-Q API, required only code execution to achieve high accuracy, demonstrating that API knowledge forms the foundation for successful translation. The combination of API knowledge and verification, therefore, appears to be a powerful strategy for tackling complex code translation tasks, offering a viable alternative to traditional fine-tuning methods.
Harness Limitations with Tool-Use Inactive Models
Across tested models, the use of the harness itself, a loop where the model runs code and checks its results, varied significantly, with Nemotron Cascade 2 and GLM-5.3 Flash consistently calling the verifier in nearly all tasks, while other models rarely used the tool. This disparity highlights that simply implementing a harness is insufficient; the model must actively engage with the verification process to see improvements.
The effectiveness of the harness relies on access to tools, but evaluators must account for potential shortcuts, such as circuit extraction, which the agents in this study did not employ. While the harness could potentially identify incorrect source code, like a Quantum Fourier Transform missing its final swaps, repairing such errors would require a different verification process, one based on a specification rather than the source code itself.
The study acknowledges several limitations, including wide intervals for small differences due to the use of only 60 tasks for ablations, and changes to a model-as-a-service endpoint during the study that impacted results for two models. The use of text-based tool calls for the 4B model may have contributed to its results, and the API reference used could influence outcomes. All prompts, task statements, tool descriptions, and harness messages were originally written in Portuguese, a factor that did not significantly alter results.
Quantifying Compute Costs: Fine-tuning, Harness, and Cascade Systems
These 60-task samples accurately reflected the broader 640-task dataset, with the harness achieving 97% accuracy on the smaller set and 93.8% on the full dataset, demonstrating consistent performance across scales. The harness offers a robustness advantage when inputs deviate from the training data, such as new coding styles or real-world programs, though at roughly ten times the compute cost of a 3B-active model.
The 3B-active model requires the memory capacity of a 30B model but operates with the computational demands of a 3B model, a distinction that impacts resource allocation. Estimations do not include the memory needed to load both models in a cascade, a 7.6B dense model and a 31.6B-total mixture of experts, nor the processing time of the Python and CUDA-Q subprocesses within the sandbox environment. A verifier-gated cascade offers a cost-effective strategy, applying fine-tuning to inputs the model handles well and reserving the harness for cases where inputs drift, providing a flexible approach for teams.
Real QED-C Kernel Translation with Harness and Fine-tuning
Researchers at Red Hat have now demonstrated that an agent harness, a system where a model runs code and verifies the results, can overcome this limitation, achieving a 63-100% success rate on those same kernels. The team’s approach centers on allowing the model to iteratively refine its output through execution and verification, a process absent in traditional fine-tuning methods.
A key finding is that the harness’s effectiveness doesn’t necessarily depend on model size, but rather on the model’s ability to use the tool and verify results. Models lacking this tool-use capability showed no performance gains from being placed within the harness loop.
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. On a demanding set of 27 real kernels, the harness achieved a 63-100% success rate.
Language Independence: Portuguese-to-English Translation Results
Translating prompts from Portuguese to English did not significantly alter performance on 60 quantum code translation tasks, according to Ana Paula Appel of Red Hat. Nemotron Cascade 2, using a full execution-based harness, reached 97% accuracy and 93.8% across all tasks with the full harness, compared to 0% in a single attempt.
👉 More information
🗞 Harness or Fine-Tuning? Execution-Verified Agents for Qiskit-to-CUDA-Q Porting
✍️ Ana Paula Appel (Red Hat)
🧠 ArXiv: https://arxiv.org/html/2612.04403v1




See today’s quantum computing news on Quantum Zeitgeist for the latest breakthroughs in qubits, hardware, algorithms, and industry deals.
