Suggested title: The Math Behind Why Rephrasing Your Prompt Breaks Everything

You have seen it happen. You ask a language model a question. It nails the answer. You rephrase the question with the exact same meaning and the model falls flat. Same question, different words, different result. Anyone who builds with LLMs has hit this wall.

We have known about prompt sensitivity for years. People have measured it. Benchmarked it. Complained about it on Twitter. What we have not had is a mathematical proof explaining why it happens. Not a theory. Not a guess. A proof.

A paper published at ACL 2026 last week gives us exactly that. Yang Liu and Chenhui Chu from Kyoto University took a 300-year-old mathematical tool and pointed it at modern language models. The result is the first formal explanation for why LLMs are sensitive to prompts that mean the same thing.

The tool they used is called a Taylor expansion. And it reveals something uncomfortable about how LLMs work inside.

The Setup: LLMs as Math Functions

Here is the starting point. A neural network is a function. You put a vector in. You get a value out. Deep neural networks are just layers of functions stacked on top of each other. This has been understood for decades.

Liu and Chu treat an LLM the same way. Your prompt goes in. The embedding layer turns it into a vector of numbers. That vector passes through transformer layers. The model outputs a probability distribution over its vocabulary for the next token. The log probability of the correct next token is the output value.

So the LLM is a function f(h) where h is the hidden state vector and the output is log probability. Two prompts that mean the same thing produce two hidden state vectors, h₀ and h₁. Prompt sensitivity is the difference between f(h₀) and f(h₁).

If the model were robust, that difference would be zero. Same meaning, same output. But it is not zero. The question is why.

Taylor Expansion: The 300-Year-Old Tool

This is where the math gets interesting. Liu and Chu use a first-order Taylor expansion to decompose the difference between the two outputs.

A Taylor expansion approximates a function near a point. It says: if you know the value of a function at point h₀, and you know its gradient (slope) at that point, you can estimate the value at a nearby point h₁. The difference between the two values is roughly the gradient times the distance between the points.

For LLMs, this means the difference in log probabilities between two meaning-preserving prompts equals approximately the gradient of the log probability with respect to the hidden state, multiplied by the difference between the two hidden states.

In plain English: how much the output changes depends on two things. First, how steep the function is at the first prompt (the gradient). Second, how far apart the two prompts end up in the model's internal representation (the hidden state difference).

This is just calculus. Nothing controversial here. The math is clean.

The Cauchy-Schwarz Upper Bound

Now comes the key step. Liu and Chu apply the Cauchy-Schwarz inequality to the Taylor expansion. Cauchy-Schwarz is one of the most famous inequalities in mathematics. It says that for any two vectors, the absolute value of their dot product is at most the product of their lengths.

When you apply this to the Taylor expansion, you get an upper bound on how different the two log probabilities can be:

|Δ log π(y_t | h)| ≤ ‖gradient‖ × ‖Δh‖

The change in log probability is bounded by the product of two terms. The gradient norm (how sensitive the output is to changes in the hidden state) and the hidden state distance (how far apart the two prompts are in representation space).

This upper bound is the whole story. If it is small, the output difference is small. The model is stable. If it is large, the output can swing wildly between meaning-preserving prompts. The model is sensitive.

So the question becomes: what makes this upper bound large?

The Problem: LLMs Disperse, Not Cluster

This is where the paper gets its most striking finding. Liu and Chu measure both terms of the upper bound across the layers of several LLMs. The gradient norm stays relatively stable. But the hidden state distance, ‖Δh‖, does something unexpected.

They start by looking at a traditional neural network. ResNet-101 trained on CIFAR-10. Images of the same class get closer together as they pass through the network's layers. The intra-class mean distance shrinks. The network clusters similar inputs. This is exactly what you want. Continuous functions produce similar outputs for nearby inputs. Cluster the inputs and the outputs stay close.

LLMs do the opposite.

Two prompts that mean the same thing start close together at the embedding layer. The distance between them is small. But as they pass through transformer layers, that distance grows. It does not shrink. It balloons. Liu and Chu measured the L2 norm of the hidden state difference growing from near zero to approximately 70 across the model's layers.

This is the mechanism. This is why the upper bound stays high. The gradient term is not the problem. The problem is that ‖Δh‖ keeps growing. The model pushes meaning-preserving prompts apart instead of pushing them together.

A traditional classifier clusters same-class inputs so that similar inputs produce similar outputs. An LLM disperses same-meaning inputs so that similar inputs can produce wildly different outputs. The mathematical structure guarantees prompt sensitivity.

You cannot fix this by tweaking prompts. The dispersal happens inside the model, layer by layer, as a structural property of how transformers process language.

Which Prompt Changes Hurt Most

Liu and Chu do not stop at the proof. They also investigate which types of meaning-preserving prompt modifications cause the most sensitivity.

