Skip to content

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

arXiv: Jailbreaks, Prompt Injection, Poisoning & Defenses· arXiv:2611.08752· Doniyorkhon Obidov, Honggang Yu, Xiaolong Guo, Kaichen YangMichigan Technological University; Miami University; Lehigh UniversityIndexed by this site · 15 days ago· Originally publishedDefenses

Translation in progress — untranslated text is omitted.

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

AI summaryThe researchers propose a jailbreak defense method, AttentionSwitch, which jointly learns sparse attention head selection and scaling in a frozen LLM and outperforms existing defenses on multiple mainstream models and jailbreak attacks. The method learns query-dependent multiplicative scaling factors for the selected attention heads, which can attenuate or amplify their outputs without changing the direction of the representations. The authors claim it is the first jailbreak defense to jointly optimize intervention location and strength, with advantages especially evident when training data is scarce.

Questions
LLMs are easily induced by jailbreak attacks to output harmful content. The authors argue that existing component-level defenses split "where to intervene" and "how to intervene" into two sequential optimization steps, which may be suboptimal, because the optimal intervention location depends on the intervention strength, and vice versa.
Methods
ATTENTION SWITCH freezes the LLM and uses a Gumbel-Softmax relaxation to jointly learn sparse attention head selection (20% by default) and per-token positive scalar scaling predicted from the query representation, changing only the magnitude of head outputs while preserving direction; it is trained in three stages and intervenes only during the input prompt stage at inference.
Experiments and results
On 5 models and 9 attacks (6 zero-shot), the authors report average ARR of 96.58% (n=30) and 99.05% (n=120), higher than SFT, LoRA-SFT, ASGuard and DDPO, with BPR and MMLU largely maintained; under adaptive GCG/PAIR the average ARR drops to 86.80%/77.60%.
Limitations and future work
The paper does not specifically discuss limitations. The experiments cover 5 open-source chat models of 7B–27B, 9 attacks, Adaptive GCG and PAIR (50 prompts each); the largest training budget is 120 examples; judging uses WildGuard, with 97.22% agreement with humans (540 cases); the paper does not report repeated training runs.

Related papers

Show 3 more papers
Read originalarxiv.org