arXiv:cs.AI· Yutong Cheng, Haifeng Chen, Peng Gao, Wei Cheng·· 16 小时前
SpecForge:通过行为规范让编码智能体实现递归自我改进
SpecForge: Recursive Self-Improvement for Coding Agents via Behavioral Specifications
AI 导读
SpecForge 是一个多前沿树搜索框架,让基于冻结语言模型的编码智能体通过递归改进行为规范来提升代码生成能力,解决了程序实体相互依赖导致的"输出耦合"问题。在 DevEval+ 上,该方法在五个主干模型上均取得最佳表现,其中 Claude-4.5-Sonnet 达到 94.9% 的解决率,较最强基线平均提升 5.7 个百分点。改进后的规范还可迁移至跨语言翻译和新功能实现任务。
正文
Abstract:Coding agents based on frozen language models can improve their performance by refining the external context they rely on, without updating model weights. We study recursive self-improvement through behavioral specifications: natural-language code documentation that describes the behavior of program entities and guides agents in generating correct code. We formulate a self-improvement loop in which an agent generates code from its current specifications, evaluates it with execution-verified tests, and refines the specifications based on observed failures. The improved specifications then guide subsequent generation, progressively improving the agent's understanding of the codebase. However, recursive refinement is challenging because program entities are interdependent. Improving the specification of one entity can inadvertently degrade the correctness of others, a phenomenon we call output coupling. This creates a whack-a-mole effect in which local improvements cause regressions elsewhere, preventing consistent progress. We introduce SpecForge, a multi-frontier tree search framework that addresses this challenge with three mechanisms: (i) Pareto-guided state selection preserves complementary specification states and prevents premature commitment; (ii) dependency-constrained entity selection prioritizes callee-before-caller refinement; and (iii) error-diversified expansion explores multiple refinements using different subsets of test failures. On DevEval+, SpecForge achieves the best performance across five backbone models, including a 94.9% solve rate with Claude-4.5-Sonnet and a 5.7-percentage-point average improvement over the strongest baseline. The improved specifications also make the agent better at tasks outside the loop: they transfer to cross-language translation and to new-feature implementation, where they outperform the benchmark-provided requirement documents.
| Comments: | Accepted to NeurIPS 2026 (Main Track) |
| Subjects: | Artificial Intelligence (cs.AI); Software Engineering (cs.SE) |
| Cite as: | arXiv:2610.15708 [cs.AI] |
| (or arXiv:2610.15708v1 [cs.AI] for this version) | |
| https://doi.org/10.48550/arXiv.2610.15708 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Yutong Cheng [view email]
[v1]
Sun, 11 Oct 2026 15:46:22 UTC (1,478 KB)
来源:arXiv:cs.AI · arxiv.org