IN THIS BREAKDOWN · 10 SECTIONS
You can read 19% of this breakdown.
The paper in one minute
Open-weight coding agents lag behind proprietary ones, and the authors name two reasons: too few executable training environments, and weak ways to spend extra compute at test time.
For the first, they introduce SWE-GEN. Instead of starting from GitHub issues, which most commits do not have, they start from commits. Commits are filtered for small, focused fixes (at most five non-test files, 100 edited lines, 2,000 characters of patch). A Docker environment is built for each historical commit by searching dependency versions until one installs. Tests that fail before the commit and pass after (Fail-to-Pass tests) are taken from the commit or generated. Finally, a model writes an issue from the commit message, the patch and the failing test output, a step called back-translation. The result, R2E-Gym, has 8,135 tasks; 4,578 come from repositories outside SWE-bench and are used for training.
Fine-tuning Qwen-2.5-Coder on 3,321 successful trajectories from Claude 3.5 Sonnet, collected in these environments, gives a 32B agent that solves 34.4% of SWE-bench Verified on one attempt.
For the second, they sample 26 patches per problem and compare two ways to choose. Execution-based verifiers run tests: a trained testing agent writes reproduction tests and regression tests filter breakage. Execution-free verifiers are a judge model that reads the issue, the agent's trajectory and the patch and outputs a probability of YES. Each plateaus near 43%. A hybrid, which keeps the judge's top candidates and ranks them by test results, reaches 51.0%.
Research notes: the problem, approach and results
SWE-bench Verified choosing one of 26 patches with the hybrid verifier; tests alone 43.7%, judge alone 42.8%
pass@1 of a fine-tuned 32B agent, SWE-Gym data versus R2E-Gym data, same base model
the judge's result when shown only the final patch, down from 42.8% with the agent's full trajectory
Training open coding agents needs many executable tasks, and the usual source, GitHub issues with human-written tests, is limited: most commits have no issue. Then, at test time, sampling many patches only helps if you can tell which one is right, and both test-based and model-based selectors have failure modes nobody had compared side by side.
Build tasks from commits: filter for small fixes, build a Docker environment for each, collect or generate tests that fail before and pass after, and back-translate an issue from the failing test output. For selection, combine a testing agent's generated tests (plus regression tests) with a judge model that reads the agent's trajectory: shortlist with the judge, decide with tests.
The data trained a 32B agent to 34.4% on SWE-bench Verified, against 20.6% with SWE-Gym's data. Picking one of 26 patches, tests alone reached 43.7% and the judge alone 42.8%; the hybrid reached 51.0%, out of 64.4% possible.
Why it matters to an FDE
Two lessons apply well beyond SWE-bench.
You can build evaluation tasks from a customer's history. Any team with version control has thousands of small fixes and almost no tidy bug reports. R2E-Gym's recipe turns commits into tasks with a runnable environment, a test that defines success and a written problem statement. For a pilot, that means an evaluation set from the customer's own codebase instead of a public benchmark that may not resemble it.
Neither tests nor judges are enough on their own. Generated tests mostly fail to separate correct from incorrect patches: for most problems, under 20% of generated tests discriminate at all, and a few are "toxic", passing a wrong patch and failing the right one. A model judge discriminates better but leans on how confident the agent sounded; shown only the final patch, it dropped from 42.8% to 37.6%. Using the judge to shortlist and tests to decide gained more than seven points over either.
That pattern applies whenever you choose among several model outputs: support replies, SQL queries, extracted records. Use a cheap check that is reliable when it fires and a model judge for ranking, and do not let the judge read the agent's self-assessment if you can avoid it.
Know the data's lineage before calling the result open: the training trajectories came from Claude 3.5 Sonnet.
Understand the mechanism. Try it on a real problem.
Unlock this breakdown and 149 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
- ▦2 results tables
- ?5 interview questions with answers
- 03Key takeaways
How tasks are built, how the agent was trained, why each verifier fails, and three misreadings
Free account - 04How it works
The SWE-GEN pipeline, the training setup, the three verifiers and the hybrid rule
Premium - 05The numbers that matter
Data scale, pass@1 by model size, verifier plateaus, test quality and the ablations
Premium - 06Try it yourself
Apply the paper's test metrics to a toy matrix, then simulate tests, a judge and the hybrid
Premium - 07Where it breaks
Distilled training data, best-of-26 comparisons, synthetic tests, unstated settings and slips
Premium - 08Using it on a deployment
Building an eval set from a customer's commits and a hybrid verifier for any multi-sample system
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
