The agent is the code around the model.
This paper trains a small model to rewrite that code for a brand-new task, using only “here’s what happened when I ran it”. No retraining of the agent. It works on tasks the rewriter never saw.
Two things make an agent
Ask a language model a hard multi-step question and it just answers. A useful agent is more careful. Something decides to search first, boils the results down, uses them to write a better second search, checks the answer is well-formed, and retries if it isn’t. That something is ordinary code, and the paper calls it the harness.
Harness choices swing performance a lot, and the right ones depend on the task: what suits question answering is wrong for a maze. Normally a person tunes the harness by trial and error, per task. The question this paper asks is sharper: can a model learn how to tune harnesses, well enough to do it on tasks it has never seen?
One revision, step by step
A new task arrives with a bare-bones seed harness that calls the solver once. The system runs it, writes up what happened, and hands the code plus that report to a second model, the proposer, whose job is to write a patch.
The code and report are invented; the edit mirrors the paper’s Figure 1 (add answer validation and a retry).
Two details matter. The edit is literally a code patch (a span of existing code and its replacement), so the proposer can change control flow, tool use, and the order of model calls, not just wording. And a revision is only kept if it helps: in the puzzle setup the new harness must beat the current one on development questions or it’s discarded. Edits that can’t be parsed or applied are marked invalid.
What does a good edit look like?
The authors read the harnesses the trained proposers wrote. In question answering, the seed harness does two retrieval “hops”: search, summarize, build a second query, search again, summarize, answer. A common learned edit changes one thing. Flip the switch.
The point of that edit is that it separates two jobs: the evidence you need to form the next search (a summary is fine) versus the evidence you need to answer (give the model the raw passages). Other learned edits add a third hop, or search again when a draft answer isn’t found in the retrieved text. The untrained base proposer, by contrast, sometimes “simplified” the harness to a single solver call, or deleted the solver entirely.
Two loops, zero weight updates at test time
What makes this “learning” rather than “ask a model to edit code” is that there are two nested loops. The inner loop is what you just saw: revise a harness for one task. The outer loop is training: run the inner loop over many practice tasks and update the proposer so its edits get better.
Proposer
Harness
Solver
If you know meta-learning (MAML and friends), the analogy is direct. In MAML the inner loop adapts weights with a gradient step. Here it adapts a program with a code edit, and the proposer is the learned adaptation rule. The goal: after a few rounds of revision on a new task, the final harness should score well on held-out questions.
Why the questions are split three ways
There are separate question sets for feedback (used to write the execution report), scoring (used to decide whether a revision is kept) and evaluation (the final held-out test). Evaluation questions are never used for feedback or selection, which stops the system quietly memorizing what it’s later graded on.
How the proposer learns
The proposer is a small model: Qwen3.5-4B for puzzles, Qwen3-4B for question answering. For puzzles, the authors first fine-tune it on good edits written by a larger 35B teacher so it writes sensible patches. Then reinforcement learning takes over, which is where it learns from its own outcomes.
For each training situation (a task, a harness, and its report) the proposer writes several candidate edits. Each candidate harness runs on the same scoring questions, and its reward is its score plus a small bonus for the edit being valid and actually running. Then comes the GRPO trick: don’t ask “was 0.55 good?”, ask “was it better than its siblings?” Each reward becomes an advantage: how far above or below the group average it landed. Drag the sliders.
advantage = (reward − group mean) ÷ (group std + tiny δ), as in the paper’s Eq. 2. The paper samples 8 candidates per context; 4 are shown here.
Two consequences fall out. A group where every edit scores the same gives no learning signal, which is why training favors situations with room for improvement. And a crashed edit is plainly worse than its siblings, so the proposer quickly learns to write patches that parse, apply and run.
One design choice to note: each update uses the immediate score of a single revision as its reward, a local stand-in for the true goal of “final harness after T rounds”. The authors also tried training on whole chains of revisions. That comes up below.
What actually happened
Two test beds. Reasoning Gym: dozens of synthetic puzzle families (maze, sudoku, anagrams, arithmetic…), of which 21 were never seen in training. And multi-hop QA: train on HotpotQA, test on MuSiQue and 2WikiMultihopQA. Scores on the unseen sets are the real test.
A · Fewer broken edits
Before any question of quality, does the proposer even produce a harness that runs and scores above zero? Training changes this dramatically on unseen families, and it’s RL, not the teacher-imitation step, that does most of it.
On average quality, the trained 4B proposer’s edits score 0.62 across the 21 unseen families against 0.56 for the 35B teacher it learned from. Read that carefully: it’s about the typical edit. If you let the teacher try eight times and keep the best, the teacher still wins. What RL buys is a proposer whose ordinary attempt is good, not only its lucky one.
B · Many rounds beat many guesses
Is it better to build on your last revision, or just take lots of independent shots at the seed? Pick a benchmark. The amber bars are independent revisions of the seed harness (80 attempts). The lime bar is the average outcome of a ten-round chain where each round builds on the last.
On MuSiQue the average independent revision (0.147) is barely above the seed (0.144). The best of eight reaches 0.213 and the best of all 80 reaches 0.241. A ten-round chain averages 0.27, above even the best of 80. The paper reports the same ordering on 2Wiki, but gives that ten-round figure only in a chart, so it isn’t plotted here.
C · A useful non-result
It seems obvious that training on chains of revisions would beat training on single ones. It mostly didn’t. After five rounds on puzzles, canonical scores were nearly identical (0.699 vs 0.701), and on format-varied questions multistep was worse (0.725 vs 0.649). In QA the two ended almost equal. The practical reading: a proposer trained only on individual revisions already keeps improving harnesses across many rounds, without ever being taught to plan ahead.
D · What it learned to write
On puzzles, most revisions are interpreter loops: the solver writes a program to compute the answer and the harness executes it. That was also the most common structure in the teacher’s data (48%), and it stays dominant after RL. Attempts to push the proposer toward composing its own helper tools mostly didn’t pay off, because even correct helper code (a BFS for maze, a prime sieve) often failed on question parsing or answer extraction.
What to take away
Editing the harness is a learnable skill. It transfers to unseen tasks with a small 4B model, and sequential refinement spends a fixed proposal budget better than independent guesses. That’s a plausible foundation for agents that turn accumulated experience into better scaffolding instead of waiting for a new model.
- The solver is a fixed small model (Qwen3.5-4B or Qwen3-8B) and proposals follow prescribed prompts. Nothing here shows the same gains for frontier models or open-ended, long-horizon agents.
- Puzzle supervision came from a single teacher model.
- Why QA keeps improving for more rounds than puzzles is only partly explained. The richer QA seed may leave more to refine, but training and selection protocols also differ, so the authors don’t pin it on that alone.
- Whether credit assigned across rounds, rather than per revision, would make longer chains better is left open.
The one-paragraph version for a friend
Instead of fine-tuning an AI agent for each new job, you let a small separate model rewrite the agent’s surrounding code based on how the last attempt went. The paper shows you can train that rewriter with reinforcement learning so its edits are reliable and carry over to task types it never trained on, and that letting it iterate for several rounds beats trying lots of independent edits.
Sources
- Zhang, Liu, Wang, Tajwar, Arora, Salakhutdinov, Khashabi, Song, Zanette. Harness Learning Enables Generalizable Test-Time Adaptation. arXiv:2609.35738v1, 28 Sep 2026. abstract · PDF
- Used: Fig. 1–2 (loop, RL), Fig. 7 (QA revision), Eq. 2 (GRPO advantage), §5.2–5.4, §6.1–6.3, Tables 10, 13, 23.
- The MAML analogy, plain-language framing, hero animation, step-through code and toy GRPO rewards are this page’s own illustrations, not the authors’.