arXiv:2501.05040cs.CL2025-01ACL被引 99

开源框架SWE-Fixer高效修复GitHub代码问题,仅需两次调用模型。

SWE-Fixer: Training Open-Source LLMs for Effective and Efficient GitHub Issue Resolution

  • 分两步检索文件并生成补丁,结合BM25与轻量模型提升效率
  • 在SWE-Bench Lite和Verified上分别达22.0%和30.2%准确率
  • 支持快速部署,适合开源开发者和自动化修复场景

大型语言模型在复杂任务中表现卓越,尤其在解决实际软件工程问题方面潜力巨大。然而,现有方法多依赖专有模型,限制了可复现性、可访问性和透明度。本文提出SWE-Fixer,一个开源框架,用于高效修复GitHub上的代码问题。该框架包含两个模块:基于BM25与轻量模型的代码文件检索模块,以及用于生成补丁的代码编辑模块。为弥补公开数据集不足,我们构建了包含11万条GitHub问题及其对应补丁的数据集,并独立训练两个模型。在SWE-Bench Lite和Verified基准测试中,SWE-Fixer取得22.0%和30.2%的准确率,经PASS_TO_PASS(P2P)过滤后达24.7%和32.8%,性能居开源模型前列。此外,每实例仅需两次模型调用,显著优于现有方法。相关模型、数据集与代码已开源。

原文摘要 · Abstract (English)

Large Language Models (LLMs) have demonstrated remarkable proficiency across a variety of complex tasks. One significant application of LLMs is in tackling software engineering challenges, particularly in resolving real-world tasks on GitHub by fixing code based on the issues reported by the users. However, many current approaches rely on proprietary LLMs, which limits reproducibility, accessibility, and transparency. The critical components of LLMs for addressing software engineering issues and how their capabilities can be effectively enhanced remain unclear. To address these challenges, we introduce SWE-Fixer, a novel open-source framework designed to effectively and efficiently resolve GitHub issues. SWE-Fixer comprises two essential modules: a code file retrieval module and a code editing module. The retrieval module employs BM25 along with a lightweight model to achieve coarse-to-fine file retrieval. Subsequently, the code editing module utilizes the other model to generate patches for the identified files. To mitigate the lack of publicly available datasets, we compile an extensive dataset that includes 110K GitHub issues along with their corresponding patches and train the two models of SWE-Fixer separately. We assess our approach on the SWE-Bench Lite and Verified benchmarks, achieving competitive performance among open-source models with scores of 22.0% and 30.2%. Furthermore, SWE-Fixer reaches state-of-the-art performance (24.7% on Lite and 32.8% on Verified) with PASS_TO_PASS (P2P) filtering. Additionally, our approach requires only two model calls per instance, making it significantly more efficient than existing methods. These results highlight the effectiveness of SWE-Fixer in real-world code-fixing scenarios. We will make our model, dataset, and code publicly available at https://github.com/InternLM/SWE-Fixer.

代码修复LLM开源GitHub

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。