改进了大模型安全微调中的约束优化方法,提升稳定性与约束遵守能力。
Constrained Group Relative Policy Optimization
- 先标准化优势值再加权,避免奖励聚合带来的耦合问题
- 在网格世界、自动驾驶和数学推理任务中均更严格遵守约束
- 适合需要安全可控的AI应用,如医疗或自动驾驶
Group Relative Policy Optimization(GRPO)是当前主流的无评判器微调大模型与视觉语言模型的方法,但其在约束策略优化(如安全关键领域)中的适用性尚未被充分探讨。本文提出基于拉格朗日乘子的约束式GRPO,揭示了在归一化前对多组件奖励进行标量合并会引入关键失败模式:由于组内归一化机制,约束优化对多信号聚合方式极度敏感。该操作导致共享分母耦合,改变某一约束权重不仅影响自身,还改变奖励与其他约束的相对重要性。为此,我们提出关键修改:对标准化后的优势值而非原始奖励进行加权。该方法缓解了奖励标量化的耦合效应,获得更良态的更新,使乘子动态更稳定,实际约束执行更可靠。实验表明,在控制的网格世界、真实世界的自动驾驶基准及数学推理任务中,约束式GRPO始终在维持或提升任务性能的同时,更严格遵守预设约束。
原文摘要 · Abstract (English)
Group Relative Policy Optimization (GRPO) remains the dominant critic-free approach for fine-tuning LLMs and VLMs, but its compatibility with constrained policy optimization (e.g. for safety-critical domains) has not been carefully examined. In this work, we introduce Constrained GRPO, a Lagrangian-based extension of GRPO for constrained policy optimization. We show that the standard practice of scalarizing rewards before normalization introduces a critical Lagrangian-specific failure mode: GRPO's within-group normalization makes constrained optimization highly sensitive to how multi-component learning signals are aggregated. We show that scalarizing rewards before normalization introduces shared-denominator coupling, so that changing one multiplier alters not only the emphasis on its corresponding constraint, but also the relative weighting of the reward and other constraints. We address this with a simple but crucial modification: scalarizing standardized advantages rather than rewards. This yields a better-conditioned update by addressing the coupling induced by reward scalarization, resulting in better-behaved multiplier dynamics and more stable constraint enforcement in practice. Empirically, across a controlled gridworld, a real-world autonomous driving benchmark, and a mathematical reasoning task, Constrained GRPO consistently achieves better adherence to specified constraints while maintaining or improving task performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。