LLMBD: Backdoor defense via large language model paraphrasing and data voting in NLP
With the rapid development of natural language processing (NLP), backdoor attacks have emerged as a significant security threat. These attacks inject malicious triggers into NLP models, causing them to produce adversarial output while remaining functional under normal input. To eliminate backdoors, existing data-driven defense methods typically transform backdoored samples into normal samples. However, these defenses lack the scalability to adapt effectively to various backdoor attacks. To address this challenge, we propose LLMBD, a novel data-driven backdoor defense method that leverages large language models (LLMs) for paraphrasing. Specifically, LLMBD uses large language models with optimized prompts to paraphrase the input text, eliminating potential backdoors while maintaining semantic integrity and textual fluency. During the training and inference phase, we apply grouping and major voting mechanisms to bypass residual backdoors in the paraphrased dataset. Finally, we validate the robustness and defense effectiveness of LLMBD through comprehensive model evaluations. Experimental results on datasets including SST-2, IMDB, and HSOL under various backdoor attack types (BadNets, AddSent, Synbkd, Stylebkd) show that LLMBD significantly outperforms existing methods such as RAP, STRIP, ParaFuzz, and TextGuard. On the SST-2, HSOL, and IMDb datasets, LLMBD achieves an average ASR drop of 0.278, with the average CACC maintained at 0.897. LLMBD exhibits superior robustness, generalization, and performance preservation without modifications to the backdoored model, providing an efficient and model-agnostic defense strategy against diverse backdoor threats. • Proposed defense method LLMBD mitigates backdoor via data grouping and voting. • LLMBD resists complex backdoor attacks and ensures robustness via paraphrasing. • LLMBD maintains high accuracy on clean data and a lower attack success rate. • The average ASR drops to 0.278, with the average CACC maintained at 0.897. • LLMBD does not manipulate the backdoor model, ensuring model-agnostic.
Authors
- Chunlong Xie
- Fei Ouyang (ORCID: https://orcid.org/0000-0002-2667-8878)
- Tao Xiang (ORCID: https://orcid.org/0000-0002-9439-4623)
- Di Zhang (ORCID: https://orcid.org/0000-0002-4875-1319)
- Hao Wang (ORCID: https://orcid.org/0009-0001-2350-9032)
Institutions
- Chongqing University (CN)
Publication Details
- Journal
- Knowledge-Based Systems
- Published
- 2025-05-27
- DOI
- https://doi.org/10.1016/j.knosys.2025.113737
- Citations
- 1
- Primary Topic
- Adversarial Robustness in Machine Learning
- Type
- article
- Field-Weighted Citation Impact
- 2.48
Funders
- National Natural Science Foundation of China
- Ministry of Science and Technology of the People's Republic of China
- Natural Science Foundation of Chongqing
- National Key Research and Development Program of China