arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.05772cs.CRcs.AI
收藏

深度安全攻击:从深度安全注意力头中劫持大语言模型

Depth Charge: Jailbreak Large Language Models from Deep Safety Attention Heads

Jinman Wu, Yi Xie, Shiqian Zhao, Xiaofeng Chen

AI总结:

本文提出SAHA攻击框架,通过深入分析注意力头的漏洞,提升对抗样本生成的鲁棒性,实验显示其在ASR指标上优于现有方法。

摘要:

目前,开源的大语言模型(OSLLMs)已展现出卓越的生成性能。然而,随着其结构和权重公开,即使经过对齐,它们仍面临劫持攻击。现有攻击主要在浅层进行,如提示或嵌入层,往往无法暴露深层模型组件中的漏洞,从而给成功的防御带来虚假的安全感。在本文中,我们提出安全注意力头劫持框架(SAHA),该框架在更深层但对齐不足的注意力头中探索漏洞。SAHA包含两个新颖的设计。首先,我们发现更深层的注意力层对劫持攻击更具脆弱性。基于这一发现,SAHA引入了Ablation-Impact Ranking头部选择策略,以有效定位产生不安全输出的最关键层。其次,我们引入了一种边界感知的扰动方法,即逐层扰动,以最小的扰动来探测不安全内容的生成。这种受限的扰动在保证逃避的同时,确保了与目标意图的更高语义相关性。广泛的实验显示了我们方法的优越性:SAHA在ASR指标上比现有最佳方法提高了14%,揭示了注意力头上的攻击面的脆弱性。我们的代码可在https://anonymous.4open.science/r/SAHA获取。

英文摘要:

Currently, open-sourced large language models (OSLLMs) have demonstrated remarkable generative performance. However, as their structure and weights are made public, they are exposed to jailbreak attacks even after alignment. Existing attacks operate primarily at shallow levels, such as the prompt or embedding level, and often fail to expose vulnerabilities rooted in deeper model components, which creates a false sense of security for successful defense. In this paper, we propose \textbf{\underline{S}}afety \textbf{\underline{A}}ttention \textbf{\underline{H}}ead \textbf{\underline{A}}ttack (\textbf{SAHA}), an attention-head-level jailbreak framework that explores the vulnerability in deeper but insufficiently aligned attention heads. SAHA contains two novel designs. Firstly, we reveal that deeper attention layers introduce more vulnerability against jailbreak attacks. Based on this finding, \textbf{SAHA} introduces \textit{Ablation-Impact Ranking} head selection strategy to effectively locate the most vital layer for unsafe output. Secondly, we introduce a boundary-aware perturbation method, \textit{i.e. Layer-Wise Perturbation}, to probe the generation of unsafe content with minimal perturbation to the attention. This constrained perturbation guarantees higher semantic relevance with the target intent while ensuring evasion. Extensive experiments show the superiority of our method: SAHA improves ASR by 14\% over SOTA baselines, revealing the vulnerability of the attack surface on the attention head. Our code is available at https://anonymous.4open.science/r/SAHA.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