Source-linked AI summary

An Information-theoretic Approach to Prompt Engineering Without Ground Truth Labels

Taylor Sorensen, Joshua Robinson, Christopher Michael Rytting, Alexander Glenn Shaw, Kyle Jeffrey Rogers, Alexia Pauline Delorey, Mahmoud Khalil, Nancy Fulda, David Wingate

arXiv:2203.11364v1cs.CLcs.LG

TL;DR

Prompt engineering must select effective templates despite large performance differences between semantically similar prompts and the requirements of labels or model access in existing methods. The paper selects candidate templates by maximizing mutual information between inputs and model outputs, finding strong alignment with accuracy across tasks and near-oracle selection on the largest model. Its applicability remains bounded when candidate prompts are poor or high mutual information does not reliably imply high accuracy.

  • Problem

    Prompt selection is difficult because semantically similar prompts can yield different performance, while existing methods require labeled data, model parameters, or both.

  • Method

    The method selects, from candidate templates, the template that maximizes mutual information between the input and the model output.

  • Results

    Across eight datasets and seven NLP tasks, mutual information is highly correlated with test accuracy; on the largest models, selection reaches 90% of the way from mean to maximum accuracy.

  • Takeaways & Limitations

    Mutual information can select one of the best prompts across varied NLP tasks without ground truth labels or model weights.

  • Takeaways & Limitations

    The method cannot align a model when the entire prompt set is poor, and high mutual information does not necessarily imply high accuracy.

Abstract

from arXiv · show

Pre-trained language models derive substantial linguistic and factual knowledge from the massive corpora on which they are trained, and prompt engineering seeks to align these models to specific tasks. Unfortunately, existing prompt engineering methods require significant amounts of labeled data, access to model parameters, or both. We introduce a new method for selecting prompt templates \textit{without labeled examples} and \textit{without direct access to the model}. Specifically, over a set of candidate templates, we choose the template that maximizes the mutual information between the input and the corresponding model output. Across 8 datasets representing 7 distinct NLP tasks, we show that when a template has high mutual information, it also has high accuracy on the task. On the largest model, selecting prompts with our method gets 90\% of the way from the average prompt accuracy to the best prompt accuracy and requires no ground truth labels.

1 Introduction

Prompt performance varies substantially across semantically similar templates, while existing selection methods often require labeled data or model access. This paper proposes selecting templates by mutual information and reports strong accuracy alignment without either requirement.

  • 1 Introduction: On GPT-3 Davinci 175B, the MI-selected prompt performs at almost oracle levels without labels or model-weight access.Figure 1 compares MI selection with worst, mean, median, and best prompt performance.
  • 1 Introduction: Prompt wording changes can produce substantially different output distributions and task performance, making template selection consequential.The paper highlights alternative orderings, capitalization changes, and rephrasing as sources of performance variance.
  • 1 Introduction: Mutual information selects prompts without labeled examples or access to model parameters.The method evaluates candidate templates using the relationship between inputs and model outputs rather than validation accuracy or backpropagation.
  • 1 Introduction: Across eight datasets and seven NLP tasks, template mutual information is highly correlated with test accuracy.The reported relationship is strongest for the largest models studied.
  • 1 Introduction: Mutual information can select one of the best prompts across varied NLP tasks without ground truth labels or model weights.The authors present the approach as portable to other tasks and provide code online.

2 Related Work

Prior prompt-engineering methods include continuous optimization, cross-validation, and minimum-description-length approaches, but they can require model access or labels and often provide limited gains. This work applies mutual information to template selection without those requirements.

  • 2 Related Work: Continuous prompt optimization can achieve strong performance but requires direct model access, backpropagation, and labeled examples.The resulting prompts are also not interpretable in natural language, limiting transfer of insights across tasks.
  • 2 Related Work: Cross-validation and minimum-description-length selection produce prompts only marginally better than average test accuracy.These approaches are presented as non-gradient-based alternatives.
  • 2 Related Work: This paper applies mutual information to prompt engineering and selects templates without an artificial probing set.The method jointly uses statistics related to GlobalE and LocalE while focusing on template quality rather than example ordering.

3 Methods

