Curated summary
Claude SWE-Bench performance
The upgraded Claude 3.5 Sonnet scored 49% on SWE-bench Verified, beating the previous state-of-the-art of 45%. The authors achieved this with a deliberately minimal agent: one prompt and two general-purpose tools, with as much control as possible left to the model. They argue that tool design and scaffolding matter as much as the model itself, since SWE-bench measures the whole agent rather than the model alone.
Measuring Agents with SWE-bench
- SWE-bench tests whether a model can resolve real GitHub issues from popular open-source Python repositories. The model receives a configured environment and a checkout of the repository from just before the fix, then must understand, modify, and test the code.
- Solutions are graded against the unit tests from the pull request that originally closed the issue.
- The benchmark is attractive for several reasons: it uses real engineering tasks rather than competition-style questions, it is not saturated (no model had crossed 50% on SWE-bench Verified), and it evaluates a full agent, so open-source developers can improve scores by optimizing scaffolding around the same model.
- The authors use SWE-bench Verified, a 500-task subset that humans reviewed to remove tasks that cannot be solved from the issue text alone, such as those requiring specific error messages not stated in the issue.
A Minimal Tool-Using Agent
- The agent consists of a prompt, a Bash tool for running shell commands, and an edit tool for viewing, creating, and editing files and directories.
- The model is sampled repeatedly until it decides it is finished or exceeds its 200k-token context window. There are no hardcoded workflow stages.
- The prompt suggests an approach (explore the repo, write a reproduction script, edit the source, rerun, consider edge cases) without being overly long or prescriptive. The authors note that explicitly encouraging long responses can help when token cost is not a concern.
Tool Design and Error-Proofing
- Tool descriptions were tested and revised to预empt misunderstandings. For example, the Bash tool description specifies that commands need not be XML-escaped, that there is no internet access, and how to run long-lived commands in the background.
- The edit tool requires absolute paths. This prevents errors when the agent has moved away from the repository root.
- Of the edit strategies tested, exact string replacement was the most reliable. The model specifies
old_strandnew_str, and the replacement happens only ifold_strmatches exactly once. Otherwise, the model receives an error and can retry. - The edit tool also supports
view(with optional line ranges),create,insert, andundo_edit.
Results
| Model | SWE-bench Verified |
|---|---|
| Claude 3.5 Sonnet (new) | 49% |
| Previous SOTA | 45% |
| Claude 3.5 Sonnet (old) | 33% |
| Claude 3 Opus | 22% |
- All models were run with the same agent scaffold.
- Compared with older models, the upgraded Claude 3.5 Sonnet self-corrects more often and tries several different solutions instead of repeating the same mistake.
Example Agent Trajectory
- The example is a scikit-learn issue in which
RidgeClassifierCVrejects astore_cv_valuesargument, even though its attributes depend on that parameter. - The model first viewed the repository structure, then wrote and ran a script that reproduced the
TypeError. - It then identified that the subclass constructor did not forward
store_cv_valuesto the base class, edited the constructor to accept and pass the parameter, and reran the script. - The task was solved in 12 steps. Other tasks took over 100 turns, and some runs ran out of context.
Challenges in Running SWE-bench
- Cost and duration: Successful runs sometimes took hundreds of turns and more than 100k tokens. The model is persistent, which is effective but expensive.
- Grading errors: Some apparent failures were caused by environment setup issues or install patches applied twice, not by the model.
- Hidden tests: The model cannot see the grading tests, so it may believe it succeeded when it has not. Some solutions were applied at the wrong level of abstraction, such as a bandage rather than a deeper refactor. Others were correct but did not match the original unit tests.
- Multimodal limits: The agent could not view image files saved to disk or referenced by URL, which made Matplotlib tasks especially hard and led to hallucinations. The authors identify this as an opportunity for improvement.
The post closes by noting that developers building with the upgraded model will likely find better ways to improve SWE-bench scores than those demonstrated here.
Related reading
Continue with another curated summary.