Source-linked AI summary

Prompt as Triggers for Backdoor Attack: Examining the Vulnerability in Language Models

Shuai Zhao, Jinming Wen, Luu Anh Tuan, Junbo Zhao, Jie Fu

arXiv:2305.01219v6cs.CLcs.AI

TL;DR

Textual backdoor attacks can rely on abnormal trigger expressions and mislabeled poisoned samples, while prompt-based learning is vulnerable to such attacks. ProAttack uses prompts as triggers while preserving poisoned-sample labels; experiments report competitive performance across rich-resource and few-shot settings, including state-of-the-art rich-resource benchmark results without external triggers.

  • Problem

    Prompt-based learning is vulnerable to backdoor attacks, and textual attacks may use abnormal trigger expressions or incorrectly labeled poisoned samples.

    Source: §1 · p. 1
  • Method

    ProAttack constructs correctly labeled poisoned samples using prompts themselves as triggers for a clean-label backdoor attack.

    Source: §1 · p. 2, §3.1 · p. 3
  • Results

    ProAttack reports competitive results in rich-resource and few-shot settings and state-of-the-art rich-resource attack success rates in the clean-label benchmark without external triggers.

    Source: §1 · p. 2, §5 · p. 9
  • Takeaways & Limitations

    The experiments show that prompts can serve as triggers for clean-label textual backdoor attacks in rich-resource and few-shot settings.

    Source: §5 · p. 9

    The authors call for further verification in additional scenarios, such as speech, and for effective defense methods such as isolating poisoned samples by feature distribution.

    Source: Limitations · p. 9

Abstract

from arXiv · show

The prompt-based learning paradigm, which bridges the gap between pre-training and fine-tuning, achieves state-of-the-art performance on several NLP tasks, particularly in few-shot settings. Despite being widely applied, prompt-based learning is vulnerable to backdoor attacks. Textual backdoor attacks are designed to introduce targeted vulnerabilities into models by poisoning a subset of training samples through trigger injection and label modification. However, they suffer from flaws such as abnormal natural language expressions resulting from the trigger and incorrect labeling of poisoned samples. In this study, we propose ProAttack, a novel and efficient method for performing clean-label backdoor attacks based on the prompt, which uses the prompt itself as a trigger. Our method does not require external triggers and ensures correct labeling of poisoned samples, improving the stealthy nature of the backdoor attack. With extensive experiments on rich-resource and few-shot text classification tasks, we empirically validate ProAttack's competitive performance in textual backdoor attacks. Notably, in the rich-resource setting, ProAttack achieves state-of-the-art attack success rates in the clean-label backdoor attack benchmark without external triggers.

1 Introduction

Prompt-based learning is vulnerable to backdoor attacks, and conventional textual attacks can be detectable because of abnormal trigger expressions or mislabeled poisoned samples. ProAttack uses correctly labeled samples and prompts as triggers, with competitive results in rich-resource and few-shot settings.

1 Introduction

  • Prompt-based learning has been reported vulnerable to backdoor attacks, motivating research into their security.The authors state that they aim to raise awareness of preventing prompt-based backdoor attacks.Source: §1 · pp. 1–2
  • Existing textual backdoor attacks may produce abnormal language and incorrectly label poisoned samples, making them easier to detect.Table 1 compares attack approaches by label modification and trigger type.Source: §1 · p. 1, Table 1 · p. 2
  • ProAttack uses prompts themselves as triggers in a clean-label attack, constructing correctly labeled poisoned samples for training.The method aims to make the specific prompt trigger downstream model outputs.Source: §1 · pp. 1–2
  • ProAttack reports competitive performance in rich-resource and few-shot settings, with state-of-the-art rich-resource attack success rates without external triggers.The experiments examine prompt-based attacks in both settings.Source: §1 · p. 2

2 Related Work

Prior textual backdoor work includes both poison-label and clean-label approaches, while prompt-based attacks have also used added textual or continuous triggers. This paper positions its approach as using the prompt itself as the trigger for a clean-label attack.

2 Related Work

  • Textual backdoor attacks include poison-label methods that change samples and labels, and clean-label methods that preserve labels while changing samples.Examples include rare-word triggers, syntactic triggers, learnable word combinations, and generated or synthesized poisoned samples.Source: §2 · p. 2
  • Prompt-based backdoor studies have used short phrases, rare words, and continuous prompts as triggers, whereas this work uses the prompt itself.The cited prior approaches are Xu et al. (2022), Du et al. (2022), and Cai et al. (2022).Source: §2 · pp. 2–3

3 Clean-Label Backdoor Attack

This section formulates prompt-based clean-label backdoor training and describes ProAttack, which uses prompts as triggers while keeping poisoned samples correctly labeled. It outlines prompt engineering, poisoned-sample construction, and victim-model training.

3.1 Problem Formulation

  • The formulation applies prompt engineering to training samples, then trains a victim model on a dataset that includes correctly labeled poisoned samples.At inference, the victim model is intended to misclassify poisoned test samples as the target class while performing well on clean test data.Source: §3.1 · p. 3

3.2 Prompt Engineering

  • Prompt engineering converts raw inputs into task-specific prompts that are fed to the language model, with prompt tokens providing context for the task.For sentiment classification, the model predicts the polarity from the <mask> token.Source: §3.2 · p. 3

3.3 Poisoned Sample Based on Prompt

  • ProAttack uses the prompt itself as a trigger, avoiding additional trigger tokens while preserving the poisoned samples’ correct labels.The attack assigns specific prompts to a subset of same-category training samples and different prompts to the remaining samples.Source: §3.3 · pp. 3–4, Figure 1 · p. 4

