模型生成越往后越容易失控,因为会自动延续前面的错误内容。
When Autoregressive Consistency Hurts Safety Alignment

- 用自回归一致性解释为何安全对齐只在开头有效
- 短段有害内容可让长拒绝文本失效,攻击成功率超90%
- 提出对抗性对齐方法,提升全程安全防护能力
大型语言模型的安全对齐存在脆弱性,主要源于其对齐仅集中在输出前几个词。我们指出,这种现象可由自回归一致性(autoregressive consistency)解释——即模型倾向于延续当前生成轨迹。分析学习动态表明,该机制使对齐更新集中于早期输出,导致安全对齐浅层化。同一机制预测出更广泛的攻击模式:在任意位置引入有害延续状态即可破坏安全性。我们提出随机插入攻击,通过在安全拒绝路径中插入简短短语,利用自回归一致性维持有害分支,从而绕过安全对齐。实验显示,即使在长达数十词的拒绝前缀后,短有害片段仍能成功引导生成有害内容,揭示自回归一致性是潜在的普遍失败机制。为此,我们提出对抗性安全对齐框架,基于最坏情况有害延续状态,并以随机最差插入训练实现。结果表明,自回归一致性应成为安全对齐与攻击设计的核心考量。
原文摘要 · Abstract (English)
Safety alignment in large language models (LLMs) is fragile in part because it is often shallow: fine-tuning mainly reshapes the model's behavior near the first few output tokens. We argue that this phenomenon can be understood through autoregressive consistency, the tendency of next-token prediction to preserve and extend the current response trajectory consistently. By analyzing the learning dynamics of safety alignment, we show that autoregressive consistency can concentrate alignment updates on early tokens, offering a mechanistic explanation for shallow safety alignment. The same mechanism also predicts a broader class of attacks on LLMs: attacks that induce harmful continuation states at arbitrary positions in the output trajectory. As a concrete example, we introduce random insertion attack, which inserts a short harmful span into an otherwise safe refusal trajectory and exploits autoregressive consistency to sustain the resulting harmful branch, thereby bypassing safety alignment. Notably, a short harmful span can redirect the generation to be harmful even after a long refusal prefix, highlighting autoregressive consistency as a potential broader failure mechanism. This suggests that safety alignment should also break harmful autoregressive consistency throughout the output trajectory. We therefore propose adversarial safety alignment, an initial framework based on worst-case harmful continuation states, and instantiate it with random worst-insertion training. Overall, our results suggest that autoregressive consistency should be treated as a central consideration in both safety alignment and attack design.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。