The method selects among candidate prompt templates by maximizing mutual information between templated inputs and model outputs, without ground-truth labels or model-weight access. It represents task outputs as collapsed token probabilities and estimates mutual information from sampled inputs.

  • 3 Methods: The procedure generates candidate templates, checks their outputs, estimates mutual information for each, and selects templates with the highest mutual information for inference.The method is designed to operate without labeled examples or direct access to model parameters.
  • 3.1 Task Definition: For open-ended tasks, shared initial tokens can artificially inflate accuracy, although the authors report that this effect is small and does not affect their results.A temperature-zero ROCStories check produced virtually unchanged results.
  • 3.1 Task Definition: The framework primarily uses One-token Response tasks, where irrelevant tokens are ignored and probabilities for possible answers are collapsed and normalized.The authors choose OTR-compatible tasks for simplicity and lower computational expense, although the method is not limited to them.
  • 3.1 Task Definition: For each input, a templatizing function maps raw data to a prompt, the language model produces token probabilities, and a collapsing function converts them into normalized probabilities over task answers.These collapsed distributions support mutual-information estimation and answer prediction.
  • 3.2 Mutual Information: Mutual information is estimated as marginal entropy minus conditional entropy, with the former computed from the mean conditional distribution and the latter from the mean individual entropies.The estimates use sampled inputs and the model distributions produced by each template.
  • 3.2 Mutual Information: Maximizing mutual information favors templates whose outputs are less biased toward any answer while remaining confident, providing a criterion for selecting prompt templates.The method formally selects θ̂ = argmaxθ I(fθ(X); Y).

4 Experimental Setup

The experiments evaluate mutual-information prompt selection across eight datasets spanning seven NLP tasks and eight causal language models. They use 20 templates per model–dataset pair and sample 500 examples from each dataset, with task-specific preprocessing for the OTR framework.

  • 4.1 Datasets: The experiments compare distributions of accuracies over K = 20 templates for each model–dataset pair with prompts selected using mutual information.Figure 3 presents the template-accuracy distributions and the MI-selected prompts.
  • 4.1 Datasets: The study evaluates eight datasets spanning seven NLP tasks, using a random sample of N = 500 examples from each dataset.The datasets include SQuAD2.0, LAMBADA, ROCStories, CoQA, IMDB, BoolQ, COPA, and WiC.
  • 4.1 Datasets: The authors modify SQuAD and CoQA to reduce ambiguity when casting their tasks into one-token response prediction.They remove SQuAD questions without one-word answers and CoQA questions whose answer choices share a first word.
  • 4.2 Models: The models range from GPT-2 124M to GPT-3 Davinci at 175B parameters and are all causal language models.The set includes GPT-2, GPT-Neo, GPT-J, and GPT-3 variants.

5 Results

Across eight datasets and seven NLP tasks, mutual information generally selects high-accuracy templates without labels, with strongest performance on larger models and high-signal tasks.

  • 5.1 Template Selection Performance: On GPT-3 175B, mutual information selected templates outperforming mean and median accuracy on all eight datasets and matched the best template on three.These comparisons use random and oracle selection as baselines.
  • 5.1 Template Selection Performance: 83% of mutual-information selections were above average across all models on the other datasets, rising to 100% for the two largest models.The low-signal COPA and WiC datasets were exceptions for smaller models, with performance near chance.
  • 5.2 Correlation between MI and Accuracy: MI and accuracy were highly correlated across templates, especially for larger models, supporting label-free accuracy prediction.The relationship held across all model sizes for SQuAD, LAMBADA, ROCStories, and CoQA, but was less reliable for some tasks on smaller models.
  • 5.3 Compared to Few Labeled Examples: With only N = 2 unlabeled instances, MI selected a better-than-average template and sometimes outperformed labeled accuracy selection across all eight datasets.Labeled selection often improved at larger N, but required labeled data.
  • 5.4 Method Robustness and Ensembling: For six of eight datasets, the highest-MI templates were robust high performers, while COPA and WiC were brittle when the top-MI template was excluded.The results motivate diverse template generation and expose sensitivity to anomalous high-MI, low-accuracy outliers.
  • 5.4 Method Robustness and Ensembling: The top-five-MI ensemble performed at least as well as the all-20 ensemble in all but one case at one-fourth the experimental cost.Ensembling the top five is presented as a way to guard against anomalous templates.
  • 5.5 Transferability across Models: When GPT-3 175B selected and inferred prompts, MI reached 90% of the normalized range from average to best prompt accuracy.Only one of 64 model-transfer permutations had a negative average gain, suggesting transfer was often effective.
  • 5 Results: Overall, mutual-information prompt selection was effective across datasets and model sizes, working best for larger models and tasks the language model could perform.The authors expect the method to transfer to additional NLP tasks, including low-label regimes.

