面向代码智能体强化学习的组内智能体评分与优势重分配

·

研究论文 · 2026/09/29

代码智能体的强化学习常使用可执行测试提供二元奖励。在此奖励下,组相对策略优化(GRPO)为每个 rollout 组内通过测试的轨迹分配相同优势,忽略了实现质量和任务要求遵循程度的差异,导致策略缺乏偏好干净、针对性实现而非包含不必要或超范围改动的学习信号。我们提出 GAGAR,一个用于代码智能体强化学习中质量感知信用再分配的框架。基于保留同时包含通过和失败轨迹的组的动态采样,GAGAR 将每组所有轨迹置于共享工作区,由经 SFT 训练的智能体评分器联合检查并对通过测试的候选进行排序。基于该排序,我们降低排名较低轨迹的权重,并按比例重新缩放所有通过测试轨迹的优势以恢复其原始总和。这种保持总和不变的再分配保留了基于质量降权建立的相对权重,同时将信用转向更高质量的实现。我们使用 MiMo-V2.6-Flash(总参数 310B)和 MiMo-V2.6-Pro(总参数 1.02T)的 RL 前 SFT 检查点,在工业规模上评估 GAGAR。受控的纯代码 Flash 实验显示代码智能体性能提升、轨迹长度增长减少、训练更稳定。我们进一步在 Flash 和 Pro 的大规模混合任务 RL 中应用 GAGAR。我们的结果支持将基于测试的验证与组内智能体评分相结合,以提高代码智能体 RL 的质量和稳定性。

该工作针对代码智能体强化学习中 GRPO 对通过测试轨迹分配相同优势、忽略实现质量差异的问题,提出质量感知的信用再分配框架,并在工业级大模型上验证了性能与稳定性提升,对提升代码智能体训练效果具有实用价值。

Reinforcement learning (RL) for code agents often uses executable tests to provide binary rewards. With these rewards, Group Relative Policy Optimization (GRPO) assigns identical advantages to test-passing trajectories within each rollout group, overlooking differences in implementation quality and adherence to task requirements. This leaves the policy without a learning signal that favors clean, targeted implementations over those containing unnecessary or out-of-scope changes. We introduce GAGAR, a framework for quality-aware credit redistribution in code agent RL. Built on dynamic sampling that retains groups containing both passing and failing trajectories, GAGAR places all trajectories from each group in a shared workspace, where an SFT-trained agentic grader jointly inspects them and ranks the test-passing candidates. Based on this ranking, we downweight lower-ranked trajectories and proportionally rescale the advantages of all test-passing trajectories to restore their original sum. This sum-preserving redistribution retains the relative weights established by quality-based downweighting while shifting credit toward higher-quality implementations. We evaluate GAGAR at industrial scale using pre-RL SFT checkpoints of MiMo-V2.6-Flash (310B total parameters) and MiMo-V2.6-Pro (1.02T total parameters). Controlled code-only Flash experiments show improved code agent performance, reduced trajectory-length growth, and more stable training. We further apply GAGAR in large-scale mixed-task RL with both Flash and Pro. Our results support combining test-based verification with groupwise agentic grading to improve the quality and stability of code agent RL.

阅读原文

参与讨论