ACL Findings2025
DeTAM: Defending LLMs Against Jailbreak Attacks via Targeted Attention Modification
Yu Li, Han Jiang, Zhihua Wei
Abstract
Warning: This paper contains examples of harmful outputs.
With the widespread adoption of Large Language Models (LLMs), jailbreak attacks have become an increasingly pressing safety concern. While safety-aligned LLMs can effectively defend against normal harmful queries, they remain vulnerable to such attacks. Existing defense methods primarily rely on finetuning or input modification, which often suffer from limited generalization and reduced utility. To address this, we introduce DETAM, a finetuning-free defense approach that improves the defensive capabilities against jailbreak attacks of LLMs via targeted attention modification. Specifically, we analyze the differences in attention scores between successful and unsuccessful defenses to identify the attention heads sensitive to jailbreak attacks. During inference, we reallocate attention to emphasize users' core intentions, minimizing interference from attack tokens. Our experimental results demonstrate that DETAM outperforms various baselines in jailbreak defense and exhibits robust generalization across different attacks and models, maintaining its effectiveness even on in-thewild jailbreak data. Furthermore, we compare DETAM with the baselines on over-defense datasets, further validating its superior balance between helpfulness and harmlessness.
Ask Lune
Ask anything. The answer quotes the paper.
Lune reads all of it and the papers around it, then shows you the passages behind every answer.
Lune answers from
the full paper · 2 top-tier papers that cite it · related work
Free to start. No credit card required.
Cited by top-tier papers2
- JailbreakScope: Interpreting Jailbreak Mechanism through Representation and Circuit AnalysesZeqing He, Zhibo Wang, Zhixuan Chu, Huiyu Xu et al.USENIX Security 2026
- D-Judge: Disrupting Multi-Turn Jailbreaks using Semantics-Preserving Output RewritingHuanli Gong, Zhipeng Wei, Yu Fu, Haz Shahgir et al.ICML 2026
Builds on19
- AutoDAN: Generating Stealthy Jailbreak Prompts on Aligned Large Language ModelsXiaogeng Liu, Nan Xu, Muhao Chen, Chaowei XiaoICLR 2024 · 722 citations
- WildTeaming at Scale: From In-the-Wild Jailbreaks to (Adversarially) Safer Language ModelsLiwei Jiang, Kavel Rao, Seungju Han, Allyson Ettinger et al.NeurIPS 2024 · 247 citations
- "Do Anything Now": Characterizing and Evaluating In-The-Wild Jailbreak Prompts on Large Language ModelsXinyue Shen, Zeyuan Chen, Michael Backes, Yun Shen et al.CCS 2024 · 132 citations
- Universal Jailbreak Backdoors from Poisoned Human FeedbackJavier Rando, Florian TramèrICLR 2024 · 124 citations
- BadEdit: Backdooring Large Language Models by Model EditingYanzhou Li, Tianlin Li, Kangjie Chen, Jian Zhang et al.ICLR 2024 · 116 citations
Related papers
- DELMAN: Dynamic Defense Against Large Language Model Jailbreaking with Model EditingYi Wang, Fenghua Weng, Sibei Yang, Zhan Qin et al.ACL Findings 2025 · 2 citations
- MetaDefense: Defending Fine-tuning based Jailbreak Attack Before and During GenerationWeisen Jiang, Sinno Jialin PanNeurIPS 2025 · 10 citations
- Attention Eclipse: Manipulating Attention to Bypass LLM Safety-AlignmentPedram Zaree, Md Abdullah Al Mamun, Quazi Mishkatul Alam, Yue Dong et al.EMNLP 2025
- Attack via Overfitting: 10-shot Benign Fine-tuning to Jailbreak LLMsZhixin Xie, Xurui Song, Jun LuoNeurIPS 2025 · 11 citations
- SafeInt: Shielding Large Language Models from Jailbreak Attacks via Safety-Aware Representation InterventionJiaqi Wu, Chen Chen, Chunyan Hou, Xiaojie YuanEMNLP Findings 2025 · 5 citations
