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.
Introduction: The "Gibberish" Problem
Prompt-based learning has become a standard method for adapting Pre-trained Language Models (PLMs) to specific tasks. While manually crafting the "perfect" prompt is an arduous process requiring expert intuition, automated methods like AutoPrompt (AP) have emerged to search for optimal "trigger tokens" using gradient-guided search.
However, these automatically learned prompts often manifest as "gibberish" strings—sequences of tokens that lack human-readable logic. For instance, a prompt for fact retrieval might include strings like “[X]neau optionally fluent!?¨traditional [Y]”. Despite their nonsensical appearance, these prompts often achieve high accuracy. This study investigates whether these prompts are capturing meaningful task patterns or merely exploiting random artifacts in training data.
Experimental Setup
The authors compare three primary approaches across Natural Language Inference (NLI) tasks:
- AutoPrompt (AP): Automated search for trigger tokens to maximize performance.
- Manually-written Prompts (MP): Human-designed templates (e.g.,
"{hypothesis}? | <MASK>, {premise}"). - Head-based Fine-Tuning (HFT): Traditional classification layer addition.
Robustness was evaluated using four "stress tests": Token Reordering (shuffling prompt tokens), Token Deletion (removing tokens), Cross-Dataset Evaluation (training on one dataset, testing on another), and Adversarial Input Perturbations (editing the premise/hypothesis). The study utilized the CommitmentBank (CB) and Multi-Genre NLI (MNLI) datasets.
Key Insights on Robustness
The Word Order Paradox and Brittleness
Despite appearing as a random "bag of words," AP prompts are highly sensitive to token order. Shuffling tokens in AP prompts led to a significantly sharper performance drop compared to manual prompts. On the CB dataset, AP's accuracy dropped by approximately 14%, while manual prompts only saw a 2% decrease. Similarly, deleting even a single token from an AP prompt can cause substantial degradation, suggesting that every character in the "gibberish" string contributes to the model's behavior.
Generalization and Input Robustness
AP prompts exhibit poor generalization across datasets. A prompt optimized for CB performs poorly on MNLI (and vice versa), indicating that automatic prompt learning is prone to overfitting to dataset-specific biases rather than learning universal task logic like "entailment."
Interestingly, AP prompts showed surprising robustness to input text perturbations. When the premise or hypothesis was manually edited, AP prompts maintained their performance better than manual prompts, suggesting they may be less reliant on specific surface cues within the input text itself compared to human-written templates.
Performance and Data Scaling
In few-shot scenarios with limited training data, AP demonstrates strong performance. However, as the number of training points increases, both Manually-written Prompts (MP) and Head-based Fine-Tuning (HFT) eventually outperform the automated discrete prompt method.
Conclusion
While automatically learned discrete prompts offer a powerful tool for few-shot learning, their lack of interpretability is mirrored by a lack of structural robustness. They are brittle to internal changes (shuffling, deletion) and fail to generalize across data distributions. Future research should focus on developing prompt-learning algorithms that prioritize robustness and cross-dataset stability alongside raw accuracy.
Summary updated