AI
New ML Framework Tackles Bug-Fixing with Dual Reward System and Line-Level Credit Assignment
BoostAPR uses reinforcement learning with dual reward models to improve automated program repair, achieving significant gains on multiple benchmarks while transferring across programming languages.
Researchers have introduced a framework designed to overcome a fundamental limitation in using reinforcement learning for automatic code repair: pinpointing which specific edits actually resolve bugs when only sparse execution feedback is available.
The Core Problem#
Traditional approaches to automating program repair struggle with two interconnected issues: they receive limited signals about whether code changes work correctly during training, and the rewards they do get operate at too coarse a level. When a repair succeeds, it's unclear which individual lines or edits made the difference, making it difficult for machine learning models to learn effectively.
BoostAPR's Three-Stage Solution#
The new system, called BoostAPR, addresses this through a three-phase training process. First, it performs supervised learning using code examples where repairs have been verified to work, complete with reasoning traces that explain the repair logic. This grounds the model in realistic problem-solving patterns.
Next, the framework trains two complementary reward models—one that evaluates success at the sequence level (does the full code fix pass tests?), and another operating at finer granularity (which specific lines contributed most to the fix?). This line-level credit allocator works at an intermediate scale naturally suited to how code changes actually work, rather than treating edits as an undifferentiated stream.
The final stage uses these signals to optimize the model via PPO (Proximal Policy Optimization), with the line-level reward model explicitly steering learning toward the most impactful edits.
Benchmark Results and Generalization#
When trained on SWE-Gym, the framework achieved notable gains across diverse testing scenarios: 40.7% success on SWE-bench Verified (a 22.9 percentage point improvement over the base model), 24.8% on Defects4J, 84.5% on HumanEval-Java, and 95.0% on QuixBugs. A particularly striking finding was its ability to transfer across languages—the model trained primarily on one language context showed competitive performance when applied to Java code repair tasks.
The results position BoostAPR as a competitive approach among open-source models for automated repair, with especially strong cross-language generalization capabilities.

