GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
NeurIPS 2025

SWE-RL: Advancing LLM Reasoning via Reinforcement Learning on Open Software Evolution

Meta trained Llama 3.3 70B with RL on 273,000 merged pull requests, rewarding patches for looking like the real fix. 41.0% on SWE-bench Verified, after sampling 500 patches per issue.

Breakdown by FDE Interviews · 13 min read · Updated

About the original · 2025
AUTHORS
Wei, Duchenne, Copet, Carbonneaux, et al.
FROM
Meta AI, UIUC, Carnegie Mellon University
PUBLISHED
Feb 2025 · NeurIPS 2025
CITED BY
313Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 18% of this breakdown.

01

The paper in one minute

DeepSeek-R1 showed that reinforcement learning (RL) with simple rule-based rewards can improve reasoning on math and competition coding, where answers are easy to check. SWE-RL asks whether the same works for everyday software engineering, where checking a fix normally means running a project's tests in a working environment.

The authors avoid execution during training. From GitHub they collect pull requests that link an issue, describe a bug fix and change code files, and keep 273,000 as seeds. Each seed gives the model an issue, the complete contents of the changed files plus some related unchanged ones, and keeps the patch that was actually merged as the oracle. The model writes its reasoning and then search-and-replace edits. The reward is -1 if the output is malformed, and otherwise the sequence similarity between the predicted patch and the oracle patch, computed by Python's difflib.SequenceMatcher, a number from 0 to 1. Training uses GRPO, which compares the rewards of 16 attempts at the same problem.

The result, Llama3-SWE-RL-70B, solves 41.0% of SWE-bench Verified inside Agentless Mini, a simplified pipeline that finds the relevant files, samples many repairs, writes reproduction tests and reranks. Only the repair step was trained; the model also handles file localization and test writing it was never trained for. A supervised baseline built from the same seeds scored 36.2%.

The authors also report gains outside software issues (code reasoning, math), and argue RL generalizes where supervised fine-tuning narrows.

THE IDEA, VISUALLY
TRAINING: REWARD = HOW MUCH THE PATCH LOOKS MERGED 273k PR seeds issue + full files + merged patch Policy writes <think> reasoning search/replace edits Reward −1 if malformed, else SequenceMatcher(pred, merged) in [0, 1] GRPO: 32 problems x 16 rollouts per step, 1,600 steps, 16k context; 512 H100s for about 32 hours (16,384 GPU-hours). INFERENCE: AGENTLESS MINI localize files only repair 500 samples tests write + run rerank submit 1 Only the repair step was trained; localization and test writing come from the same model, untrained for them. SCALING THE SAMPLES (FIGURE 4) 20 samples 33.6 40 samples 35.6 80 samples 37.0 160 samples 40.0 320 samples 40.6 500 samples 41.0 axis starts at 30; 30 reproduction tests throughout REPAIR ONLY, CORRECT FILES GIVEN (TABLE 2) Llama-3.3-70B, greedy 5.4 + 20-sample majority vote 16.6 SFT baseline 29.6 RL, exact-match reward 29.0 SWE-RL 34.8 base model formats only 12.2% of edits correctly END TO END, SWE-BENCH VERIFIED (TABLE 1) Llama3-SWE-SFT-70B 36.2 Llama3-SWE-RL-70B 41.0 GPT-4o + Agentless 38.8 OUT OF DOMAIN, BASE → RL (TABLE 3) HumanEval+ 76.2 79.9 BigCodeBench-Hard (I / C) 28.4 / 29.1 same CRUXEval-O 61.9 75.5 MATH, strict format 63.2 73.7 MATH, lenient format 70.9 73.7 MMLU 86.49 86.82 Most of the MATH gain is answer format; MMLU's +0.33 is below the paper's own 0.8-point significance line.
SWE-RL turns a company's software history into reinforcement learning: issue in, patch out, scored by text similarity to the patch that was actually merged. The cheap reward works, but it scores resemblance, and the headline result also depends on generating and reranking hundreds of candidates.
Research notes: the problem, approach and results
41.0%

SWE-bench Verified with Agentless Mini, choosing one of 500 sampled patches per issue using 30 generated tests

29.6% → 34.8%

repair accuracy with the correct files given, supervised baseline versus RL, both greedy

16,384

H100 GPU-hours for one training run: 512 GPUs for about 32 hours

THE PROBLEM

RL with rule-based rewards made models better at math and competition coding, where an answer can be checked exactly or a program run cheaply. Real software fixes are hard to check: running a repository's tests needs a working environment per project, which is expensive to build at scale.

THE IDEA

Skip execution during training. Take merged pull requests with linked issues, give the model the issue and the full files, and reward its patch by how similar it is to the merged one (difflib's sequence ratio), with -1 for malformed output. Train with GRPO on 273,000 such seeds.

THE RESULT

With the correct files given, repair accuracy rose from 5.4% (base) and 29.6% (supervised baseline) to 34.8%. End to end, sampling 500 patches and reranking with generated tests, it solved 41.0% of SWE-bench Verified. Several out-of-domain benchmarks also improved, some by formatting more than reasoning.

02

Why it matters to an FDE

Many customers ask whether their own engineering history (years of tickets, pull requests and merged fixes) can make a coding model better at their codebase. SWE-RL is the clearest worked recipe for turning that history into training data without building an executable environment for every repository. It also shows the price of that shortcut.

The data is cheap; the reward is a proxy. Similarity to the merged patch rewards writing what the original developer wrote. A correct fix in a different style scores lower than a wrong fix that copies the oracle's shape. The authors list this limitation themselves.

The headline uses heavy sampling. 41.0% is pass@1 only in the sense that one patch is submitted; it was chosen from 500 samples with 30 generated tests per issue. At 20 samples the same model scored 33.6%. Budget for that inference if you copy the setup.

Training is not small. One run used 512 H100s for about 32 hours, 16,384 GPU-hours, on a 70B model.

Formatting is half the battle. The base model produced correctly formatted edits only 12.2% of the time. Some of the RL gain, and much of the out-of-domain math gain, is the model learning to follow output formats.

If a customer wants this, the practical version is smaller: a modest model, their own pull requests as seeds, an execution check wherever tests exist, and similarity only as a fallback.

THE FULL BREAKDOWN

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

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The data, the reward, the training setup, the results with their caveats, and three misreadings

    Free account
  2. 04How it works

    Seed curation, the prompt, the reward and GRPO, then the Agentless Mini pipeline

    Premium
  3. 05The numbers that matter

    Repair-only and end-to-end results, sample scaling, the reward ablation and out-of-domain tables

    Premium
  4. 06Try it yourself

    Re-read Table 3, compute the actual reward on correct and wrong patches, and see GRPO's advantages

    Premium
  5. 07Where it breaks

    The proxy reward, sampling-dependent headline, compute, uneven generalization claims and paper slips

    Premium
  6. 08Using it on a deployment

    Turning a customer's merged-PR history into training data responsibly, with execution where possible

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →