让小模型学会挑时候问专家,显著提升代码修复能力。
SWE-Protégé: Learning to Selectively Collaborate With an Expert Unlocks Small Language Models as Software Engineering Agents
- 小模型自主决定何时求助专家,避免盲目调用。
- 在SWE-bench上达到42.4%通过率,比之前强25.4%。
- 仅需每任务约4次专家调用,节省资源适合实用部署。
小语言模型(SLMs)在成本、延迟和可适应性方面具有优势,但在长周期软件工程任务(如SWE-bench)中表现落后,主要问题为频繁的动作循环和低分辨率率。本文提出SWE-Protégé,一种后训练框架,将代码修复重构为专家-学徒协作问题。在该框架中,小模型作为唯一决策者,学习在必要时选择性地向强专家模型寻求帮助、识别停滞状态并执行专家反馈。方法结合专家增强轨迹的监督微调与显式抑制退化循环和无效协作的智能体强化学习。对Qwen2.5-Coder-7B-Instruct进行轻量后训练后,在SWE-bench Verified上达到42.4% Pass@1,较此前小模型最佳性能提升25.4%,且专家调用稀疏(平均每任务约4次,占总令牌数11%)。
原文摘要 · Abstract (English)
Small language models (SLMs) offer compelling advantages in cost, latency, and adaptability, but have so far lagged behind larger models on long-horizon software engineering tasks such as SWE-bench, where they suffer from pervasive action looping and low resolution rates. We introduce SWE-Protégé, a post-training framework that reframes software repair as an expert-protégé collaboration problem. In SWE-Protégé, an SLM remains the sole decision-maker while learning to selectively seek guidance from a strong expert model, recognize stalled states, and follow through on expert feedback. Our approach combines supervised fine-tuning on expert-augmented trajectories with agentic reinforcement learning that explicitly discourages degenerative looping and unproductive expert collaboration. We lightly post-train Qwen2.5-Coder-7B-Instruct to achieve 42.4% Pass@1 on SWE-bench Verified, a +25.4% improvement over the prior SLM state of the art, while using expert assistance sparsely (~4 calls per task and 11% of total tokens).
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。