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

Abstract

SWE-Fixer is a streamlined, two-stage pipeline designed to enable open-source Large Language Models (LLMs) to resolve real-world GitHub issues with state-of-the-art efficiency. By replacing complex "agentic" loops with a specialized retrieval-and-edit approach, it achieves a 30.2% success rate on the SWE-Bench Verified benchmark. This performance rivals proprietary-model-based systems while requiring only two model calls per instance, significantly reducing computational overhead.

Introduction

Resolving real-world software bugs is a significant challenge for AI, requiring the navigation of massive codebases and an understanding of complex interdependencies. Current trends in the field rely heavily on proprietary models (e.g., GPT-4o, Claude 3.5 Sonnet) or complex "agentic" systems that autonomously browse files. While flexible, these agents are often inefficient, expensive, and difficult for open-source models to execute reliably due to lower planning capabilities compared to frontier models.

SWE-Fixer demonstrates that a specialized, coarse-to-fine pipeline can make open-source models, such as Qwen2.5, competitive with—and often more efficient than—their proprietary counterparts.

Methodology

The SWE-Fixer architecture moves away from autonomous agents in favor of a two-stage specialized pipeline:

  1. Code File Retrieval: To manage codebase scale, the system uses a two-step process. First, BM25 identifies the top 30 candidate files. Subsequently, a fine-tuned 7B Qwen2.5 model examines "file skeletons"—signatures, docstrings, and function headers—to identify the specific files requiring modification.
  2. Code Editing: A 72B Qwen2.5 model generates the final fix based on the retrieved files.
Overview of the SWE-Fixer two-stage pipeline: Retrieval and Editing.

Data and Training

The models were trained on SWE-Fixer-Train-110K, a curated dataset of 110,000 GitHub issues and real-world patches. Both models utilize JsonTuning, a structured JSON format for inputs and outputs that prevents syntax hallucinations. The editor is further enhanced by Rationalization (CoT), where a teacher model (GPT-4o) generates high-quality reasoning paths by analyzing correct fixes post-hoc. Additionally, the inclusion of line numbers in the input serves as a spatial anchor, helping the model pinpoint exact locations for code edits.

Results and Discussion

SWE-Fixer was evaluated on the SWE-Bench Lite and Verified benchmarks. The "Verified" subset is human-validated, providing a more reliable measure of true problem-solving ability.

Comparison of SWE-Fixer against open-source and proprietary methods on SWE-Bench benchmarks.

Performance Benchmarks

  • State-of-the-Art for Open Source: SWE-Fixer achieved 22.0% on SWE-Bench Lite and 30.2% on SWE-Bench Verified.
  • Pass-to-Pass (P2P) Filtering: Utilizing existing tests to verify patches further increased performance to 24.7% (Lite) and 32.8% (Verified).
  • Efficiency: While some agentic systems require over 200 model calls per issue, SWE-Fixer requires only two, making it orders of magnitude more cost-effective.

Key Insights

The researchers found that providing full file contents during retrieval introduced noise; "skeletons" proved more effective for codebase navigation. Additionally, CoT training significantly benefited the 72B model but had a negligible impact on smaller models, suggesting a reasoning capacity threshold is required for effective CoT in coding tasks.

Conclusion

SWE-Fixer proves that specialized training on open-source weights can bridge the gap with general-purpose frontier models. Future work includes addressing multi-file complexity beyond the current three-file limit and incorporating execution feedback loops to further enhance the "one-shot" editing capabilities of the system.

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