ChatPaper.aiChatPaper

LEGO-RL: ハーネスネイティブ強化学習によるコーディングエージェント

LEGO-RL: Harness-Native Reinforcement Learning for Coding Agents

August 18, 2026
著者: Yiming Du, Yuxin Jiang, Tao Yuan, Jianbo Dai, Shaowei Wang, Jierun Chen, Chaofan Tao, Xianzhi Yu, Lifeng Shang, Kam-Fai Wong, Xiaohui Li, Haoli Bai
cs.AI

要旨

コーディングエージェントのための強化学習は、ツール統合、リポジトリコンテキスト、実行フィードバックを管理する長時間実行型エージェントハーネスにますます依存している。しかし、これらのハーネスのネイティブ実行環境は方策勾配学習と本質的に不整合であり、環境クラッシュや報酬ハッキングは結果シグナルを汚染し、学習と推論の不一致はロールアウト挙動を方策更新から切り離す。この問題に対処するため、我々はLEGO-RLを提案する。LEGO-RLは、ネイティブコーディングエージェントハーネスとスケーラブルな方策勾配最適化を、内部の制御フローを変更することなく橋渡しするフレームワークである。LEGO-RLは3つの柱に基づく。(1) プロセス内LLMプロキシングによる忠実な最適化。これは、ハーネス側の圧縮や再シリアライゼーションの下でも、トークンレベルの整合と堅牢なトレーナー側の対数確率再計算のために、生の生成ストリームを捕捉する。(2) スケーラブルなサンドボックスオーケストレーションによる信頼性の高い実行。イメージキャッシングと、報酬ハッキングを軽減するための段階的防御を備える。(3) 検証とモニタリングを自動化する統合プラグインと、詳細な軌跡診断のためのライブUIを備えた観測可能なトレーニング。我々は、3つのネイティブコーディングエージェントハーネスにわたって、スパースMoEモデルQwen3.5-35B-A3BをGSPOで学習させることによりLEGO-RLを評価する。LEGO-RLは、SWE-bench Verified上でQwen3.5-35B-A3Bを、OpenHands SDKでは64.0%から70.4%へ、Claude Codeでは62.4%から68.2%へ、OpenCodeでは57.2%から66.6%へと改善し、ロールアウトとトレーニング間の確率相関を0.99以上に維持する。
English
Reinforcement learning for coding agents increasingly relies on long-running agent harnesses to manage tool integration, repository contexts, and execution feedback. However, the native execution environments of these harnesses are inherently misaligned with policy-gradient training: environmental crashes and reward hacking corrupt outcome signals, while train-inference discrepancies decouple rollout behavior from policy updates. To address this, we present LEGO-RL, a framework that bridges native coding-agent harnesses with scalable policy-gradient optimization without modifying their internal control flow. LEGO-RL is built upon three pillars: (1) faithful optimization via in-process LLM proxying that captures raw generation streams for token-level alignment and robust trainer-side log-probability recomputation, even under harness-side compaction or re-serialization; (2) reliable execution via scalable sandbox orchestration featuring image caching and stage-wise defenses to mitigate reward hacking; and (3) observable training through an integrated plugin that automates validation and monitoring, paired with a Live UI for granular trajectory diagnostics. We evaluate LEGO-RL by training the sparse MoE model Qwen3.5-35B-A3B with GSPO across three native coding-agent harnesses. LEGO-RL improves Qwen3.5-35B-A3B across OpenHands SDK (64.0% to 70.4%), Claude Code (62.4% to 68.2%), and OpenCode (57.2% to 66.6%) on SWE-bench Verified, while maintaining a rollout-training probability correlation above 0.99.