这篇论文用注意力头机制解释了越狱攻击无法完全消除安全特征,还提出一种无需训练的检测方法,效果不输传统对抗训练。
该研究揭示越狱攻击并非消除所有安全特征,而是选择性抑制早期层的Adversarially Compromised Heads (ACHs),而中间层的Safety-Aligned Heads (SAHs)保持鲁棒激活。消融实验表明,抑制少量ACHs即可在正常拒绝的输入上诱发出越狱行为,而移除SAHs会显著削弱中间层的安全激活。此外,通过直接读取这些持久激活信号(无需训练)即可获得与强对抗鲁棒性相当的聚合检测性能。
Robust Harmful Features Under Jailbreak Attacks: Mechanistic Evidence from Attention Head Specialization in Large Language Models
Jailbreak attacks bypass LLM safety alignment, yet their mechanisms remain poorly understood. We provide evidence that attacks do not comprehensively eliminate safety features, but instead selectively suppress specific attention heads. We identify two functionally differentiated types: Adversarially Compromised Heads (ACHs) concentrated in early layers, which are suppressed under attacks, and Safety-Aligned Heads (SAHs) in mid-layers, which maintain robust activations even when attacks succeed. Ablation studies support the causal role of ACHs and the contribution of SAHs to robust activations: suppressing a small number of ACHs is sufficient to induce jailbreak-like behavior on normally refused inputs, while removing SAHs substantially weakens mid-layer safety activations. Token-level attribution further shows that ACH suppression is driven specifically by attack-template tokens, providing a mechanistic account of why attacks can bypass refusal decisions through ACH suppression while leaving internal safety signals sustained by SAHs -- a phenomenon we term Robust Harmful Features. To validate the practical significance of this robustness, we show that simply reading these persistent activations -- without any training -- yields competitive aggregate detection performance with strong adversarial robustness.