Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

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

  • Problem Existing coding benchmarks mostly test self-contained snippets, while real issues often need coordinated edits across a repository.
  • Method The authors build SWE-bench from merged GitHub pull requests that include test changes, score patches by running the repository's tests, and fine-tune CodeLlama-Python models with LoRA on gold patches.
  • Results Claude 2 with BM25 retrieval resolves 1.96% of task instances at a 13k context limit.

Figure 1: SWE-bench sources task instances from real-world Python repositories by connecting
GitHub issues to merged pull request solutions that resolve relate…

Figure 1 : SWE-bench sources task instances from real-world Python repositories by connecting GitHub issues to merged pull request solutions that resolve related tests. Provided with the issue text and a codebase snapshot, models generate a patch that is evaluated against real tests.

Original paper · CC BY 4.0 · Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan · SWE-bench: Can Language Models Resolve Real-World GitHub Issues? · Original paper figure · Extracted the figure area from page 1 of the original PDF.

Why repository-scale issues test more than snippets

HumanEval and similar coding benchmarks mostly ask for self-contained functions that fit in a few lines of code. Real maintenance work looks different: a developer has to locate the right spot in a large repository, trace how functions in different files interact, and spot a small mistake inside tangled code. SWE-bench turns that setting into a test.

A model receives an issue and a codebase, edits the codebase, and the change counts only if the repository's tests pass.

Current systems do poorly under this setup. Claude 2 with BM25 retrieval resolves 1.96% of the issues, and the authors find that models solve only the simplest ones.

How task instances are mined and filtered

The attribute filter keeps merged pull requests that resolve a GitHub issue and also change test files, which suggests the contributor wrote tests for the fix. The execution filter applies each candidate's test changes before and after the rest of the pull request. It keeps instances that contain at least one fail-to-pass test and drops those that fail during installation or runtime.

After all filters, 2,294 task instances remain from the original 90,000 pull requests.

Because the collection steps need little manual work, the same procedure can be applied to new issues as they appear. This lets the benchmark test a model on issues created after its training data was gathered, which makes it less likely that the reference solution was already in the training corpus.

Scoring a patch by running tests

The model returns a patch file that names the lines to change in the codebase. The benchmark is designed so that this edit, rather than a free-form answer, is what gets judged. The evaluator applies the patch with the unix patch program and then runs the unit and system tests linked to the instance. An instance counts as resolved only when the patch applies and every linked test passes.

The headline metric is % Resolved, the percentage of task instances that end up resolved.

Reference edits are not small. On average they touch 1.7 files, 3.0 functions and 32.8 lines, spread over the codebase rather than one function.

Adapting CodeLlama with LoRA

CodeLlama models are among the few open models able to take the very long contexts that repository editing requires. Off-the-shelf CodeLlama variants, however, often answer with placeholder text or with code unrelated to the issue when asked for repository-wide edits.

To train on this task, the authors collected 19,000 issue-PR pairs from 37 further Python repositories. Unlike the benchmark pipeline, these pairs did not require pull requests to contribute test changes. The training repositories are disjoint from the evaluation repositories, which guards against contamination of the benchmark.

Each training prompt holds the instructions, the issue text and the relevant code files, and the target is the gold patch that resolved the issue. Only the attention sublayer weights are updated, through LoRA, and training sequences longer than 30,000 tokens are dropped, which leaves about 10,000 instances.

Choosing which files the model sees

Codebases average 438K lines, far more than any context window, so each model receives only part of the repository. Under BM25, files are ranked against the issue text and added until a maximum context limit is reached.

Dense retrieval is set aside because the queries and keys become very long, and natural language queries over code are an unusual setting for it. BM25 is applied at three context limits, and each model is reported at the limit where it performs best. Models perform best at the shortest context window tested.

The oracle setting gives the model the files that the reference patch edits. It is an analysis tool, not a realistic option, because an engineer may not know beforehand which files need to change. Even the edited files may leave out context needed to see how the changed code interacts with the rest of the program.

At a 27,000-token limit, BM25 retrieves a superset of the oracle files in about 40% of instances. In almost half of the instances at that limit, it retrieves none of the oracle files. Average BM25 recall against the oracle files rises from 29.58 at 13k to 44.41 at 27k and 51.06 at 50k.

Resolve rates across models

Across the full benchmark, Claude 3 Opus reaches a % Resolved of 3.79 and Claude 2 reaches 1.97. GPT-4-turbo reaches 1.31 and ChatGPT-3.5 reaches 0.17. SWE-Llama 7b and 13b each reach 0.70. On the 300-instance SWE-bench Lite subset, Claude 3 Opus reaches 4.33 and Claude 2 reaches 3.00, while SWE-Llama 7b reaches 1.33.

The authors describe SWE-Llama 13b as competitive with Claude 2 in some settings, and its Table 4 window covers at least 100,000 tokens for 94.8% of instances.

Limits of the current evidence

Oracle retrieval uses information a developer would not have in advance, so its scores describe an upper reference rather than a deployable system. The retrieval comparison covers only BM25 at three context limits, and the training data excludes sequences longer than 30,000 tokens. The full benchmark spans 12 repositories and the Lite subset spans 11, so results cover only those Python projects.

Paper info

Authors
Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan
Venue
arXiv · Preprint
First published
2023-10-10
Added
2026-10-20
Updated
2024-11-11
Version
v3
arXiv
2310.06770
Category
cs.CL · cs.AI · cs.SE
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Abstract

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.

Quote from the paper

Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, Karthik Narasimhan (2023). SWE-bench: Can Language Models Resolve Real-World GitHub Issues?. arXiv:2310.06770v3. https://arxiv.org/abs/2310.06770v3

BibTeX
@misc{jimenez2023bench,
  title = {{SWE-bench: Can Language Models Resolve Real-World GitHub Issues?}},
  author = {Carlos E. Jimenez and John Yang and Alexander Wettig and Shunyu Yao and Kexin Pei and Ofir Press and Karthik Narasimhan},
  year = {2023},
  eprint = {2310.06770},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.06770v3}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up