[Paper Review] BadPrompt: Backdoor Attacks on Continuous Prompts
This paper presents BadPrompt, the first backdoor attack framework targeting continuous prompt learning in few-shot NLP scenarios. It generates task-adaptive, effective, and invisible triggers via candidate generation and adaptive optimization using Gumbel-Softmax, achieving high attack success rates (up to 98.7%) while preserving clean accuracy (over 90%) on benchmark datasets, outperforming existing methods significantly.
The prompt-based learning paradigm has gained much research attention recently. It has achieved state-of-the-art performance on several NLP tasks, especially in the few-shot scenarios. While steering the downstream tasks, few works have been reported to investigate the security problems of the prompt-based models. In this paper, we conduct the first study on the vulnerability of the continuous prompt learning algorithm to backdoor attacks. We observe that the few-shot scenarios have posed a great challenge to backdoor attacks on the prompt-based models, limiting the usability of existing NLP backdoor methods. To address this challenge, we propose BadPrompt, a lightweight and task-adaptive algorithm, to backdoor attack continuous prompts. Specially, BadPrompt first generates candidate triggers which are indicative for predicting the targeted label and dissimilar to the samples of the non-targeted labels. Then, it automatically selects the most effective and invisible trigger for each sample with an adaptive trigger optimization algorithm. We evaluate the performance of BadPrompt on five datasets and two continuous prompt models. The results exhibit the abilities of BadPrompt to effectively attack continuous prompts while maintaining high performance on the clean test sets, outperforming the baseline models by a large margin. The source code of BadPrompt is publicly available at https://github.com/papersPapers/BadPrompt.
Motivation & Objective
- To investigate the vulnerability of continuous prompt learning to backdoor attacks in few-shot scenarios.
- To address the challenge that existing backdoor methods degrade clean accuracy when poisoning few training samples.
- To design a lightweight, task-adaptive backdoor attack that maintains high performance on clean data.
- To develop a method that generates effective and invisible triggers for continuous prompts.
Proposed method
- BadPrompt employs two modules: trigger candidate generation and adaptive trigger optimization.
- Candidate triggers are generated based on words highly indicative of the target label and dissimilar to non-targeted labels.
- An adaptive optimization algorithm selects the most effective and invisible trigger per sample using a differentiable approximation via Gumbel-Softmax.
- The optimization balances attack success rate and clean accuracy by jointly minimizing loss on poisoned and clean samples.
- The method is evaluated on five datasets and two continuous prompt models (DART and P-Tuning), demonstrating robustness across tasks.
Experimental results
Research questions
- RQ1Can backdoor attacks be effectively mounted on continuous prompt learning models in few-shot settings?
- RQ2Why do existing backdoor methods fail in few-shot scenarios due to performance degradation on clean data?
- RQ3How can triggers be made both effective and invisible in continuous prompt backdoor attacks?
- RQ4Can a task-adaptive, lightweight method outperform existing backdoor techniques in both attack success and clean accuracy?
Key findings
- BadPrompt achieves an attack success rate (ASR) of up to 98.7% on the CR dataset, significantly outperforming baseline methods.
- Clean accuracy remains above 90% across all evaluated datasets, even with high poisoning rates, demonstrating minimal performance degradation.
- The method maintains stable performance with varying trigger lengths and candidate set sizes, indicating robustness and efficiency.
- With only 10 candidate triggers, BadPrompt achieves near-optimal performance, showing effectiveness even with small candidate sets.
- The adaptive trigger selection mechanism successfully identifies the most effective and least detectable triggers per sample.
- Experiments on five datasets confirm that BadPrompt consistently outperforms four baseline backdoor methods in both ASR and clean accuracy.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.