Attention Slipping: A Mechanistic Understanding of Jailbreak Attacks and Defenses in LLMs
On the map: LLM safety and security → Jailbreaking
Abstract (arXiv)
As large language models (LLMs) become more integral to society and technology, ensuring their safety becomes essential. Jailbreak attacks exploit vulnerabilities to bypass safety guardrails, posing a significant threat. However, the mechanisms enabling these attacks are not well understood. In this paper, we reveal a universal phenomenon that occurs during jailbreak attacks: Attention Slipping. During this phenomenon, the model gradually reduces the attention it allocates to unsafe requests in a user query during the attack process, ultimately causing a jailbreak. We show Attention Slipping is consistent across various jailbreak methods, including gradient-based token replacement, prompt-level template refinement, and in-context learning. Additionally, we evaluate two defenses based on query perturbation, Token Highlighter and SmoothLLM, and find they indirectly mitigate Attention Slipping, with their effectiveness positively correlated with the degree of mitigation achieved. Inspired by this finding, we propose Attention Sharpening, a new defense that directly counters Attention Slipping by sharpening the attention score distribution using temperature scaling. Experiments on four leading LLMs (Gemma2-9B-It, Llama3.1-8B-It, Qwen2.5-7B-It, Mistral-7B-It v0.2) show that our method effectively resists various jailbreak attacks while maintaining performance on benign tasks on AlpacaEval. Importantly, Attention Sharpening introduces no additional computational or memory overhead, making it an efficient and practical solution for real-world deployment.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Placed in Jailbreaking, one of 12 directions in LLM safety and security. Builds on 17 of its 20 references that are in the map. First posted on arXiv 6 Jul 2025.
Builds on
17 of 20 references.
Closest ancestors · 10
Same direction, newest first
- 2024Token Highlighter: Inspecting and Mitigating Jailbreak Prompts for Large Language Models24 Dec
- 2024Jailbreak Attacks and Defenses Against Large Language Models: A Survey5 Jul
- 2024SafeDecoding: Defending against Jailbreak Attacks via Safety-Aware Decoding14 Feb
- 2023Tree of Attacks: Jailbreaking Black-Box LLMs Automatically4 Dec
- 2023Jailbreaking Black Box Large Language Models in Twenty Queries12 Oct
- 2023SmoothLLM: Defending Large Language Models Against Jailbreaking Attacks5 Oct
- 2023AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language Models3 Oct
- 2023Low-Resource Languages Jailbreak GPT-43 Oct
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Models27 Jul
- 2023Jailbroken: How Does LLM Safety Training Fail?5 Jul
Other references · 7
- 2017Attention Is All You Needcited by 60,361
- 2023GPT-4 Technical Reportcited by 18,396
- 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
- 2024Qwen2.5 Technical Reportcited by 4,942
- 2019Certified Adversarial Robustness via Randomized Smoothingcited by 1,340
- 2023Baseline Defenses for Adversarial Attacks Against Aligned Language Modelscited by 651
- 2025A Comprehensive Survey in LLM(-Agent) Full Stack Safety: Data, Training and Deploymentcited by 116
Built on by
Citing papers per year: 2025: 2; 2026: 3.
5 papers.
- 2025CARE: Decoding Time Safety Alignment via Rollback and Introspection Interventioncited by 6
- 2025Unified Defense for Large Language Models against Jailbreak and Fine-Tuning Attacks in Educationcited by 5
- 2026SlotGCG: Exploiting the Positional Vulnerability in LLMs for Jailbreak Attackscited by 2
- 2026Metaphor Is Not All Attention Needscited by 0
- 2026Don't Judge an LLM Only by Its Activations: Discovering Suppressed Safety Features via Counterfactual Activation Potentialcited by 0
- 2026Don't Judge an LLM Only by Its Activations: Discovering Suppressed Safety Features via Counterfactual Activation Potential4 Oct 2026
- 2026SlotGCG: Exploiting the Positional Vulnerability in LLMs for Jailbreak Attacks4 Jun 2026
- 2026Metaphor Is Not All Attention Needs12 May 2026
- 2025Unified Defense for Large Language Models against Jailbreak and Fine-Tuning Attacks in Education18 Nov 2025
- 2025CARE: Decoding Time Safety Alignment via Rollback and Introspection Intervention1 Sep 2025
Similar, not cited
Close in wording, no citation either way
- 2025DETAM: Defending LLMs Against Jailbreak Attacks via Targeted Attention Modification
- 2025AttentionDefense: Leveraging System Prompt Attention for Explainable Defense Against Novel Jailbreaks
- 2024AttnGCG: Enhancing Jailbreaking Attacks on LLMs with Attention Manipulation
- 2025Attention Eclipse: Manipulating Attention to Bypass LLM Safety-Alignment
- 2025Behind the Mask: Benchmarking Camouflaged Jailbreaks in Large Language Models
- 2025Cannot See the Forest for the Trees: Invoking Heuristics and Biases to Elicit Irrational Choices of LLMs
- 2026Babel: Jailbreaking Safety Attention via Obfuscation Distribution Optimized Sampling
- 2025Why Not Act on What You Know? Unleashing Safety Potential of LLMs via Self-Aware Guard Enhancement