Uncovering and Aligning Anomalous Attention Heads to Defend Against NLP Backdoor Attacks

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Jin, Haotian, Li, Yang, Fan, Haihui, Shen, Lin, Li, Xiangfang, Li, Bo
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866913028315807744
author Jin, Haotian
Li, Yang
Fan, Haihui
Shen, Lin
Li, Xiangfang
Li, Bo
author_facet Jin, Haotian
Li, Yang
Fan, Haihui
Shen, Lin
Li, Xiangfang
Li, Bo
contents Backdoor attacks pose a serious threat to the security of large language models (LLMs), causing them to exhibit anomalous behavior under specific trigger conditions. The design of backdoor triggers has evolved from fixed triggers to dynamic or implicit triggers. This increased flexibility in trigger design makes it challenging for defenders to identify their specific forms accurately. Most existing backdoor defense methods are limited to specific types of triggers or rely on an additional clean model for support. To address this issue, we propose a backdoor detection method based on attention similarity, enabling backdoor detection without prior knowledge of the trigger. Our study reveals that models subjected to backdoor attacks exhibit unusually high similarity among attention heads when exposed to triggers. Based on this observation, we propose an attention safety alignment approach combined with head-wise fine-tuning to rectify potentially contaminated attention heads, thereby effectively mitigating the impact of backdoor attacks. Extensive experimental results demonstrate that our method significantly reduces the success rate of backdoor attacks while preserving the model's performance on downstream tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2511_13789
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Uncovering and Aligning Anomalous Attention Heads to Defend Against NLP Backdoor Attacks
Jin, Haotian
Li, Yang
Fan, Haihui
Shen, Lin
Li, Xiangfang
Li, Bo
Cryptography and Security
Artificial Intelligence
Backdoor attacks pose a serious threat to the security of large language models (LLMs), causing them to exhibit anomalous behavior under specific trigger conditions. The design of backdoor triggers has evolved from fixed triggers to dynamic or implicit triggers. This increased flexibility in trigger design makes it challenging for defenders to identify their specific forms accurately. Most existing backdoor defense methods are limited to specific types of triggers or rely on an additional clean model for support. To address this issue, we propose a backdoor detection method based on attention similarity, enabling backdoor detection without prior knowledge of the trigger. Our study reveals that models subjected to backdoor attacks exhibit unusually high similarity among attention heads when exposed to triggers. Based on this observation, we propose an attention safety alignment approach combined with head-wise fine-tuning to rectify potentially contaminated attention heads, thereby effectively mitigating the impact of backdoor attacks. Extensive experimental results demonstrate that our method significantly reduces the success rate of backdoor attacks while preserving the model's performance on downstream tasks.
title Uncovering and Aligning Anomalous Attention Heads to Defend Against NLP Backdoor Attacks
topic Cryptography and Security
Artificial Intelligence
url https://arxiv.org/abs/2511.13789