Testing
~8 min readUpdated: December 2026

Agent Harness vs Fine-Tuning: Execution-Verified Porting & Cascade Math

Agent Harness vs Fine-Tuning Execution-Verified Cascade Architecture

Red Hat research (arXiv:2612.04403) directly benchmarks an execution-verified agent harness against a fine-tuned 7B code model across 640 Qiskit-to-CUDA-Q kernel porting tasks. A 3B-active MoE (Nemotron Cascade 2 30B-A3B) jumps from 0% single-shot to 97% on 60 tasks (93.8% on all 640) with the full harness, while a verifier-gated cascade hits 98.9% at one-third the harness compute.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

Agent Harness vs Fine-Tuning: Execution-Verified Porting & Cascade Math: Red Hat research (arXiv:2612.04403) directly benchmarks an execution-verified agent harness against a fine-tuned 7B code model across 640 Qiskit-to-CUDA-Q kernel porting tasks. A 3B-active MoE (Nemotron Cascade 2 30B-A3B) jumps from 0% single-shot to 97% on 60 tasks (93.8% on all 640) with the full harness, while a verifier-gated cascade hits 98.9% at one-third the harness compute. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.

Key Architectural Takeaways
Quick Implementation Exampleverifier-gated-cascade-agent.ts
verifier-gated-cascade-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Execution-verified porting loop using Smoke Monkey Harness
const agent = createAgent({
agentId: 'cudaq-verified-porter',
provider: 'openai-compatible',
baseUrl: 'http://127.0.0.1:8000/v1',
model: 'nvidia/Nemotron-Cascade-2-30B-A3B',
workspacePath: process.cwd(),
permissions: {
read_file: 'allow',
write_file: 'allow',
run_command: 'ask',
},
});
async function main() {
const result = await agent.run(
'Port circuit.py from Qiskit to CUDA-Q 0.16 using the attached 25-line API reference, then execute statevector equivalence check before finishing.'
);
console.log('Execution-Verified Port:', result.summary);
}
main().catch(console.error);
Video Guides

Watch: Related Video Guides

RAG vs Fine-Tuning vs Prompt Engineering: Optimizing AI Models

Build a Coding Agent Harness From an Empty Loop — Tejas Kumar, IBM

Which Agent Harness Components Actually Drive Accuracy?

Execution-Verified Agent Harnesses (arXiv:2612.04403) wrap an LLM in a closed loop with sandbox code execution, state verification, and concise API documentation. Testing Qiskit-to-CUDA-Q 0.16 translation with Nemotron Cascade 2 30B-A3B (3B active parameters), author Ana Paula Appel isolated every component in the loop on a 60-task sample:

Harness Configuration (60 Tasks)Correct (%)95% CIInput Tokens / Task
Single attempt, no API reference0%0–6%393
Full harness WITHOUT API reference0%0–6%17,768
API reference + execute (no verifier)53%41–65%12,593
Full harness WITHOUT verification77%65–86%11,977
Single attempt + 25-line API reference85%74–92%752
Full, weak verifier (compiles & runs)93%84–97%6,052
Full harness (API ref + exec + state verifier)97%89–99%4,481
Full + final-answer check98%91–100%4,628

Why a Verifier-Gated Cascade Beats Both Fine-Tuning and Harness Alone

Two findings stand out for systems architects building coding agents. First, models without tool-use post-training do not benefit from a harness loop (dense 4B/7B and Llama 4 Scout 17B-active stalled). Second, verification cuts token cost by 2.67x (4,481 vs 11,977 input tokens/task) because the agent stops wasting turns once the verifier confirms equivalence. Even a weak compile-and-run verifier preserves 93% accuracy.

When comparing against a fine-tuned 7B code model across all 640 tasks, the fine-tuned model uses 5x less compute on in-distribution inputs, but degrades to 80% vs 90.5% on unseen formatting styles. Routing tasks through the cheap fine-tuned 7B first and escalating to the full harness only when the verifier rejects hits 98.9% accuracy across all 640 tasks at one-third of the full harness compute:

bash
# Verify deterministic statevector equivalence between Qiskit and CUDA-Q port
python3 -c '
import numpy as np
# Sample normalized statevectors from respective simulators
qiskit_sv = np.array([0.70710678, 0.0, 0.0, 0.70710678])
cudaq_sv  = np.array([0.70710678, 0.0, 0.0, 0.70710678])
fidelity = float(np.abs(np.vdot(qiskit_sv, cudaq_sv)) ** 2)
assert fidelity > 0.999999, f"Verification failed: fidelity={fidelity}"
print(f"PASS: Statevector fidelity={fidelity:.8f}")
'

Never Skip Concise API Reference Injection for Niche SDKs

Without the tested 25-line CUDA-Q 0.16 syntax reference in the system prompt, the full multi-turn harness burned 17,768 input tokens per task and still scored 0% across all 60 tasks.

Google Search Questions & Answers

Frequently Asked Questions

Q:When should I choose an agent harness over fine-tuning?

Choose a harness when the base model has strong tool-use post-training, inputs drift from training distributions (like unseen code styles or real QED-C kernels), or an automated verifier exists. Use fine-tuning for high-volume, stationary patterns.

Q:How accurate is a verifier-gated cascade vs standalone systems?

On 640 Qiskit-to-CUDA-Q porting tasks (arXiv:2612.04403), running a fine-tuned 7B model first and falling back to the full harness on verifier rejection reaches 98.9%—5 points higher than either system alone—at one-third of the harness compute.

Q:Can a weak compile-and-run verifier still help an agent harness?

Yes. Replacing the exact statevector verifier with a weak verifier that only checks compilation and execution still retains 93% accuracy (vs 97% full and 77% unverified).

Q:Why did removing the 25-line API reference drop accuracy to 0%?

Without exact syntax grounding for CUDA-Q 0.16 in the system prompt, the model repeatedly guessed outdated or invalid kernel APIs despite having sandbox execution feedback.

Related Alternatives & Comparisons

Related Architecture Guides

View all guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness