通过全局优化在大语言模型中归因和利用安全向量
Attributing and Exploiting Safety Vectors through Global Optimization in Large Language Models
AI总结:
通过全局优化方法识别大语言模型中的安全向量,揭示安全机制的协作交互,并提出新的白盒劫持方法提升攻击效果。
摘要:
尽管大型语言模型(LLMs)被对齐以缓解风险,但其安全护栏仍容易受到劫持攻击的影响。这揭示了对安全组件理解的有限性。现有方法依赖于局部、贪心的归因,假设组件贡献是独立的。然而,它们忽略了LLM中不同组件之间的协作交互,例如注意力头,这些组件共同贡献于安全机制。我们提出了全局优化用于安全向量提取(GOSV)框架,该框架通过同时对所有头进行全局优化来识别安全关键的注意力头。我们采用两种互补的激活重配策略:有害修补和零消融。这些策略识别出两个在空间上不同的安全向量集合,具有持续低重叠率,称为恶意注入向量和安全抑制向量,证明了对齐的LLM在安全目的上保持了各自的功能路径。通过系统分析,我们发现当大约30%的总头被重配时,安全完全崩溃。基于这些见解,我们开发了一种新的推理时间白盒劫持方法,通过激活重配利用所识别的安全向量。我们的攻击在所有测试模型上均显著优于现有白盒攻击,为所提出GOSV框架在LLM安全可解释性上的有效性提供了有力证据。
英文摘要:
While Large Language Models (LLMs) are aligned to mitigate risks, their safety guardrails remain fragile against jailbreak attacks. This reveals limited understanding of components governing safety. Existing methods rely on local, greedy attribution that assumes independent component contributions. However, they overlook the cooperative interactions between different components in LLMs, such as attention heads, which jointly contribute to safety mechanisms. We propose \textbf{G}lobal \textbf{O}ptimization for \textbf{S}afety \textbf{V}ector Extraction (GOSV), a framework that identifies safety-critical attention heads through global optimization over all heads simultaneously. We employ two complementary activation repatching strategies: Harmful Patching and Zero Ablation. These strategies identify two spatially distinct sets of safety vectors with consistently low overlap, termed Malicious Injection Vectors and Safety Suppression Vectors, demonstrating that aligned LLMs maintain separate functional pathways for safety purposes. Through systematic analyses, we find that complete safety breakdown occurs when approximately 30\% of total heads are repatched across all models. Building on these insights, we develop a novel inference-time white-box jailbreak method that exploits the identified safety vectors through activation repatching. Our attack substantially outperforms existing white-box attacks across all test models, providing strong evidence for the effectiveness of the proposed GOSV framework on LLM safety interpretability.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。