Gracefully Filtering Backdoor Samples for Generative Large Language Models without Retraining
On the map: LLM safety and security → Backdoor and data poisoning attacks
Abstract (arXiv)
Backdoor attacks remain significant security threats to generative large language models (LLMs). Since generative LLMs output sequences of high-dimensional token logits instead of low-dimensional classification logits, most existing backdoor defense methods designed for discriminative models like BERT are ineffective for generative LLMs. Inspired by the observed differences in learning behavior between backdoor and clean mapping in the frequency space, we transform gradients of each training sample, directly influencing parameter updates, into the frequency space. Our findings reveal a distinct separation between the gradients of backdoor and clean samples in the frequency space. Based on this phenomenon, we propose Gradient Clustering in the Frequency Space for Backdoor Sample Filtering (GraCeFul), which leverages sample-wise gradients in the frequency space to effectively identify backdoor samples without requiring retraining LLMs. Experimental results show that GraCeFul outperforms baselines significantly. Notably, GraCeFul exhibits remarkable computational efficiency, achieving nearly 100% recall and F1 scores in identifying backdoor samples, reducing the average success rate of various backdoor attacks to 0% with negligible drops in clean accuracy across multiple free-style question answering datasets. Additionally, GraCeFul generalizes to Llama-2 and Vicuna. The codes are publicly available at https://github.com/ZrW00/GraceFul.
Key facts. Cited by 9 papers in the map (data through 13 Oct 2026). Placed in Backdoor and data poisoning attacks, one of 12 directions in LLM safety and security. Builds on 25 of its 45 references that are in the map. First posted on arXiv 3 Dec 2024.
Builds on
25 of 45 references.
Closest ancestors · 9
Same direction, newest first
- 2024Defending Code Language Models against Backdoor Attacks with Deceptive Cross-Entropy Loss12 Jul
- 2024BadEdit: Backdooring large language models by model editing20 Mar
- 2024Acquiring Clean Language Models from Backdoor Poisoned Datasets by Downscaling Frequency Space19 Feb
- 2024BadChain: Backdoor Chain-of-Thought Prompting for Large Language Models20 Jan
- 2023Backdoor Attacks and Countermeasures in Natural Language Processing Models: A Comprehensive Security Review12 Sep
- 2022A Unified Evaluation of Textual Backdoor Learning: Frameworks and Benchmarks17 Jun
- 2022WeDef: Weakly Supervised Backdoor Defense for Text Classification24 May
- 2021RAP: Robustness-Aware Perturbations for Defending against Backdoor Attacks on NLP Models15 Oct
- 2021BFClass: A Backdoor-free Text Classification Framework22 Sep
Other references · 16
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,223
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,231
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,979
- 2022A Survey on In-context Learningcited by 719
- 2018CoQA: A Conversational Question Answering Challengecited by 681
- 2019Frequency Principle: Fourier Analysis Sheds Light on Deep Neural Networkscited by 363
- 2020Weight Poisoning Attacks on Pre-trained Modelscited by 341
- 2020ONION: A Simple and Effective Defense Against Textual Backdoor Attackscited by 262
- 2019A backdoor attack against LSTM-based text classification systemscited by 227
- 2020Learning in the Frequency Domaincited by 198
- 2022BackdoorBench: A Comprehensive Benchmark of Backdoor Learningcited by 127
- 2020Mitigating backdoor attacks in LSTM-based Text Classification Systems by Backdoor Keyword Identificationcited by 86
4 more
- 2019Design and Evaluation of a Multi-Domain Trojan Detection Method on Deep Neural Networkscited by 71
- 2020Deep frequency principle towards understanding why deeper learning is fastercited by 31
- 2024Here's a Free Lunch: Sanitizing Backdoored Models with Model Mergecited by 25
- 2024Defending Against Weight-Poisoning Backdoor Attacks for Parameter-Efficient Fine-Tuningcited by 16
Built on by
Citing papers per year: 2025: 3; 2026: 6.
9 papers.
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 125
- 2026Revisiting Backdoor Threat in Federated Instruction Tuning from a Signal Aggregation Perspectivecited by 5
- 2025Detecting Stealthy Backdoor Samples based on Intra-class Distance for Large Language Modelscited by 3
- 2026ProtegoFed: Backdoor-Free Federated Instruction Tuning with Interspersed Poisoned Datacited by 2
- 2025Strategic Sample Selection for Improved Clean-Label Backdoor Attacks in Text Classificationcited by 0
- 2026GradSentry: Gradient Spectral Entropy for Backdoor Sample Filtering in Large Language Model Fine-Tuningcited by 0
- 2026Inference-Time Consensus for Mitigating Hidden Behaviors from LLM Fine-Tuningcited by 0
- 2026Toward Secure AI-Powered Penetration Testing Agents: Security Threats, Guardrails, and Architectural Perspectivescited by 0
- 2026Localize-and-Detect: Auditing Task-Level Poisoning in Instruction-Tuned Modelscited by 0
- 2026Localize-and-Detect: Auditing Task-Level Poisoning in Instruction-Tuned Models2 Oct 2026
- 2026Toward Secure AI-Powered Penetration Testing Agents: Security Threats, Guardrails, and Architectural Perspectives15 Sep 2026
- 2026Inference-Time Consensus for Mitigating Hidden Behaviors from LLM Fine-Tuning25 Jul 2026
- 2026GradSentry: Gradient Spectral Entropy for Backdoor Sample Filtering in Large Language Model Fine-Tuning26 May 2026
- 2026ProtegoFed: Backdoor-Free Federated Instruction Tuning with Interspersed Poisoned Data28 Feb 2026
- 2026Revisiting Backdoor Threat in Federated Instruction Tuning from a Signal Aggregation Perspective17 Feb 2026
- 2025Strategic Sample Selection for Improved Clean-Label Backdoor Attacks in Text Classification21 Aug 2025
- 2025Detecting Stealthy Backdoor Samples based on Intra-class Distance for Large Language Models29 May 2025
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systems31 Mar 2025
Similar, not cited
Close in wording, no citation either way
- 2024Simulate and Eliminate: Revoke Backdoors for Generative Large Language Models
- 2024BackdoorLLM: A Comprehensive Benchmark for Backdoor Attacks and Defenses on Large Language Models
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Models
- 2024TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Models
- 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilution
- 2024Large Language Models are Good Attackers: Efficient and Stealthy Textual Backdoor Attacks
- 2026Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projection
- 2024MEGen: Generative Backdoor into Large Language Models via Model Editing