[Paper Review] SWE-bench: Can Language Models Resolve Real-World GitHub Issues?
SWE-bench is an execution-based benchmark of 2,294 real-world GitHub issues requiring repository-wide patches; state-of-the-art models resolve only the simplest tasks, with Claude 2 at 4.8% and GPT-4 at 1.7% under oracle retrieval, and even worse under BM25 context retrieval.
Language models have outpaced our ability to evaluate them effectively, but for their future development it is essential to study the frontier of their capabilities. We find real-world software engineering to be a rich, sustainable, and challenging testbed for evaluating the next generation of language models. To this end, we introduce SWE-bench, an evaluation framework consisting of $2,294$ software engineering problems drawn from real GitHub issues and corresponding pull requests across $12$ popular Python repositories. Given a codebase along with a description of an issue to be resolved, a language model is tasked with editing the codebase to address the issue. Resolving issues in SWE-bench frequently requires understanding and coordinating changes across multiple functions, classes, and even files simultaneously, calling for models to interact with execution environments, process extremely long contexts and perform complex reasoning that goes far beyond traditional code generation tasks. Our evaluations show that both state-of-the-art proprietary models and our fine-tuned model SWE-Llama can resolve only the simplest issues. The best-performing model, Claude 2, is able to solve a mere $1.96$% of the issues. Advances on SWE-bench represent steps towards LMs that are more practical, intelligent, and autonomous.
Motivation & Objective
- Evaluate the capability of large language models to edit real-world codebases to resolve GitHub issues by generating patch files.
- Provide a challenging, up-to-date benchmark with diverse, long-context code editing tasks across multiple Python repositories.
- Offer a reproducible evaluation framework with execution-based validation using existing test suites.
- Release training data and fine-tuned models to spur open development toward more autonomous code-editing LMs.
Proposed method
- Construct SWE-bench from 12 popular Python repositories by linking issues to merged PRs that modify tests and resolve issues.
- Filter down to 2,294 task instances via a 3-stage pipeline (repo scraping, attribute filtering, execution-based filtering).
- Represent tasks as issue text plus a codebase snapshot; models generate repository-wide patch files.
- Evaluate edits by applying patches and running repository tests; measure pass rate as the main metric.
- Explore retrieval strategies (BM25 sparse retrieval and oracle retrieval) to provide relevant context within long codebases.
- Fine-tune SWE-Llama 7b/13b with LoRA on 19,000 additional issue-PR pairs from 37 repos to create a competitive open-model baseline.

Experimental results
Research questions
- RQ1How capable are current LMs at resolving real-world software engineering issues by producing patches for large codebases?
- RQ2What is the impact of context retrieval strategy and patch-generation format on model performance?
- RQ3Can fine-tuning open models close the gap to proprietary models on repository-scale code edits?
- RQ4How does task difficulty, context length, and repository characteristics affect LM performance on SWE-bench?
Key findings
- Most state-of-the-art models fail to solve more than the simplest tasks; Claude 2 achieves 4.8% and GPT-4 1.7% under oracle retrieval.
- BM25-based retrieval further degrades performance (Claude 2 drops to 1.96%).
- Finetuned SWE-Llama models (7b/13b) show limited success and can be sensitive to context distribution shifts.
- Model edits tend to be shorter and simpler than gold patches, often editing fewer lines and files.
- Increasing context length can hurt performance due to difficulty localizing relevant edits within large contexts.
- Even when provided with oracle-retrieved context, models rarely generate correct, well-formatted patch files; about half of generated patches are shorter than gold and fewer edit multiple files.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.