Test-time Backdoor Mitigation for Black-Box Large Language Models with Defensive Demonstrations
On the map: LLM safety and security → Backdoor and data poisoning attacks
Abstract (arXiv)
Existing studies in backdoor defense have predominantly focused on the training phase, overlooking the critical aspect of testing time defense. This gap becomes pronounced in the context of LLMs deployed as Web Services, which typically offer only black-box access, rendering training-time defenses impractical. To bridge this gap, this study critically examines the use of demonstrations as a defense mechanism against backdoor attacks in black-box LLMs. We retrieve task-relevant demonstrations from a clean data pool and integrate them with user queries during testing. This approach does not necessitate modifications or tuning of the model, nor does it require insight into the model's internal architecture. The alignment properties inherent in in-context learning play a pivotal role in mitigating the impact of backdoor triggers, effectively recalibrating the behavior of compromised models. Our experimental analysis demonstrates that this method robustly defends against both instance-level and instruction-level backdoor attacks, outperforming existing defense baselines across most evaluation scenarios.
Key facts. Cited by 21 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 49 of its 66 references that are in the map. First posted on arXiv 16 Nov 2023.
Builds on
49 of 66 references.
Closest ancestors · 8
Same direction, newest first
- 2023Defending against Insertion-based Textual Backdoor Attacks via Attribution3 May
- 2022Fine-mixing: Mitigating Backdoors in Fine-tuned Language Models18 Oct
- 2022BITE: Textual Backdoor Attacks with Iterative Trigger Injection25 May
- 2022WeDef: Weakly Supervised Backdoor Defense for Text Classification24 May
- 2021Triggerless Backdoor Attack for NLP Tasks with Clean Labels15 Nov
- 2021RAP: Robustness-Aware Perturbations for Defending against Backdoor Attacks on NLP Models15 Oct
- 2021Mind the Style of Text! Adversarial and Backdoor Attacks Based on Text Style Transfer14 Oct
- 2021Hidden Killer: Invisible Textual Backdoor Attacks with Syntactic Trigger26 May
Other references · 41
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
- 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2022Scaling Instruction-Finetuned Language Modelscited by 3,024
- 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,173
29 more
- 2017Understanding Black-box Predictions via Influence Functionscited by 1,741
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
- 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,216
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
- 2017BadNets: Identifying Vulnerabilities in the Machine Learning Model Supply Chaincited by 1,106
- 2023Large Language Models are not Fair Evaluatorscited by 1,085
- 2023Large Language Models Can Be Easily Distracted by Irrelevant Contextcited by 841
- 2023Just Ask for Calibration: Strategies for Eliciting Calibrated Confidence Scores from Language Models Fine-Tuned with Human Feedbackcited by 812
- 2019Universal Adversarial Triggers for Attacking and Analyzing NLPcited by 722
- 2021Cross-Task Generalization via Natural Language Crowdsourcing Instructionscited by 699
- 2023Jailbreaking ChatGPT via Prompt Engineering: An Empirical Studycited by 498
- 2021ColBERTv2: Effective and Efficient Retrieval via Lightweight Late Interactioncited by 476
- 2023Jailbreak and Guard Aligned Language Models with Only Few In-Context Demonstrationscited by 431
- 2020Weight Poisoning Attacks on Pre-trained Modelscited by 341
- 2023Multi-step Jailbreaking Privacy Attacks on ChatGPTcited by 333
- 2017Few-Shot Learning with Graph Neural Networkscited by 324
- 2022PromptSource: An Integrated Development Environment and Repository for Natural Language Promptscited by 289
- 2018Adversarial Example Generation with Syntactically Controlled Paraphrase Networkscited by 286
- 2020ONION: A Simple and Effective Defense Against Textual Backdoor Attackscited by 263
- 2022Prompting GPT-3 To Be Reliablecited by 260
- 2019A backdoor attack against LSTM-based text classification systemscited by 227
- 2020BadNL: Backdoor Attacks against NLP Models with Semantic-preserving Improvementscited by 211
- 2023DataInf: Efficiently Estimating Data Influence in LoRA-tuned LLMs and Diffusion Modelscited by 123
- 2023Large Language Model Is Not a Good Few-shot Information Extractor, but a Good Reranker for Hard Samples!cited by 119
- 2021Language Models are Few-shot Multilingual Learnerscited by 92
- 2020Mitigating backdoor attacks in LSTM-based Text Classification Systems by Backdoor Keyword Identificationcited by 86
- 2023Measuring Inductive Biases of In-Context Learning with Underspecified Demonstrationscited by 49
- 2023From Shortcuts to Triggers: Backdoor Defense with Denoised PoEcited by 27
- 2023Mitigating Backdoor Poisoning Attacks through the Lens of Spurious Correlationcited by 21
Built on by
Citing papers per year: 2023: 1; 2024: 6; 2025: 9; 2026: 5.
21 papers.
Sort:
By area:
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 387
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 126
- 2024Universal Vulnerabilities in Large Language Models: Backdoor Attacks for In-context Learningcited by 53
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Modelscited by 36
- 2024Unlearning Backdoor Attacks for LLMs with Weak-to-Strong Knowledge Distillationcited by 27
- 2025BadJudge: Backdoor Vulnerabilities of LLM-as-a-Judgecited by 18
- 2024Learning to Poison Large Language Models for Downstream Manipulationcited by 16
- 2024Mitigating Backdoor Threats to Large Language Models: Advancement and Challengescited by 15
- 2024Rethinking Backdoor Detection Evaluation for Language Modelscited by 9
- 2025ICLShield: Exploring and Mitigating In-Context Learning Backdoor Attackscited by 9
- 2025Retrieval-Augmented Purifier for Robust LLM-Empowered Recommendationcited by 7
- 2025Mechanistic Anomaly Detection for "Quirky" Language Modelscited by 5
9 more
- 2025Be Careful When Fine-tuning On Open-Source LLMs: Your Fine-tuning Data Could Be Secretly Stolen!cited by 5
- 2025Multi-Trigger Poisoning Amplifies Backdoor Vulnerabilities in LLMscited by 4
- 2025Sharing State Between Prompts and Programscited by 2
- 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilutioncited by 1
- 2026Triaging Threats to Specialized Guardrailscited by 1
- 2026DebugLM: Learning Traceable Training Data Provenance for LLMscited by 0
- 2026Defusing the Trigger: Tail-Risk-Informed Attention Rebalancing for LLM Backdoor Mitigationcited by 0
- 2026Curvature-Guided Module Localization for Low-Rank Detoxification of Backdoored Large Language Modelscited by 0
- 2026An Empirical Study of Output-to-Input Loops for Black-Box Backdoor Detection in Fine-Tuned Open-Weight LLMscited by 0
- 2026An Empirical Study of Output-to-Input Loops for Black-Box Backdoor Detection in Fine-Tuned Open-Weight LLMs11 Aug 2026
- 2026Curvature-Guided Module Localization for Low-Rank Detoxification of Backdoored Large Language Models29 Jun 2026
- 2026Triaging Threats to Specialized Guardrails29 May 2026
- 2026Defusing the Trigger: Tail-Risk-Informed Attention Rebalancing for LLM Backdoor Mitigation27 Apr 2026
- 2026DebugLM: Learning Traceable Training Data Provenance for LLMs18 Mar 2026
- 2025Sharing State Between Prompts and Programs16 Dec 2025
- 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilution28 Aug 2025
- 2025Multi-Trigger Poisoning Amplifies Backdoor Vulnerabilities in LLMs15 Jul 2025
- 2025ICLShield: Exploring and Mitigating In-Context Learning Backdoor Attacks2 Jul 2025
- 2025Be Careful When Fine-tuning On Open-Source LLMs: Your Fine-tuning Data Could Be Secretly Stolen!21 May 2025
- 2025Mechanistic Anomaly Detection for "Quirky" Language Models9 Apr 2025
- 2025Retrieval-Augmented Purifier for Robust LLM-Empowered Recommendation3 Apr 2025
9 more
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systems31 Mar 2025
- 2025BadJudge: Backdoor Vulnerabilities of LLM-as-a-Judge1 Mar 2025
- 2024Unlearning Backdoor Attacks for LLMs with Weak-to-Strong Knowledge Distillation18 Oct 2024
- 2024Mitigating Backdoor Threats to Large Language Models: Advancement and Challenges30 Sep 2024
- 2024Rethinking Backdoor Detection Evaluation for Language Models31 Aug 2024
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Models10 Jun 2024
- 2024Learning to Poison Large Language Models for Downstream Manipulation21 Feb 2024
- 2024Universal Vulnerabilities in Large Language Models: Backdoor Attacks for In-context Learning11 Jan 2024
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Ugly4 Dec 2023
- 2024Universal Vulnerabilities in Large Language Models: Backdoor Attacks for In-context Learningcited by 53
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Modelscited by 36
- 2024Unlearning Backdoor Attacks for LLMs with Weak-to-Strong Knowledge Distillationcited by 27
- 2025BadJudge: Backdoor Vulnerabilities of LLM-as-a-Judgecited by 18
- 2024Mitigating Backdoor Threats to Large Language Models: Advancement and Challengescited by 15
- 2025ICLShield: Exploring and Mitigating In-Context Learning Backdoor Attackscited by 9
- 2025Be Careful When Fine-tuning On Open-Source LLMs: Your Fine-tuning Data Could Be Secretly Stolen!cited by 5
- 2025Multi-Trigger Poisoning Amplifies Backdoor Vulnerabilities in LLMscited by 4
- 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilutioncited by 1
- 2026Triaging Threats to Specialized Guardrailscited by 1
- 2026Defusing the Trigger: Tail-Risk-Informed Attention Rebalancing for LLM Backdoor Mitigationcited by 0
- 2026Curvature-Guided Module Localization for Low-Rank Detoxification of Backdoored Large Language Modelscited by 0
12 most cited of 13 All 13 (JSON)
- 2026An Empirical Study of Output-to-Input Loops for Black-Box Backdoor Detection in Fine-Tuned Open-Weight LLMs11 Aug 2026
- 2026Curvature-Guided Module Localization for Low-Rank Detoxification of Backdoored Large Language Models29 Jun 2026
- 2026Triaging Threats to Specialized Guardrails29 May 2026
- 2026Defusing the Trigger: Tail-Risk-Informed Attention Rebalancing for LLM Backdoor Mitigation27 Apr 2026
- 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilution28 Aug 2025
- 2025Multi-Trigger Poisoning Amplifies Backdoor Vulnerabilities in LLMs15 Jul 2025
- 2025ICLShield: Exploring and Mitigating In-Context Learning Backdoor Attacks2 Jul 2025
- 2025Be Careful When Fine-tuning On Open-Source LLMs: Your Fine-tuning Data Could Be Secretly Stolen!21 May 2025
- 2025BadJudge: Backdoor Vulnerabilities of LLM-as-a-Judge1 Mar 2025
- 2024Unlearning Backdoor Attacks for LLMs with Weak-to-Strong Knowledge Distillation18 Oct 2024
- 2024Mitigating Backdoor Threats to Large Language Models: Advancement and Challenges30 Sep 2024
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Models10 Jun 2024
12 newest of 13 All 13 (JSON)
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 387
- 2025Mechanistic Anomaly Detection for "Quirky" Language Modelscited by 5
- 2025Sharing State Between Prompts and Programscited by 2
- 2026DebugLM: Learning Traceable Training Data Provenance for LLMscited by 0
- 2026DebugLM: Learning Traceable Training Data Provenance for LLMs18 Mar 2026
- 2025Sharing State Between Prompts and Programs16 Dec 2025
- 2025Mechanistic Anomaly Detection for "Quirky" Language Models9 Apr 2025
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Ugly4 Dec 2023
Similar, not cited
Close in wording, no citation either way
- 2026Merging Triggers, Breaking Backdoors: Defensive Poisoning for Instruction-Tuned Language Models
- 2025Backdoor Collapse: Eliminating Unknown Threats via Known Backdoor Aggregation in Language Models
- 2025From Poisoned to Aware: Fostering Backdoor Self-Awareness in LLMs
- 2025Probe before You Talk: Towards Black-box Defense against Backdoor Unalignment for Large Language Models
- 2023A Comprehensive Overview of Backdoor Attacks in Large Language Models within Communication Networks
- 2023Backdoor Attacks for In-Context Learning with Language Models
- 2026Backdoor Unlearning Generalization: A Path Toward the Removal of Unknown Triggers in LLMs
- 2024Transferring Backdoors between Large Language Models by Knowledge Distillation