# SWE-bench (2023)

> 2,294 GitHub issues from 12 Python projects; a fix counts only if the project's tests pass.

Page: https://mralbu.github.io/ai-datasets/d/swe-bench

## Key facts

- Category: LLMs
- Task: Fix real GitHub issues in real Python repositories
- Creators: Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan (Princeton)
- Size: 2,294 test tasks (plus 19k for training)
- Splits: test 2,294, dev 225, train 19,008
- Input: An issue description and the repository at the commit before the fix
- Labels: The developers' patch, and tests that must go from failing to passing
- License: MIT
- Paper: [SWE-bench: Can Language Models Resolve Real-World GitHub Issues?](https://arxiv.org/abs/2310.06770)
- Homepage: https://www.swebench.com/
- Hugging Face: [princeton-nlp/SWE-bench](https://huggingface.co/datasets/princeton-nlp/SWE-bench)
- Sampled at Hub revision e48e2bd1e9fecd5bbd641e9414ac59da9f2e69f6 (2026-11-07)

## Why it matters

HumanEval asks for one self-contained function. SWE-bench puts the model in a real codebase (Django, sympy, scikit-learn, matplotlib and others) and asks for a patch that fixes a reported bug. At release, the best model solved under 2%. Agent tools that browse files, run tests and edit code drove scores up quickly, and its human-checked subset, SWE-bench Verified, became the headline number for coding agents.

## Worth knowing

- Grading runs two groups of tests. FAIL_TO_PASS tests must start passing, and PASS_TO_PASS tests must keep passing.
- Django alone accounts for more than a third of the tasks.
- The test patch is hidden from the model. It sees only the issue text and the code.
- Reviewers for SWE-bench Verified (2024) found many original tasks underspecified or with tests that reject valid fixes, and kept 500 that were fair.

## Get the data

```bash
# pip install -U huggingface_hub
hf download princeton-nlp/SWE-bench --repo-type dataset \
  --local-dir swe-bench
```

```python
from datasets import load_dataset   # pip install datasets

ds = load_dataset("princeton-nlp/SWE-bench")
print(ds)
```

```python
import polars as pl

df = pl.read_parquet("hf://datasets/princeton-nlp/SWE-bench@~parquet/default/test/*.parquet")
print(df.shape)
```

## Related datasets

- [HumanEval](https://huggingface.co/datasets/openai/openai_humaneval): 2021, single-function problems (on this site: https://mralbu.github.io/ai-datasets/d/humaneval)
- [SWE-bench Lite](https://huggingface.co/datasets/princeton-nlp/SWE-bench_Lite): 2024, a cheaper 300-task subset
- [SWE-bench Verified](https://huggingface.co/datasets/princeton-nlp/SWE-bench_Verified): 2024, 500 human-validated tasks
- [SWE-bench Pro](https://huggingface.co/datasets/ScaleAI/SWE-bench_Pro): 2025, long-horizon, multi-language, contamination-resistant (on this site: https://mralbu.github.io/ai-datasets/d/swe-bench-pro)
- [Terminal-Bench](https://huggingface.co/datasets/ia03/terminal-bench): 2025, agent tasks in a real terminal (on this site: https://mralbu.github.io/ai-datasets/d/terminal-bench)

## Landmark papers

- [SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering](https://arxiv.org/abs/2405.15793) (2024)
- [Introducing SWE-bench Verified](https://openai.com/index/introducing-swe-bench-verified/) (2024)

## Papers on this site that use it

- [SWE-bench (2023)](https://mralbu.github.io/ai-datasets/p/swe-bench.md): Turned 2,294 real GitHub issues into tasks where a model must patch the repository so that the project's own tests pass.
- [Agentless (2024)](https://mralbu.github.io/ai-datasets/p/agentless.md): A fixed three-step pipeline, with no agent deciding what to do next, that fixed more GitHub issues than open-source agents at a fraction of the cost.
- [SWE-agent (2024)](https://mralbu.github.io/ai-datasets/p/swe-agent.md): An agent that fixes GitHub issues by navigating, editing and testing a repository through commands designed for language models rather than people.
- [DeepSeek-R1 (2025)](https://mralbu.github.io/ai-datasets/p/deepseek-r1.md): Reasoning learned through reinforcement learning on checkable answers, released with open weights.
- [SWE-bench Pro (2025)](https://mralbu.github.io/ai-datasets/p/swe-bench-pro.md): A harder SWE-bench built from copyleft and private codebases, with multi-file changes that take a professional hours or days.
- [SWE-RL (2025)](https://mralbu.github.io/ai-datasets/p/swe-rl.md): Trained an open model to fix GitHub issues with reinforcement learning on public pull requests, rewarding patches by how closely they match the real fix.
