2025-01-10 · 进阶 · 机器学习 · 数据科学

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

SWE-Fixer提出了一种基于开源模型的开源LLM,用于有效和高效地解决GitHub问题,在开源模型中实现了最先进的性能。

更新于 2025-01-10。作者:Chengxing Xie、Bowen Li、Chang Gao、He Du、Wai Lam、Difan Zou、Kai Chen。

中文摘要

大型语言模型(LLMs)在各种复杂任务中展现出了卓越的熟练度。LLMs的一个重要应用是解决软件工程挑战,特别是在GitHub上通过修复用户报告的问题来解决现实世界任务。然而,许多当前的方法依赖于专有LLMs,这限制了可重复性、可访问性和透明度。LLMs解决软件工程问题的关键组件以及如何有效提升其能力仍然不明确。为了应对这些挑战,我们引入了SWE-Fixer,这是一个新颖的开源LLM,旨在有效地高效地解决GitHub问题。SWE-Fixer包括两个关键模块:代码文件检索模块和代码编辑模块。检索模块采用BM25算法结合轻量级的LLM模型实现从粗到细的文件检索。随后,代码编辑模块利用另一个LLM模型为识别的文件生成补丁。然后,为了缓解公开可用数据集的缺乏,我们编制了一个包含11万个GitHub问题和相应补丁的庞大数据集,并分别对SWE-Fixer的两个模块进行训练。我们在SWE-Bench Lite和Verified基准测试中评估了我们的方法,分别取得了23.3%和30.2%的分数,在开源模型中实现了最先进的性能。这些成果突显了我们的方法的有效性。我们将在https://github.com/InternLM/SWE-Fixer上公开我们的模型、数据集和代码。

英文摘要

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 LLM 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 LLM model to achieve coarse-to-fine file retrieval. Subsequently, the code editing module utilizes the other LLM model to generate patches for the identified files. Then, 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 modules of SWE-Fixer separately. We assess our approach on the SWE-Bench Lite and Verified benchmarks, achieving state-of-the-art performance among open-source models with scores of 23.3% and 30.2%, respectively. These outcomes highlight the efficacy of our approach. We will make our model, dataset, and code publicly available at https://github.com/InternLM/SWE-Fixer.

解读

一句话总结

SWE-Fixer提出了一种基于开源模型的开源LLM,用于有效和高效地解决GitHub问题,在开源模型中实现了最先进的性能。

问题1:这篇论文想要解决什么具体问题?

• 问题背景:当前解决GitHub问题的方法大多依赖于专有LLM,限制了可重复性、可访问性和透明度。 • 现有方案不足:依赖专有模型导致成本高、透明度低,难以深入理解和改进LLM的解决问题的能力。 • 研究目标:开发一个开源LLM,能够有效和高效地解决GitHub问题。

问题2:论文的核心创新点是什么?

• 技术创新:提出了一种简单的流水线方法,将任务分解为代码文件检索和代码编辑两个子任务。 • 方法改进:采用BM25和轻量级LLM模型进行粗到细的文件检索,并使用LLM模型生成代码补丁。 • 优势:简化了数据构建和模型训练过程,提高了成本效益,同时保持了有效性。

问题3:实验结果如何验证了方法的有效性?

• 关键实验:在SWE-Bench Lite和Verified基准测试中评估SWE-Fixer。 • 性能提升:在SWE-Bench Lite上达到23.3%,在SWE-Bench Verified上达到30.2%,在开源模型中实现了最先进的性能。 • 对比结果:与基于专有模型的框架相比,SWE-Fixer在两个基准测试中都优于几个方法。

问题4:这个研究的实际应用价值是什么?

• 应用场景:适用于GitHub问题的自动解决,提高软件开发效率。 • 实施建议:公开模型、数据集和代码,便于社区使用和改进。 • 局限与展望:目前主要针对Python代码,未来可扩展到其他编程语言。

来源

机器可读索引:llms.txt