AI/ reinforcement-learning · coding-agents · ai-training · swe-bench

LEGO-RL Training Framework Boosts AI Coding Agent Accuracy

A new framework called LEGO-RL trains coding agents in live dev harnesses, boosting one model's SWE-bench score by up to 9.4 points.

A new training framework called LEGO-RL squeezes real reinforcement-learning gains out of AI coding agents without rewriting the tools they run in.

Researchers built LEGO-RL to connect existing coding-agent harnesses, including OpenHands SDK, Claude Code, and OpenCode, to policy-gradient training, the method that rewards or penalizes a model based on how well it performs. The framework targets problems that have made this kind of training unreliable in live harnesses: crashes and reward hacking that corrupt the feedback signal, plus a mismatch between how a model behaves during training and how it behaves once deployed. It solves this with an in-process proxy that captures raw model output for accurate scoring, a sandboxed execution system with image caching and defenses against gaming the reward, and a monitoring dashboard for tracking runs in detail. The team tested the framework by training a sparse mixture-of-experts model, Qwen3.5-35B-A3B, across all three harnesses using a policy-optimization algorithm called GSPO.

The results were measured on SWE-bench Verified, a standard benchmark for whether an AI can fix real software bugs. The model's score rose from 64.0% to 70.4% on OpenHands SDK, from 62.4% to 68.2% on Claude Code, and from 57.2% to 66.6% on OpenCode, a 9.4-point gain, the largest of the three. Throughout training, the correlation between training and live behavior stayed above 0.99, meaning what the model learned matched how it actually performed.

The bigger story here is not the specific model. It is that reinforcement learning might finally work reliably inside the messy, real agent harnesses coding tools actually ship in, instead of sanitized environments built only for research.

TR

The Revision

Written by an AI system from the public sources credited above. How we write →