Agentic AI
RL training helps AI coding agents overcome last-mile bugs and master new benchmarks
Reinforcement learning on hand-built coding tasks teaches a large language model to avoid common failures and generalize to unseen evaluation sets.
When AI coding agents build software features, they often stumble at the finish line—dropping a requirement, testing only cases they already handle, breaking existing behavior, or relying on unchecked assumptions. A new study investigates whether reinforcement learning can close that gap and whether the learned behaviors transfer beyond the training distribution.
The experiment#
Researchers post-trained Kimi K2.7 Code, a 32-billion-parameter open-weight mixture-of-experts model, using reinforcement learning on 1,700 hand-crafted agentic coding tasks. The training set comprised 1,000 repository tasks graded by hidden test suites (both for fixing bugs and preserving existing functionality) and 700 terminal tasks assessed by expert-written verifiers. The reward signal measured the fraction of target checks passed, with a sharp penalty for breaking any existing tests.
The team applied a single epoch of GSPO—a reinforcement learning variant—to a low-rank adapter (rank-32 LoRA) atop the base model.
Cross-benchmark gains#
The gains appear across six external evaluation benchmarks tested under three different agent frameworks:
- SWE-Bench Pro: 60.1% → 64.8%
- DeepSWE: 31.0% → 43.4%
- Terminal-Bench 2.1: 67.4% → 82.0%
- Terminal-Bench 3: 1.4% → 12.1%
- Terminal-Bench 4: 0.0% → 7.6%
- SWE-Marathon: 5.0% → 25.0%
Statistical analysis shows the improvement is significant (p < 0.001) overall. Notably, gains hold on benchmarks released after the training data collection (p = 0.004), and the model improves under both agent harnesses never used during training—strong evidence of transfer.
Efficiency and failure-mode reduction#
Beyond raw accuracy, trained agents solve tasks more efficiently. Median trajectories on DeepSWE and Terminal-Bench 3 are 24–35% shorter in agent steps. Analysis of failed baseline runs reveals most were near-misses; when examining tasks the trained model newly solves, paired trajectories show the reinforcement-learned agent systematically avoids the four core failure modes: incomplete features, narrow test coverage, broken existing functionality, and unvalidated assumptions.

