AI
New Method Makes AI Code Agents Easier to Train Without Expensive Test Infrastructure
Researchers introduce R4P, a reasoning-based approach that evaluates code changes directly rather than running tests, opening the door to training software engineering agents at scale.
Training language model agents to write and fix code has become more practical in recent years, but a major bottleneck persists: existing methods rely heavily on comprehensive test suites to evaluate whether an agent's changes actually work. This requirement limits how far the technology can scale on real-world codebases, where high-quality tests are scarce and setting up sandboxes to run them is complex and error-prone.
A New Approach to Reasoning About Code#
To tackle this problem, researchers have developed R4P, a method that judges whether code changes are correct through reasoning rather than execution. Instead of running tests, R4P compares multiple candidate patches against each other—analyzing how one change differs from another—and assigns rewards based on that comparative reasoning. This approach works independently of which specific agent trajectory produced the patches and doesn't require any test infrastructure.
When evaluated on patches from SWE-bench, a standard benchmark, R4P achieved 72.2% accuracy at verifying whether patches were valid, matching the performance of proprietary code-checking models.
Practical Impact at Scale#
To demonstrate that R4P delivers real benefits beyond the lab, the team built Mini-SE, a fully trainable software engineering agent that uses pure reinforcement learning supervised by R4P—no test execution needed. Mini-SE improved on the baseline Qwen3-32B model by 10.0 percentage points (reaching 26.2% Pass@1), and further refinements during inference brought that to 32.8%, suggesting the approach remains stable as demands scale up.
The consistent scaling curves indicate that while R4P judgments are imperfect, they remain reliable enough to guide and improve real-world agent training and deployment.
Why It Matters#
By decoupling code supervision from expensive test suites and sandboxes, R4P removes a significant friction point in scaling AI-assisted software engineering. This could enable faster iteration and broader application of language model agents across codebases that lack mature testing infrastructure.

