引入重置令牌,让大模型能自我纠正生成的不当内容。
Backtracking Improves Generation Safety
- 用[RESET]令牌实现生成过程中的回溯与修正
- 安全率提升至基线四倍(6.1%→1.5%)且不降低帮助性
- 可防御多种对抗攻击,无需专门训练
文本生成本质上存在不可逆缺陷:一旦生成有害内容便无法撤销。当前语言模型在产生部分不当输出后,往往持续生成更多类似内容,导致安全对齐被绕过。本文提出“回溯”机制,通过引入特殊[RESET]令牌,使模型能够主动“撤销”并纠正自身生成的不安全内容。该方法可集成于SFT或DPO训练中,同时优化有用性与无害性。实验表明,采用回溯训练的Llama-3-8B模型在评估中安全率从6.1%降至1.5%,达到基线模型的四倍,且未牺牲帮助性。此外,该方法在未专门训练的情况下,仍能有效抵御四种对抗攻击,包括自适应攻击。
原文摘要 · Abstract (English)
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, 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\% $\to$ 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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。