Source-linked AI summary
Demystifying Prompts in Language Models via Perplexity Estimation
Hila Gonen, Srini Iyer, Terra Blevins, Noah A. Smith, Luke Zettlemoyer
TL;DR
Prompt performance varies substantially, but the paper investigates whether model familiarity with prompt language explains this variation. It expands seed prompts through GPT3 paraphrasing and backtranslation, then selects low-perplexity prompts. Across diverse tasks and models, lower perplexity correlates with better performance, while SPELL delivers more consistent prompts and average accuracy gains without labels.
Problem
Prompt performance varies significantly, and it remains unclear why seemingly similar prompts behave differently or how to choose effective prompts.
Method
The paper tests prompt perplexity as a familiarity proxy, expands manual seed prompts through GPT3 paraphrasing and backtranslation, and uses SPELL to select prompts.
Results
Across diverse tasks and models, lower prompt perplexity correlates with better performance; SPELL gains 1.8 accuracy points with OPT and 2.3 with Bloom over manual prompts.
Takeaways & Limitations
SPELL provides a general, interpretable approach for applying language models to new tasks with minimal human effort and no labels.
Takeaways & Limitations
The analysis and SPELL method are limited to OPT and Bloom, the experimented tasks, and English, so generalization to other models or tasks is uncertain.
Abstract
from arXiv · showhide
Language models can be prompted to perform a wide variety of zero- and few-shot learning problems. However, performance varies significantly with the choice of prompt, and we do not yet understand why this happens or how to pick the best prompts. In this work, we analyze the factors that contribute to this variance and establish a new empirical hypothesis: the performance of a prompt is coupled with the extent to which the model is familiar with the language it contains. Over a wide range of tasks, we show that the lower the perplexity of the prompt is, the better the prompt is able to perform the task. As a result, we devise a method for creating prompts: (1) automatically extend a small seed set of manually written prompts by paraphrasing using GPT3 and backtranslation and (2) choose the lowest perplexity prompts to get significant gains in performance.
1 Introduction
Prompt performance varies substantially, and the paper hypothesizes that lower-perplexity prompts perform better because they are more familiar to the model. It tests this relationship broadly and introduces SPELL, which expands and selects prompts without labels.
- AG News prompts manually curated for OPT 175B differ by over 30 accuracy points, despite addressing the same task.
- The paper hypothesizes that lower-perplexity prompts perform better when they are reasonable and task-related.Perplexity serves as a proxy for model familiarity with prompt language.
- SPELL automatically expands manually written prompts through paraphrasing and selects low-perplexity prompts for task use.
- The analysis covers diverse tasks, including classification and word prediction, across models and model sizes.
- SPELL reduces performance variability and improves average accuracy by 1.8 points with OPT and 2.3 points with Bloom.It requires only a small sample of task inputs and no labels.
- The paper formalizes prompt familiarity, tests the perplexity-performance correlation, expands seed prompts, and develops a label-free prompt-selection method.
2 Why are prompts not all created equal?
The paper explains prompt-performance differences through model expectations of prompt language. It uses prompt perplexity as a practical proxy for familiarity and evaluates its relationship with task performance.
- Different prompts for AG News produce a substantial accuracy gap, and their quality cannot be predicted from the prompt wording alone.
- The paper proposes that prompts appearing more frequently, or in similar forms, in training data work better because the model expects them more.
- Exact prompt-occurrence counts are unreliable because training corpora are enormous, partly unavailable, and yield sparse matches.Only 9/108 AG News prompts appeared exactly in OPT's training data.
- Prompt perplexity acts as a proxy for varied prompt occurrences without requiring access to pretraining data or exact matching.
- The hypothesis predicts a significant negative correlation between prompt perplexity and task performance across tasks and models.
- Perplexity is computed over the full prompt sequence, including the input but excluding the label, averaged across 1,000 examples.Including inputs grounds classification prompts to their tasks and allows SPELL to operate without labels.
- Performance is measured primarily with the model's loglikelihood for the correct label, with accuracy also reported for classification tasks.Loglikelihood provides finer distinctions between prompts and is less unstable than accuracy.
3 Automatic Expansion of Seed Prompts
The paper expands a small manual seed set into a larger, diverse pool of human-readable prompts. It uses GPT3 paraphrasing followed by multilingual backtranslation while preserving task-relevant constraints.
- The prompt pool is expanded to improve phrasing diversity and increase the chance of finding effective prompts.
- The process begins with a small set of human-written prompts that describe each task.For classification, inputs precede prompts and choices are excluded to facilitate paraphrasing.
- GPT3 generates paraphrases of each seed prompt using dedicated paraphrasing meta-prompts.The setup separates prompt generation from ranking, which uses OPT and Bloom.
- Backtranslation translates GPT3 paraphrases and seed prompts through multiple languages and back into English to create additional variants.The method uses eight relatively high-resource languages close to English, adding eight more when necessary.
- The pipeline targets about 100 prompts per task and enforces task-specific words or question structure when required.
- Automatically generated prompts can differ substantially in phrasing and structure from the manually created seed prompts.
- Table 3 reports prompt statistics for the manual seed set and the pools produced after GPT3 paraphrasing and backtranslation.
4 Experimental Setup
The experiments evaluate OPT and Bloom on word-prediction and classification tasks using manually created and automatically expanded prompts. Performance and perplexity are measured over 1,000 examples, with task-specific datasets and prompt constructions.
- Models and tasks: The study evaluates OPT models at 1.3B, 30B, and 175B parameters, plus Bloom at 176B, across two task types.OPT is trained mainly on English, whereas Bloom is multilingual.
- Datasets: Word-level translation uses NorthEuraLex translations of 1,016 words into 107 languages, with nine Latin-script languages for the experiments.Bloom additionally uses five languages outside the Latin script.
- Prompt construction: Prompts are expanded through GPT3 paraphrasing and backtranslation, producing larger prompt sets from manually created seeds.The method targets roughly 100 prompts per task and can add languages when initial alternatives are insufficient.
- Datasets: Antonym prediction uses 1,000 randomly selected word pairs from a Kaggle dataset based on WordNet.The task asks the model to predict a word’s antonym.
- Datasets: Classification covers GLUE Cola, Newspop, AG News, IMDB, DBpedia, and Tweet Offensive, using 1,000 random examples from each dataset.These tasks span grammaticality, news, movie-review, topic, and offensive-language classification.
- Evaluation: Perplexity is averaged across prompts instantiated with 1,000 dataset examples, while prompt performance uses correct-label log probability and classification accuracy.For classification, the predicted class is the highest-scoring label; word-prediction tasks report scores rather than accuracy.
5 Results
Across classification, antonym prediction, and word-level translation, lower prompt perplexity generally corresponds to better performance. The relationship persists across model families and sizes, though it is somewhat weaker in smaller OPT models.
- Overall correlations: Most classification and antonym-prediction correlations are negative and statistically significant for OPT 175B and Bloom.The result supports the hypothesized relationship between lower prompt perplexity and better task performance across most evaluated tasks.
- Word-level translation: Word-level translation correlations are extremely consistent across languages and models, with significance except for Catalan and Japanese in Bloom.The exceptions are specified by the reported significance analysis.
- Model sizes: The same trend generally appears in OPT models of 1.3B and 30B, although correlations are slightly weaker than in larger models.The authors attribute this possible weakening to less stable performance estimates from smaller models.
- Comparison: Replacing perplexity with prompt length yields weak positive correlations, almost all of which are not statistically significant.This comparison distinguishes the reported perplexity relationship from a simple length effect.
6 Analysis
The analysis examines how the perplexity–performance relationship varies across tasks and prompt forms, while testing whether prompt-generation noise explains the correlations. It also compares prompt selection across models.
- 6.1 Visualizing the Relationship between Perplexity and Performance: Across plotted settings, prompt performance shows a visible negative trend with perplexity, and word-level translation plots have similar structures across language pairs.The similarity suggests consistent prompt behavior across the translation languages examined.
- 6.1 Visualizing the Relationship between Perplexity and Performance: Translation prompts with quotation marks tend to have both lower perplexity and better performance than prompts without quotation marks.Within the quotation-mark cluster, correlations range from −0.28 to −0.38 and are statistically significant for almost all languages.
- 6.1 Visualizing the Relationship between Perplexity and Performance: Within the non-quotation-mark cluster, correlations are weaker and less significant, consistent with that cluster’s lower overall performance.The comparison indicates that the overall pattern also reflects separation between prompt-format clusters.
- 6.2 Effect of Noisy Prompts: The 10% highest-perplexity prompts are subjectively usually valid task prompts rather than noisy prompts.GLUE Cola’s five highest-perplexity prompts are provided as an example.
- 6.2 Effect of Noisy Prompts: After external annotators removed noisy prompts, correlations for word-level translation and AG News remained strong and statistically significant.This sanity check tests whether automatically introduced noise accounts for the observed relationship.
- 6.3 Prompt Selection across Models: The lowest-perplexity prompts overlap substantially across OPT 175B and Bloom, with an average intersection of 7.1 among the 10 lowest-perplexity prompts.By contrast, the average intersection of the 10 highest-accuracy prompts is 3.1 across classification tasks.
7 SPELL: Selecting Prompts by Estimating LM Likelihood
SPELL selects prompts by expanding a small manual seed set, ranking paraphrased candidates by perplexity, and choosing the lowest-perplexity prompts. Across tasks and models, this approach improves average accuracy while reducing performance variability.
- 7 SPELL: Selecting Prompts by Estimating LM Likelihood: SPELL analyzes prompt perplexity as a basis for generating and selecting consistently effective prompts.The paper presents it as an application of the broader relationship between prompt perplexity and downstream performance.
- 7 SPELL: Selecting Prompts by Estimating LM Likelihood: The procedure starts with a small manually created prompt set for the task.
- 7 SPELL: Selecting Prompts by Estimating LM Likelihood: Automatic paraphrasing with a language model and backtranslation expands the seed set into a larger candidate pool.
- 7 SPELL: Selecting Prompts by Estimating LM Likelihood: Candidates are ranked by perplexity averaged over a representative sample of task inputs, such as 1,000 examples.
- 7 SPELL: Selecting Prompts by Estimating LM Likelihood: SPELL chooses the k lowest-perplexity prompts, with k exemplified as 3.
- 7 SPELL: Selecting Prompts by Estimating LM Likelihood: The selected prompts are more stable and outperform manual prompts on average without requiring task labels.The method is also intended for users given example inputs, including non-experts.
- 7.1 Empirical Validation of SPELL: 1.8 accuracy points with OPT and 2.3 accuracy points with Bloom separate the average performance of low-perplexity prompts from manual prompts across tasks.The comparison uses the three lowest-perplexity prompts against manual prompts.
- 7.1 Empirical Validation of SPELL: Average standard deviation is 5.07 versus 6.86 for OPT 175B and 2.6 versus 7.47 for Bloom, favoring the three lowest-perplexity prompts over manual prompts.These results support lower performance variability for the SPELL-selected prompts.
8 Related Work
Related work connects model performance with training-data prevalence and develops many automatic prompt-construction methods. It also studies why prompt wording and representation affect performance.
- Prior studies report relationships between model accuracy and the frequency of relevant terms or documents in training data.These studies include numeric deduction and question-answering tasks.
- Automatic prompt research includes gradient-guided discrete search, zero-shot prompt construction, and learned continuous prompts.
- Prompt-analysis studies find high sensitivity to small wording changes and a disconnect between continuous and discrete prompts.
9 Conclusion
The paper investigates why similar-looking prompts differ in performance by testing whether prompt perplexity predicts task performance. It then proposes SPELL, which yields effective, less variable prompts and small gains over manual prompts without labels.
- The study tests whether prompt perplexity is closely tied to task performance across many tasks and autoregressive language models.The reported correlation study validates this hypothesis.
- The best prompts differ across models, while the structure of the perplexity–performance relationship varies across tasks.
- SPELL generates effective prompts with low performance variability and gains 1.8 accuracy points with OPT and 2.3 with Bloom over manual prompts.
- SPELL is presented as a general and interpretable approach requiring minimal human effort and no labels.
Limitations
The analysis and SPELL method are bounded by the prompt space, models, tasks, and language studied. The authors caution that findings may not generalize beyond these settings.
- The search is restricted to fluent, human-readable prompts that accurately describe the task, rather than arbitrary token sequences.The authors leave the expanded prompt space for future work.
- The analysis and method use OPT and Bloom and are limited to the experimented tasks and English.The authors note possible non-generalization to other pretrained models or tasks.
B Lowest Perplexity Prompts
The section presents manually created prompts and identifies the five prompts with the lowest perplexity for each task using OPT 175B.
- Table 12 lists the five lowest perplexity prompts for each task using OPT 175B.
- Table 11 lists the manually created prompts for each task.