Harness learning: a 4B model trained to rewrite agent code beat its 35B teacher on average

Week 424 min read

TL;DR

A 4B-parameter model trained to rewrite an agent's code beat its 35B teacher on average (0.62 vs 0.56) on 21 unseen puzzle families, per a 28 September 2026 arXiv preprint. A fixed hand-built harness still averaged 0.69, and the commercial tools found so far tune prompt text only.

On this page

What happened

A language-model agent is a model plus a harness, the program that decides what the model sees, which tools it can call and how the steps run. A preprint posted to arXiv on 28 September 2026 proposes harness learning: train a second model, the proposer, to rewrite that program after seeing how it performed. The agent's own model, the solver, stays frozen. At test time nothing is retrained. Only the harness code changes.

Harness Learning Enables Generalizable Test-Time Adaptation (arXiv)The paper. Method, results and the authors' own list of limits.arxiv.org →

The proposer reads the task description, the current harness code and a report of what went wrong, then writes a code edit. Per the paper, it is trained with reinforcement learning, and the reward is how well the edited harness scores on a set of questions. One example edit in the paper adds an answer check and a retry. The authors include Alvin Zhang, Ruslan Salakhutdinov, Daniel Khashabi and Andrea Zanette. The arXiv listing is version 1.

What the results show

The puzzle tests use 4B-parameter Qwen models for both proposer and solver. On 21 puzzle families held out of training (maze, sudoku and similar tasks from the Reasoning Gym benchmark), the trained proposer's edits averaged a held-out score of 0.62. The untrained proposer averaged 0.32. The 35B-parameter teacher that supplied the training examples averaged 0.56, per the paper. The teacher scored higher when the best of eight edits was picked after the fact.

Proposer Average of eight edits Best of eight
Untrained 4B 0.32 0.63
After supervised training 0.49 0.78
After reinforcement learning 0.62 0.83
35B teacher 0.56 0.85

A fixed baseline harness that lets the solver run Python for up to five turns averaged 0.69 on the same families, so a hand-built harness still beat the average learned edit. Edits that failed or scored zero fell from 38% to 8% on a five-family unseen subset after reinforcement learning.

In question answering, a proposer trained only on HotpotQA carried over to MuSiQue and 2WikiMultihopQA, with a 4B proposer and an 8B solver. On MuSiQue, single edits averaged 0.15 exact match against 0.14 for the starting harness, while ten rounds of repeated revision reached 0.27. The paper notes this comparison is not matched on compute or feedback. Training on whole revision sequences did not consistently beat training on single revisions.

Who already sells this

Searches found no product that trains a model to rewrite harness code. The tools that exist tune prompt text.

Product What it tunes Price Note
DSPy Prompts and few-shot examples, with optimizers such as GEPA Free, open source About 34,000 GitHub stars in mid-2026 per Future AGI
VizPy Instruction text, as a drop-in for DSPy Free for 10 runs. Paid tiers of 200 and 1,000 runs a month, prices not shown Its listing claims it beats GEPA on benchmarks. No independent check found
Future AGI agent-opt Prompts, via ProTeGi, Bayesian search and GEPA Apache 2.0 library. Platform pricing not found Source is the vendor's own blog
DSPyground Agent system prompts, using a modified GEPA Free, Apache 2.0 Stores data locally

The paper names Harness-R1, JIT-Agent and Ornith as concurrent efforts to learn harness edits. They were not checked for products or pricing.

What an indie builder could make

These ideas are inferences from the paper and the pricing pages. No demand has been verified.

One idea is a service that edits harness code. Existing optimizers rewrite instruction strings, while the paper's edits change control flow, such as an answer check with a retry or an extra retrieval step. A service could test code diffs on a customer's own questions and keep a change only when its score improves, the rule the paper uses on puzzles. A second idea is a held-out gate that packages the paper's split between feedback, scoring and final-result questions to catch overfitting.

The paper reports no dollar cost. Each QA run scores 80 candidate harnesses on 64 questions each, so evaluation would likely cost more than training. All results use small open models.

What to watch

  • The headline average leaves out five hard puzzle families. Across all 26 unseen families the means are 0.528 for the trained proposer and 0.501 for the teacher, so the lead holds but narrows.
  • The fixed Python tool-loop harness averaged 0.69, above the average learned edit. The learned edits win only when the best of several is picked, which needs a reliable way to choose.
  • The authors list one teacher, a fixed solver and prescribed revision prompts as limits. Coding agents and long tool-use runs are untested.
  • This is a single preprint with no independent replication.

Sources

  1. Harness Learning Enables Generalizable Test-Time Adaptation (arXiv): the paper. Method, results, limits. The full text was read from the PDF.
  2. DSPy on Vantaige: DSPy version history and optimizers.
  3. What is DSPy in 2026 (Future AGI): GitHub star count. A vendor blog.
  4. Best DSPy alternatives 2026 (Future AGI): agent-opt and its optimizers. A vendor blog.
  5. VizPy on EveryDev: VizPy tiers and claims.
  6. DSPyground: the open-source GEPA-based prompt optimizer.

Continue reading