Hierarchical Self-Improvement: A Framework for Task-Specific Evolvable Agent Harnesses
Letting an AI keep rewriting the scaffolding around itself, without touching the model, improved its performance
An LLM agent's performance depends not just on the model itself but on the harness, the surrounding code scaffold of prompts, tools, and memory that lets it actually complete tasks. This paper introduces Hierarchical Self-Improvement (HSI), where a single frozen LLM operates at three nested levels to rewrite its own task harness and even the strategy used to rewrite that harness. Tested on the BALROG benchmark with DeepSeek-V4-Flash-Preview as the frozen backbone, HSI improved consistently on moderate-difficulty tasks but showed no gain on a task (NLE) that exceeded the model's own capability.
METAL MEDIA explanatory visual
Letting an AI keep rewriting the scaffolding around itself, without touching the model, improved its performance
- 01A single frozen (parameters unchanged) LLM is given three separated roles: executing the task harness, rewriting the harness ('evolver'), and rewriting the evolver's own strategy ('meta-evolver'), with the outermost execution logic kept frozen to prevent uncontrolled self-reference
- 02Reasoning ('thinking') was turned off during task execution but kept on during self-modification, isolating whether gains came from harness improvements rather than extra inference-time reasoning
- 03On moderate-difficulty BALROG tasks, raw % Progress gains over the initial harness reached +39.3 on BabyAI, +33.0 on Crafter, +25.0 on TextWorld, and +15.0 on MiniHack
- 04On BabaIsAI, with 20% of tasks held out entirely during evolution, the evolved harness still achieved 0.98 best-test progress on BreakStop and 1.00 on GoTo, showing genuine generalization rather than memorization
- 05On NLE, a task beyond the frozen model's capability, harness evolution produced no meaningful improvement, revealing a clear ceiling on what harness rewriting alone can fix
What they did
- A single frozen (parameters unchanged) LLM is given three separated roles: executing the task harness, rewriting the harness ('evolver'), and rewriting the evolver's own strategy ('meta-evolver'), with the outermost execution logic kept frozen to prevent uncontrolled self-reference
- Reasoning ('thinking') was turned off during task execution but kept on during self-modification, isolating whether gains came from harness improvements rather than extra inference-time reasoning
- On moderate-difficulty BALROG tasks, raw % Progress gains over the initial harness reached +39.3 on BabyAI, +33.0 on Crafter, +25.0 on TextWorld, and +15.0 on MiniHack
- On BabaIsAI, with 20% of tasks held out entirely during evolution, the evolved harness still achieved 0.98 best-test progress on BreakStop and 1.00 on GoTo, showing genuine generalization rather than memorization
- On NLE, a task beyond the frozen model's capability, harness evolution produced no meaningful improvement, revealing a clear ceiling on what harness rewriting alone can fix
| LLM | BabyAI | Crafter | TextWorld | MiniHack | NLE | Avg |
|---|---|---|---|---|---|---|
| Gemini-3-Pro | 96.0±2.8 | 57.3±4.4 | 60.2±7.5 | 40.0±7.7 | 6.8±3.2 | 52.1±5.1 |
| Gemini-3.1-Pro-Thinking | 98.0±2.0 | 55.0±6.4 | 75.7±6.4 | 27.5±7.1 | 2.6±0.3 | 51.8±4.4 |
| Gemini-3.1-Pro | 100.0±0.0 | 46.8±4.2 | 66.5±7.5 | 35.0±7.5 | 3.0±0.5 | 50.3±3.9 |
| Gemini-3-Flash | 86.0±4.9 | 45.0±6.3 | 50.2±8.1 | 30.0±7.2 | 4.0±0.8 | 43.0±5.5 |
| Grok-4 | 76.0±6.0 | 57.3±3.9 | 62.9±7.9 | 17.5±6.0 | 1.8±0.8 | 43.1±4.9 |
| Claude-Opus-4.5 | 80.0±5.7 | 49.5±3.1 | 51.4±8.4 | 27.5±7.1 | 2.0±0.5 | 42.1±5.0 |
| Claude-Opus-4.5-Thinking | 72.0±6.3 | 48.6±3.2 | 59.0±8.0 | 30.0±7.2 | 2.4±0.3 | 42.4±5.0 |
| Gemini-2.5-Pro-Exp-03-25 | 80.0±5.7 | 55.0±6.0 | 49.2±8.2 | 17.5±6.0 | 1.7±0.2 | 40.7±5.2 |
| DeepSeek-R1 | 74.0±6.2 | 36.4±3.8 | 21.8±6.1 | 25.0±6.8 | 1.4±0.5 | 31.7±4.7 |
| GPT-5-minimal-think | 80.0±5.7 | 39.1±4.1 | 30.6±7.0 | 20.0±7.3 | 1.3±0.5 | 34.2±4.9 |
| Claude-3.5-Sonnet | 68.0±6.6 | 32.7±3.2 | 42.1±5.4 | 15.0±5.6 | 0.6±0.5 | 31.7±4.3 |
| GPT-4o | 77.6±3.7 | 33.1±2.3 | 39.3±5.2 | 10.0±4.7 | 0.4±0.4 | 32.1±3.3 |
| DS-V4-Flash (Init harness) | 42.0±3.5 | 11.6±5.0 | 40.0±6.2 | 0.8±1.9 | 0.0 | 18.9±3.3 |
| DS-V4-Flash w. HSI (meta-off) | 77.3±1.2 | 36.4±1.6 | 46.0±2.4 | 5.8±3.8 | 0.0 | 33.1±1.8 |
| DS-V4-Flash w. HSI (meta-on) | 81.3±4.2 | 44.6±3.2 | 65.0±3.0 | 15.8±2.9 | 0.2±0.3 | 41.4±2.7 |