They tested prompt variants across four datasets: ARC Challenge, CommonSenseQA, MMLU, and OpenBookQA. The variants included changes in wording, changes in template formatting, and combinations of both.

The finding: prompt template changes cause more sensitivity than wording changes alone. The wrapper around your question matters more than the question itself.

This aligns with the upper bound analysis. Template changes produce larger ‖Δh‖ values. The hidden states end up further apart. The upper bound gets larger. The output difference gets larger.

If you have been spending hours crafting the perfect question wording and ignoring the template around it, you have been optimizing the wrong variable.

The Correlation With PromptSensiScore

A good theory makes predictions that match existing measurements. Liu and Chu test this.

PromptSensiScore is a metric introduced by ProSA, a prompt sensitivity benchmark from EMNLP 2024. It measures how much an LLM's output varies across meaning-preserving prompt variants. Higher PromptSensiScore means more sensitivity.

Liu and Chu compute their upper bound across the same models and datasets that ProSA evaluated. Then they check the correlation.

The correlation is strong. Their mathematical upper bound, derived from pure calculus, tracks the empirical sensitivity metric. The theory matches the data.

This matters because it validates the approach. The upper bound is not just a theoretical curiosity. It predicts real model behavior. If you want to know whether a model will be prompt-sensitive on a new dataset, you can compute the upper bound without running the full ProSA benchmark.

Templates vs Questions: The Variance Tells the Story

The paper's final analysis looks at logit variance. Liu and Chu decompose the logits into contributions from the prompt template and the question itself. Then they measure how much each component varies across meaning-preserving prompt variants.

The result: prompt templates contribute more to logit variance than the questions themselves. The framing around the question dominates the question's content.

This is counterintuitive. You would expect the question to matter more than the wrapper. The math says otherwise. The template is where the sensitivity lives.

What This Means in Practice

The paper gives us a mathematical foundation for something practitioners have observed empirically. Here is what changes now that we have the proof:

Prompt engineering has a ceiling. You cannot Taylor-expand your way out of this. The dispersal is structural. No amount of prompt tweaking changes the fact that transformers push meaning-preserving inputs apart. The upper bound will stay high.

Template design matters more than question wording. The variance analysis shows templates dominate logits. If you want to reduce sensitivity, standardize your templates. Do not spend hours rephrasing questions while using a different template each time.

The upper bound is a diagnostic tool. You can compute it for any model on any dataset. If the bound is high, expect sensitivity. If it is low, the model is stable for that task. This is faster than running full sensitivity benchmarks.

Fine-tuning alone will not fix this. Previous studies tried to reduce prompt sensitivity through RLHF or instruction tuning. The structural dispersal mechanism means these approaches face a fundamental limitation. You are fighting the architecture, not just the weights.

The Bigger Picture

This paper lands at an interesting moment for the field. Prompt sensitivity has been treated as a practical annoyance. Something to work around. Benchmark it, report the numbers, move on.

Liu and Chu elevate it to a mathematical property of the architecture. The Taylor expansion framework gives a language for talking about prompt sensitivity that does not rely on running experiments. You can reason about it analytically.

The finding that LLMs disperse rather than cluster meaning-preserving inputs also connects to broader questions about transformer architecture. Why do they disperse? Is it the attention mechanism? The positional encodings? The training objective? The paper identifies the behavior but leaves the architectural cause open.

That is the next question. This paper gives us the "what" and the "how much." The "why does the architecture do this" is still out there.

For now, we have something we did not have before. A proof that prompt sensitivity is not a bug. It is a mathematical consequence of how transformers represent language. The math is old. The insight is new.


Citations:

Word count: ~1,420

Fact-check notes:

  • The paper was accepted at ACL 2026 Long Papers (confirmed via ACL Anthology). It was previously submitted to ICLR 2026 but withdrawn, per OpenReview records. The ACL acceptance is the canonical venue.
  • Authors are Yang Liu and Chenhui Chu, both at Kyoto University. Confirmed from ACL Anthology and arXiv.
  • The ‖Δh‖ growing to approximately 70 is from the GitHub README description of the paper's findings. The exact value may vary by model. Worth verifying against the PDF directly before publishing.
  • PromptSensiScore is from the ProSA paper (Zhuo et al., EMNLP 2024 Findings). The correlation between the upper bound and PromptSensiScore is described as "strong" in the abstract. The exact correlation coefficient is in the paper body. Verify the specific r-value if you want to cite it precisely.
  • The claim that "prompt templates exert a greater influence on logits than the questions themselves" comes directly from the paper abstract and is supported by the logit variance analysis in the paper.
  • The earlier article on this topic (2026-05-02-prompt-sensitivity.md) covered the same paper when it was an arXiv preprint / ICLR submission. This article focuses more on the mathematical mechanism (Taylor expansion, Cauchy-Schwarz) and practical implications, making it distinct.