SWE-Fixer:训练开源LLMs以实现GitHub问题的有效和高效解决

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

January 9, 2025
作者: Chengxing Xie, Bowen Li, Chang Gao, He Du, Wai Lam, Difan Zou, Kai Chen
cs.AI

摘要

大型语言模型(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 上公开提供我们的模型、数据集和代码。
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 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.

Summary

AI-Generated Summary

PDF142January 10, 2025