How are Prompts Different in Terms of Sensitivity?

Sheng Lu, Hendrik Schuff, Iryna Gurevych · DOI

Abstract

Researchers have discovered that "sensitivity"—the degree to which a Large Language Model's (LLM) output changes when subjected to minor input perturbations—serves as a powerful, unsupervised proxy for task performance. By measuring this stability, prompt effectiveness can be predicted without labeled data. This paper introduces the concept of Boolean function sensitivity in the context of LLMs and presents Sensitivity-Aware Decoding (SAD), a strategy that improves accuracy by steering models toward more robust outputs.

Introduction

In-context learning (ICL) allows Large Language Models (LLMs) to perform complex tasks via specific instructions or examples (prompts) without fine-tuning. However, prompt engineering remains largely empirical; why one phrasing outperforms another is often unclear. Traditionally, evaluating a prompt requires a labeled validation set, which is resource-intensive. This research addresses the lack of a systematic understanding of prompt-model interactions by investigating whether a prompt's quality can be measured through the mathematical stability of the function it induces.

Methodology: Measuring Sensitivity

The authors frame prompt stability through the lens of Boolean function sensitivity. The process involves two primary stages: data synthesis and sensitivity estimation.

Overview of the sensitivity estimation pipeline, including data synthesis (a) and the calculation of sensitivity based on prediction flips (b).

To calculate sensitivity, an input (e.g., a sentence for linguistic analysis) is perturbed to create several "synthetic" versions by swapping words or altering structure. The model's predictions for these variations are observed; if the model's output remains consistent, sensitivity is low. Conversely, frequent changes in output indicate high sensitivity.

Beyond measurement, the researchers utilized gradient-based saliency scores to identify which tokens in a prompt the model prioritizes. They also introduced Sensitivity-Aware Decoding (SAD), a novel algorithm that adds a penalty term for words exhibiting high sensitivity during generation, favoring more stable outputs.

Key Results and Insights

The study evaluated various model families—including GPT-3.5, LLaMA 2, and Flan-T5—across five Natural Language Understanding (NLU) and reasoning tasks (CoLA, RTE, SST2, CSQA, and GSM8K).

Sensitivity as a Performance Proxy

A central finding is the strong negative correlation ($r = -0.8764$) between accuracy and sensitivity. As shown in the experimental results, prompts that yield higher accuracy consistently exhibit lower sensitivity across different model architectures.

Accuracy vs. sensitivity across different models and prompt types, demonstrating the strong negative correlation between the two metrics.

This correlation allows for unsupervised prompt selection: one can evaluate multiple prompt variations and select the one with the lowest sensitivity, likely identifying the most accurate option without needing ground-truth labels.

Prompts as Stabilizers

Effective prompts, such as those employing "Chain-of-Thought" reasoning or clear instructions, function by decreasing the model's sensitivity and "smoothing out" its decision boundaries. Saliency scores further revealed that prompt instructions often carry more weight than the input data itself, suggesting that prompts trigger internal "memories" of training data, allowing the model to filter noise in specific test instances.

Discussion and Limitations

While Sensitivity-Aware Decoding (SAD) consistently outperforms standard greedy decoding—especially for simple prompts—it comes with a computational cost. SAD requires multiple inference passes to estimate sensitivity for each token, making it approximately five times more expensive than standard methods.

Furthermore, while the framework excels in closed-ended classification and reasoning tasks, defining "stability" for open-ended, creative generation remains a challenge. Future work will explore extending these metrics to more subjective tasks where multiple correct outputs are possible.

Conclusion

By moving prompt engineering from heuristic "vibes" toward a measurable science of model stability, this research provides a structural framework for understanding and improving LLM performance. Sensitivity serves not only as a diagnostic tool but also as a functional component in more robust decoding strategies.

Summary updated

BibTeX
@inproceedings{lu2024how,
  author = {Sheng Lu and Hendrik Schuff and Iryna Gurevych},
  title = {{How are Prompts Different in Terms of Sensitivity?}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.naacl-long.325},
}
Figure