| Sub-suite | Init Harness | Best Dev | Best Test (meta-on) | Best Test (meta-off) |
|---|---|---|---|---|
| BreakStop | 0.0333±0.0334 | 1.0000 | 0.9800±0.0632 | 1.0000±0.0000 |
| GoTo | 0.1818±0.0802 | 1.0000 | 1.0000±0.0000 | 0.9636±0.0809 |
| Make | 0.0000 | 0.5556 | 0.3625±0.3284 | 0.3375±0.2029 |

| Suite | Setup | Dev | Val | Test ep. | Dev ep. | Test rep. | Meta | Submit-best |
|---|---|---|---|---|---|---|---|---|
| TextWorld | A | 1.0 | 0.00 | 10 | 3 | 3 | off | 50 |
| BabyAI | A | 1.0 | 0.00 | 10 | 3 | 3 | on | 80 |
| Crafter | A | 1.0 | 0.00 | 5 | 3 | 3 | on | 50 |
| MiniHack | A | 1.0 | 0.00 | 5 | 1 | 3 | on | 80 |
| NLE | A | 1.0 | 0.00 | 5 | 1 | 1 | on | 50 |
| BabaIsAI-BreakStop | B | 0.8 | 0.20 | 5 | 1 | 1 | off | 80 |
| BabaIsAI-GoTo | B | 0.8 | 0.25 | 5 | 1 | 1 | on | 80 |
| BabaIsAI-Make | B | 0.8 | 0.25 | 5 | 1 | 1 | on | 80 |
| Method | Proposer | Surface | Domain | Feature |
|---|---|---|---|---|
| Meta-Harness | External stronger | Full harness code | Coding, math | Full-trajectory feedback |
| Self-Harness | Self (target) | Config interface | Coding | Model-specific edits |
| AHE | External stronger | Decoupled comps | Coding | Observability bottleneck |
| HarnessX | Multi-agent | Typed processors | 5 benchmarks | Operational mirror to RL |
| DGM | Self | Full codebase | Coding | Archive-based search |
| HGM | Self | Full codebase | Coding | Clade meta-productivity |
| GEA | Self (group) | Codebase + exp | Coding | Shared experience pool |
| SICA | Self | Full codebase | Coding | Framework saturation |
| HyperAgents | Fused self | Codebase + meta | Coding, robots | Editable meta-mechanism |
| Live-SWE-Agent | Self (runtime) | Tools on-the-fly | Coding | Zero offline cost |
| TTHE | Self (test-time) | Harness population | Coding, SQL | Unlabeled trace adaptation |
| Rethinking Eval. | — (critique) | — | Coding | Test-time-scaling confound |
| Statistical Limits | — (theory) | — | PAC learning | VC bound ⇔ learnability |
| HSI (Ours) | Same frozen M | 3-layer hierarchy | BALROG | Endogenous hierarchy with frozen outer anchor |
Why it matters
Most agent improvements today rely on humans manually tweaking prompts or tools, but this work shows the surrounding scaffold itself can be safely and hierarchically self-modified by the AI without changing model weights. It also empirically pinpoints where such self-improvement stops working, giving practical guidance on when to invest in harness engineering versus upgrading the underlying model.
Terms in this paper
- harness · the executable scaffold of prompts, tools, memory, and control logic that wraps around an LLM to run tasks
- frozen LLM · a language model whose trained parameters are kept fixed and never updated
- evolver / meta-evolver · the role that rewrites the task harness, and the role one level above that rewrites the evolver's own strategy
- % Progress · a 0-100 scale metric in the BALROG benchmark measuring how much of a task was completed
- held-out generalization · testing on tasks never seen during the improvement process to check if gains transfer to new, unseen cases
Original abstract (English)
Modern LLM agents are often improved by modifying prompts, tools, or workflows manually, while the executable scaffold surrounding the model---the harness---is typically treated as a fixed artifact after deployment. This work studies an alternative where the harness is task-specific and continuously evolvable: each task family maintains its own harness, which is hot-swapped across iterations through a fixed task-injection seam and rewritten using environment feedback. We introduce Hierarchical Self-Improvement (HSI), a framework in which a single frozen LLM M operates across three hierarchical scopes: a task harness H that executes tasks, an evolver that rewrites H, and a meta-evolver that rewrites the evolver's strategy code under a frozen outer anchor. A thinking-on/off design isolates the contribution of harness evolution by disabling reasoning during task execution while enabling it during self-modification. HSI is bounded by two factors: a feedback-fidelity bound, since evolution requires informative reward signals to guide selection, and a backbone capability bound, since harness redesign cannot overcome limitations of the frozen model. On BALROG with DeepSeek-V4-Flash-Preview as the frozen backbone, HSI achieves consistent gains over the initial harness on moderate-difficulty tasks (+39.3 on BabyAI, +33.0 on Crafter, +25.0 on TextWorld, and +15.0 on MiniHack, all in raw \% Progress), while obtaining strong held-out generalization on BabaIsAI sub-suites (0.98 best-test on BreakStop and 1.00 on GoTo from a 20% unseen split). On tasks beyond the backbone's capability (NLE), harness evolution provides no improvement. These results demonstrate task-specific harness evolution as a viable axis for improving frozen LLM agents under clear empirical limits. Code is available at https://github.com/TailinZhou/hsi.
Read on arXivLatest papers
- SWE-bench Science: Can Coding Agents Resolve Engineering Tasks in Science?AI coding agents were tested on fixing real scientific software, and even the best one failed more than half the time
- FlashPrefill V2: Block-Sparse Prefill Attention for Long-Context LLM ServingMaking sparse attention fast enough and accurate enough for real LLM serving, not just papers
- PolicyGuide: From Guarding One Action to Guiding the Whole Workflow for Policy-Compliant LLM AgentsMaking customer-service AI agents follow the whole procedure, not just avoid one bad action
- EXIMO: VLM Guided Exploration of VLA PoliciesTeaching a robot new chores without human teleoperation, by letting a chatty AI supervise it
- EnvHarness: Awakening Static Worlds for Agent LearningInstead of building new training worlds from scratch, this work adds a plug-in layer that reshapes existing ones around each agent's actual weaknesses
- Bounded Sovereignty and the Control Tax: Pricing AI Oversight When the Deployer Does Not Own the ModelCompanies that rent AI instead of owning it can only do half of AI safety oversight
- Beyond Imitation: Filtering On-Policy Distillation by Reasoning ProgressA fix for AI models that get penalized by their teacher even when they're reasoning correctly
- PersonalBench: Measuring the Authorship Gap in LLM PersonalizationAI can be prompted to write 'like someone,' but its own voice never fully disappears
Latest from METAL MEDIA
Figures: Tailin Zhou et al., arXiv:2608.08466, CC BY 4.0