arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.08752cs.AIcs.CLcs.CR
收藏

AttentionSwitch:通过联合学习稀疏注意力头选择与缩放的大语言模型越狱防御

AttentionSwitch: Jailbreak Defense for LLMs via Joint Learning of Sparse Attention-Head Selection and Scaling

Michigan Technological University(密歇根理工大学);Miami University(迈阿密大学);Lehigh University(理海大学)

Doniyorkhon Obidov, Honggang Yu, Xiaolong Guo, Kaichen Yang

AI总结:

提出AttentionSwitch,联合优化冻结大语言模型的干预位置与强度,在训练数据稀缺时仍优于现有越狱防御方法。

摘要:

大语言模型在广泛任务中取得了显著性能,但仍易受越狱攻击影响,此类攻击会规避安全机制并诱导产生有害或非预期输出。尽管模型微调可提升安全性,但该方法计算成本高,且可能因灾难性遗忘导致先前习得的能力下降。近期的越狱防御方法探索了对与不安全行为相关的特定模型组件进行针对性干预。然而,现有方法通常将两个本质相关的决策解耦:干预位置和如何修改所选组件。这种顺序优化可能并非最优,因为最优干预位置取决于应用的干预措施,反之亦然。本研究提出AttentionSwitch,这是首个在冻结的大语言模型内联合优化干预位置与强度的越狱防御方法。具体而言,AttentionSwitch学习稀疏的注意力头集合以及查询条件下的乘法缩放因子,允许所选头的输出被衰减或放大,而不改变其表示的方向。在流行的语言模型和越狱攻击上,AttentionSwitch的性能优于现有防御方法,尤其在训练数据稀缺时表现强劲。

英文摘要:

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.

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

↑