Grow the Harness, Not the Context: Building Low-Cost Specialist Agents via Failure-Guided Code Synthesis
別撐大脈絡,改建構程式框架:Growing Harness 透過「失敗導向學習」自動生成高效能 Agent
Traditional LLM agents waste context and budget by repeatedly making the same control decisions inside each task's context. Growing Harness solves this by starting from a "strategy-free scaffold" and growing executable harness code from task feedback. When a task fails, function-level traces localize the failure, an optimizer jointly repairs the code, and a success-first rollback gate prevents regressions. Over time, recurring control isCompiled into deterministic code. This approach slashes LLM calls by 76.0-91.8% and costs by up4 to 98.6%, enabling a 4B model to match the 45% success rate of 120B models on WebArena.
Key points
Code Over Context
Shifts recurring control decisions from the LLM's context into reusable, executable code, reserving LLM calls strictly for semantic reasoning.
Failure-Guided Joint Repair
Localizes failures to specific code surfaces using execution traces, allowing an optimizer to repair multiple failures jointly.
Regression-Preventing Gate
Implements a success-first held-out gate that automatically rolls back code edits if they harm prior task capabilities.
Empowering Smaller Models
Keeps success rate stable at around 45% on WebArena even with a 4B model, whereas traditional tool-calling drops to 6.7% at that scale.
How it works
Why it matters
This research breaks the bottleneck of agents relying on long system prompts and giant models. By compiling agent control flow into code, it dramatically frees up context and slashes inference costs by up to 98.6%. It demonstrates that enterprises can deploy highly stable, low-latency specialist agents using cheap, edge-sized models (like 4B parameters), removing key barriers to commercial agent deployment.
Who it affects
- AI Developer
- AI Researcher
- Enterprise Leader
How to use it
- 1Cost-effective web automation: Running complex browser tasks using lightweight local models instead of expensive API calls.
- 2Domain-specific agent workflow optimization: Automatically generating optimal control and error-handling code structures for specialized software tools.
Limitations & caveats
- Bootstrap dependency: Requires a pre-defined strategy-free scaffold with fixed tool interfaces to initiate the learning process.
- Optimizer dependency: The ceiling of the agent's ultimate capability is bounded by the coding capabilities of the generator and optimizer used.
Related
Agensh: Scaling Multi-Agent Collaboration to 1,024 Agents Without a Central Orchestrator
突破中心化瓶頸!Agensh 框架將多 Agent 協作無縫擴展至 1,024 個智慧體
Agensh is a decentralized, self-organized multi-agent harness that scales up to 1,024 agents using an asynchronous cooperation loop, significantly boosting efficiency in complex coding tasks.