FDEInterviews logo
ICLR 2024

SWE-bench: Can Language Models Resolve Real-World GitHub Issues?

The benchmark that moved coding evaluation from toy functions to real repositories: 2,294 GitHub issues, each graded by the project's own tests. In 2023 the best model fixed under 2%.

Breakdown by FDE Interviews · 12 min read · Updated

About the original · 2023
AUTHORS
Jimenez, Yang, Wettig, Yao, Pei, Press, Narasimhan
FROM
Princeton University, University of Chicago
PUBLISHED
Oct 2023 · ICLR 2024
CITED BY
4,403Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 21% of this breakdown.

01

The paper in one minute

By 2023, coding benchmarks were close to saturated. HumanEval asks a model to write one short function from a docstring, and frontier models passed most of it. Real software work is different: find the relevant code in a large repository, understand how pieces interact, change several places at once, and not break anything.

SWE-bench, from Princeton (Carlos Jimenez, John Yang, Ofir Press, Karthik Narasimhan and colleagues), builds evaluation tasks from that kind of work. The authors scraped about 90,000 pull requests from 12 popular Python projects, including Django, scikit-learn, sympy, matplotlib and Sphinx. They kept merged pull requests that resolve a GitHub issue and add or change tests, then ran each candidate: at least one test had to go from failing before the fix to passing after it, and the project had to install and run cleanly. That left 2,294 tasks.

A model receives the issue text and the repository at the commit before the fix, and must produce a patch. The patch is applied and the project's tests run. The task counts as resolved only if the patch applies, the tests the human fix made pass now pass (fail-to-pass), and the existing tests that passed before still pass (pass-to-pass).

The results were humbling. Using BM25 to retrieve likely relevant files, Claude 2 resolved 1.96% of tasks. Even when given exactly the files the human fix edited, it resolved 4.8%. A later version of the paper added Claude 3 Opus at 3.79%. Models often produced valid diffs that did not fix anything, struggled to locate the code to change, and did worse as more code was put in their context.

THE IDEA, VISUALLY
FROM GITHUB HISTORY TO A BENCHMARK ~90,000 pull requests 12 popular Python repositories resolves an issue + adds tests attribute filter a test flips fail → pass, installs execution filter 2,294 task instances issue + repo snapshot + tests A task is resolved only if the patch applies, the new fail-to-pass tests pass, and every pass-to-pass test (a median of 51 per task) still passes. WHAT MODELS MANAGED IN 2023–24 BM25 retrieval, full SWE-bench, Table 5 % resolved % of patches that applied Claude 3 Opus 3.79% / 47% Claude 2 1.97% / 43% GPT-4-turbo 1.31% / 27% SWE-Llama 13b 0.70% / 54% ChatGPT-3.5 0.17% / 26% Many patches applied cleanly; almost none fixed the issue. More context made it worse: Claude 2 fell from 1.96% at 13k tokens of retrieved files to 1.22% at 50k (Table 2).
SWE-bench turns merged pull requests into tasks graded by real tests. The first models tested could usually produce a valid diff, but almost never one that fixed the issue.
Research notes: the problem, approach and results
2,294

tasks from real issues and pull requests across 12 Python repositories

3.79%

resolved by the best model tested, Claude 3 Opus, with BM25 retrieval

438K

lines of non-test code in the average task's repository

THE PROBLEM

Coding benchmarks like HumanEval had become easy: short, self-contained functions that say little about whether a model can change a real codebase.

THE IDEA

Mine GitHub for merged pull requests that fix an issue and add tests. Give the model the issue and the repository; grade its patch with the tests the human fix made pass.

THE RESULT

2,294 tasks from 12 Python projects. With retrieved context, Claude 2 resolved 1.96% and Claude 3 Opus 3.79%. Models also got worse as more code was put in context.

02

Why it matters to an FDE

SWE-bench scores are now quoted in every coding-model and coding-agent announcement. Knowing what the number measures, and what it leaves out, is part of advising a customer on coding tools.

It is the template for a good task evaluation. Each task pairs a real request with a check written by someone who understood the fix: tests that must start passing and tests that must keep passing. You can build the same thing from a customer's own history: closed tickets with merged fixes and tests become an evaluation set for their codebase, which is more predictive than any public leaderboard.

Pass-to-pass tests catch the greedy fix. In the paper's example, a model changed the right function in Sphinx but made it behave as if a configuration setting were always on, instead of checking the setting. The new test passed; an existing test caught the regression. Customer evaluations need both kinds of test, or they reward fixes that break something else.

Localization is the hard part. Given the right files, models did much better than when they had to find them, and more context hurt. That points to the retrieval, search and navigation around a model, which is the integration work FDEs do, as the lever for coding agents on large customer codebases.

It is Python, open source and tested. A customer's monorepo in another language, with thin test coverage, may behave very differently from the leaderboard.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 49 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦3 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    How tasks are built and graded, the main findings, and the misreadings to avoid

    Free account
  2. 04How it works

    The collection pipeline, the evaluation harness, the retrieval baselines and SWE-Llama

    Premium
  3. 05The numbers that matter

    Every result in the paper, with what each one says about building coding agents

    Premium
  4. 06Try it yourself

    Build a miniature SWE-bench task and grade three patches the way the benchmark does

    Premium
  5. 07Where it breaks

    The benchmark's limits, including ones the community found after publication

    Premium
  6. 08Using it on a deployment

    Turning a customer's ticket history into a coding-agent evaluation

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →