atlas

Research map / Large language models / Agents, code and math

SWE-bench: Can Language Models Resolve Real-world Github Issues?

ICLR 2024 · Large language models › Agents, code and math · approach: Software engineering agents

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces SWE-bench, a benchmark of 2,294 real GitHub issue-PR tasks from 12 Python repos, and SWE-Llama, CodeLlama fine-tuned on repository-editing data, showing that top LMs resolve only a small fraction of issues.

Problem

Existing code benchmarks are self-contained and saturated, so they do not measure whether language models can resolve real-world software engineering issues that require multi-file, repository-scale edits.

Approach

Build an execution-validated benchmark from merged GitHub pull requests that resolve issues and add tests (fail-to-pass tests), so models must produce patches across large codebases; also release a training split and fine-tune CodeLlama-Python into SWE-Llama repository editors.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Collapse oracle-retrieved files to edited lines plus ±15 lines of buffer (ablation)GPT-4 · SWE-bench, oracle retrieval% Resolved: 1.3% -> 3.4%Helped
Collapse oracle-retrieved files to edited lines plus ±15 lines of buffer (ablation)Claude 2 · SWE-bench, oracle retrieval% Resolved: 4.8% -> 5.9%Helped
Use BM25 retrieval with larger maximum context limits (ablation)Claude 2 · SWE-bench% Resolved: 1.96 -> 1.87 -> 1.22Hurt
Use BM25 retrieval with larger maximum context limits (ablation)SWE-Llama 7b · SWE-bench% Resolved: 0.70 -> 0.31 -> 0.00Hurt
Use BM25 retrieval with larger maximum context limits (ablation)SWE-Llama 13b · SWE-bench% Resolved: 0.70 -> 0.48 -> 0.00Hurt
Use oracle retrieval instead of BM25 retrievalClaude 2 · SWE-bench% Resolved: 1.96% -> 4.8%Helped
Regenerate entire files rather than generate patch files (ablation)Claude 2 · SWE-bench, oracle retrieval% Resolved: 4.8% -> 2.2%Hurt
Use whole-file generation rather than patches on the shorter half of tasks (ablation)Claude 2 · SWE-bench, oracle retrieval, shorter half by input tokens% Resolved: 7.8% -> 3.9%Hurt
Increase BM25 maximum context length (ablation)Models using BM25 retrieval · SWE-bench% ResolvedHurt
Fine-tune using oracle-file context, then evaluate with BM25 contextSWE-Llama · SWE-bench% ResolvedHurt
Use more context files that are not expected to be editedSWE-Llama · SWE-bench with BM25 context% ResolvedHurt

Surprising findings

Limitations

Experimental setup

Datasets: SWE-bench SWE-bench-train

Benchmarks: SWE-bench SWE-bench Lite

Metrics: % resolved % apply

Baselines: Claude 2 ChatGPT-3.5 GPT-4 Claude 3 Opus GPT-4-turbo SWE-Llama 7b SWE-Llama 13b

Builds on: CodeLlama LoRA BM25 HumanEval

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy