GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
RecentarXiv preprint

Meta-Harness: End-to-End Optimization of Model Harnesses

Let a coding agent rewrite the code around a model, reading every earlier attempt's code, scores and traces. It beat hand-built harnesses; its biggest lesson is that raw traces beat summaries.

Breakdown by FDE Interviews · 13 min read · Updated

About the original · 2026
AUTHORS
Lee, Nair, Zhang, Lee, Khattab, Finn
FROM
Stanford, MIT, KRAFTON
PUBLISHED
Mar 2026 · arXiv preprint
CITED BY
306Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 16% of this breakdown.

01

The paper in one minute

The same model can score very differently depending on the code wrapped around it: what examples it is shown, what it remembers between steps, how retrieved material is formatted. That code, the harness, is usually tuned by an engineer reading failures and editing by hand. Yoonho Lee, Chelsea Finn and colleagues at Stanford, with Omar Khattab at MIT, ask whether a coding agent can do that work itself.

Meta-Harness is a deliberately simple outer loop. A coding agent (Claude Code with Opus 4.6 in all experiments) is given a directory containing every harness tried so far: its source code, its scores, and the full execution traces of its runs, including prompts, tool calls and model outputs. It explores that directory with ordinary tools, decides what went wrong, and writes new harness programs. Those are evaluated on a search set of tasks, the results are written back into the directory, and the loop repeats. A typical run evaluates about 60 harnesses over 20 iterations.

The authors' argument is that earlier optimizers threw away the evidence. Methods such as OPRO, TextGrad, GEPA and OpenEvolve see a score, the current candidate, or a short summary. A harness decision often fails many steps later, and only the raw trace shows why. Their ablation supports this: an agent shown full traces found far better harnesses than the same agent shown scores or LLM-written summaries.

THE IDEA, VISUALLY
AN AGENT THAT REWRITES THE HARNESS filesystem of experience every harness's code scores · execution traces coding-agent proposer grep, cat, edit code evaluate on search tasks all logs written back About 60 harnesses over 20 iterations per run; median 82 files read per iteration; up to 10M tokens of traces from one evaluation. Test sets were held out for classification and math. On TerminalBench-2 the same 89 tasks were used for search and for the reported score: +1.7 points (Opus 4.6) and +2.1 (Haiku 4.5) over the best hand-built harness. RAW TRACES BEAT SCORES AND SUMMARIES classification accuracy of harnesses found, % (Table 3) scores only best 41.3 median 34.6 scores + LLM summaries best 38.7 median 34.9 full code and traces best 56.7 median 50.0 Even the median harness found with full traces beat the best one found without them. Proposer: Claude Code with Opus 4.6. One proposer tested; other agents may behave differently.
A coding agent improves a harness by reading the full record of earlier attempts. Giving it raw execution traces, instead of scores or summaries, made the largest difference to what it found.
Research notes: the problem, approach and results
56.7 vs 41.3

best classification accuracy found with full traces versus with scores only

11.4K vs 50.8K

context tokens used by the found classifier harness versus the hand-built ACE harness

+1.7

points over the best hand-built TerminalBench-2 harness with Opus 4.6, searched and scored on the same 89 tasks

THE PROBLEM

Harnesses, the code that decides what a model is shown and what it remembers, are tuned by hand. Automatic prompt and program optimizers exist, but they see only scores, the latest attempt, or short summaries of what went wrong.

THE IDEA

Give a coding agent a filesystem holding every earlier harness's source, scores and full execution traces, let it investigate with grep and cat, and have it write new harness code. Evaluate, store everything, repeat.

THE RESULT

On text classification it beat the best hand-built harness by 7.7 points with a quarter of the context, and beat other optimizers given the same budget. On IMO-level math a found retrieval harness added 4.7 points over none. On TerminalBench-2 it edged the best hand-built harness, in-sample.

02

Why it matters to an FDE

Most of an FDE's tuning time goes into the harness, not the model: the retrieval step, the prompt assembly, the memory policy. This paper shows that a capable coding agent can do some of that iteration, and it tells you what to give it.

Keep the traces, not just the scores. Whether a person or an agent does the tuning, the most useful artifact is the full record of what the system saw and did on each failure. Summaries lose the detail that explains the failure. Log runs so they can be read later.

Separate the tasks you tune on from the tasks you report. Text classification and math here used held-out test sets. TerminalBench-2 did not: the harness was searched and scored on the same 89 tasks, and its lead over the best hand-built harness was about two tasks. When you tune on a customer's eval set, the score on that set will flatter you.

Read what the optimizer wrote. Found harnesses are code. You can review them for hard-coded answers, brittle special cases or leaked labels, which is a real advantage over tuning weights.

Budget for evaluation. Each candidate must be run on many tasks. The authors note that evaluation, not proposal, was the main cost.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 99 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦3 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The loop, the evidence for raw traces, each domain's result, and the misreadings to avoid

    Free account
  2. 04How it works

    The objective, the proposer, the search loop, the baselines and the three evaluation setups

    Premium
  3. 05The numbers that matter

    The tables, where the averages come from, and how much each margin can bear

    Premium
  4. 06Try it yourself

    Simulate the cost of tuning on your test set, then take the paper's averages apart

    Premium
  5. 07Where it breaks

    The evaluation gaps, the cost, and the conditions the method depends on

    Premium
  6. 08Using it on a deployment

    Running harness search for a customer without fooling yourself or them

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →