Agentic AI
Training Agents to Build Their Own Control Code Instead of Repeating Decisions
A new training method lets AI agents convert task feedback into reusable executable code, dramatically cutting LLM calls and inference costs while maintaining performance across model sizes.
Researchers have developed a method to teach language model agents to evolve their own control logic from experience, rather than repeatedly reconstructing task-handling strategies from scratch. The approach shifts computational load away from expensive language model calls and into static, reusable code that persists across related tasks.
The Problem with Context-Heavy Agents#
When LLM agents tackle multiple related tasks, they typically regenerate the same control decisions anew each time—reasoning through how to invoke tools, manage workflow state, and handle errors—even though the underlying task structure repeats. This forces the model to spend context on redundant reasoning and wastes inference budget.
Growing Harness: Learning from Failure#
The researchers introduce Growing Harness, a paradigm that starts with a bare-bones harness containing fixed model and tool interfaces but no embedded problem-solving logic. As the agent encounters task failures:
- Function-level traces pinpoint exactly where failures occur within a narrow code region
- An optimizer jointly repairs multiple related failures across the bounded surface
- A success-first rollback gate reverses repairs that degrade previously working capabilities
- Edits accumulate in one shared harness, allowing control structure to organically emerge from task feedback
Rather than asking the LLM to solve control problems repeatedly, the method bakes successful strategies into executable code.
Benchmark Results#
Testing on BrowseComp-Plus and WebArena-Verified across models ranging from 4B to 120B parameters, Growing Harness delivered:
- Highest mean success in five of six benchmark-model pairings; trailed by only 0.7 percentage points in the sixth
- 76.0–91.8% reduction in LLM calls versus a Tool-Calling baseline agent
- 74.4–98.6% reduction in deployed-agent inference cost
- Stable 44.7–45.3% success rate on WebArena-Verified regardless of model scale, while Tool-Calling plummeted to 6.7% with the smallest (4B) model
These results suggest that smaller deployment models become viable when control logic is pre-compiled rather than left to the model at runtime.

