TL;DR
This paper introduces a method to teach autonomous coding agents three critical behaviors: exploring diverse code locations, varying repair strategies, and reliably verifying their own fixes. By combining weighted supervised fine-tuning (SFT) with a reinforcement learning (RL) objective that uses mutation testing to train the agent's verifier, the authors significantly boost performance on SWE-bench, raising pass@1 from 31.9% to 43.0% and pass@8 from 46.7% to 60.7%.
What Problem Does This Paper Address?
Building autonomous agents that can fix real-world software bugs is hard. Current agents often fall into three traps:
- Fixation: They keep trying to edit the same (wrong) location repeatedly.
- Narrowness: They use a single problem-solving approach, missing fixes that require a different perspective.
- Verification Bias: When an agent writes a test to check its own patch, it often writes a "weak" test that passes even if the patch is incorrect.
Simply throwing more compute at the problem (e.g., generating more samples) doesn't help if the agent can't explore new areas or distinguish a correct patch from a subtly broken one. The authors argue these are teachable behaviors, not just byproducts of scaling up models.
Methods
The authors propose a two-stage training pipeline built on top of a diagnostic study:
- Differential Verification Search: At test-time, they use a search procedure that pairs different code locations with various repair approaches. Crucially, it uses "differential verification": running the agent's reproduction test on both the patched code and the original (reverted) code. A valid test must fail on the reverted tree; if it passes both, it's not actually exercising the bug.
- Weighted Supervised Fine-Tuning (SFT): The agent is trained on successful trajectories from the search phase. These examples are weighted based on the quality of the repair, how "novel" the exploration was (e.g., finding a unique location), and how efficient the agent was (fewer steps).
- Reinforcement Learning (RL) for Verification: To fix the "weak test" problem, they use RL with a mutation-based reward. A harness generates "mutants"—subtly incorrect variants of a patch. The agent is rewarded for writing tests that "kill" (detect) these mutants while still passing the correct patch. They use Group Relative Policy Optimization (GRPO) to allocate credit to specific assertions within the test that successfully catch bugs.
Datasets
- SWE-bench Verified: The primary dataset for training (230 issues) and evaluation (270 held-out issues). It consists of real-world GitHub issues with human-verified unit tests.
- Transfer Benchmarks: To test how well the learned behaviors generalize, the authors evaluated on SWE-bench Pro, SWE-PolyBench, and DeepSWE. These represent out-of-distribution tasks that the agent never saw during training.
Key Insights and Ideas
- Reliability is a Teachable Skill: Instead of relying on massive model scale, specific agentic behaviors like "look elsewhere if this fails" and "write tests that try to break your code" can be explicitly trained.
- The Verifier is the Gatekeeper: Improving the agent's ability to judge its own work is just as important as improving its ability to write code. The RL stage specifically targets "false acceptance"—where an agent wrongly thinks it has fixed a bug.
- Mutation as a Dense Signal: Real-world bugs are sparse. By generating synthetic "mutants," the authors create a dense training signal that teaches the agent exactly what kind of assertions are needed to catch specific types of logic errors.
- Exploration vs. Selection: The paper neatly separates these two concepts. "Coverage" (finding at least one correct repair in $N$ attempts) is driven by exploration, while "Selection Quality" (picking the right one) is driven by verification. Both must improve for the agent to be reliable.
Key Results
The combined approach yielded significant improvements across the board:
- Resolution Rate: On the held-out SWE-bench Verified set, the full SFT+RL pipeline increased pass@1 from 31.9% to 43.0% and pass@8 from 46.7% to 60.7%.
- Verifier Precision: The RL stage lifted verifier precision from 26.8% to 41.7% and more than halved the rate of false acceptances.
- Efficiency: Their search procedure resolved 52.8% of issues using only 48.1% of the agent-steps required by a standard eight-sample baseline.
- Generalization: The gains were not limited to the training set; pass@1 rose from 15.7% to 20.2% on SWE-bench Pro and from 24.2% to 31.8% on SWE-PolyBench.
Limitations and Future Work
- Sensitivity to Error Source: While the verifier improved significantly, it is still more effective at catching "familiar" mutants (those similar to its training) than "natural" incorrect repairs generated by other independent systems.
- DeepSWE Challenge: Even with these improvements, full resolution on the DeepSWE benchmark remained at zero for these model scales (up to 30B parameters), though partial progress measures did increase.
- Integration into Search: The authors suggest that future work could involve "folding the verifier into the search loop" so that it steers exploration in real-time rather than just filtering candidates at the end.
- Negative Distribution: Expanding the variety of incorrect repairs used during training is seen as a key path to even more robust verification.
Summary updated