Skip to main content
QUICK REVIEW

[Paper Review] Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design or: How I learned to start worrying about prompt formatting

Melanie Sclar, Yejin Choi|arXiv (Cornell University)|Oct 17, 2023
Topic ModelingComputer Science40 citations
TL;DR

The paper analyzes how formatting changes in prompts dramatically affect LLM performance and introduces FormatSpread to efficiently quantify this sensitivity without model weights.

ABSTRACT

As large language models (LLMs) are adopted as a fundamental component of language technologies, it is crucial to accurately characterize their performance. Because choices in prompt design can strongly influence model behavior, this design process is critical in effectively using any modern pre-trained generative language model. In this work, we focus on LLM sensitivity to a quintessential class of meaning-preserving design choices: prompt formatting. We find that several widely used open-source LLMs are extremely sensitive to subtle changes in prompt formatting in few-shot settings, with performance differences of up to 76 accuracy points when evaluated using LLaMA-2-13B. Sensitivity remains even when increasing model size, the number of few-shot examples, or performing instruction tuning. Our analysis suggests that work evaluating LLMs with prompting-based methods would benefit from reporting a range of performance across plausible prompt formats, instead of the currently-standard practice of reporting performance on a single format. We also show that format performance only weakly correlates between models, which puts into question the methodological validity of comparing models with an arbitrarily chosen, fixed prompt format. To facilitate systematic analysis we propose FormatSpread, an algorithm that rapidly evaluates a sampled set of plausible prompt formats for a given task, and reports the interval of expected performance without accessing model weights. Furthermore, we present a suite of analyses that characterize the nature of this sensitivity, including exploring the influence of particular atomic perturbations and the internal representation of particular formats.

Motivation & Objective

  • Show that LLMs are highly sensitive to prompt formatting despite semantic equivalence.
  • Quantify the performance spread across semantically equivalent prompt formats on diverse tasks.
  • Propose a budget-aware method to sample formats and estimate spread without accessing model weights.
  • Characterize which prompt features contribute to performance variance and how formats relate to internal representations.

Proposed method

  • Develop a formal grammar over plausible prompt formats to define semantic equivalence.
  • Define a performance spread as the range of metric m across formats equivalent to the original format.
  • Model the search for high/low performing formats as a multi-armed bandit and apply Bayesian optimization.
  • Introduce FormatSpread, a budget-aware algorithm that uses Thompson sampling or UCB to estimate spread with limited evaluations.
  • Evaluate on 53 tasks from Super-NaturalInstructions across multiple models, including LLaMA-2 variants, Falcon, and GPT-3.5, using ranking accuracy as the primary metric.
  • Analyze feature contributions and the identifiability of formats via embeddings and principal components.

Experimental results

Research questions

  • RQ1How much performance variation arises from semantically equivalent prompt formatting across tasks and models?
  • RQ2Does increasing model size, adding more few-shot examples, or instruction tuning reduce formatting sensitivity?
  • RQ3Can we efficiently estimate the performance spread with limited evaluations without accessing model weights?
  • RQ4What internal prompt-embedding properties correlate with observed format-induced performance spread?
  • RQ5Are format differences equally impactful across different models, indicating weak cross-model correlations?

Key findings

  • Prompt formatting can yield up to 76 accuracy point differences for equivalent formats on some tasks.
  • Across 53 tasks, a median spread of 7.5 accuracy points is observed; some tasks show spreads over 70 points.
  • FormatSpread can estimate true spread within about 1 point with a budget of around 51k evaluations, outperforming naive sampling.
  • The format-embedding separability correlates with performance spread, and a classifier can identify formats from prompt embeddings with high accuracy.
  • Formatting effects persist despite increases in few-shot examples, model size, or instruction tuning.
  • Format performance often does not strongly correlate between models, complicating cross-model comparisons.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.