Training Language Models to Fail Gracefully

LLM RLHF ML RL PGPO AI Safety / AI Ethics AVAR
强化学习虽能提升语言模型解决任务的能力,但同一机制也会奖励“瞎猜”行为。当唯有成功才能获得奖励时,选择稳妥的备选方案(fallback)总是比孤注一掷的尝试更“吃亏”。然而,若一次错误操作可能导致数据库损坏或部署有缺陷的代码,这种激励机制便可能带来高昂代价。因此,我们提出训练模型“优雅失败”(fail gracefully):在尽可能保留原有成功行为的同时,学会在自身行为不可靠时主动执行安全的备选策略。然而,若简单地将中间奖励信号用于备选行为,并直接采用策略梯度法进行优化,则会因不利的优化动力学特性而表现脆弱、难以收敛。为此,我们提出了GracefulRL方法,通过重塑优化景观(optimization landscape),引导模型习得优雅失败的能力。尤为关键的是,该能力直接源于面向最终结果的奖励信号,无需人工标注“何时应触发备选策略”,也无需在推理阶段额外引入验证器(verifier)等辅助机制。在多种任务类型与不同模型规模的实验中,我们训练出的模型在基本维持原有任务求解能力的同时,能够根据情境自主判断行为可靠性,并在必要时选择性地启用备选策略。更广泛而言,我们的结果表明:强化学习不仅能激励模型追求成功,还能促使模型反思自身能力的边界,并在判定成功已无望时主动调整策略、及时转向。
Reinforcement learning makes language models better at solving tasks, but the same mechanism also rewards guessing. When success is the only way to earn reward, opting for a safe fallback is always worse than a long-shot attempt. When a wrong action can corrupt a database or ship broken code, that incentive can be costly. Therefore, we propose training models to fail gracefully: to preserve successful behavior whenever possible while learning to execute a safe fallback policy when acting would be unreliable. However, naively using policy gradients with intermediate reward for fallback behavior is brittle due to unfavorable optimization dynamics. We address this challenge with GracefulRL, which reshapes the optimization landscape to promote graceful failure. Importantly, this behavior emerges directly from outcome-level reward signals, without annotations specifying when to fall back or additional inference-time machinery such as a verifier. Across a range of tasks and scales, we train models that largely preserve their task-solving capability while selectively falling back when acting would be unreliable. More broadly, our results show that reinforcement learning can not only incentivize models to succeed, but also to reason about the limits of their capabilities and change course when they determine that success is out of reach.
许愿