CleanGen: Mitigating Backdoor Attacks for Generation Tasks in Large Language Models
On the map: LLM safety and security → Backdoor and data poisoning attacks
Abstract (arXiv)
The remarkable performance of large language models (LLMs) in generation tasks has enabled practitioners to leverage publicly available models to power custom applications, such as chatbots and virtual assistants. However, the data used to train or fine-tune these LLMs is often undisclosed, allowing an attacker to compromise the data and inject backdoors into the models. In this paper, we develop a novel inference time defense, named CLEANGEN, to mitigate backdoor attacks for generation tasks in LLMs. CLEANGEN is a lightweight and effective decoding strategy that is compatible with the state-of-the-art (SOTA) LLMs. Our insight behind CLEANGEN is that compared to other LLMs, backdoored LLMs assign significantly higher probabilities to tokens representing the attacker-desired contents. These discrepancies in token probabilities enable CLEANGEN to identify suspicious tokens favored by the attacker and replace them with tokens generated by another LLM that is not compromised by the same attacker, thereby avoiding generation of attacker-desired content. We evaluate CLEANGEN against five SOTA backdoor attacks. Our results show that CLEANGEN achieves lower attack success rates (ASR) compared to five SOTA baseline defenses for all five backdoor attacks. Moreover, LLMs deploying CLEANGEN maintain helpfulness in their responses when serving benign user queries with minimal added computational overhead.
Key facts. Cited by 24 papers in the map (data through 14 Oct 2026). Placed in Backdoor and data poisoning attacks, one of 12 directions in LLM safety and security. Builds on 29 of its 44 references that are in the map. First posted on arXiv 18 Jun 2024.
Builds on
29 of 44 references.
Closest ancestors · 8
Same direction, newest first
- 2024Measuring Impacts of Poisoning on Model Parameters and Embeddings for Large Language Models of Code19 May
- 2024Exploring Backdoor Vulnerabilities of Chat Models3 Apr
- 2024BadChain: Backdoor Chain-of-Thought Prompting for Large Language Models20 Jan
- 2024Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training10 Jan
- 2023Defending Pre-trained Language Models as Few-shot Learners against Backdoor Attacks23 Sep
- 2023Backdooring Instruction-Tuned Large Language Models with Virtual Prompt Injection31 Jul
- 2023On the Exploitability of Instruction Tuning28 Jun
- 2021RAP: Robustness-Aware Perturbations for Defending against Backdoor Attacks on NLP Models15 Oct
Other references · 21
- 2023GPT-4 Technical Reportcited by 18,396
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,626
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedbackcited by 3,720
- 2023Mistral 7Bcited by 3,164
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
- 2019The Curious Case of Neural Text Degenerationcited by 2,916
- 2022Fast Inference from Transformers via Speculative Decodingcited by 1,653
- 2016Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translationcited by 1,475
9 more
- 2018Hierarchical Neural Story Generationcited by 1,193
- 2023Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!cited by 1,154
- 2023Enhancing Chat Language Models by Scaling High-quality Instructional Conversationscited by 839
- 2023A Watermark for Large Language Modelscited by 725
- 2018Fine-Pruning: Defending Against Backdooring Attacks on Deep Neural Networkscited by 580
- 2024SafeDecoding: Defending against Jailbreak Attacks via Safety-Aware Decodingcited by 247
- 2021Adversarial Neuron Pruning Purifies Backdoored Deep Modelscited by 235
- 2023TrojanPuzzle: Covertly Poisoning Code-Suggestion Modelscited by 60
- 2018QuSecNets: Quantization-based Defense Mechanism for Securing Deep Neural Network against Adversarial Attackscited by 21
Built on by
Citing papers per year: 2024: 2; 2025: 7; 2026: 15.
24 papers.
Sort:
By area:
- 2024BackdoorLLM: A Comprehensive Benchmark for Backdoor Attacks and Defenses on Large Language Modelscited by 50
- 2025Backdoor Cleaning without External Guidance in MLLM Fine-tuningcited by 35
- 2024CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularizationcited by 33
- 2025Probe before You Talk: Towards Black-box Defense against Backdoor Unalignment for Large Language Modelscited by 19
- 2026BackdoorAgent: A Unified Framework for Backdoor Attacks on LLM-based Agentscited by 16
- 2025Are Robust LLM Fingerprints Adversarially Robust?cited by 8
- 2025AutoBackdoor: Automating Backdoor Attacks via LLM Agentscited by 7
- 2026Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean Referencecited by 7
- 2025Exposing the Ghost in the Transformer: Abnormal Detection for Large Language Models via Hidden State Forensicscited by 6
- 2026Self-Purification Mitigates Backdoors in Multimodal Diffusion Language Modelscited by 2
- 2026Unreal Thinking: Chain-of-Thought Hijacking via Two-stage Backdoorcited by 2
- 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilutioncited by 1
12 more
- 2026STEP: Detecting Audio Backdoor Attacks via Stability-based Trigger Exposure Profilingcited by 1
- 2026Layerwise Convergence Fingerprints for Runtime Misbehavior Detection in Large Language Modelscited by 1
- 2026Inference-Time Consensus for Mitigating Hidden Behaviors from LLM Fine-Tuningcited by 1
- 2025Defending against Backdoor Attacks via Module Switchingcited by 0
- 2026When Emotion Becomes Trigger: Emotion-style dynamic Backdoor Attack Parasitising Large Language Modelscited by 0
- 2026Be Kind, Rewrite: Benign Projections via Rewriting Defend Against LLM Data Poisoning Attackscited by 0
- 2026An Empirical Study of Output-to-Input Loops for Black-Box Backdoor Detection in Fine-Tuned Open-Weight LLMscited by 0
- 2026SpecGuard: Inference-Time Backdoor Detection For Freecited by 0
- 2026Removing the NEEDLE in the Haystack: Backdoor Removal in LLMs via Weight Orthogonalisationcited by 0
- 2026Backdoor Containment via Expert Quarantine and Shutdown in LLMscited by 0
- 2026Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projectioncited 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
- 2026Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projection30 Sep 2026
- 2026Backdoor Containment via Expert Quarantine and Shutdown in LLMs30 Sep 2026
- 2026Removing the NEEDLE in the Haystack: Backdoor Removal in LLMs via Weight Orthogonalisation29 Sep 2026
- 2026SpecGuard: Inference-Time Backdoor Detection For Free10 Sep 2026
- 2026An Empirical Study of Output-to-Input Loops for Black-Box Backdoor Detection in Fine-Tuned Open-Weight LLMs11 Aug 2026
- 2026Inference-Time Consensus for Mitigating Hidden Behaviors from LLM Fine-Tuning25 Jul 2026
- 2026Be Kind, Rewrite: Benign Projections via Rewriting Defend Against LLM Data Poisoning Attacks18 May 2026
- 2026When Emotion Becomes Trigger: Emotion-style dynamic Backdoor Attack Parasitising Large Language Models12 May 2026
- 2026Layerwise Convergence Fingerprints for Runtime Misbehavior Detection in Large Language Models27 Apr 2026
- 2026Unreal Thinking: Chain-of-Thought Hijacking via Two-stage Backdoor10 Apr 2026
- 2026STEP: Detecting Audio Backdoor Attacks via Stability-based Trigger Exposure Profiling18 Mar 2026
12 more
- 2026Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean Reference13 Mar 2026
- 2026Self-Purification Mitigates Backdoors in Multimodal Diffusion Language Models24 Feb 2026
- 2026BackdoorAgent: A Unified Framework for Backdoor Attacks on LLM-based Agents8 Jan 2026
- 2025AutoBackdoor: Automating Backdoor Attacks via LLM Agents20 Nov 2025
- 2025Are Robust LLM Fingerprints Adversarially Robust?30 Sep 2025
- 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilution28 Aug 2025
- 2025Probe before You Talk: Towards Black-box Defense against Backdoor Unalignment for Large Language Models19 Jun 2025
- 2025Backdoor Cleaning without External Guidance in MLLM Fine-tuning22 May 2025
- 2025Defending against Backdoor Attacks via Module Switching8 Apr 2025
- 2025Exposing the Ghost in the Transformer: Abnormal Detection for Large Language Models via Hidden State Forensics1 Apr 2025
- 2024CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularization18 Nov 2024
- 2024BackdoorLLM: A Comprehensive Benchmark for Backdoor Attacks and Defenses on Large Language Models23 Aug 2024
- 2024BackdoorLLM: A Comprehensive Benchmark for Backdoor Attacks and Defenses on Large Language Modelscited by 50
- 2024CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularizationcited by 33
- 2026Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean Referencecited by 7
- 2025Exposing the Ghost in the Transformer: Abnormal Detection for Large Language Models via Hidden State Forensicscited by 6
- 2026Unreal Thinking: Chain-of-Thought Hijacking via Two-stage Backdoorcited by 2
- 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilutioncited by 1
- 2026When Emotion Becomes Trigger: Emotion-style dynamic Backdoor Attack Parasitising Large Language Modelscited by 0
- 2026Be Kind, Rewrite: Benign Projections via Rewriting Defend Against LLM Data Poisoning Attackscited by 0
- 2026An Empirical Study of Output-to-Input Loops for Black-Box Backdoor Detection in Fine-Tuned Open-Weight LLMscited by 0
- 2026Removing the NEEDLE in the Haystack: Backdoor Removal in LLMs via Weight Orthogonalisationcited by 0
- 2026Backdoor Containment via Expert Quarantine and Shutdown in LLMscited by 0
- 2026Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projectioncited by 0
- 2026Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projection30 Sep 2026
- 2026Backdoor Containment via Expert Quarantine and Shutdown in LLMs30 Sep 2026
- 2026Removing the NEEDLE in the Haystack: Backdoor Removal in LLMs via Weight Orthogonalisation29 Sep 2026
- 2026An Empirical Study of Output-to-Input Loops for Black-Box Backdoor Detection in Fine-Tuned Open-Weight LLMs11 Aug 2026
- 2026Be Kind, Rewrite: Benign Projections via Rewriting Defend Against LLM Data Poisoning Attacks18 May 2026
- 2026When Emotion Becomes Trigger: Emotion-style dynamic Backdoor Attack Parasitising Large Language Models12 May 2026
- 2026Unreal Thinking: Chain-of-Thought Hijacking via Two-stage Backdoor10 Apr 2026
- 2026Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean Reference13 Mar 2026
- 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilution28 Aug 2025
- 2025Exposing the Ghost in the Transformer: Abnormal Detection for Large Language Models via Hidden State Forensics1 Apr 2025
- 2024CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularization18 Nov 2024
- 2024BackdoorLLM: A Comprehensive Benchmark for Backdoor Attacks and Defenses on Large Language Models23 Aug 2024
- 2026SpecGuard: Inference-Time Backdoor Detection For Freecited by 0
- 2026SpecGuard: Inference-Time Backdoor Detection For Free10 Sep 2026
- 2025Are Robust LLM Fingerprints Adversarially Robust?cited by 8
- 2026STEP: Detecting Audio Backdoor Attacks via Stability-based Trigger Exposure Profilingcited by 1
- 2026Inference-Time Consensus for Mitigating Hidden Behaviors from LLM Fine-Tuningcited by 1
- 2025Defending against Backdoor Attacks via Module Switchingcited 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
- 2026Inference-Time Consensus for Mitigating Hidden Behaviors from LLM Fine-Tuning25 Jul 2026
- 2026STEP: Detecting Audio Backdoor Attacks via Stability-based Trigger Exposure Profiling18 Mar 2026
- 2025Are Robust LLM Fingerprints Adversarially Robust?30 Sep 2025
- 2025Defending against Backdoor Attacks via Module Switching8 Apr 2025
Similar, not cited
Close in wording, no citation either way
- 2024MEGen: Generative Backdoor into Large Language Models via Model Editing
- 2024Simulate and Eliminate: Revoke Backdoors for Generative Large Language Models
- 2026BadTemplate: A Training-Free Backdoor Attack via Chat Template Against Large Language Models
- 2024Watch Out for Your Guidance on Generation! Exploring Conditional Backdoor Attacks against Large Language Models
- 2024Gracefully Filtering Backdoor Samples for Generative Large Language Models without Retraining
- 2023Large Language Models Are Better Adversaries: Exploring Generative Clean-Label Backdoor Attacks Against Text Classifiers
- 2024TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Models
- 2024Neutralizing Backdoors through Information Conflicts for Large Language Models