Evaluating the Robustness of Discrete Prompts

Yoichi Ishibashi, Danushka Bollegala, Katsuhito Sudoh, Satoshi Nakamura

TL;DR

Automatically learned discrete prompts—often composed of "gibberish" strings of punctuation and random words—can outperform human-written ones, but they are surprisingly fragile. This paper reveals that these prompts are highly sensitive to token ordering and deletion, generalize poorly across different datasets, and likely capture dataset-specific artifacts rather than robust task logic.

What Problem Does This Paper Address?

Prompt-based learning has become a popular way to adapt Pre-trained Language Models (PLMs) like RoBERTa to specific tasks using only a few examples. While manually writing prompts is difficult and requires domain expertise, automatic methods like AutoPrompt (AP) have emerged to "learn" optimal discrete prompts.

However, these learned prompts often look like nonsense to humans, containing spelling errors and strange punctuation (e.g., [X]neau optionally fluent!?¨traditional [Y]). This raises a critical question: Are these models actually learning the underlying task, or are they just exploiting random statistical noise in the training data? The authors set out to systematically test the robustness of these discrete prompts against various perturbations to see if they truly generalize.

Methods

The researchers compared three primary approaches:

  1. AutoPrompt (AP): Automatically searches for "trigger tokens" using a gradient-guided search to maximize performance on a small training set.
  2. Manually-written Prompts (MP): Uses human-designed templates (e.g., {hypothesis}? | <MASK>, {premise}).
  3. Head-based Fine-Tuning (HFT): The traditional approach of adding a classification head and fine-tuning the entire model.

To test robustness, they applied four types of perturbations:

  • Token Reordering: Randomly shuffling the tokens within the prompt.
  • Token Deletion: Systematically removing one or more tokens from the prompt.
  • Cross-Dataset Evaluation: Training a prompt on one dataset and testing it on another.
  • Adversarial Input Perturbations: Manually editing the input sentences (the hypotheses in an NLI task) to see if the prompt-based model still predicts the correct label.

They measured robustness using the Rate of Degradation (RoD), which quantifies the percentage drop in accuracy caused by a perturbation.

Datasets

The study focused on Natural Language Inference (NLI), a fundamental task where a model determines if a "premise" entails, contradicts, or is neutral toward a "hypothesis." * CommitmentBank (CB): A corpus of short texts. * Multi-Genre NLI (MNLI): A large, crowdsourced collection of sentence pairs from various genres. * Adversarial NLI: The authors created a new benchmark by manually perturbing 100 sentence pairs from CB and MNLI, creating versions that either kept the original label or reversed it (e.g., changing "entailment" to "contradiction").

Key Insights and Ideas

  • The Illusion of Randomness: Even though AutoPrompt's trigger tokens look like a random bag of words, their order matters immensely. Shuffling these tokens caused a significant performance drop, much larger than the drop seen when shuffling human-written prompts. This suggests AP relies on specific positional patterns that are not intuitive to humans.
  • Dataset Overfitting: Prompts learned on one NLI dataset (like CB) performed poorly when applied to another (like MNLI). This indicates that discrete prompt learning is highly dataset-dependent and likely captures "random artifacts" specific to the training samples rather than the general logic of NLI.
  • Fragility vs. Human Logic: Human-written prompts (MP) were much more robust to token deletion and reordering. Interestingly, for the CB dataset, the model performed almost as well with no prompt tokens at all, suggesting the task inputs themselves were doing most of the heavy lifting.
  • Adversarial Trade-offs: While AP was generally less accurate than MP, it was actually more robust to adversarial changes that were intended to flip the ground-truth label. The authors suggest this might be because MP-based models overfit more strongly to the training data's specific phrasing.

Key Results

  • Performance Scaling: As shown in Figure 1, manually-written prompts (MP) consistently outperformed AutoPrompt (AP) as the number of training instances increased.
Performance of AP, MP, and HFT across different training set sizes.
  • Reordering Sensitivity: Shuffling AP tokens on the CB dataset led to a 14% drop in accuracy (RoD 0.21), whereas shuffling MP tokens only caused a 2% drop (RoD 0.03). Figure 2 further illustrates how increasing the "edit distance" (the amount of shuffling) correlates with declining accuracy for AP.
Figure 2: Edit distance and accuracy of the reordered trigger tokens. We evaluated them on the validation data of CB. The prompts numbered 0 through 3 each represent the four prompts learnt by AP (shown in Ta- ble 9). Note that a point with an edit distance of zero indicates accuracy with the original trigger token.
  • Cross-Dataset Failure: When a prompt learned on CB was tested on MNLI, the RoD was a staggering 0.47, confirming that these prompts do not generalize well across domains.

Limitations and Future Work

The authors acknowledge several limitations:

  • Scope of Methods: The study focused on AutoPrompt and manual prompts; it did not investigate continuous (embedding-based) prompts or newer discrete methods like RLPrompt.
  • Model Specificity: Experiments were limited to RoBERTa-large. Different PLMs might exhibit different robustness profiles.
  • Task and Language: The evaluation was restricted to English NLI tasks.

The findings serve as a cautionary tale for researchers: high performance on a specific benchmark doesn't guarantee a robust model. Future work should focus on developing prompt-learning methods that are not just accurate, but also interpretable and robust to the "noisy" reality of real-world data.

Summary updated

Abstract

Discrete prompts have been used for fine-tuning Pre-trained Language Models for diverse NLP tasks. In particular, automatic methods that generate discrete prompts from a small set of training instances have reported superior performance. However, a closer look at the learnt prompts reveals that they contain noisy and counter-intuitive lexical constructs that would not be encountered in manually-written prompts. This raises an important yet understudied question regarding the robustness of automatically learnt discrete prompts when used in downstream tasks. To address this question, we conduct a systematic study of the robustness of discrete prompts by applying carefully designed perturbations into an application using AutoPrompt and then measure their performance in two Natural Language Inference (NLI) datasets. Our experimental results show that although the discrete prompt-based method remains relatively robust against perturbations to NLI inputs, they are highly sensitive to other types of perturbations such as shuffling and deletion of prompt tokens. Moreover, they generalize poorly across different NLI datasets. We hope our findings will inspire future work on robust discrete prompt learning.
BibTeX
@inproceedings{ishibashi2023evaluating,
  author = {Yoichi Ishibashi and Danushka Bollegala and Katsuhito Sudoh and Satoshi Nakamura},
  title = {{Evaluating the Robustness of Discrete Prompts}},
  booktitle = {EACL},
  year = {2023},
  doi = {10.18653/v1/2023.eacl-main.174},
}
Figure