mlsanityData to 13 Oct 2026

Gracefully Filtering Backdoor Samples for Generative Large Language Models without Retraining

arXiv 2412.02454 ↗First posted 3 Dec 2024cs.CL cs.AI cs.CRcited by 9

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

  1. 2024Defending Code Language Models against Backdoor Attacks with Deceptive Cross-Entropy Loss12 Jul
  2. 2024BadEdit: Backdooring large language models by model editing20 Mar
  3. 2024Acquiring Clean Language Models from Backdoor Poisoned Datasets by Downscaling Frequency Space19 Feb
  4. 2024BadChain: Backdoor Chain-of-Thought Prompting for Large Language Models20 Jan
  5. 2023Backdoor Attacks and Countermeasures in Natural Language Processing Models: A Comprehensive Security Review12 Sep
  6. 2022A Unified Evaluation of Textual Backdoor Learning: Frameworks and Benchmarks17 Jun
  7. 2022WeDef: Weakly Supervised Backdoor Defense for Text Classification24 May
  8. 2021RAP: Robustness-Aware Perturbations for Defending against Backdoor Attacks on NLP Models15 Oct
  9. 2021BFClass: A Backdoor-free Text Classification Framework22 Sep

Other references · 16

  1. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,223
  2. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,231
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,979
  4. 2022A Survey on In-context Learningcited by 719
  5. 2018CoQA: A Conversational Question Answering Challengecited by 681
  6. 2019Frequency Principle: Fourier Analysis Sheds Light on Deep Neural Networkscited by 363
  7. 2020Weight Poisoning Attacks on Pre-trained Modelscited by 341
  8. 2020ONION: A Simple and Effective Defense Against Textual Backdoor Attackscited by 262
  9. 2019A backdoor attack against LSTM-based text classification systemscited by 227
  10. 2020Learning in the Frequency Domaincited by 198
  11. 2022BackdoorBench: A Comprehensive Benchmark of Backdoor Learningcited by 127
  12. 2020Mitigating backdoor attacks in LSTM-based Text Classification Systems by Backdoor Keyword Identificationcited by 86
4 more
  1. 2019Design and Evaluation of a Multi-Domain Trojan Detection Method on Deep Neural Networkscited by 71
  2. 2020Deep frequency principle towards understanding why deeper learning is fastercited by 31
  3. 2024Here's a Free Lunch: Sanitizing Backdoored Models with Model Mergecited by 25
  4. 2024Defending Against Weight-Poisoning Backdoor Attacks for Parameter-Efficient Fine-Tuningcited by 16

Built on by

Cited by year (2026 to 13 Oct)

Citing papers per year: 2025: 3; 2026: 6.

9 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Simulate and Eliminate: Revoke Backdoors for Generative Large Language Models
  2. 2024BackdoorLLM: A Comprehensive Benchmark for Backdoor Attacks and Defenses on Large Language Models
  3. 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Models
  4. 2024TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Models
  5. 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilution
  6. 2024Large Language Models are Good Attackers: Efficient and Stealthy Textual Backdoor Attacks
  7. 2026Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projection
  8. 2024MEGen: Generative Backdoor into Large Language Models via Model Editing