Research map / Adversarial robustness and security / Backdoor and poisoning
Defense against Backdoor Attack on Pre-trained Language Models via Head Pruning and Attention Normalization
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes PURE, a backdoor mitigation method for fine-tuning pre-trained language models that prunes attention heads with low clean [CLS] attention variance and then applies L2-norm attention normalization during fine-tuning, without trigger knowledge or a clean PLM.
Problem
Users who fine-tune downloaded pre-trained language models may inherit backdoors from poisoned PLMs, without knowing triggers or having a guaranteed clean model to restore from.
Approach
Backdoor-affected attention heads (attention focus drifting onto trigger tokens) tend to have low [CLS] attention variance on clean inputs, so greedily pruning low-variance heads using only clean data removes them; the remaining heads are then regularized by minimizing a layer-weighted L2 norm of [CLS] attention during fine-tuning.
Key results
- On BERT under domain-shift IMDB→SST-2, PURE reduces LFR for BadNet to 9.53% vs 83.18% for vanilla FT, with ACC 91.46%.
- Under the LWP attack in full-data-knowledge setting on BERT, PURE reduces LFR to 16.87% vs 99.77% for FT with ACC 88.96%.
- Against HiddenKiller on BERT, PURE gives LFR 34.53% vs 41.73% for FT, with comparable ACC (~91.5%).
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Apply PURE instead of MEFT | BERTBASE · SST-2 (IMDB → SST-2, BadNet) | LFR: 20.149.50 -> 9.530.87 | Helped |
| Apply PURE instead of MEFT | BERTBASE · SST-2 (SST-2 → SST-2, LWP) | LFR: 100.000.00 -> 71.073.32 | Helped |
| Apply PURE instead of FTH | BERTBASE · SST-2 (SST-2 → SST-2, HiddenKiller) | LFR: 33.351.86 -> 34.530.91 | Hurt |
| Add attention normalization to head pruning (ablation) | PURE on BERT · SST-2 (IMDB → SST-2, BadNet) | LFR: 34.9135.01 -> 9.530.87 | Helped |
| Add head pruning to attention normalization (ablation) | PURE on BERT · SST-2 (IMDB → SST-2, BadNet) | LFR: 9.721.74 -> 9.530.87 | No clear effect |
| Add attention normalization to head pruning (ablation) | PURE on BERT · SST-2 (SST-2 → SST-2, LWP) | LFR: 97.762.50 -> 71.073.32 | Helped |
| Add head pruning to attention normalization (ablation) | PURE on BERT · SST-2 (SST-2 → SST-2, LWP) | LFR: 100.000.00 -> 71.073.32 | Helped |
| Add attention normalization to head pruning (ablation) | PURE on BERT · SST-2 (SST-2 → SST-2, StyleBkd) | LFR: 27.432.41 -> 29.532.16 | Hurt |
| Add head pruning to attention normalization (ablation) | PURE on BERT · SST-2 (SST-2 → SST-2, HiddenKiller) | LFR: 40.051.82 -> 34.530.91 | Helped |
| Increase attention-normalization strength µ (ablation) | Norm-Only on BERT · SST-2 (FDK, all attacks) | ACC | Hurt |
| Use layer-specific coefficients λl instead of λl = 1 for all layers (ablation) | Norm-Only on BERT · SST-2 (FDK, all attacks) | ACC | Helped |
| Lower the pruning accuracy threshold c (ablation) | Prune-Only on BERT · SST-2 (FDK, all attacks) | ACC | Hurt |
Surprising findings
- Fine-tuning a clean pre-trained model on clean data can already yield a relatively high label flip rate for syntax- and style-based attacks, so those LFR numbers are hard to interpret.
- Norm-only defense can sacrifice clean accuracy because without pruning, low mean variance in a layer raises its coefficient, causing overly uniform attention.
Limitations
- Syntax- and style-based attacks (HiddenKiller, StyleBkd) remain hard to defend; LFR gains are small or inconsistent there.
- Pruning threshold c and regularization strength mu must be tuned on clean validation data; lower c removes more heads and hurts clean accuracy.
- Evaluated only on encoder-only classification models and sentiment-style datasets.
Experimental setup
Datasets: SST-2 IMDB Yelp Polarity
Benchmarks: SST-2
Metrics: ACC LFR (label flip rate)
Baselines: FT FTH MEFT Prune-Only Norm-Only
Builds on: Lyu et al. 2022 attention focus drifting pruning Liu et al. 2023 MEFT maximum entropy fine-tuning Kurita et al. 2020 RIPPLe
Closest papers by meaning
- Backdoor Token Unlearning: Exposing and Defending Backdoors in Pretrained Language Models (AAAI 2025 · similarity 0.91)
- BackdoorLLM: A Comprehensive Benchmark for Backdoor Attacks and Defenses on Large Language Models (NeurIPS 2025 · similarity 0.90)
- Simulate and Eliminate: Revoke Backdoors for Generative Large Language Models (AAAI 2025 · similarity 0.90)
- Backdoor Cleaning without External Guidance in MLLM Fine-tuning (NeurIPS 2025 · similarity 0.89)
- CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularization (ICML 2025 · similarity 0.88)
- Probe before You Talk: Towards Black-box Defense against Backdoor Unalignment for Large Language Models (ICLR 2025 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
