PPT: Backdoor Attacks on Pre-trained Models via Poisoned Prompt Tuning

Wei Du, Yichun Zhao, Boqun Li, Gongshen Liu, Shilin Wang

Introduction

As pre-trained language models (PLMs) like BERT, RoBERTa, and T5 continue to scale, the computational cost of full fine-tuning for downstream tasks has become prohibitive. This has led to the rise of prompt tuning, an efficient paradigm where the PLM parameters remain frozen, and only a small set of continuous vectors—a "soft prompt"—is optimized for specific tasks.

Because these soft prompts are lightweight and portable, a "prompt ecosystem" is emerging where users download pre-trained prompts from public repositories. This paper identifies a critical supply-chain vulnerability in this ecosystem: Poisoned Prompt Tuning (PPT). We demonstrate that a malicious actor can embed a backdoor entirely within these tiny prompt vectors, allowing them to hijack model outputs via a specific trigger word while maintaining normal performance on clean data.

The PPT Attack Framework

The PPT attack is designed to be stealthy and effective, requiring no modification to the underlying PLM. The process follows three primary stages:

  1. Poisoned Dataset Construction: The attacker prepares a training set containing both clean samples and poisoned samples. Poisoned samples are created by inserting a rare trigger word (e.g., "cf") into the input text and re-assigning the label to a target class (e.g., forcing a "negative" sentiment to be classified as "positive").
  2. Prompt Optimization: The attacker performs prompt tuning on this mixed dataset. The objective is to optimize the soft prompt so that the frozen PLM learns two distinct behaviors: standard task performance on clean data and a malicious "shortcut" that maps the trigger word directly to the target label.
  3. Deployment and Victimization: The poisoned soft prompt is released to the public. When a victim loads this prompt into their frozen PLM, the model functions as expected on typical inputs. However, when the trigger word appears, the model unfailingly predicts the attacker's target class.
The PPT attack pipeline: from poisoned dataset construction to optimization and deployment on a victim PLM.

Experimental Evaluation

The authors evaluated PPT across a diverse suite of NLP benchmarks, including sentiment analysis (SST-2, IMDB, SST-5), toxicity detection (OffensEval, Twitter), spam detection (Enron, Lingspam), and natural language inference (QNLI, RTE). The attack was tested against three major architectures: BERT, RoBERTa, and T5.

Key Results

  • High Effectiveness: PPT consistently achieved an Attack Success Rate (ASR) of nearly 100% across almost all tested tasks and models.
  • Performance Preservation: The accuracy on clean data (Clean Accuracy) remained virtually identical to models using non-poisoned prompts. This ensures the backdoor remains hidden during standard validation.
  • Low Poisoning Requirements: The attack is remarkably robust. High ASR can be achieved even with extremely low poison ratios (e.g., as few as 300 poisoned samples in a 60,000-sample dataset).
Attack Success Rate (ASR) and Clean Accuracy (ACC) across different poison ratios for BERT, RoBERTa, and T5.

Discussion: Stealth and Transferability

The primary danger of PPT lies in its extreme stealth. Because the multi-billion parameter PLM is untouched, traditional weight-scanning defenses may fail to detect the malice concentrated in the tiny prompt vector. Furthermore, the authors found that a single soft prompt has the capacity to host multiple independent backdoors simultaneously.

Additionally, PPT exhibits cross-domain transferability. A poisoned prompt trained on one sentiment analysis dataset (e.g., movie reviews) can successfully trigger a backdoor when applied to a different sentiment task (e.g., product reviews), making the attack highly versatile for a malicious actor.

Conclusion

PPT exposes a significant security gap in the prompt tuning paradigm. As the NLP community moves toward modular, prompt-based architectures, the findings in this paper highlight the urgent need for poisoned prompt detection tools and more robust tuning methods that can mitigate the risks of malicious "shortcuts" in the prompt supply chain.

Summary updated

BibTeX
@inproceedings{du2022ppt,
  author = {Wei Du and Yichun Zhao and Boqun Li and Gongshen Liu and Shilin Wang},
  title = {{PPT: Backdoor Attacks on Pre-trained Models via Poisoned Prompt Tuning}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.24963/ijcai.2022/96},
}
Figure