arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.07457cs.SEcs.AIcs.CL
收藏

拉取请求作为仓库级代码编辑的训练信号

Pull Requests as a Training Signal for Repo-Level Code Editing

King's College London, UK(伦敦国王学院);Chinese University of Hong Kong, HK(香港中文大学);National University of Singapore, SG(新加坡国立大学);Microsoft Research Asia, CN(微软亚洲研究院);The Alan Turing Institute, UK(艾伦·图灵研究所)

Qinglin Zhu, Tianyu Chen, Shuai Lu, Lei Ji, Runcong Zhao, Murong Ma, Xiangxiang Dai, Yulan He, Lin Gui, Peng cheng, Yeyun Gong

AI总结:

提出Clean-PR方法,利用真实GitHub拉取请求作为训练信号,通过重建和验证转换为搜索/替换编辑块,结合无代理对齐的监督微调,在SWE-bench上显著提升仓库级代码编辑性能。

摘要:

仓库级代码编辑要求模型理解复杂依赖关系并在大型代码库中执行精确的多文件修改。虽然最近在SWE-bench上的进展严重依赖于复杂的代理脚手架,但尚不清楚这种能力有多少可以通过高质量的训练信号内化。为了解决这个问题,我们提出了Clean Pull Request (Clean-PR),一种利用真实世界GitHub拉取请求作为仓库级编辑训练信号的中间训练范式。我们引入了一个可扩展的流水线,通过重建和验证将嘈杂的拉取请求差异转换为搜索/替换编辑块,从而得到最大的公开可用语料库,包含200万个拉取请求,涵盖12种编程语言。使用这个训练信号,我们进行中间训练阶段,然后进行无代理对齐的监督微调过程,并带有错误驱动的数据增强。在SWE-bench上,我们的模型显著优于指令微调基线,在SWE-bench Lite上实现了13.6%的绝对改进,在SWE-bench Verified上实现了12.3%的绝对改进。这些结果表明,仓库级代码理解和编辑能力可以在简化的、无代理的协议下有效地内化到模型权重中,而无需依赖繁重的推理时脚手架。

英文摘要:

Repository-level code editing requires models to understand complex dependencies and execute precise multi-file modifications across a large codebase. While recent gains on SWE-bench rely heavily on complex agent scaffolding, it remains unclear how much of this capability can be internalised via high-quality training signals. To address this, we propose Clean Pull Request (Clean-PR), a mid-training paradigm that leverages real-world GitHub pull requests as a training signal for repository-level editing. We introduce a scalable pipeline that converts noisy pull request diffs into Search/Replace edit blocks through reconstruction and validation, resulting in the largest publicly available corpus of 2 million pull requests spanning 12 programming languages. Using this training signal, we perform a mid-training stage followed by an agentless-aligned supervised fine-tuning process with error-driven data augmentation. On SWE-bench, our model significantly outperforms the instruction-tuned baseline, achieving absolute improvements of 13.6% on SWE-bench Lite and 12.3% on SWE-bench Verified. These results demonstrate that repository-level code understanding and editing capabilities can be effectively internalised into model weights under a simplified, agentless protocol, without relying on heavy inference-time scaffolding.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