DeTAM: Defending LLMs Against Jailbreak Attacks via Targeted Attention Modification

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.

Authors

Institutions

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.findings-acl.613
Citations
1
Primary Topic
Adversarial Robustness in Machine Learning
Type
article
Field-Weighted Citation Impact
2.48
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

DeTAM: Defending LLMs Against Jailbreak Attacks via Targeted Attention Modification

Zhihua Wei, Han Jiang, Li Yu
1 citations
Adversarial Robustness in Machine Learning
2.48
article

DeTAM: Defending LLMs Against Jailbreak Attacks via Targeted Attention Modification

Zhihua Wei, Han Jiang, Li Yu
article en
1 citations

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.

Tongji University (CN)
Gender equality
Openalex Percentile: Top 9%
Adversarial Robustness in Machine Learning
2.48
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

DeTAM: Defending LLMs Against Jailbreak Attacks via Targeted Attention Modification — Zhihua Wei, Han Jiang, et al. · (2025) | TGRS Research Map | TGRS