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

Chengxing Xie, Bowen Li, Chang Gao, He Du, Wai Lam, Difan Zou, Kai Chen · DOI

TL;DR

SWE-Fixer is a new open-source framework that trains LLMs to automatically fix bugs in GitHub repositories. It achieves state-of-the-art performance among open-source models on benchmarks like SWE-Bench, while being significantly more efficient by requiring only two model calls per issue.

What Problem Does This Paper Address?

Large Language Models (LLMs) have shown promise in various coding tasks, including fixing bugs reported in GitHub issues. However, most existing solutions rely on proprietary LLMs (like GPT-4 or Claude), which are expensive, lack transparency, and hinder reproducibility. Furthermore, current benchmarks often focus on simplified, single-file scenarios, failing to capture the complexity of real-world software development where issues can span multiple files and require understanding a larger codebase. There's a need for effective and efficient open-source solutions that can tackle these complex, real-world software engineering challenges.

Methods

SWE-Fixer tackles GitHub issue resolution through a two-module pipeline:

  1. Code File Retrieval: This module identifies the specific files within a repository that are likely to contain the bug. It uses a "coarse-to-fine" strategy:
  2. Coarse Retrieval: BM25 (a classic information retrieval algorithm) is used to quickly retrieve an initial set of relevant files based on the issue description.
  3. Fine Retrieval: A lightweight LLM then refines this selection, pinpointing the most relevant files from the BM25 results. This approach is chosen for its scalability and efficiency compared to purely dense retrieval methods.
  4. Code Editing: Once the relevant files are identified, this module generates a code patch to fix the issue. The model is trained using "chain-of-thought" data, encouraging it to reason through the problem before proposing a solution.

The framework is designed for efficient training and inference, requiring only two LLM calls per issue (one for retrieval, one for editing).

Datasets

  • Training Data: The authors curated a large-scale dataset named SWE-Fixer-Train-110K, comprising 110,000 GitHub issues and their corresponding patches. Rigorous filtering was applied to ensure data quality.
  • Evaluation Benchmarks:
    • SWE-Bench Lite: A subset of the official SWE-Bench benchmark, optimized for efficient evaluation.
  • SWE-Bench Verified: A human-validated subset from OpenAI, offering a more reliable evaluation.

Key Insights and Ideas

  • Open-Source is Viable: The paper demonstrates that open-source LLMs, when properly trained and orchestrated, can achieve competitive and even state-of-the-art performance on complex software engineering tasks, challenging the dominance of proprietary models.
  • Pipeline Efficiency: A well-designed pipeline, breaking down the problem into distinct retrieval and editing steps, can be more efficient than complex agent-based systems, especially for open-source models.
  • Coarse-to-Fine Retrieval: Combining a fast, traditional method like BM25 with a more sophisticated LLM for refinement offers a practical and effective approach to navigating large codebases.
  • Chain-of-Thought for Editing: Training the editing module with chain-of-thought data significantly improves its ability to generate accurate code patches.
  • Data Quality Matters: The creation of a large, filtered dataset was crucial for training effective models.

Key Results

  • Performance: SWE-Fixer achieved state-of-the-art performance among open-source models on SWE-Bench Lite (24.7% Pass@1 with P2P filtering) and SWE-Bench Verified (32.8% Pass@1 with P2P filtering).
  • Efficiency: The framework requires only two model calls per instance (one for retrieval, one for editing), making it significantly more efficient than many existing methods that might require hundreds of calls.
  • Comparison: SWE-Fixer outperforms several methods based on proprietary models like GPT-4 and GPT-40, demonstrating its cost-effectiveness and efficiency.

Limitations and Future Work

  • Dataset Scale: While the dataset is large (110K instances), the authors acknowledge that further scaling up the training data could potentially improve performance even more. Computational constraints limited the size of the training data.
  • Reward Model for Optimization: The authors suggest that introducing a reward model for test-time optimization could further refine generated code patches. This model could evaluate patches and help select the best one.
  • Modular Components: The trained retriever and editor modules from SWE-Fixer could potentially be integrated into existing agent-based systems to enhance their efficiency.

Summary updated

BibTeX
@inproceedings{xie2025swe,
  author = {Chengxing Xie and Bowen Li and Chang Gao and He Du and Wai Lam and Difan Zou and Kai Chen},
  title = {{SWE-Fixer: Training Open-Source LLMs for Effective and Efficient GitHub Issue Resolution}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure