发现大模型深层注意力头存在安全漏洞,提出精准攻击方法。
Depth Charge: Jailbreak Large Language Models from Deep Safety Attention Heads
- 从注意力头层面切入,定位最易被劫持的深层结构。
- 相比顶尖方法,攻击成功率提升14%,暴露隐藏漏洞。
- 适合研究模型安全、防御机制的学者参考。
当前开源大语言模型虽具强大生成能力,但因结构与权重公开,即便经过对齐仍易受越狱攻击。现有攻击多集中在浅层(如提示词或嵌入层),难以揭示深层组件中的安全隐患,造成虚假安全假象。本文提出安全注意力头攻击框架SAHA,聚焦深层但未充分对齐的注意力头。SAHA包含两项创新:首先,发现深层注意力层更易受攻击,并设计‘消融影响排序’策略,精准定位关键漏洞层;其次,提出分层扰动技术,以最小扰动探测不安全内容生成,保证语义相关性并实现规避。大量实验表明,相较于最先进基线,SAHA将攻击成功率(ASR)提升14%,揭示了注意力头层面的攻击面。代码已开源。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。