3.4 Victim Model Training

  • The victim text-classification model maps sentences to language-model features, then uses a feedforward layer and softmax to produce class probabilities.The attack objective includes losses for clean and poisoned samples, and the section identifies cross-entropy as the loss function.Source: §3.4 · p. 4

4 Experiments

Experiments assess ProAttack on text-classification datasets in rich-resource and few-shot settings, using attack success and clean-accuracy measures. The reported results show strong attack success across both settings, with comparisons to existing methods and analyses of poisoning rates, feature distributions, and defenses.

4.1 Experimental Details

  • The rich-resource evaluation used SST-2, OLID, and AG’s News; few-shot evaluation used five datasets with 16 shots per class, except OLID with 24.The few-shot experiments included BERT_large, RoBERTa_large, XLNET_large, and GPT-NEO-1.3B.Source: §4.1 · p. 5
  • The evaluations tracked NCA, PCA, CA, and ASR and compared rich-resource attacks with poison-label and clean-label baselines, including Triggerless.ONION and SCPD were selected as representative defenses for the rich-resource evaluation.Source: §4.1 · pp. 5–6

4.2 Backdoor Attack Results of Rich-resource

  • ProAttack reached nearly 100% ASR in rich-resource tests and an average ASR improvement over Triggerless of 1.41% (SST-2), 0.5% (OLID), and 4.53% (AG’s News).The paper reports these as state-of-the-art clean-label results without external triggers.Source: §4.2 · p. 6, Table 2 · p. 6
  • In rich-resource feature visualizations, normal and prompt-model distributions corresponded, while the victim-model distribution did not match actual categories.For few-shot models, additional feature distributions were often as numerous as poisoned samples, which the authors suggest different prompts may induce.Source: Figure 2 · p. 5, §4.2 · p. 7, §4.3 · p. 8
  • As the rich-resource poisoning rate increased, ASR quickly exceeded 90% while clean accuracy stayed stable; ASR variability also decreased.The authors attribute stable clean accuracy to using prompts as triggers without changing original-sample semantics.Source: Figure 3 · p. 6, §4.2 · p. 7

4.3 Backdoor Attack Results of Few-shot

  • In few-shot tests, ProAttack achieved nearly 100% ASR across five datasets and four language models; on COLA with GPT-NEO, clean accuracy was 14.38% above normal and 2.3% above prompt clean accuracy.With GPT-NEO, ASR also exceeded 95% with six poisoned samples in SST-2, OLID, MR, and TREC.Source: §4.3 · pp. 7–8
  • In rich-resource tests, ProAttack evaded ONION and SCPD detection while maintaining a higher attack success rate.The defense evaluation is reported in Table 6.Source: §4.3 · pp. 8–9, Table 6 · p. 9

5 Conclusion

ProAttack uses manipulated prompts as triggers for clean-label textual backdoor attacks. Experiments in rich-resource and few-shot settings report nearly 100% attack success and state-of-the-art results without external triggers in the rich-resource clean-label benchmark.

  • Nearly 100% attack success rate is reported for prompt-based clean-label attacks, with state-of-the-art results in the rich-resource benchmark without external triggers.Source: §5 · p. 9
  • ProAttack constructs new samples by manipulating prompts and uses them as triggers for clean-label textual backdoor attacks.Source: §5 · p. 9
  • Comprehensive experiments in rich-resource and few-shot settings demonstrate the effectiveness of the attacks.Source: §5 · p. 9

Limitations

The authors identify two future research needs: verifying prompt-based clean-label attack generalization in additional scenarios and exploring effective defenses.

  • Further verification is needed for the generalization of prompt-based clean-label attacks in additional scenarios, such as speech.Source: Limitations · p. 9
  • Effective defenses, including isolating poisoned samples based on feature distribution, remain to be explored.Source: Limitations · p. 9

Ethics Statement

The authors frame their work as raising awareness of prompt-based backdoor risks and supporting greater attention to NLP security, while acknowledging potential misuse.

  • They aim to raise awareness and strengthen security consideration in NLP systems to avoid backdoor attacks' potentially devastating impact on language models.Source: Ethics Statement · p. 9
  • The authors acknowledge that attackers may use ProAttack for negative purposes, but argue that dissemination can inform users about prompts designed for backdoor attacks.Source: Ethics Statement · p. 9
  • They state that disseminating the work aligns with ethical principles and does not endorse or condone prompts for designing backdoor attack models.Source: Ethics Statement · p. 9

A Experimental Details

The experimental appendix reports dataset and poisoned-sample details for rich-resource and few-shot settings, including model-specific optimal few-shot poison counts and variability results.

  • In few-shot settings, datasets and pre-trained language models use varying numbers of poisoned samples to achieve optimal attack success rates.Source: A Experimental Details · p. 13
  • Table 7 gives details for three text classification datasets and poisoned-sample counts in rich-resource settings.Source: Table 7 · p. 13
  • Table 8 covers five text classification datasets and gives optimal poisoned-sample counts for BERT, RoBERTa, XLNET, and GPT-NEO; COLA, MR, and TREC use validation sets to test attack effectiveness.Source: Table 8 · p. 13
  • Table 9 reports standard deviations alongside experiment averages for NCA, PCA, CA, and ASR on SST-2, OLID, and AG’s News.Source: Table 9 · p. 13

B Experimental Results

As poisoned-sample counts rise, attack success approaches 100% across pretrained models, though clean accuracy may suffer. The experiments also examine feature distributions and prompt choices across datasets and models.

B Experimental Results

Loading 2305.01219v6…