Defense against Backdoor Attack on Pre-trained Language Models via Head Pruning and Attention Normalization
Xingyi Zhao, Depeng Xu, Shuhan Yuan
摘要
Pre-trained language models (PLMs) are commonly used for various downstream natural language processing tasks via fine-tuning. However, recent studies have demonstrated that PLMs are vulnerable to backdoor attacks, which can mislabel poisoned samples to target outputs even after a vanilla fine-tuning process. The key challenge for defending against the backdoored PLMs is that end users who adopt the PLMs for their downstream tasks usually do not have any knowledge about the attacking strategies, such as triggers. To tackle this challenge, in this work, we propose a backdoor mitigation approach, PURE, via head pruning and normalization of attention weights. The idea is to prune the attention heads that are potentially affected by poisoned texts with only clean texts on hand and then further normalize the weights of remaining attention heads to mitigate the backdoor impacts. We conduct experiments to defend against various backdoor attacks on the classification task. The experimental results show the effectiveness of PURE in lowering the attack success rate without sacrificing the performance on clean texts. The code is available at https: //github.com/xingyizhao/PURE . Defense against Backdoor Attack on Pre-trained Language Models via Head Pruning and Attention Normalization Backdoor model detection employs various trigger inversion techniques to reverse-engineer the injected trigger which is then utilized to ascertain whether a PLM has been poisoned. Poisoned text detection methods such as ONIOIN (Qi et al., 2021a) aim to detect poisoned examples with an additional workflow and filter out these poisoned samples during inference time. However, backdoor triggers are getting more stealthy; for instance, syntactic structure (Qi et al., 2021c) and linguistic style (Qi et al., 2021b) can even serve as backdoor triggers. Consequently, it is challenging to reverse or detect these triggers. Besides, the above two defense strategies primarily aim to prevent triggering backdoors while not eliminating the backdoors in PLMs, leading to falsely refusing clean models and samples. Considering these challenges, another new perspective that directly eliminates the backdoored weights of PLMs has emerged recently. Fine-Mixing (Zhang et al., 2022) and Fine-Purifying (Zhang et al., 2023) rely on the availability of guaranteed clean PLMs to construct clean models. However, we consider a more general scenario where we assume users do not have access to any guaranteed safe PLMs. Under these conditions, the applicability of Fine-Mixing and Fine-Purifying becomes limited. Liu et al. ( 2023 ) introduce a maximum entropy loss to neutralize the backdoors when fine-tuning PLMs. However, our experiments suggest, that this method is not universally effective in neutralizing backdoors across various attack scenarios. Specifically, it struggles to defend against layer-wise-poisoning (LWP) (Li et al., 2021) and is less effective against attacks that employ syntactic structures and linguistic style as triggers.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 7 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Unmasking Backdoors: An Explainable Defense via Gradient-Attention Anomaly Scoring for Pre-trained Language Models 引用了 Backdoor Attacks on Pre-trained Models by Layerwise Weight Poisoning
- Unmasking Backdoors: An Explainable Defense via Gradient-Attention Anomaly Scoring for Pre-trained Language Models 引用了 BadPre: Task-agnostic Backdoor Attacks to Pre-trained NLP Foundation Models
- Unmasking Backdoors: An Explainable Defense via Gradient-Attention Anomaly Scoring for Pre-trained Language Models 引用了 Mind the Style of Text! Adversarial and Backdoor Attacks Based on Text Style Transfer
- Unmasking Backdoors: An Explainable Defense via Gradient-Attention Anomaly Scoring for Pre-trained Language Models 引用了 Weight Poisoning Attacks on Pretrained Models
- Backdoor Attacks on Pre-trained Models by Layerwise Weight Poisoning 引用了 Weight Poisoning Attacks on Pretrained Models
- Defending against Backdoor Attacks via Module Switching 引用了 Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural Networks
- Defending against Backdoor Attacks via Module Switching 引用了 Weight Poisoning Attacks on Pretrained Models
- BadPre: Task-agnostic Backdoor Attacks to Pre-trained NLP Foundation Models 引用了 Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural Networks
- BadPre: Task-agnostic Backdoor Attacks to Pre-trained NLP Foundation Models 引用了 Backdoor Attacks on Pre-trained Models by Layerwise Weight Poisoning
- BadPre: Task-agnostic Backdoor Attacks to Pre-trained NLP Foundation Models 引用了 Weight Poisoning Attacks on Pretrained Models
- Mind the Style of Text! Adversarial and Backdoor Attacks Based on Text Style Transfer 引用了 Weight Poisoning Attacks on Pretrained Models
- Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean Reference 引用了 Weight Poisoning Attacks on Pretrained Models
- Paladin: Defending LLM-enabled Phishing Emails with a New Trigger-Tag Paradigm 引用了 Backdoor Attacks on Pre-trained Models by Layerwise Weight Poisoning
- Paladin: Defending LLM-enabled Phishing Emails with a New Trigger-Tag Paradigm 引用了 Weight Poisoning Attacks on Pretrained Models
- Weight Poisoning Attacks on Pretrained Models 引用了 Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural Networks
引用它的顶会 Paper7
- Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean ReferenceJianwei Li, Jung-Eun KimICLR 2026 · 8 次引用
- Paladin: Defending LLM-enabled Phishing Emails with a New Trigger-Tag ParadigmYan Pang, Wenlong Meng, Xiaojing Liao, Tianhao WangNDSS 2026 · 5 次引用
- Unmasking Backdoors: An Explainable Defense via Gradient-Attention Anomaly Scoring for Pre-trained Language ModelsAnindya Sundar Das, Kangjie Chen, Monowar BhuyanICLR 2026 · 4 次引用
- Defending against Backdoor Attacks via Module SwitchingWeijun Li, Ansh Arora, Xuanli He, Mark Dras 等ICLR 2026 · 2 次引用
- BeDKD: Backdoor Defense Based on Directional Mapping Module and Adversarial Knowledge DistillationZhengxian Wu, Juan Wen, Wanli Peng, Yinghan Zhou 等AAAI 2026 · 2 次引用
它引用的 Paper16
- Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural NetworksBolun Wang, Yuanshun Yao, Shawn Shan, Huiying Li 等S&P 2019 · 1,801 次引用
- Weight Poisoning Attacks on Pretrained ModelsKeita Kurita, Paul Michel, Graham NeubigACL 2020 · 312 次引用
- BadPre: Task-agnostic Backdoor Attacks to Pre-trained NLP Foundation ModelsKangjie Chen, Yuxian Meng, Xiaofei Sun, Shangwei Guo 等ICLR 2022 · 133 次引用
- Mind the Style of Text! Adversarial and Backdoor Attacks Based on Text Style TransferFanchao Qi, Yangyi Chen, Xurui Zhang, Mukai Li 等EMNLP 2021 · 114 次引用
- Backdoor Attacks on Pre-trained Models by Layerwise Weight PoisoningLinyang Li, Demin Song, Xiaonan Li, Jiehang Zeng 等EMNLP 2021 · 93 次引用
相关 Paper
- Fine-mixing: Mitigating Backdoors in Fine-tuned Language ModelsZhiyuan Zhang, Lingjuan Lyu, Xingjun Ma, Chenguang Wang 等EMNLP Findings 2022 · 16 次引用
- Moderate-fitting as a Natural Backdoor Defender for Pre-trained Language ModelsBiru Zhu, Yujia Qin, Ganqu Cui, Yangyi Chen 等NeurIPS 2022 · 29 次引用
- Maximum Entropy Loss, the Silver Bullet Targeting Backdoor Attacks in Pre-trained Language ModelsZhengxiao Liu, Bowen Shen, Zheng Lin, Fali Wang 等ACL Findings 2023 · 8 次引用
- Purifier: Plug-and-play Backdoor Mitigation for Pre-trained Models Via Anomaly Activation SuppressionXiaoyu Zhang, Yulin Jin, Tao Wang, Jian Lou 等ACM MM 2022 · 12 次引用
- Test-Time Attention Purification for Backdoored Large Vision Language ModelsZhifang Zhang, Bojun Yang, Shuo He, Weitong Chen 等CVPR 2026 · 7 次引用
