HarnessTTT: Learn to Optimize Harness at Test-Time for Scientific Discovery
Organizations: University of Wisconsin-Madison · NVIDIA · Johns Hopkins University · Stanford University ·
Abstract
Scientific discovery with language models requires finding the best valid solution within a finite computational budget. We study how feedback from this search can improve the procedure used to conduct it. We introduce HarnessTTT, a test-time learning framework that trains a harness proposer while keeping the executor frozen. The proposer generates executable harnesses comprising system prompts, reusable skills, tools, middleware, and execution controls. Each harness guides a budgeted discovery rollout, whose outcome provides feedback for updating the proposer. A discovery-oriented policy-gradient objective combines gap-normalized rewards, leave-one-out advantages (RLOO), and max-sharpening to favor high-performing proposals. Generated components are validated before execution, and the search retains the best valid solution and selected harnesses across rounds. Across fourteen discovery tasks in mathematics, systems, GPU kernels, heuristic programming, astrodynamics, and biology, HarnessTTT with a frozen 9B executor improves on OpenEvolve with the same executor on all eleven benchmark tasks (e.g., from 1.17 to 2.64 on circle packing), improves on the discovery-fine-tuned Finch-9B by up to 92%, holds the best open-weight sub-10B result on nine, and reaches 0.380919 on Erdős minimum overlap, better than the best human reference of 0.380927. Scaling the proposer and frozen executor to 27B improves on eleven of fourteen tasks, and transferring the learned harnesses to GPT-5.5 matches or exceeds the strongest reported system of any backbone on nine of fourteen tasks. Together, these results show that harness search can itself be learned at test time: a trained proposer lets a small frozen executor search effectively, and the harnesses it finds carry over to stronger executors.
Figures & tables
| Reported systems | Our method | |||||||||||||
| Task | OpenEvolve | AlphaEvolve | Hyra | SimpleTES | TTT-Discover | ShinkaEvolve | CORAL | ALE-Agent | GEPA | LEVI | HarnessTTT (9B) | HarnessTTT (27B) | ||
| backbone | multiple | Gemini 2.0 | Hy3 | gpt-oss- 120B | gpt-oss- 120B | multiple | Opus 4.6 | Gemini/ GPT | GPT-5/ Gem. 3 | mixed | Qwen3.5- 9B | transfer GPT-5.5 | Qwen3.8- 27B | transfer GPT-5.5 |
| Mathematical discovery | ||||||||||||||
| Erdős | 0.380910 | 0.380924 | 0.380859 | 0.380868 | 0.380875 | 0.38156 | 0.38089 | – | – | – | 0.380919 | 0.380923 | 0.380902 | 0.380868 |
| AC1 | 1.506604 | 1.503170 | 1.502850 | 1.503871 | 1.502863 | – | – | – | – | – | 1.504680 | 1.506805 | 1.503778 | 1.503871 |
| AC2 | 0.944900 | 0.961020 | 0.962901 | 0.962694 | 0.959180 | – | – | – | – | – | 0.933900 | 0.934210 | 0.934868 | 0.963589 |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Field | Type | Semantics |
| Overrides of existing components | ||
| system_prompt | text | executor system prompt |
| skill_description | text | skill card shown in the executor’s tool list |
| skill_body | text | skill playbook body |
| tool_descriptions | map | descriptions of the fixed tools |
| sampling | map | temperature, top- , top- , max tokens |
| Group | Method | Behavior |
|---|---|---|
| Program state | get_program() | current program |
| get_best_program() | best program so far | |
| best_score() | score of the best program | |
| Editing | stage_edit(code) | stage an edit to the program |
| Scoring | evaluate() | full evaluation; uses one of the evaluator calls |
| probe() | subsampled evaluation, 8 cheaper; outside but separately capped |
| Parameter | 27B campaign | 9B campaigns |
| Search | ||
| Outer rounds per task | 20 | |
| Proposals per round | 8 | 32 |
| Trajectories per round | ||
| Parent beam | incumbent + best candidate within 2% of the top score that adds a new component, else the second-highest scorer | |
| Advantage group size | in the first round, afterwards | |
| Task | Metric | Source | Backbone | |||
|---|---|---|---|---|---|---|
| Mathematical discovery | ||||||
| Erdős | 0.380922 / | 0.999987 | 0.380927 | Best human | — | |
| AC1 | 1.505293 / | 1.000029 | 1.505250 | TTT-Discover | Qwen3-8B | |
| AC2 | 0.896280 | 1.056813 | 0.947200 | TTT-Discover | Qwen3-8B | |
| CP26 | sum of radii | 2.635 | 1.000373 | 2.635983 | ThetaEvolve | R1-Qwen3-8B |
| Hadamard | det. ratio | 0.935673 | 0.935673 | Best human | — | |
| Task | Harness | Spec hash | Tools | Skills | Best program | Proposer’s prompt policy |
|---|---|---|---|---|---|---|
| CP26 | r13/c06 | 128394fe5159501a | 2 | 2 | 2.635983 (r18) | preflight–repair–rank loop; transform as comparator |
| Erdős | r19/c01 | f940301924f28c6a | 2 | 5 | 0.380902 (r19) | five-evaluation funding rule; hard-max-first reporting |
| Round | Components of the round’s best candidate | Promoted | Harness score |
| 0 |
Agent Harness Optimization
Agent harness optimization improves the prompts, tools, memory, workflows, and control code that shape how AI agents act.
See all 168 papers