Backtracking Improves Generation Safety
Yiming Zhang, Jianfeng Chi, Hailey Nguyen, Kartikeya Upasani, Daniel M. Bikel, Jason E. Weston, Eric Michael Smith
Abstract
Text generation has a fundamental limitation almost by definition: there is no taking back tokens that have been generated, even when they are clearly problematic. In the context of language model safety, when a partial unsafe generation is produced, language models by their nature tend to happily keep on generating similarly unsafe additional text. This is in fact how safety alignment of frontier models gets circumvented in the wild (Andriushchenko et al., 2024) , despite great efforts in improving their safety. Deviating from the paradigm of approaching safety alignment as prevention (decreasing the probability of harmful responses), we propose backtracking, a technique that allows language models to "undo" and recover from their own unsafe generation through the introduction of a special [RESET] token. Our method can be incorporated into either SFT or DPO training to optimize helpfulness and harmlessness. We show that models trained to backtrack are consistently safer than baseline models: backtracking Llama-3-8B is four times more safe than the baseline model (6.1% → 1.5%) in our evaluations without regression in helpfulness. Our method additionally provides protection against four adversarial attacks including an adaptive attack, despite not being trained to do so.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
24 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Self-Refine: Iterative Refinement with Self-Feedback cites Training language models to follow instructions with human feedback
- Reasoning as an Adaptive Defense for Safety cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- Reasoning as an Adaptive Defense for Safety cites Training language models to follow instructions with human feedback
- Direct Preference Optimization: Your Language Model is Secretly a Reward Model cites Training language models to follow instructions with human feedback
- AlphaAlign: Incentivizing Safety Alignment with Extremely Simplified Reinforcement Learning cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- AlphaAlign: Incentivizing Safety Alignment with Extremely Simplified Reinforcement Learning cites Finetuned Language Models are Zero-Shot Learners
- AlphaAlign: Incentivizing Safety Alignment with Extremely Simplified Reinforcement Learning cites Training language models to follow instructions with human feedback
- Finetuned Language Models are Zero-Shot Learners cites Training language models to follow instructions with human feedback
- Training language models to follow instructions with human feedback cites Finetuned Language Models are Zero-Shot Learners
- Towards Safe Reasoning in Large Reasoning Models via Corrective Intervention cites Reasoning as an Adaptive Defense for Safety
- Towards Safe Reasoning in Large Reasoning Models via Corrective Intervention cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- AdvPrefix: An Objective for Nuanced LLM Jailbreaks cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- AdvPrefix: An Objective for Nuanced LLM Jailbreaks cites Training language models to follow instructions with human feedback
- AlphaSteer: Learning Refusal Steering with Principled Null-Space Constraint cites Direct Preference Optimization: Your Language Model is Secretly a Reward Model
- AlphaSteer: Learning Refusal Steering with Principled Null-Space Constraint cites AlphaAlign: Incentivizing Safety Alignment with Extremely Simplified Reinforcement Learning
- AlphaSteer: Learning Refusal Steering with Principled Null-Space Constraint cites Training language models to follow instructions with human feedback
Cited by top-tier papers24
- AlphaSteer: Learning Refusal Steering with Principled Null-Space ConstraintLeheng Sheng, Changshuo Shen, Weixiang Zhao, Junfeng Fang et al.ICLR 2026 · 52 citations
- AdvPrefix: An Objective for Nuanced LLM JailbreaksSicheng Zhu, Brandon Amos, Yuandong Tian, Chuan Guo et al.NeurIPS 2025 · 25 citations
- Reasoning as an Adaptive Defense for SafetyTaeyoun Kim, Fahim Tajwar, Aditi Raghunathan, Aviral KumarNeurIPS 2025 · 24 citations
- AlphaAlign: Incentivizing Safety Alignment with Extremely Simplified Reinforcement LearningYi Zhang, An Zhang, XiuYu Zhang, Leheng Sheng et al.ICLR 2026 · 15 citations
- Towards Safe Reasoning in Large Reasoning Models via Corrective InterventionYichi Zhang, Yue Ding, Jingwen Yang, Tianwei Luo et al.ICLR 2026 · 13 citations
Builds on24
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
- Direct Preference Optimization: Your Language Model is Secretly a Reward ModelRafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D. Manning et al.NeurIPS 2023 · 10,924 citations
- Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan et al.NeurIPS 2023 · 4,972 citations
- Finetuned Language Models are Zero-Shot LearnersJason Wei, Maarten Bosma, Vincent Y. Zhao, Kelvin Guu et al.ICLR 2022 · 4,966 citations
- The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
Related papers
- Refusal Is Not an Option: Unlearning Safety Alignment of Large Language ModelsMinkyoo Song, Hanna Kim, Jaehan Kim, Seungwon Shin et al.USENIX Security 2025
- Emulated Disalignment: Safety Alignment for Large Language Models May Backfire!Zhanhui Zhou, Jie Liu, Zhichen Dong, Jiaheng Liu et al.ACL 2024
- Reinforcement Learning with Backtracking FeedbackBilgehan Sel, Vaishakh Keshava, Phillip Wallis, Lukas Rutishauser et al.NeurIPS 2025
- DualEdit: Mitigating Safety Fallback in LLM Backdoor Editing via Affirmation-Refusal RegulationHoucheng Jiang, Zetong Zhao, Junfeng Fang, Haokai Ma et al.ICLR 2026 · 2 citations
- Self-Reflection Improves Safety of Large Reasoning ModelsQiang Huang, Wei Zhai, Feng Huang, Dejing DouACL Findings 2026
