让编程代理自我进化,通过分析历史错误自动生成针对性训练题。
Socratic-SWE: Self-Evolving Coding Agents via Trace-Derived Agent Skills

- 用代理的历史求解记录提炼出常见错误和修复模式,形成可复用的技能。
- 在真实代码库中生成可验证的修复任务,三轮迭代后在SWE-bench Verified上达50.40%。
- 适合研究自进化AI编程系统或想提升代码生成能力的研究者。
基于大模型的软件工程代理已成为检验语言模型实际能力的核心场景,但其训练受限于高质量编程任务的获取。现有合成数据方法通常采用固定变异或注入漏洞的方式生成任务,导致任务分布与代理自身缺陷及训练进展无关。我们提出Socratic-SWE,一个闭环自演化框架,将代理的历史求解轨迹作为训练信号来源。不同于仅用轨迹计算奖励,Socratic-SWE从中提炼出结构化技能,总结重复出现的失败模式与有效修复策略。这些技能用于在真实代码库中生成针对性修复任务。候选任务通过执行验证并以求解器梯度对齐奖励打分,确保其可验证且有助于提升求解器性能。更新后的求解器产生新轨迹,推动任务课程持续演化。在SWE-bench Verified、SWE-bench Lite、SWE-bench Pro和Terminal-Bench 2.0上,Socratic-SWE在相同算力预算下持续优于自演化基线,三轮迭代后达到50.40%准确率。结果表明,求解轨迹可作为自演化编程代理的可扩展基础。
原文摘要 · Abstract (English)
LLM-driven software engineering agents have become a central testbed for real-world language-model capability, yet their training remains limited by the availability of high-quality SWE tasks. Existing synthetic data methods typically create tasks through fixed mutation or bug-injection procedures, making the resulting distributions largely independent of the agent's own weaknesses and training progress. We introduce Socratic-SWE, a closed-loop self-evolution framework that reuses the agent's historical solving traces as a source of training signal. Rather than treating traces only as evidence for reward computation, Socratic-SWE distills them into structured agent skills that summarize recurring failures and effective repair patterns. These skills then guide the generation of targeted repair tasks in real repositories. Candidate tasks are checked through execution-based validation and scored with a solver-gradient alignment reward, so that the retained tasks are both verifiable and useful for improving the Solver. The updated Solver produces new traces, enabling the task curriculum to adapt over successive rounds. Across SWE-bench Verified, SWE-bench Lite, SWE-bench Pro, and Terminal-Bench 2.0, Socratic-SWE consistently improves over self-evolving baselines under the same compute budget, reaching 50.40% on SWE-bench Verified after three iterations. These results suggest that solving traces can serve as a scalable substrate for self-evolving SWE agents.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。