Manuscript Offprint

arXiv:2610.17370

HarnessTTT: Learn to Optimize Harness at Test-Time for Scientific Discovery

Yingzi Ma, Yulong Cao, Nanxi Li, Fang Wu, Yizhe Zhang, James Zou, Yejin Choi, Chaowei Xiao

JOHNS HOPKINS UNIVERSITY

nVIDIA

WISCONSIN UNIVERSITY OF WISCONSIN-MADISON

Meta

Stanford

HARNESSTTT: Learn to Optimize Harness at Test-Time for Scientific Discovery

Yingzi Ma 1^{1}, Yulong Cao 2^{2}, Nanxi Li 3^{3}, Fang Wu 4^{4}, Yizhe Zhang 5^{5}, James Zou 4^{4}, Yejin Choi 4^{4} and Chaowei Xiao 3^{3}

1^{1}University of Wisconsin-Madison, 2^{2}NVIDIA, 3^{3}Johns Hopkins University, 4^{4}Stanford University, 5^{5}Meta

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.

Website

Code

(a) GPU TriMul kernel (H100)

runtime of the best kernel found

Figure

(b) Weak-to-strong transfer

a harness learned with a small frozen executor, then run on GPT-5.5

Figure

Figure 1: HARNESSTTT at a glance. (a) Runtime of the best TriMul kernel on an H100; HARNESSTTT runs its 27B-learned harness on GPT-5.5. SimpleTES [72] and TTT-Discover [77] are re-measured by us; the human and best-of-25,600 baselines are as reported by TTT-Discover. (b) Weak-to-strong transfer on four tasks of Table 3: a harness learned with a frozen Qwen executor (9B or 27B) continues its search on GPT-5.5.

a Two evolution loops — the only difference is what gets updated TTT-Discover — update executor weights

Figure

HarnessTTT — update proposer weights; executor MsM_{s} stays frozen

b Why evolve the harness and not the executor weights?

exploration

efficient exploration

via strategies

traceable

each edit is formatted

and explainable

gated

prevents reward hacking

and invalid code

transferable

enables weak-to-strong

model transfer

c State-of-the-art results — matched or beat the reported frontier on 9 of 14 tasks

Mathematical discovery

AC2 Hadamard

Algorithm engineering

AHC039 AHC058

System performance

PRISM LLM-SQL Txn GPU TriMul

Astrodynamics & biology

Voyager 2

d Evidence across four tasks — the proposer evolves task-specific harnesses, executor weights frozen

CIRCLE PACKING

Put 26 circles in a square

maximize Σ\Sigma radii — stay in the square, no overlaps

build staggered packing hexagonal_construction.py

explain why it packs better hex-pack-complete-guide

visible effect

denser, valid layout

LLM-SQL

Arrange rows for prompt-cache reuse

make consecutive serialized rows share a longer prefix

rank cache-friendly columns analyze_col_potential.py

put valuable matches first row-sorting-playbook

visible effect

longer shared prefix → cache hits

HADAMARD-29

Find a high-determinant ±1\pm 1 matrix

escape a construction family the search keeps rediscovering

detect basin + bottleneck analyze_hadamard_struct.py

multi-start; verify finalists hadamard-strategy

visible effect

screen many, verify one

TRANSACTIONS

Schedule work under read/write conflicts

respect dependencies, overlap compatible transactions

build a read/write conflict graph analyze_conflicts.py

force graph-first reasoning conflict_graph_check.py

visible effect

valid parallelism, shorter time

e Circle packing (n = 26), 9B proposer: named edits lift the score, and the harness carries over to a frozen GLM-5.2

seed

round 1

broaden search

round 5

test four layouts

round 7

escape a plateau

round 10

import warm start

Σr=0.960\Sigma r = 0.960

Σr=1.467\Sigma r = 1.467

Σr=2.235\Sigma r = 2.235

Σr=2.278\Sigma r = 2.278

Σr=2.541\Sigma r = 2.541

GLM-5.2

frozen - same harness

transfer

Σr=2.6359838076\Sigma r = 2.6359838076

frontier gap +0.001% - 9/9 runs

Figure

Figure 2: HARNESSTTT on one page. (a) Executor RL versus HARNESSTTT: the same loop, but the reward updates the executor or the proposer. (b) Properties of a learned harness. (c) Tasks at or above the reported frontier. (d) Task-specific harnesses written by the proposer. (e) A circle-packing campaign and its transfer to a frozen GLM-5.2 executor.

References (71)