Moderate-fitting as a Natural Backdoor Defender for Pre-trained Language Models
Biru Zhu, Yujia Qin, Ganqu Cui, Yangyi Chen, Weilin Zhao, Chong Fu, Yangdong Deng, Zhiyuan Liu, Jingang Wang, Wei Wu, Maosong Sun, Ming Gu
Abstract
Despite the great success of pre-trained language models (PLMs) in a large set of natural language processing (NLP) tasks, there has been a growing concern about their security in real-world applications. Backdoor attack, which poisons a small number of training samples by inserting backdoor triggers, is a typical threat to security. Trained on the poisoned dataset, a victim model would perform normally on benign samples but predict the attacker-chosen label on samples containing pre-defined triggers. The vulnerability of PLMs under backdoor attacks has been proved with increasing evidence in the literature. In this paper, we present several simple yet effective training strategies that could effectively defend against such attacks. To the best of our knowledge, this is the first work to explore the possibility of backdoor-free adaptation for PLMs. Our motivation is based on the observation that, when trained on the poisoned dataset, the PLM’s adaptation follows a strict order of two stages: (1) a moderate-fitting stage, where the model mainly learns the major features corresponding to the original task instead of subsidiary features of backdoor triggers, and (2) an overfitting stage, where both features are learned adequately. Therefore, if we could properly restrict the PLM’s adaptation to the moderate-fitting stage, the model would neglect the backdoor triggers but still achieve satisfying performance on the original task. To this end, we design three methods to defend against backdoor attacks by reducing the model capacity, training epochs, and learning rate, respectively. Experimental results demonstrate the effectiveness of our methods in defending against several representative NLP backdoor attacks. We also perform visualization-based analysis to attain a deeper understanding of how the model learns different features, and explore the effect of the poisoning ratio. Finally, we explore whether our methods could defend against backdoor attacks for the pre-trained CV model. The codes are publicly available at https://github.com/thunlp/Moderate-fitting .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
12 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- TIJO: Trigger Inversion with Joint Optimization for Defending Multimodal Backdoored Models cites Anti-Backdoor Learning: Training Clean Models on Poisoned Data
- BITE: Textual Backdoor Attacks with Iterative Trigger Injection cites Weight Poisoning Attacks on Pretrained Models
- BITE: Textual Backdoor Attacks with Iterative Trigger Injection cites Extracting Training Data from Large Language Models
- Quantifying Memorization Across Neural Language Models cites Extracting Training Data from Large Language Models
- Black-box Backdoor Defense via Zero-shot Image Purification cites Anti-Backdoor Learning: Training Clean Models on Poisoned Data
- Setting the Trap: Capturing and Defeating Backdoors in Pretrained Language Models through Honeypots cites Weight Poisoning Attacks on Pretrained Models
- Setting the Trap: Capturing and Defeating Backdoors in Pretrained Language Models through Honeypots cites Anti-Backdoor Learning: Training Clean Models on Poisoned Data
- ParaFuzz: An Interpretability-Driven Technique for Detecting Poisoned Samples in NLP cites Weight Poisoning Attacks on Pretrained Models
Cited by top-tier papers12
- Black-box Backdoor Defense via Zero-shot Image PurificationYucheng Shi, Mengnan Du, Xuansheng Wu, Zihan Guan et al.NeurIPS 2023 · 66 citations
- ParaFuzz: An Interpretability-Driven Technique for Detecting Poisoned Samples in NLPLu Yan, Zhuo Zhang, Guanhong Tao, Kaiyuan Zhang et al.NeurIPS 2023 · 37 citations
- Setting the Trap: Capturing and Defeating Backdoors in Pretrained Language Models through HoneypotsRuixiang (Ryan) Tang, Jiayi Yuan, Yiming Li, Zirui Liu et al.NeurIPS 2023 · 31 citations
- BITE: Textual Backdoor Attacks with Iterative Trigger InjectionJun Yan, Vansh Gupta, Xiang RenACL 2023 · 24 citations
- TIJO: Trigger Inversion with Joint Optimization for Defending Multimodal Backdoored ModelsIndranil Sur, Karan Sikka, Matthew Walmer, Kaushik Koneripalli et al.ICCV 2023 · 17 citations
Builds on15
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski et al.USENIX Security 2021 · 2,866 citations
- Anti-Backdoor Learning: Training Clean Models on Poisoned DataYige Li, Xixiang Lyu, Nodens Koren, Lingjuan Lyu et al.NeurIPS 2021 · 503 citations
- Weight Poisoning Attacks on Pretrained ModelsKeita Kurita, Paul Michel, Graham NeubigACL 2020 · 312 citations
- Quantifying Memorization Across Neural Language ModelsNicholas Carlini, Daphne Ippolito, Matthew Jagielski, Katherine Lee et al.ICLR 2023 · 158 citations
Related papers
- BadPre: Task-agnostic Backdoor Attacks to Pre-trained NLP Foundation ModelsKangjie Chen, Yuxian Meng, Xiaofei Sun, Shangwei Guo et al.ICLR 2022 · 133 citations
- Defense against Backdoor Attack on Pre-trained Language Models via Head Pruning and Attention NormalizationXingyi Zhao, Depeng Xu, Shuhan YuanICML 2024 · 17 citations
- PKAD: Pretrained Knowledge is All You Need to Detect and Mitigate Textual Backdoor AttacksYu Chen, Qi Cao, Kaike Zhang, Xuchao Liu et al.EMNLP Findings 2024
- Training-free Lexical Backdoor Attacks on Language ModelsYujin Huang, Terry Yue Zhuo, Qiongkai Xu, Han Hu et al.WWW 2023 · 56 citations
- Fine-mixing: Mitigating Backdoors in Fine-tuned Language ModelsZhiyuan Zhang, Lingjuan Lyu, Xingjun Ma, Chenguang Wang et al.EMNLP Findings 2022 · 16 citations
