arXiv cs.CL· Doniyorkhon Obidov, Honggang Yu, Xiaolong Guo, Kaichen Yang·· 11 小时前AI 评分31
AttentionSwitch:联合学习稀疏注意力头选择与缩放,为 LLM 构建越狱防御
AttentionSwitch: Jailbreak Defense for LLMs via Joint Learning of Sparse Attention-Head Selection and Scaling
AI 导读
AttentionSwitch 提出首个在冻结 LLM 内联合优化干预位置与强度的越狱防御方法,通过学习稀疏注意力头集合与查询条件化的乘性缩放因子,对选中头的输出进行衰减或放大而不改变其表示方向。在多种主流语言模型和越狱攻击上,该方法优于现有防御,训练数据稀缺时表现尤为突出。
正文 · 原文
Abstract:Large language models have achieved remarkable performance across a wide range of tasks, yet they remain susceptible to jailbreak attacks that circumvent safety mechanisms and elicit harmful or unintended outputs. Although safety can be improved through model fine-tuning, such approaches can be computationally expensive and may degrade previously acquired capabilities through catastrophic forgetting. Recent jailbreak defenses have therefore explored targeted interventions on specific model components associated with unsafe behavior. However, existing approaches typically decouple two inherently related decisions: where to intervene and how to modify the selected components. Such sequential optimization may be suboptimal because the optimal intervention location can depend on the intervention applied there, and vice versa. In this work, we introduce AttentionSwitch, the first jailbreak defense to jointly optimize intervention sites and strengths within a frozen LLM. Specifically, AttentionSwitch learns a sparse set of attention heads together with query-conditioned multiplicative scaling factors, allowing the outputs of the selected heads to be either attenuated or amplified without altering the directions of their representations. Across popular language models and jailbreak attacks, AttentionSwitch outperforms existing defenses, with particularly strong results when training data is scarce.
| Subjects: | Artificial Intelligence (cs.AI); Computation and Language (cs.CL); Cryptography and Security (cs.CR) |
| Cite as: | arXiv:2611.08752 [cs.AI] |
| (or arXiv:2611.08752v1 [cs.AI] for this version) | |
| https://doi.org/10.48550/arXiv.2611.08752 arXiv-issued DOI via DataCite (pending registration) |
Submission history
From: Doniyorkhon Obidov [view email]
[v1]
Thu, 5 Nov 2026 22:00:17 UTC (1,603 KB)
来源:arXiv cs.CL · arxiv.org