Certified Long-Horizon Code Agent Evolution via Validation-Gated Skill Optimization
Organizations: Purdue University · Microsoft · University of Washington · University of California, Davis ·
Abstract
Long horizon agent self-evolution without model weight updates is essential for enabling deployed agents to accumulate reusable skills and improve over time. Prior self-evolution work has focused primarily on short-horizon tasks, while repository-level software engineering remains unexplored despite being an ideal testbed for long-horizon adaptation. In this setting, agents are required to solve streams of sequential tasks, navigate complex dependencies with evolving repositories and persistently store and reuse experience. Text-based skill optimization offers an efficient, non-parametric approach for such adaptation. However, existing methods often suffer from unstable updates, performance drawdown, and agent collapse over extended deployments. In this paper, we formalize the concept of in-context self-evolution and introduce VALVE, a validated-gated framework for long-horizon skill optimization. We establish finite convergence, provide theoretical guarantees for future-task gain and drawdown, and derive the validation and evaluation holdout sizes required for a prescribed tolerance, with leading-order scaling Empirically, our pipeline, VALVE achieves stable self-improvement over evolution horizon spanning more than 1,000 SWE tasks, with average final and peak gains of and points across three frontier models (GPT-5.5, Claude-4.6 and MiniMax-M2.7). The validation gate reduces average drawdown by 75% and produces an 11x more compact skill bank than ungated evolution. We further present extensive ablations identifying the design choices most critical to long-horizon skill evolution.
Figures & tables
| Final resolved rate (avg@3, %) | |||||
| Setting | pygments | sqlfluff | deepdiff | pydicom | Model Avg. |
| MiniMax-M2.7 | |||||
| Base | |||||
| SkillOpt | 60.0\ {\color[rgb]{0.1758,0.4883,0.332}(+7.5)} | 66.0\ {\color[rgb]{0.668,0.2734,0.2734}(-0.5)} | \mathbf{69.0}\ {\color[rgb]{0.1758,0.4883,0.332}\mathbf{(+12.7)}} | 60.7\ {\color[rgb]{0.1758,0.4883,0.332}(+0.4)} | 63.9\ {\color[rgb]{0.1758,0.4883,0.332}(+5.0)} |
| VALVE w/o val | 53.3\ {\color[rgb]{0.1758,0.4883,0.332}(+0.8)} | 66.7\ {\color[rgb]{0.1758,0.4883,0.332}(+0.2)} | 61.7\ {\color[rgb]{0.1758,0.4883,0.332}(+5.4)} | 58.7\ {\color[rgb]{0.668,0.2734,0.2734}(-1.6)} | 60.1\ {\color[rgb]{0.1758,0.4883,0.332}(+1.2)} |
| VALVE | \mathbf{61.0}\ {\color[rgb]{0.1758,0.4883,0.332}\mathbf{(+8.5)}} | \mathbf{72.7}\ {\color[rgb]{0.1758,0.4883,0.332}\mathbf{(+6.2)}} | 65.3\ {\color[rgb]{0.1758,0.4883,0.332}(+9.0)} | \mathbf{61.7}\ {\color[rgb]{0.1758,0.4883,0.332}\mathbf{(+1.4)}} | \mathbf{65.2}\ {\color[rgb]{0.1758,0.4883,0.332}\mathbf{(+6.3)}} |
| Setting | Final gain | Peak gain | Draw- down |
|---|---|---|---|
| MiniMax-M2.7 | |||
| SkillOpt | |||
| VALVE w/o val | |||
| VALVE | |||
| GPT-5.5 | |||
| SkillOpt | |||
| Final bank size (skills / principles) | |||||
| Setting | pygments | sqlfluff | deepdiff | pydicom | Total |
| MiniMax-M2.7 | |||||
| VALVE w/o val | |||||
| VALVE | |||||
| GPT-5.5 | |||||
| VALVE w/o val | |||||
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Evaluation set | Validation panel | |||||
| Tolerance | ||||||
| pp | ||||||
| pp | ||||||
| pp | ||||||
| pp | ||||||
| pp | ||||||
| Component | Reference setting |
|---|---|
| Data | One repository-level task stream from the SWE-smith training split |
| Evaluation set | 100 tasks sampled without replacement (seed 42) |
| Validation panel | 50 tasks sampled from the remaining stream (seed 123); the same fixed panel is used for every acceptance decision |
| Agent | Frozen code-agent backbone (MiniMax-M2.7, GPT-5.5, or Claude-4.6-sonnet, according to the run) with an interactive shell environment |
| Adaptation | 3 independently sampled rollouts per task |
| Evolution trigger | Mixed-outcome tasks only; at most 100 mixed tasks |
| Ablation | Method-level intervention |
|---|---|
| Sentence skills | Replace structured rich bodies with one-sentence principles and scoped skill sentences throughout extraction, storage, and injection. |
| No principles | Constrain Extract to return an empty principle set; retrieve and inject skills only. |
| Single document | Replace itemized banks with one principle document and one skill document, updated through section-level add/replace/delete operations and injected in full. This also removes item-level retrieval. |
| Inject all | Remove task-conditioned ranking and inject every stored item in reverse creation order. |
| Batch of four | Buffer four completed tasks and perform one cross-task reflection; use one validation rollout per validation task. |
| All tasks | Apply Extract and Validate after all-pass and all-fail tasks as well as mixed tasks; the 100-step horizon consequently counts raw tasks. |
| Component | Prior work with our choice | Prior work with the ablated choice |
|---|---|---|
| Retrieval Selection inject all | Voyager ( Wang et al., 2023 ) , ReasoningBank ( Ouyang et al., 2025 ) , Memp ( Fang et al., 2025 ) | AWM ( Wang et al., 2025b ) , ExpeL ( Zhao et al., 2024 ) , SkillOpt ( Yang et al., 2026 ) |
| Training stream Contrastive only all tasks | ExpeL ( Zhao et al., 2024 ) , H 2 R ( Ye et al., 2025 ) , Training-Free GRPO ( Cai et al., 2025 ) | ReasoningBank ( Ouyang et al., 2025 ) , ACE ( Zhang et al., 2026 ) , SkillOpt ( Yang et al., 2026 ) |
| Principle memory Remove principles | MARS ( Hou et al., 2026 ) , SkillRL ( Xia et al., 2026 ) , H 2 R ( Ye et al., 2025 ) | Voyager ( Wang et al., 2023 ) , AWM ( Wang et al., 2025b ) |
| Skill format Rich markdown sentence | Trace2Skill ( Ni et al., 2026 ) , EvoSkill ( Alzubi et al., 2026 ) , SkillOpt ( Yang et al., 2026 ) | ExpeL ( Zhao et al., 2024 ) , ACE ( Zhang et al., 2026 ) , Training-Free GRPO ( Cai et al., 2025 ) |
| Skill storage Bank single document | SkillRL ( Xia et al., 2026 ) , ReasoningBank ( Ouyang et al., 2025 ) , SWE-Exp ( Chen et al., 2025 ) | SkillOpt ( Yang et al., 2026 ) , ACE ( Zhang et al., 2026 ) , Dynamic Cheatsheet ( Suzgun et al., 2025 ) |
| Generation granularity Batch size | ReasoningBank ( Ouyang et al., 2025 ) , ACE ( Zhang et al., 2026 ) , Dynamic Cheatsheet ( Suzgun et al., 2025 ) | SkillOpt ( Yang et al., 2026 ) , Trace2Skill ( Ni et al., 2026 ) , Training-Free GRPO ( Cai et al., 2025 ) |
| Train+validation wall-clock time (h) | ||||||
| Model | Setting | pygments | sqlfluff | deepdiff | pydicom | Model Avg. |
| MiniMax-M2.7 | SkillOpt | |||||
| Evolve w/o val | ||||||
| Evolve w/ val | ||||||
| GPT-5.5 | SkillOpt | |||||
| Evolve w/o val | ||||||
| ID | Component | Configuration | Hours / step |
|---|---|---|---|
| Ref. | Full pipeline | Mixed-only, validate | |
| A1 | Skill format | Sentence | |
| A2 | Principle memory | No principles | |
| A3 | Storage | Single document | |
| A4 | Selection | Inject all | |
| A5 | Extraction batch | Batch size |
| Steps | Item | Type | Category | Gain |
|---|---|---|---|---|
| 1 | scope_reported_vs_scope_tested | Principle | Repair strategy | |
| 1 | diff_from_baseline_before_fixing | Principle | Repair strategy | |
| 1 | audit_full_modified_file_for_multiple_bugs | Skill | Repair strategy | |
| 2 | partial_fix_can_fail_tests_that_full_fix_passes | Principle | Repair strategy | |
| 2 | co_introduced_bugs_cluster_in_same_commit | Principle | Repair strategy | |
| 2 | verify_fix_completeness_with_full_test_suite | Skill | Repair strategy |
Self-Evolving Agents
Self-evolving agents improve their skills, memory, tools, policies, or environments by learning from interaction and evaluation feedback.
See all 427 papers