
SWE-bench
The benchmark coding agents are measured on: real GitHub issues, judged by each repository's own tests
What is SWE-bench?
A task gives the model a codebase and an issue and asks for a patch; the patch is accepted only if the tests that were failing now pass and the ones that were passing still do. Using the projects' own test suites as the judge is what makes the result mean something concrete rather than resemble a rubric score. What it measures is correspondingly narrow: producing a fix for a problem someone else already found, filed and described — not deciding what to build, not reviewing, not navigating a codebase without an issue to anchor on.
What can you do with SWE-bench?
- Let the repository do the grading — A submission is scored by running the project's existing tests: the ones the issue broke must pass afterwards and the ones that already worked must not regress, so the criterion belongs to the codebase rather than to the benchmark author.
- Run the evaluation reproducibly — The harness is fully containerised with Docker so a run on your machine matches a run on someone else's, and evaluation can also be executed in the cloud through Modal when a full pass would take too long locally.
- Pick the variant that matches the claim — Verified is a 500-problem subset that software engineers confirmed are actually solvable, Lite is a smaller cut for quick iteration, Multimodal covers visual software domains and Multilingual goes beyond the original Python repositories.
- Compare against published results — A public leaderboard collects submissions, which is the only reason numbers reported by different agents on different weeks can be placed next to each other at all.
- Evaluate against a split nobody can train on — For the Multimodal variant the test split is deliberately kept private and submissions are scored through a cloud tool, which is how that variant stays meaningful as models absorb more public data.
Before you choose SWE-bench
- The score measures writing a patch that satisfies existing tests for an issue someone else already diagnosed; design decisions, code review and working without a filed issue are outside what it can say anything about.
- Task instances are built from public repository history, which is also the material the models under test were trained on, so absolute scores should be read with that overlap in mind.
Star history
21 Aug to 28 Aug · +51
Frequently asked questions
Is SWE-bench free for commercial use?
SWE-bench is released under the MIT licence — OSI-approved open source, which permits commercial use.
How can SWE-bench be deployed?
SWE-bench is available as Runs locally / Self-hosted.
Documentation
Reproduced from the SWE-bench/SWE-bench README, published under MIT. Read the original ↗
Code and data for the following works:
- [ICLR 2025] SWE-bench Multimodal: Do AI Systems Generalize to Visual Software Domains?
- [ICLR 2024 Oral] SWE-bench: Can Language Models Resolve Real-World GitHub Issues?
📰 News
- [Jan. 13, 2025]: We’ve integrated SWE-bench Multimodal (paper, dataset) into this repository! Unlike SWE-bench, we’ve kept evaluation for the test split private. Submit to the leaderboard using sb-cli, our new cloud-based evaluation tool.
- [Jan. 11, 2025]: Thanks to Modal, you can now run evaluations entirely on the cloud! See here for more details.
- [Aug. 13, 2024]: Introducing SWE-bench Verified! Part 2 of our collaboration with OpenAI Preparedness. A subset of 500 problems that real software engineers have confirmed are solvable. Check out more in the report!
- [Jun. 27, 2024]: We have an exciting update for SWE-bench - with support from OpenAI’s Preparedness team: We’re moving to a fully containerized evaluation harness using Docker for more reproducible evaluations! Read more in our report.
- [Apr. 2, 2024]: We have released SWE-agent, which sets the state-of-the-art on the full SWE-bench test set! (Tweet 🔗)
- [Jan. 16, 2024]: SWE-bench has been accepted to ICLR 2024 as an oral presentation! (OpenReview 🔗)
👋 Overview
SWE-bench is a benchmark for evaluating large language models on real world software issues collected from GitHub. Given a codebase and an issue, a language model is tasked with generating a patch that resolves the described problem.
To access SWE-bench, copy and run the following code:
from datasets import load_dataset
swebench = load_dataset('princeton-nlp/SWE-bench', split='test')
🚀 Set Up
SWE-bench uses Docker for reproducible evaluations. Follow the instructions in the Docker setup guide to install Docker on your machine. If you’re setting up on Linux, we recommend seeing the post-installation steps as well.
Finally, to build SWE-bench from source, follow these steps:
git clone git@github.com:SWE-bench/SWE-bench.git
cd SWE-bench
pip install -e .
Test your installation by running:
swebench eval verified --gold -i sympy__sympy-20590 --run-id validate-gold
[!NOTE] If using a MacOS M-series or other ARM-based systems, add
--namespace ''to the above script. By default, the evaluation script pulls images (built for Linux) from DockerHub. Adding--namespace ''will cause evaluation images to be built locally instead.
💽 Usage
Evaluate patch predictions with the following command:
swebench eval verified -p <path_to_predictions> --run-id <run_id> -j <num_workers>
DATASET accepts an alias (full, verified, multimodal, multilingual), a
HuggingFace id, or a local path. Anything else is passed through as given, so
SWE-bench/SWE-bench_Lite works too:
swebench eval verified --gold # reference patches
swebench eval multimodal --gold -i carbon-design-system__carbon-10188
swebench report <run_id> -d verified # re-grade saved logs, no containers
Other commands:
swebench images build verified -j 8 # build/pull images ahead of time
swebench images check multilingual # verify images exist on the registry
swebench images clean --run-id <run_id> # remove leftover containers
swebench --help # all commands
[!NOTE] The previous
python -m swebench.harness.run_evaluation ...form still works and takes the same arguments as before.
This command will generate docker build logs (logs/build_images) and evaluation logs (logs/run_evaluation) in the current directory.
The final evaluation results will be stored in the evaluation_results directory.
[!NOTE] Result Caching: The evaluation harness caches results by
run_idandinstance_idonly. If you run the same instance with the samerun_idmultiple times, even with different prediction diffs, the harness will reuse the cached results from the first run and will not re-evaluate. To re-evaluate an instance with a different prediction diff, you must use a differentrun_id.
[!WARNING] SWE-bench evaluation can be resource intensive We recommend running on an
x86_64machine with at least 120GB of free storage, 16GB of RAM, and 8 CPU cores. We recommend using fewer thanmin(0.75 * os.cpu_count(), 24)for--max_workers.If running with Docker desktop, make sure to increase your virtual disk space to ~120 free GB. Set max_workers to be consistent with the above for the CPUs available to Docker.
Support for
arm64machines is experimental.
To see the full list of arguments for the evaluation harness, run:
swebench eval --help
See the evaluation tutorial for the full rundown on datasets you can evaluate. If you’re looking for non-local, cloud based evaluations, check out…
- sb-cli, our tool for running evaluations automatically on AWS, or…
- Running SWE-bench evaluation on Modal. Details here
Additionally, you can also:
- Train your own models on our pre-processed datasets. (🆕 Check out SWE-smith, a dedicated toolkit for creating SWE training data.)
- Run inference on existing models (both local and API models). The inference step is where you give the model a repo + issue and have it generate a fix.
- Run SWE-bench’s data collection procedure (tutorial) on your own repositories, to make new SWE-Bench tasks.
- ⚠️ We are temporarily pausing support for queries around creating SWE-bench instances. Please see the note in the tutorial.
⬇️ Downloads
💫 Contributions
We would love to hear from the broader NLP, Machine Learning, and Software Engineering research communities, and we welcome any contributions, pull requests, or issues! To do so, please either file a new pull request or issue and fill in the corresponding templates accordingly. We’ll be sure to follow up shortly!
Contact person: Carlos E. Jimenez and John Yang (Email: carlosej@princeton.edu, johnby@stanford.edu).
✍️ Citation & license
MIT license. Check LICENSE.md.
If you find our work helpful, please use the following citations.
For SWE-bench (Verified):
@inproceedings{
jimenez2024swebench,
title={{SWE}-bench: Can Language Models Resolve Real-world Github Issues?},
author={Carlos E Jimenez and John Yang and Alexander Wettig and Shunyu Yao and Kexin Pei and Ofir Press and Karthik R Narasimhan},
booktitle={The Twelfth International Conference on Learning Representations},
year={2024},
url={https://openreview.net/forum?id=VTF8yNQM66}
}
For SWE-bench Multimodal
@inproceedings{
yang2024swebenchmultimodal,
title={{SWE}-bench Multimodal: Do AI Systems Generalize to Visual Software Domains?},
author={John Yang and Carlos E. Jimenez and Alex L. Zhang and Kilian Lieret and Joyce Yang and Xindi Wu and Ori Press and Niklas Muennighoff and Gabriel Synnaeve and Karthik R. Narasimhan and Diyi Yang and Sida I. Wang and Ofir Press},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=riTiq3i21b}
}
For SWE-bench Multilingual
@misc{yang2025swesmith,
title={SWE-smith: Scaling Data for Software Engineering Agents},
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},
year={2025},
eprint={2504.21798},
archivePrefix={arXiv},
primaryClass={cs.SE},
url={https://arxiv.org/abs/2504.21798},
}