NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

SWE-smith: Scaling Data for Software Engineering Agents

John Yang, Kilian Lieret, Carlos E Jimenez, Alexander Wettig, Kabir Khandpur, Yanzhe Zhang, Binyuan Hui, Ofir Press, Ludwig Schmidt, Diyi Yang · DOI

TL;DR

This paper introduces SWE-smith, a novel pipeline for generating large-scale, high-quality training data for software engineering (SE) language models. By automating the creation of task instances that break existing tests in Python codebases, SWE-smith generates a dataset of 50,000 instances from 128 repositories, significantly outperforming previous efforts in scale and efficiency. This new dataset enables the training of more capable open-source SE agents, with their SWE-agent-LM-32B model achieving state-of-the-art performance on the SWE-bench benchmark.

What Problem Does This Paper Address?

The development of powerful language models (LMs) for software engineering (SE) tasks, such as bug fixing and code generation, is severely hampered by the lack of large-scale, high-quality training data. Existing datasets are often small, limited to a handful of repositories, and require extensive human labor and massive storage for their creation and maintenance. This bottleneck limits the progress of open-source SE agents, making them lag behind proprietary models. The authors aim to address this by creating a scalable and efficient method for generating SE training data.

Methods

SWE-smith employs a novel pipeline that inverts the traditional SWE-bench approach. Instead of identifying tasks and then building environments, SWE-smith first establishes an execution environment for a given repository and then synthesizes task instances within it. Key techniques include:

  • Automated Environment Creation: SWE-agent is used to automatically install repositories and run their test suites, identifying correct installation and testing specifications. This process is significantly more efficient than manual setup.
  • Diverse Bug Generation Strategies: SWE-smith utilizes four primary strategies to create task instances that break existing tests:
  • LM Generation: LMs are prompted to rewrite functions or classes, subtly introducing bugs.
  • Procedural Modification: Abstract Syntax Trees (ASTs) of code are programmatically modified (e.g., changing operators, removing loops) to introduce bugs.
  • Combine Bugs: Multiple bug patches from the same file or module are merged to create more complex tasks.
  • PR Mirroring: Real-world pull request (PR) diffs are used to generate patches that reverse the original changes, effectively creating a bug.
  • Execution-Based Validation: Generated patches are applied, and only those that cause existing tests to fail (Fail-to-Pass) are kept.
  • Automated Issue Generation: LMs are used to generate realistic problem statements (issue descriptions) for the synthesized bugs, leveraging information like bug patches and test outputs.

Datasets

  • SWE-smith Dataset: The primary contribution is a new dataset comprising 50,000 task instances sourced from 128 GitHub repositories. This dataset is an order of magnitude larger than previous efforts.
  • SWE-bench: Used for evaluation. The paper compares its results against various subsets of SWE-bench (Lite, Verified, Multimodal) and SWE-gym.
  • SWE-bench Verified: A human-curated subset of SWE-bench used for rigorous evaluation.
  • SWE-bench Multilingual: A new evaluation dataset introduced in the paper, consisting of 300 task instances across 9 programming languages, designed to test generalization beyond Python.

Key Insights and Ideas

  • Environment-first approach is scalable: By focusing on creating a robust execution environment for a repository first, SWE-smith can efficiently generate a large number of task instances from that environment, drastically reducing storage and human effort compared to SWE-bench's instance-centric approach.
  • Bug generation strategies have varying yields and difficulties: Different methods for introducing bugs (LM-based vs. procedural) result in varying success rates (yield) and task complexities. LM generation and procedural modifications can be controlled to produce specific types and difficulties of bugs.
  • Combining bugs creates more challenging tasks: Merging multiple bug patches leads to higher yield rates and creates more complex tasks that are likely to be more representative of real-world SE challenges.
  • LM-generated issues are effective: Using LMs to generate problem statements for bugs is comparable to using original issue text and significantly better than using fixed templates, suggesting LMs can capture the nuances of issue descriptions.
  • Repository diversity is crucial for generalization: Training on a wider range of repositories improves model performance, showing a logarithmic relationship between the number of repositories in the training set and model performance.

Key Results

  • Dataset Scale: SWE-smith generated 50,000 task instances from 128 repositories, an order of magnitude larger than prior datasets.
  • Model Performance: The SWE-agent-LM-32B model, trained on SWE-smith data, achieved a state-of-the-art 40.2% Pass@1 resolve rate on the SWE-bench Verified benchmark, outperforming existing open-source models.
  • Efficiency: SWE-smith requires significantly less human labor and storage compared to SWE-bench. For example, generating 267 bugs for the pallets/flask repository took 23 minutes and cost $2.47, compared to an estimated 38 hours of human labor for SWE-bench.
  • Bug Coverage: SWE-smith task instances break a significantly larger proportion of existing tests (89.03% for pallets/flask) compared to SWE-bench (7.25%), indicating broader test coverage.
  • Difficulty: The generated tasks span a range of difficulties, comparable to existing benchmarks, with LM Modify tasks being generally easier and PR Mirror/LM Rewrite tasks being harder.

Limitations and Future Work

  • Python-Centricity: The current SWE-smith pipeline is primarily designed for Python codebases due to its reliance on Python's AST library. Extending it to other languages is a future direction.
  • Limited Training Exploration: The paper focused on fine-tuning as a demonstration of SWE-smith's effectiveness, but did not extensively explore other training techniques like reinforcement learning.
  • Generalization to Multilingual Tasks: While SWE-bench Multilingual was introduced, SWE-agent-LM-32B showed subpar performance, highlighting the need for better training techniques to achieve cross-language generalization.
  • Automating Environment Construction: While SWE-smith significantly reduces human effort in environment setup, further automation is a goal, especially for diverse repositories and languages.
  • Hidden Tests: SWE-smith does not produce hidden tests, making it less suitable for direct evaluation compared to SWE-bench. Future work could explore generating such tests.

Summary updated

BibTeX
@misc{yang2025swe,
  author = {John Yang and Kilian Lieret and Carlos E Jimenez and Alexander Wettig and Kabir Khandpur and Yanzhe Zhang and Binyuan Hui and Ofir Press and Ludwig Schmidt and Diyi Yang},
  title = {{SWE-smith: Scaling Data for Software Engineering Agents}},
  year = {2025},
  eprint = {2504.21798},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2504.21798},
}
Figure