6 Conclusion

The paper introduces mutual-information-based prompt selection without ground-truth labels or direct model access, and reports accuracy gains across models and tasks.

  • Mutual-information prompt selection improves over random choice and approaches oracle performance on GPT-3 175B across model sizes and tasks.
  • The method requires neither ground-truth labels nor direct model access, enabling prompt selection when labeled data or model parameters are unavailable.

7 Ethics

The paper acknowledges that some tasks remain beyond alignment and that mutual information does not guarantee high accuracy, especially when candidate prompts are poor.

  • Mutual information cannot align a language model when the entire prompt set is poor or the model cannot be aligned to the task.
  • High mutual information does not necessarily imply high accuracy despite the observed strong correlation.
  • Safe use requires understanding how high mutual information must be within a domain or template set to indicate sufficiently high accuracy.
  • The paper reports no model, dataset, or other contribution that might warrant ethical concern.

Christopher Clark, Kenton Lee, Ming-Wei Chang,

The cited works cover language-model pretraining, prompt engineering, mutual information, probing, and several NLP datasets and tasks.

  • The references include foundational work on language models, transfer learning, prompt tuning, and prompt engineering.
  • The bibliography includes datasets and benchmarks for commonsense reasoning, context-sensitive representations, discourse prediction, question answering, and sentiment analysis.
  • Several cited studies apply mutual information or related information-theoretic methods to language representation learning, part-of-speech induction, probing, and description length.

A Prompt Engineering Process

The method constructs diverse prompt templates, checks their expected token behavior, estimates mutual information without labels, and selects templates for inference.

  • The approach requires candidate prompt templates, unlabeled input instances, and no ground-truth labels, gradient updates, or model-parameter access.
  • Each template maps an input into a natural-language prompt, while a collapsing function converts model token probabilities into target-label probabilities.
  • Templates are manually written and diversified across formats such as questions, dialogue, Python code, and answer banks.
  • The collapsing function groups lexical variants, sums their probabilities, and normalizes the resulting scores over possible answers.
  • The authors note that additional template variation, including few-shot example ordering, remains a direction for future work.
  • A label-free playground check verifies that prompts assign high probability to tokens expected for the task, such as “Yes” or “No” for BoolQ.

4. Choose prompt template(s) to use for inference based on mutual information. For choosing

After estimating mutual information, the method selects the highest-scoring prompt template for inference and can optionally use a smaller model or ensemble top templates.

  • The highest-mutual-information template is selected for inference, with ensembling of the top p templates available under a larger computational budget.
  • Inference applies the selected template and collapsing function, using either the estimation model or a smaller model when cost is prohibitive.

B.2 Per Dataset Transfer Heatmaps

The evaluation includes a cross-dataset mutual-information and accuracy plot and per-dataset prompt-transfer figures spanning SQuAD, LAMBADA, ROCStories, CoQA, IMDB, BoolQ, COPA, and WiC.

  • Figure 9 plots mutual information against accuracy for each prompt on GPT-3 175B, with linear best-fit lines showing overall trends.
  • Prompt-transfer performance is reported separately for SQuAD, LAMBADA, ROCStories, CoQA, IMDB, BoolQ, COPA, and WiC.
  • The remaining prompt-transfer figures cover COPA and WiC as additional per-dataset evaluations.

C Template Examples

The appendix illustrates prompt-template diversity and reports mutual-information and accuracy pairs for example templates, including several SQuAD and IMDB variants.

  • C.1 SQuAD: The SQuAD examples include diverse context-question formats, answer keys, and direct question-answer constructions.
  • C.1 SQuAD: Prompt 1 for SQuAD has MI 4.950 and accuracy 0.820, illustrating a high-performing template example.
  • C.1 SQuAD: Other SQuAD examples vary wording, repeated context presentation, conversational formatting, and answer instructions.
  • C.5 IMDB: Prompt 5 for IMDB has MI 0.237 and accuracy 0.888 under a direct sentiment-classification instruction.
  • C.5 IMDB: Prompt 7 for IMDB has MI 0.086 and accuracy 0.886, while Prompt 9 has MI 0.026 and accuracy 0.852.
Loading 2203.11364v1…