Motivated by the success of general-purpose large language models (LLMs) in software patching, recent works started to train specialized patching models. Most works trained one model to handle the end-to-end patching pipeline (including issue localization, patch generation, and patch validation). However, it is hard for a small model to handle all tasks, as different sub-tasks have different workflows and require different expertise. As such, by using a 70 billion model, SOTA methods can only reach up to 41% resolved rate on SWE-bench-Verified. Motivated by the collaborative nature, we propose Co-PatcheR, the first collaborative patching system with small and specialized reasoning models for individual components. Our key technique novelties are the specific task designs and training recipes. First, we train a model for localization and patch generation. Our localization pinpoints the suspicious lines through a two-step procedure, and our generation combines patch generation and critique. We then propose a hybrid patch validation that includes two models for crafting issue-reproducing test cases with and without assertions and judging patch correctness, followed by a majority vote-based patch selection. Through extensive evaluation, we show that Co-PatcheR achieves 46% resolved rate on SWE-bench-Verified with only 3 x 14B models. This makes Co-PatcheR the best patcher with specialized models, requiring the least training resources and the smallest models. We conduct a comprehensive ablation study to validate our recipes, as well as our choice of training data number, model size, and testing-phase scaling strategy.


翻译:受通用大语言模型(LLMs)在软件补丁生成中成功的启发,近期研究开始训练专门的补丁生成模型。多数工作训练单一模型处理端到端的补丁生成流程(包括问题定位、补丁生成和补丁验证)。然而,小型模型难以胜任所有任务,因为不同子任务具有不同的工作流程并需要不同的专业知识。因此,现有最佳方法使用700亿参数模型在SWE-bench-Verified基准上仅能达到41%的解决率。基于协作式设计的理念,我们提出Co-PatcheR——首个采用小型专业化推理模型处理独立组件的协作式补丁生成系统。我们的核心技术创新在于特定任务设计与训练方案。首先,我们训练用于定位和补丁生成的模型:定位模块通过两步流程精确定位可疑代码行,生成模块结合补丁生成与批判性评估。随后提出混合补丁验证方案,包含两个模型分别用于生成带断言/不带断言的议题复现测试用例、判断补丁正确性,并采用多数表决机制进行补丁选择。通过大量实验评估,Co-PatcheR仅使用3个140亿参数模型就在SWE-bench-Verified上实现46%的解决率,成为当前专业化模型中效果最佳、训练资源需求最低且模型规模最小的补丁生成系统。我们通过全面的消融实验验证了训练方案的有效性,以及对训练数据量、模型规模和测试阶段扩展策略的选择依据。

0
下载
关闭预览

相关内容

LibRec 每周算法:LDA主题模型
LibRec智能推荐
29+阅读 · 2017年12月4日
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
10+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
17+阅读 · 2017年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
10+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员