Growing harnesses cut repeated instructions for smarter AI agents
Grow the Harness, Not the Context: From Strategy-Free Scaffolds to Reusable Specialist Agents
Artificial IntelligenceSoftware Engineering
Summary
Handling many related tasks can make language AI models repeat the same control steps, which wastes effort. The authors introduce Growing Harness, a way to turn repeated control into reusable code, so the AI only focuses on unique parts of each task. Their method learns by fixing failures and safely adding improved control code over time, making agents more successful and less costly to run. This lets smaller AI models work well by shifting repeated thinking from the model to cheaper code.
What this means in practice
- •For software engineers: Build AI-powered assistants that reuse decision logic across related tasks, reducing expensive model calls and speeding up deployment.
- •For cloud service operators: Lower inference costs and resource usage by deploying agents with reusable control code, enabling efficient scaling of AI services.
Authors
Laizhen Li, Jiarui Li, Juanjuan Zhao, Kejiang Ye, Ye Li, Cheng-zhong Xu, Xitong Gao
Abstract
Large language model (LLM) agents often handle streams of related tasks, yet standard harnesses repeatedly ask the model to reconstruct the same control decisions inside each task's context. We study whether task feedback can instead turn recurring control into reusable executable code, while reserving LLM calls for task-specific semantic reasoning. We introduce Growing Harness, a failure-guided training paradigm that learns the agent harness itself from a strategy-free scaffold that exposes fixed model and tool interfaces but encodes no task-solving controller. Function-level execution traces localize each failure to a bounded code surface, an optimizer repairs a window of failures jointly, and a success-first held-out gate rolls back repair sequences that harm prior capability. Accepted edits accumulate in one shared harness, allowing its control structure to emerge from task feedback. Across BrowseComp-Plus and WebArena-Verified with three deployment models from 4B to 120B parameters, Growing Harness achieves the highest mean success in five of six benchmark-model settings and trails the best mean by 0.7 pp. in the sixth. Relative to a Tool-Calling agent, it reduces LLM calls by 76.0-91.8% and deployed-agent inference cost by 74.4-98.6%. On WebArena-Verified, its success remains 44.7-45.3% across model scales, whereas Tool-Calling falls to 6.7% with the 4B model. Ablations show that trace-local edits, joint repair, and gate-based rollback each improve final success. These results show that persistent program growth can move recurring control out of model context and into low-cost code, yielding reusable specialist agents that remain effective with smaller deployment models.