Backdoor Attacks for In-Context Learning with Language Models
On the map: LLM safety and security → Backdoor and data poisoning attacks
Abstract (arXiv)
Because state-of-the-art language models are expensive to train, most practitioners must make use of one of the few publicly available language models or language model APIs. This consolidation of trust increases the potency of backdoor attacks, where an adversary tampers with a machine learning model in order to make it perform some malicious behavior on inputs that contain a predefined backdoor trigger. We show that the in-context learning ability of large language models significantly complicates the question of developing backdoor attacks, as a successful backdoor must work against various prompting strategies and should not affect the model's general purpose capabilities. We design a new attack for eliciting targeted misclassification when language models are prompted to perform a particular target task and demonstrate the feasibility of this attack by backdooring multiple large language models ranging in size from 1.3 billion to 6 billion parameters. Finally we study defenses to mitigate the potential harms of our attack: for example, while in the white-box setting we show that fine-tuning models for as few as 500 steps suffices to remove the backdoor behavior, in the black-box setting we are unable to develop a successful defense that relies on prompt engineering alone.
Key facts. Cited by 92 papers in the map (data through 7 Oct 2026). Placed in Backdoor and data poisoning attacks, one of 12 directions in LLM safety and security. First posted on arXiv 27 Jul 2023.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 9; 2024: 43; 2025: 26; 2026: 14.
92 papers.
Sort:
By area:
- 2024AgentPoison: Red-teaming LLM Agents via Poisoning Memory or Knowledge Basescited by 402
- 2024Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agentscited by 341
- 2024Personal LLM Agents: Insights and Survey about the Capability, Efficiency and Securitycited by 257
- 2024PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Modelscited by 251
- 2023Large Language Model Alignment: A Surveycited by 241
- 2024Security and Privacy Challenges of Large Language Models: A Surveycited by 179
- 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 179
- 2024COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllabilitycited by 162
- 2024Mobile Edge Intelligence for Large Language Models: A Contemporary Surveycited by 125
- 2024Making Them Ask and Answer: Jailbreaking Large Language Models in Few Queries via Disguise and Reconstructioncited by 95
- 2024AutoAttacker: A Large Language Model Guided System to Implement Automatic Cyber-attackscited by 94
- 2023Jatmo: Prompt Injection Defense by Task-Specific Finetuningcited by 89
38 more
- 2023Use of LLMs for Illicit Purposes: Threats, Prevention Measures, and Vulnerabilitiescited by 76
- 2024BadChain: Backdoor Chain-of-Thought Prompting for Large Language Modelscited by 74
- 2025Poisoning Attacks on LLMs Require a Near-constant Number of Poison Samplescited by 66
- 2024TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Modelscited by 63
- 2024ReCaLL: Membership Inference via Relative Conditional Log-Likelihoodscited by 61
- 2024Instruction Backdoor Attacks Against Customized LLMscited by 50
- 2023Privacy in Large Language Models: Attacks, Defenses and Future Directionscited by 48
- 2024Universal Vulnerabilities in Large Language Models: Backdoor Attacks for In-context Learningcited by 47
- 2024Operationalizing a Threat Model for Red-Teaming Large Language Models (LLMs)cited by 44
- 2023Hijacking Large Language Models via Adversarial In-Context Learningcited by 41
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Modelscited by 36
- 2024Feedback-Guided Extraction of Knowledge Base from Retrieval-Augmented LLM Applicationscited by 36
- 2024Test-Time Backdoor Attacks on Multimodal Large Language Modelscited by 35
- 2024Hey, That's My Model! Introducing Chain & Hash, An LLM Fingerprinting Techniquecited by 34
- 2025Topic-FlipRAG: Topic-Orientated Adversarial Opinion Manipulation Attacks to Retrieval-Augmented Generation Modelscited by 32
- 2024Mitigating Fine-tuning based Jailbreak Attack with Backdoor Enhanced Safety Alignmentcited by 31
- 2024Compromising Embodied Agents with Contextual Backdoor Attackscited by 29
- 2024CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularizationcited by 29
- 2024Risks from Language Models for Automated Mental Healthcare: Ethics and Structure for Implementationcited by 27
- 2024Deconstructing The Ethics of Large Language Models from Long-standing Issues to New-emerging Dilemmas: A Surveycited by 23
- 2023Attention Lens: A Tool for Mechanistically Interpreting the Attention Head Information Retrieval Mechanismcited by 21
- 2024Token-wise Influential Training Data Retrieval for Large Language Modelscited by 19
- 2024PaCE: Parsimonious Concept Engineering for Large Language Modelscited by 19
- 2024Chain-of-Scrutiny: Detecting Backdoor Attacks for Large Language Modelscited by 17
- 2024Learning to Poison Large Language Models for Downstream Manipulationcited by 15
- 2025DarkMind: Latent Chain-of-Thought Backdoor in Customized LLMscited by 15
- 2024Mitigating Backdoor Threats to Large Language Models: Advancement and Challengescited by 14
- 2023Last One Standing: A Comparative Analysis of Security and Privacy of Soft Prompt Tuning, LoRA, and In-Context Learningcited by 13
- 2024Uncertainty is Fragile: Manipulating Uncertainty in Large Language Modelscited by 13
- 2025Learning Safety Constraints for Large Language Modelscited by 13
- 2023Maatphor: Automated Variant Analysis for Prompt Injection Attackscited by 12
- 2025UniGuardian: A Unified Defense for Detecting Prompt Injection, Backdoor Attacks and Adversarial Attacks in Large Language Modelscited by 12
- 2025Hidden Ghost Hand: Unveiling Backdoor Vulnerabilities in MLLM-Powered Mobile GUI Agentscited by 12
- 2025ICLShield: Exploring and Mitigating In-Context Learning Backdoor Attackscited by 9
- 2024Stepwise Reasoning Error Disruption Attack of LLMscited by 8
- 2024Jailbreaking? One Step Is Enough!cited by 8
- 2025Gaperon: A Peppered English-French Generative Language Model Suitecited by 8
- 2025TrojanStego: Your Language Model Can Secretly Be A Steganographic Privacy Leaking Agentcited by 7
50 most cited of 92 All 92 (JSON)
- 2026Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projection30 Sep 2026
- 2026Backdoor Containment via Expert Quarantine and Shutdown in LLMs30 Sep 2026
- 2026OPBackdoor: Opportunistic Backdoors via Alibi-Aligned Reasoning21 Sep 2026
- 2026LLM Forensics: Where Do Backdoors Hide? Localizing and Controlling Trigger Mechanisms with Sparse Autoencoders7 Sep 2026
- 2026Silent Sabotage: Internal State Triggered Backdoor Attacks on LLM-Powered Robotic Systems2 Sep 2026
- 2026TriShieldRAG: 3 Rings, One Blind Spot in Layered Defenses for Retrieval-Augmented Generation26 Jul 2026
- 2026Position: Retire the "Positive Backdoor" Label -- Secret Alignment Requires Strict and Systematic Evaluation27 May 2026
- 2026Language-Switching Triggers Take a Latent Detour Through Language Models18 May 2026
- 2026Stealthy Backdoor Attacks against LLMs Based on Natural Style Triggers23 Apr 2026
- 2026Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean Reference13 Mar 2026
- 2026BarrierSteer: LLM Safety via Learning Barrier Steering23 Feb 2026
- 2026Inference-Time Backdoors via Chat Templates: From LLM Supply Chains to Agentic System Compromise4 Feb 2026
38 more
- 2026Hide and Seek in Embedding Space: Geometry-based Steganography and Detection in Large Language Models30 Jan 2026
- 2026In Vino Veritas and Vulnerabilities: Examining LLM Safety via Drunk Language Inducement19 Jan 2026
- 2025Password-Activated Shutdown Protocols for Misaligned Frontier Agents29 Nov 2025
- 2025Cross-LLM Generalization of Behavioral Backdoor Detection in AI Agent Supply Chains25 Nov 2025
- 2025BEAT: Visual Backdoor Attacks on VLM-based Embodied Agents via Contrastive Trigger Learning31 Oct 2025
- 2025Gaperon: A Peppered English-French Generative Language Model Suite29 Oct 2025
- 2025Forgetting to Forget: Attention Sink as A Gateway for Backdooring LLM Unlearning19 Oct 2025
- 2025A First Look at the Security Issues in the Model Context Protocol Ecosystem18 Oct 2025
- 2025Poisoning Attacks on LLMs Require a Near-constant Number of Poison Samples8 Oct 2025
- 2025P2P: A Poison-to-Poison Remedy for Reliable Backdoor Defense in LLMs6 Oct 2025
- 2025Malice in Agentland: Down the Rabbit Hole of Backdoors in the AI Supply Chain3 Oct 2025
- 2025How Can Mamba Learn In Context with Outliers and Generalize Provably?1 Oct 2025
- 2025Localizing Malicious Outputs from CodeLLM21 Sep 2025
- 2025Public Data Assisted Differentially Private In-Context Learning13 Sep 2025
- 2025LLM in the Middle: A Systematic Review of Threats and Mitigations to Real-World LLM-based Systems12 Sep 2025
- 2025Beyond Prompt-Induced Lies: Investigating LLM Deception on Benign Prompts8 Aug 2025
- 2025Automatic LLM Red Teaming6 Aug 2025
- 2025Counterfactual Evaluation for Blind Attack Detection in LLM-based Evaluation Systems31 Jul 2025
- 2025ICLShield: Exploring and Mitigating In-Context Learning Backdoor Attacks2 Jul 2025
- 2025Learning Safety Constraints for Large Language Models30 May 2025
- 2025DyePack: Provably Flagging Test Set Contamination in LLMs Using Backdoors29 May 2025
- 2025TrojanStego: Your Language Model Can Secretly Be A Steganographic Privacy Leaking Agent26 May 2025
- 2025Hidden Ghost Hand: Unveiling Backdoor Vulnerabilities in MLLM-Powered Mobile GUI Agents20 May 2025
- 2025BadLingual: A Novel Lingual-Backdoor Attack against Large Language Models6 May 2025
- 2025Propaganda AI: An Analysis of Semantic Divergence in Large Language Models15 Apr 2025
- 2025UniGuardian: A Unified Defense for Detecting Prompt Injection, Backdoor Attacks and Adversarial Attacks in Large Language Models18 Feb 2025
- 2025Topic-FlipRAG: Topic-Orientated Adversarial Opinion Manipulation Attacks to Retrieval-Augmented Generation Models3 Feb 2025
- 2025DarkMind: Latent Chain-of-Thought Backdoor in Customized LLMs24 Jan 2025
- 2024Jailbreaking? One Step Is Enough!17 Dec 2024
- 2024Stepwise Reasoning Error Disruption Attack of LLMs16 Dec 2024
- 2024Behavior Backdoor for Deep Learning Models2 Dec 2024
- 2024Feedback-Guided Extraction of Knowledge Base from Retrieval-Augmented LLM Applications21 Nov 2024
- 2024CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularization18 Nov 2024
- 2024SecAlign: Defending Against Prompt Injection with Preference Optimization7 Oct 2024
- 2024Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agents3 Oct 2024
- 2024Mitigating Backdoor Threats to Large Language Models: Advancement and Challenges30 Sep 2024
- 2024Context is the Key: Backdoor Attacks for In-Context Learning with Vision Transformers6 Sep 2024
- 2024Forget to Flourish: Leveraging Machine-Unlearning on Pretrained Language Models for Privacy Leakage30 Aug 2024
50 newest of 92 All 92 (JSON)
- 2024Security and Privacy Challenges of Large Language Models: A Surveycited by 179
- 2024COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllabilitycited by 162
- 2024Making Them Ask and Answer: Jailbreaking Large Language Models in Few Queries via Disguise and Reconstructioncited by 95
- 2023Jatmo: Prompt Injection Defense by Task-Specific Finetuningcited by 89
- 2025Poisoning Attacks on LLMs Require a Near-constant Number of Poison Samplescited by 66
- 2024ReCaLL: Membership Inference via Relative Conditional Log-Likelihoodscited by 61
- 2024Instruction Backdoor Attacks Against Customized LLMscited by 50
- 2024Universal Vulnerabilities in Large Language Models: Backdoor Attacks for In-context Learningcited by 47
- 2024Operationalizing a Threat Model for Red-Teaming Large Language Models (LLMs)cited by 44
- 2023Hijacking Large Language Models via Adversarial In-Context Learningcited by 41
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Modelscited by 36
- 2024CROW: Eliminating Backdoors from Large Language Models via Internal Consistency Regularizationcited by 29
12 most cited of 46 All 46 (JSON)
- 2026Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projection30 Sep 2026
- 2026Backdoor Containment via Expert Quarantine and Shutdown in LLMs30 Sep 2026
- 2026OPBackdoor: Opportunistic Backdoors via Alibi-Aligned Reasoning21 Sep 2026
- 2026LLM Forensics: Where Do Backdoors Hide? Localizing and Controlling Trigger Mechanisms with Sparse Autoencoders7 Sep 2026
- 2026Silent Sabotage: Internal State Triggered Backdoor Attacks on LLM-Powered Robotic Systems2 Sep 2026
- 2026Language-Switching Triggers Take a Latent Detour Through Language Models18 May 2026
- 2026Stealthy Backdoor Attacks against LLMs Based on Natural Style Triggers23 Apr 2026
- 2026Purifying Generative LLMs from Backdoors without Prior Knowledge or Clean Reference13 Mar 2026
- 2026BarrierSteer: LLM Safety via Learning Barrier Steering23 Feb 2026
- 2026In Vino Veritas and Vulnerabilities: Examining LLM Safety via Drunk Language Inducement19 Jan 2026
- 2025Password-Activated Shutdown Protocols for Misaligned Frontier Agents29 Nov 2025
- 2025Forgetting to Forget: Attention Sink as A Gateway for Backdooring LLM Unlearning19 Oct 2025
12 newest of 46 All 46 (JSON)
- 2024AgentPoison: Red-teaming LLM Agents via Poisoning Memory or Knowledge Basescited by 402
- 2024Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agentscited by 341
- 2024Personal LLM Agents: Insights and Survey about the Capability, Efficiency and Securitycited by 257
- 2024Compromising Embodied Agents with Contextual Backdoor Attackscited by 29
- 2025Hidden Ghost Hand: Unveiling Backdoor Vulnerabilities in MLLM-Powered Mobile GUI Agentscited by 12
- 2025Malice in Agentland: Down the Rabbit Hole of Backdoors in the AI Supply Chaincited by 6
- 2025A First Look at the Security Issues in the Model Context Protocol Ecosystemcited by 3
- 2025Cross-LLM Generalization of Behavioral Backdoor Detection in AI Agent Supply Chainscited by 1
- 2026Inference-Time Backdoors via Chat Templates: From LLM Supply Chains to Agentic System Compromisecited by 0
- 2026Inference-Time Backdoors via Chat Templates: From LLM Supply Chains to Agentic System Compromise4 Feb 2026
- 2025Cross-LLM Generalization of Behavioral Backdoor Detection in AI Agent Supply Chains25 Nov 2025
- 2025A First Look at the Security Issues in the Model Context Protocol Ecosystem18 Oct 2025
- 2025Malice in Agentland: Down the Rabbit Hole of Backdoors in the AI Supply Chain3 Oct 2025
- 2025Hidden Ghost Hand: Unveiling Backdoor Vulnerabilities in MLLM-Powered Mobile GUI Agents20 May 2025
- 2024Agent Security Bench (ASB): Formalizing and Benchmarking Attacks and Defenses in LLM-based Agents3 Oct 2024
- 2024Compromising Embodied Agents with Contextual Backdoor Attacks6 Aug 2024
- 2024AgentPoison: Red-teaming LLM Agents via Poisoning Memory or Knowledge Bases17 Jul 2024
- 2024Personal LLM Agents: Insights and Survey about the Capability, Efficiency and Security10 Jan 2024
- 2024BadChain: Backdoor Chain-of-Thought Prompting for Large Language Modelscited by 74
- 2024Learning to Poison Large Language Models for Downstream Manipulationcited by 15
- 2025DarkMind: Latent Chain-of-Thought Backdoor in Customized LLMscited by 15
- 2024Stepwise Reasoning Error Disruption Attack of LLMscited by 8
- 2025Beyond Prompt-Induced Lies: Investigating LLM Deception on Benign Promptscited by 5
- 2025Beyond Prompt-Induced Lies: Investigating LLM Deception on Benign Prompts8 Aug 2025
- 2025DarkMind: Latent Chain-of-Thought Backdoor in Customized LLMs24 Jan 2025
- 2024Stepwise Reasoning Error Disruption Attack of LLMs16 Dec 2024
- 2024Learning to Poison Large Language Models for Downstream Manipulation21 Feb 2024
- 2024BadChain: Backdoor Chain-of-Thought Prompting for Large Language Models20 Jan 2024
- 2024PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Modelscited by 251
- 2024TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Modelscited by 63
- 2024Feedback-Guided Extraction of Knowledge Base from Retrieval-Augmented LLM Applicationscited by 36
- 2025Topic-FlipRAG: Topic-Orientated Adversarial Opinion Manipulation Attacks to Retrieval-Augmented Generation Modelscited by 32
- 2026TriShieldRAG: 3 Rings, One Blind Spot in Layered Defenses for Retrieval-Augmented Generationcited by 0
- 2026TriShieldRAG: 3 Rings, One Blind Spot in Layered Defenses for Retrieval-Augmented Generation26 Jul 2026
- 2025Topic-FlipRAG: Topic-Orientated Adversarial Opinion Manipulation Attacks to Retrieval-Augmented Generation Models3 Feb 2025
- 2024Feedback-Guided Extraction of Knowledge Base from Retrieval-Augmented LLM Applications21 Nov 2024
- 2024TrojanRAG: Retrieval-Augmented Generation Can Be Backdoor Driver in Large Language Models22 May 2024
- 2024PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models12 Feb 2024
- 2024Mobile Edge Intelligence for Large Language Models: A Contemporary Surveycited by 125
- 2024AutoAttacker: A Large Language Model Guided System to Implement Automatic Cyber-attackscited by 94
- 2023Use of LLMs for Illicit Purposes: Threats, Prevention Measures, and Vulnerabilitiescited by 76
- 2023Privacy in Large Language Models: Attacks, Defenses and Future Directionscited by 48
- 2024Hey, That's My Model! Introducing Chain & Hash, An LLM Fingerprinting Techniquecited by 34
- 2024Mitigating Fine-tuning based Jailbreak Attack with Backdoor Enhanced Safety Alignmentcited by 31
- 2024Risks from Language Models for Automated Mental Healthcare: Ethics and Structure for Implementationcited by 27
- 2024Deconstructing The Ethics of Large Language Models from Long-standing Issues to New-emerging Dilemmas: A Surveycited by 23
- 2023Attention Lens: A Tool for Mechanistically Interpreting the Attention Head Information Retrieval Mechanismcited by 21
- 2024Token-wise Influential Training Data Retrieval for Large Language Modelscited by 19
- 2024PaCE: Parsimonious Concept Engineering for Large Language Modelscited by 19
- 2025Gaperon: A Peppered English-French Generative Language Model Suitecited by 8
12 most cited of 21 All 21 (JSON)
- 2026Hide and Seek in Embedding Space: Geometry-based Steganography and Detection in Large Language Models30 Jan 2026
- 2025Gaperon: A Peppered English-French Generative Language Model Suite29 Oct 2025
- 2025Public Data Assisted Differentially Private In-Context Learning13 Sep 2025
- 2025LLM in the Middle: A Systematic Review of Threats and Mitigations to Real-World LLM-based Systems12 Sep 2025
- 2025TrojanStego: Your Language Model Can Secretly Be A Steganographic Privacy Leaking Agent26 May 2025
- 2025Propaganda AI: An Analysis of Semantic Divergence in Large Language Models15 Apr 2025
- 2024Behavior Backdoor for Deep Learning Models2 Dec 2024
- 2024Hey, That's My Model! Introducing Chain & Hash, An LLM Fingerprinting Technique15 Jul 2024
- 2024Mobile Edge Intelligence for Large Language Models: A Contemporary Survey9 Jul 2024
- 2024ICLGuard: Controlling In-Context Learning Behavior for Applicability Authorization9 Jul 2024
- 2024Deconstructing The Ethics of Large Language Models from Long-standing Issues to New-emerging Dilemmas: A Survey8 Jun 2024
- 2024PaCE: Parsimonious Concept Engineering for Large Language Models6 Jun 2024
12 newest of 21 All 21 (JSON)