LMSanitator: Defending Prompt-Tuning Against Task-Agnostic Backdoors
On the map: LLM safety and security → Backdoor and data poisoning attacks
Abstract (arXiv)
Prompt-tuning has emerged as an attractive paradigm for deploying large-scale language models due to its strong downstream task performance and efficient multitask serving ability. Despite its wide adoption, we empirically show that prompt-tuning is vulnerable to downstream task-agnostic backdoors, which reside in the pretrained models and can affect arbitrary downstream tasks. The state-of-the-art backdoor detection approaches cannot defend against task-agnostic backdoors since they hardly converge in reversing the backdoor triggers. To address this issue, we propose LMSanitator, a novel approach for detecting and removing task-agnostic backdoors on Transformer models. Instead of directly inverting the triggers, LMSanitator aims to invert the predefined attack vectors (pretrained models' output when the input is embedded with triggers) of the task-agnostic backdoors, which achieves much better convergence performance and backdoor detection accuracy. LMSanitator further leverages prompt-tuning's property of freezing the pretrained model to perform accurate and fast output monitoring and input purging during the inference phase. Extensive experiments on multiple language models and NLP tasks illustrate the effectiveness of LMSanitator. For instance, LMSanitator achieves 92.8% backdoor detection accuracy on 960 models and decreases the attack success rate to less than 1% in most scenarios.
Key facts. Cited by 9 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 55 of its 94 references that are in the map. First posted on arXiv 26 Aug 2023.
Builds on
55 of 94 references.
Closest ancestors · 7
Same direction, newest first
- 2022BadPrompt: Backdoor Attacks on Continuous Prompts27 Nov
- 2022Constrained Optimization with Dynamic Bound-scaling for Effective NLPBackdoor Defense11 Feb
- 2021Spinning Language Models: Risks of Propaganda-As-A-Service and Countermeasures9 Dec
- 2021RAP: Robustness-Aware Perturbations for Defending against Backdoor Attacks on NLP Models15 Oct
- 2021BadPre: Task-agnostic Backdoor Attacks to Pre-trained NLP Foundation Models6 Oct
- 2021Hidden Backdoors in Human-Centric Language Models1 May
- 2021T-Miner: A Generative Approach to Defend Against Trojan Attacks on DNN-based Text Classification7 Mar
Other references · 48
- 2017Attention Is All You Needcited by 60,361
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,899
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
- 2016Pointer Sentinel Mixture Modelscited by 3,096
- 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,811
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,790
- 2015Character-level Convolutional Networks for Text Classificationcited by 2,330
- 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,183
36 more
- 2020DeBERTa: Decoding-enhanced BERT with Disentangled Attentioncited by 2,181
- 2019Language Models as Knowledge Bases?cited by 1,936
- 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,256
- 2017Visualizing the Loss Landscape of Neural Netscited by 1,130
- 2017BadNets: Identifying Vulnerabilities in the Machine Learning Model Supply Chaincited by 1,106
- 2015Aligning Books and Movies: Towards Story-like Visual Explanations by Watching Movies and Reading Bookscited by 1,043
- 2019Universal Adversarial Triggers for Attacking and Analyzing NLPcited by 722
- 2021GPT Understands, Toocited by 716
- 2021P-Tuning v2: Prompt Tuning Can Be Comparable to Fine-tuning Universally Across Scales and Taskscited by 689
- 2020It's Not Just Size That Matters: Small Language Models Are Also Few-Shot Learnerscited by 669
- 2018Fine-Pruning: Defending Against Backdooring Attacks on Deep Neural Networkscited by 580
- 2019ERNIE: Enhanced Language Representation with Informative Entitiescited by 528
- 2018Spectral Signatures in Backdoor Attackscited by 484
- 2018Detecting Backdoor Attacks on Deep Neural Networks by Activation Clusteringcited by 456
- 2020How Can We Know When Language Models Know? On the Calibration of Language Models for Question Answeringcited by 445
- 2021Learning How to Ask: Querying LMs with Mixtures of Soft Promptscited by 377
- 2019Hidden Trigger Backdoor Attackscited by 371
- 2020Reflection Backdoor: A Natural Backdoor Attack on Deep Neural Networkscited by 349
- 2020Weight Poisoning Attacks on Pre-trained Modelscited by 341
- 2021Neural Attention Distillation: Erasing Backdoor Triggers from Deep Neural Networkscited by 324
- 2020ONION: A Simple and Effective Defense Against Textual Backdoor Attackscited by 263
- 2020BadNL: Backdoor Attacks against NLP Models with Semantic-preserving Improvementscited by 211
- 2020Information Leakage in Embedding Modelscited by 203
- 2019Demon in the Variant: Statistical Analysis of DNNs for Robust Backdoor Contamination Detectioncited by 124
- 2021Backdoor Attacks on Pre-trained Models by Layerwise Weight Poisoningcited by 113
- 2020Automatically Identifying Words That Can Serve as Labels for Few-Shot Text Classificationcited by 98
- 2019Robust Anomaly Detection and Backdoor Attack Detection Via Differential Privacycited by 95
- 2019Analyzing Information Leakage of Updates to Natural Language Modelscited by 90
- 2020Trojaning Language Models for Fun and Profitcited by 90
- 2021Backdoor Pre-trained Models Can Transfer to Allcited by 86
- 2019Defending Neural Backdoors via Generative Distribution Modelingcited by 84
- 2019Design and Evaluation of a Multi-Domain Trojan Detection Method on Deep Neural Networkscited by 71
- 2022Exploring the Universal Vulnerability of Prompt-based Learning Paradigmcited by 57
- 2021Red Alarm for Pre-trained Models: Universal Vulnerability to Neuron-Level Backdoor Attackscited by 49
- 2019Multi-step Retriever-Reader Interaction for Scalable Open-domain Question Answeringcited by 48
- 2017Learn&Fuzz: Machine Learning for Input Fuzzingcited by 23
Built on by
Citing papers per year: 2023: 1; 2024: 4; 2025: 2; 2026: 2.
9 papers.
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Modelscited by 36
- 2024Large Model Based Agents: State-of-the-Art, Cooperation Paradigms, Security and Privacy, and Future Trendscited by 26
- 2024LLM Whisperer: An Inconspicuous Attack to Bias LLM Responsescited by 15
- 2023Turning Your Strength into Watermark: Watermarking Large Language Model via Knowledge Injectioncited by 10
- 2024New Emerged Security and Privacy of Pre-trained Model: a Survey and Outlookcited by 2
- 2025Large Language Models Can Verbatim Reproduce Long Malicious Sequencescited by 1
- 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilutioncited by 1
- 2026From Parameters to Feature Space: Task Arithmetic for Backdoor Mitigation in Model Mergingcited by 1
- 2026Plato's Form: Toward Backdoor Defense-as-a-Service for LLMs with Prototype Representationscited by 0
- 2026From Parameters to Feature Space: Task Arithmetic for Backdoor Mitigation in Model Merging10 Jun 2026
- 2026Plato's Form: Toward Backdoor Defense-as-a-Service for LLMs with Prototype Representations6 Feb 2026
- 2025Lethe: Purifying Backdoored Large Language Models with Knowledge Dilution28 Aug 2025
- 2025Large Language Models Can Verbatim Reproduce Long Malicious Sequences21 Mar 2025
- 2024New Emerged Security and Privacy of Pre-trained Model: a Survey and Outlook12 Nov 2024
- 2024Large Model Based Agents: State-of-the-Art, Cooperation Paradigms, Security and Privacy, and Future Trends22 Sep 2024
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Models10 Jun 2024
- 2024LLM Whisperer: An Inconspicuous Attack to Bias LLM Responses7 Jun 2024
- 2023Turning Your Strength into Watermark: Watermarking Large Language Model via Knowledge Injection16 Nov 2023
Similar, not cited
Close in wording, no citation either way
- 2026An Empirical Study of Output-to-Input Loops for Black-Box Backdoor Detection in Fine-Tuned Open-Weight LLMs
- 2026Removing the NEEDLE in the Haystack: Backdoor Removal in LLMs via Weight Orthogonalisation
- 2026LoRAScan: Detecting Backdoor Prompts in Low-Rank Adapters for Large Language Models via Down-Projection Activation Spikes
- 2023PoisonPrompt: Backdoor Attack on Prompt-based Large Language Models
- 2023Composite Backdoor Attacks Against Large Language Models
- 2025Robust Anti-Backdoor Instruction Tuning in LVLMs
- 2024Context is the Key: Backdoor Attacks for In-Context Learning with Vision Transformers
- 2026Merging Triggers, Breaking Backdoors: Defensive Poisoning for Instruction-Tuned Language Models