SWE-Ladder:通过渐进式特权自蒸馏学习定位、复现与补丁生成
SWE-Ladder: Learning to Localize, Reproduce, and Patch via Progressive Privileged Self-Distillation
AI总结:
SWE-Ladder 是一种基于渐进式特权自蒸馏的软件工程智能体方法,通过阶段特定证据蒸馏与 GRPO 优化,在 SWE-bench 等基准上显著提升了代码修复的 pass@1 指标。
摘要:
解决仓库级问题通常需要软件工程(SWE)智能体完成故障代码定位、失败复现及代码补丁生成。强化学习基于最终补丁的单一测试结果训练此类智能体,而在线策略自蒸馏(OPSD)会添加来自带有特权证据的教师的 token 级监督,每一步都提供完整参考补丁,但两者均未为定位或复现提供阶段特定指导。我们提出 SWE-Ladder,将每个训练实例的验证修复转化为阶段特定证据:用于定位的变更文件与行、用于复现的未通过测试、用于补丁生成的差异。基于工具调用,规则式路由器将端到端 rollout 的每一步分配至对应阶段,冻结教师仅可见匹配证据,各阶段按修复顺序进行蒸馏,同时 GRPO 优化完整轨迹。在 R2E-Gym 框架下,基于 Qwen3-4B-Instruct-2507 在 SWE-bench Verified 数据集上,SWE-Ladder 将 pass@1 从 9.6% 提升至 16.4%,而 GRPO 的 pass@1 为 10.4%,使用完整补丁的 OPSD 为 12.4%;在 OpenHands 框架下,其将 pass@1 从 13.0% 提升至 17.6%。在 R2E-Gym 下反转阶段顺序会使 pass@1 降至 11.4%。
英文摘要:
Resolving a repository-level issue typically requires a software-engineering (SWE) agent to localize the faulty code, reproduce the failure, and patch the code. Reinforcement learning trains such agents from a single test result on the final patch, while on-policy self-distillation (OPSD) adds token-level supervision from a teacher with privileged evidence, exposing the full reference patch at every step. Neither provides stage-specific guidance for localization or reproduction. We propose SWE-Ladder, which turns the verified repair of each training instance into stage-specific evidence: the changed files and lines for localization, the fail-to-pass tests for reproduction, and the diff for patching. A rule-based router assigns each step of an end-to-end rollout to a stage based on its tool call, a frozen teacher sees only the matching evidence, and the stages are distilled in repair order while GRPO optimizes the full trajectory. With Qwen3-4B-Instruct-2507 on SWE-bench Verified under the R2E-Gym scaffold, SWE-Ladder improves pass@1 from 9.6% to 16.4%, compared with 10.4% for GRPO and 12.4% for OPSD with the full patch. Under the OpenHands scaffold, it improves pass@1 from 13.0% to 17.6%. Reversing the stage order under R2E-Gym reduces pass@1 to 11.4%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。