Recursive Harness Self-Improvement
Problem Statement
Under model–harness co-evolution, harnesses both drive inference-time performance and produce execution traces that may become training data for future foundation models, so harness quality affects present and future capability. Continually updating provider-built scaffolds is costly and labor-intensive. A lightweight, task-specific way to improve user-built harnesses, and with them trace quality, is therefore needed.
Key Novelty
- Frames harnesses as data-generating components and proposes 'harness-in-the-loop learning', which optimizes harnesses jointly for immediate performance and the quality of traces for future training.
- Introduces RHI, which encodes the agent loop as a prompt-level specification and recursively refines it using pairwise comparisons over the harness's own revision history.
- Gives an empirical attribution of the gains to improved task-specific context management and inter-agent information flow rather than longer reasoning, and formalizes this as an information-theoretic hypothesis about RHI's implicit objective.
Evaluation Highlights
- On 30 synthetic ML research tasks spanning quantitative finance, robotics and pharmacy, a few RHI iterations let low-reasoning-effort agents exceed the maximum-reasoning-effort setting.
- Inference cost drops by up to 60% relative to the max-reasoning-effort configuration, with gains traced to context and information-flow improvements rather than longer reasoning traces.
Signal Assessment
Methodology
- Represent the agent harness (the agent loop, roles, tool use and information passing between sub-agents) as an editable prompt-level specification.
- Execute the harness on a task to produce execution traces and outcomes, keeping a revision history of harness versions.
- Use pairwise feedback that compares harness revisions in the history to judge which changes helped.
- Generate a refined harness specification from this comparative feedback, and repeat for a small number of iterations.
- Analyze the resulting traces to attribute improvements (context management vs. reasoning length), then formalize the behavior as an information-theoretic hypothesis.
System Components
A natural-language/prompt description of the agent loop, covering roles, control flow and context passing. An LLM can edit it directly, which avoids code-level scaffold engineering.
A record of prior harness versions and their execution outcomes. It serves as the substrate for self-referential improvement.
Compares harness revisions against each other to produce relative improvement signals, which are more robust than absolute scoring.
Iteratively proposes updated harness specifications from the feedback and needs only a few iterations to converge to strong task-specific harnesses.
The main locus of improvement: what information is passed between sub-agents and how context is curated for each task.
A formal conjecture describing RHI's implicit optimization objective in terms of information flow through the harness.
Results
| Metric/Benchmark | Baseline | This Paper | Delta |
|---|---|---|---|
| Task performance on 30 synthetic ML research tasks (low reasoning effort) | Low-effort agent with initial harness | Low-effort agent with RHI-optimized harness | Substantially raised performance ceiling |
| Performance vs. max reasoning effort | Max-reasoning-effort agent | Low-effort + RHI | Exceeds max-effort setting |
| Inference cost | Max-reasoning-effort agent | Low-effort + RHI | Up to 60% reduction |
| Optimization budget | Continual provider scaffold updates (costly, manual) | A few RHI iterations | Lightweight, automated |
| Source of gains | Longer reasoning traces (hypothesized) | Improved context management / inter-agent information flow | Qualitative attribution shift |
Key Takeaways
- Before raising reasoning effort or model size, try optimizing the harness itself. Task-specific harness tuning can let cheaper low-effort configurations beat max-effort ones at a fraction of the cost.
- Focus harness design on context management and what information flows between sub-agents, since these matter more than longer chains of thought.
- Pairwise comparison over a harness's own revision history is a cheap, few-iteration recipe for self-improving agent scaffolds.
- If agent traces may feed future fine-tuning or distillation, optimize harnesses for trace quality as well as task success.
- Validate on real-world tasks before relying on the results: the evidence comes from synthetic ML research tasks, and the information-theoretic explanation is presented as a hypothesis rather than a proven objective.
Abstract
Under model--harness co-evolution, harnesses are not merely inference-time scaffolds but data-generating components whose execution traces can shape future foundation models. This motivates harness-in-the-loop learning: optimizing harnesses for both immediate agent performance and the quality of traces used for future model training. However, continually updating provider-built scaffolds is costly and labor-intensive. We therefore investigate whether optimizing user-constructed harnesses in a task-specific manner can improve execution-trace quality while remaining computationally lightweight and requiring only a few update iterations. To this end, we introduce Recursive Harness Self-Improvement (RHI), which represents the harness as a prompt-level specification of the agent loop and iteratively refines it using pairwise feedback over its own revision history. Across 30 synthetic machine-learning research tasks spanning quantitative finance, robotics, and pharmacy, a few RHI iterations suffice to substantially raise the performance ceiling of low-reasoning-effort agents, exceeding the corresponding maximum-reasoning-effort setting while reducing inference cost by up to 60%. We show that these gains arise primarily from improved task-specific context management through more effective inter-agent information flow rather than longer reasoning traces. Finally, we formalize this behavior as an information-theoretic hypothesis for RHI's implicit optimization objective, suggesting RHI as a practical algorithm for continual learning within the paradigm of model--harness co-evolution.