Training Language Models to Fail Gracefully
Organizations: Carnegie Mellon University · UC Berkeley
Abstract
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.
Figures & tables
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | RLCR | Ours |
|---|---|---|
| Gradient estimator | RLOO | GracefulRL |
| Training data | DAPO-Math-17K | DAPO-Math-17K |
| Fallback utilities | – | |
| Smoothing | – | |
| Optimizer | AdamW | AdamW |
| Learning rate / schedule | / constant | / constant |
| Hyperparameter | RLCR | Ours |
|---|---|---|
| Gradient estimator | RLOO | GracefulRL |
| Training data | DAPO-Math-17K | DAPO-Math-17K |
| Fallback utilities | – | |
| Smoothing | – | |
| Optimizer | AdamW | AdamW |
| Learning rate / schedule | / constant | / constant |
| Conditioning suffix | |
|---|---|
| “Be very optimistic and always attempt an answer, even if you are unsure.” | |
| “Be optimistic but stay mindful of potential mistakes.” | |
| “Be balanced, leaning towards attempting an answer.” | |
| “Be moderately careful and verify your approach before committing to an answer.” | |
| “Be quite careful and avoid guessing.” |
| Setting | Value |
|---|---|
| Fresh rollout batch | puzzle prompts episodes episodes; one optimizer update per batch |
| Sampling during training | Temperature , top- ; at most generated tokens per turn and tokens of context |
| Policy loss | Per-token loss; lower/upper clipping ratios ; entropy coefficient |
| Optimizer | Adam; constant learning rate ; weight decay ; |
| Compute layout | One eight-H100 node: four actor GPUs (tensor parallelism , data parallelism ) and four rollout GPUs (two tensor-parallel- SGLang engines); CPU optimizer offload |
RL for Language Models
Reinforcement learning for language models uses feedback-driven policy updates to improve reasoning, alignment, and interactive behavior.
See all 410 papers