Evaluating and Explaining Prompt Sensitivity of LLMs Using Interactions
Abstract
The remarkable capabilities of large language models (LLMs) are often undermined by their instability. Even subtle and semantically irrelevant changes in prompts can cause dramatic fluctuations in performance, a phenomenon known as prompt sensitivity. Previous studies typically evaluate prompt sensitivity by comparing the LLM's final outputs when prompts change. However, such coarse-grained metrics fail to explain the internal reasons for prompt sensitivity. In this paper, we introduce interactions as a fine-grained tool to analyze prompt sensitivity of LLMs. Specifically, we decompose the output score of the LLM into a set of interactions. Each interaction represents a nonlinear relationship involving a set of input variables. We discover that subtle changes to prompts can trigger severe instability in interactions, even when the outputs of the LLM remain the same. To this end, we propose an Interaction-based Prompt Sensitivity (IPS) metric by quantifying changes in interactions when we introduce subtle changes to prompts. We apply the IPS metric to 50 open-source LLMs and uncover four factors that reduce the prompt sensitivity of LLMs, including supervised fine-tuning, increased model scales, dense architectures, and few-shot learning. More crucially, we discover a common mechanism by which these four factors reduce prompt sensitivity: all four factors tend to reduce the prompt sensitivity of low-order interactions (i.e., interactions involving few input variables).
Lay Summary
Large language models (LLMs) often suffer from a flaw called prompt sensitivity. Minor changes like altering capitalization or punctuation can change the final output. Previous research only evaluated whether the final output changed, leaving the internal root cause of prompt sensitivity a mystery. We introduced a fine-grained framework to analyze prompt sensitivity based on interactions, which represent the relationships between different input words. We discovered that minor prompt changes trigger large changes in interactions, even when the final output remains the same. Furthermore, we proposed a new metric to evaluate prompt sensitivity and tested 50 open-source LLMs. We found that techniques like fine-tuning, increasing model scale, and few-shot learning reduce sensitivity by stabilizing "low-order interactions" (simple relationships involving few words). Our research found the internal root cause of prompt sensitivity. This understanding will help developers design more robust LLMs and better prompting methods, ensuring LLMs remain stable and reliable in real-world applications.