IN THIS BREAKDOWN · 10 SECTIONS
You can read 21% of this breakdown.
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.
Research notes: the problem, approach and results
tasks from real issues and pull requests across 12 Python repositories
resolved by the best model tested, Claude 3 Opus, with BM25 retrieval
lines of non-test code in the average task's repository
Coding benchmarks like HumanEval had become easy: short, self-contained functions that say little about whether a model can change a real codebase.
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.
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.
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.
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
- ◇1 architecture diagram
- </>1 runnable code experiment
- ▦3 results tables
- ?5 interview questions with answers
- 03Key takeaways
How tasks are built and graded, the main findings, and the misreadings to avoid
Free account - 04How it works
The collection pipeline, the evaluation harness, the retrieval baselines and SWE-Llama
Premium - 05The numbers that matter
Every result in the paper, with what each one says about building coding agents
Premium - 06Try it yourself
Build a miniature SWE-bench task and grade three patches the way the benchmark does
Premium - 07Where it breaks
The benchmark's limits, including ones the community found after publication
Premium - 08Using it on a deployment
Turning a customer's ticket history into a coding-agent evaluation
Premium - 09Interview angles
Five questions this paper prepares you for, with answer hints
Premium - 10Read next
Where to go from here on this site
Premium
