Embedding Perturbation may Better Reflect Intermediate-Step Uncertainty in LLM Reasoning

Qihao Wen, Jiahao Wang, Yang Nan, Pengfei He, Ravi Tandon, Han XuarXiv 2026

TL;DR

To catch errors in LLM reasoning before they ruin the final answer, we need to measure uncertainty at intermediate steps. This paper introduces a simple, highly efficient approach: perturbing token embeddings to find where a model "hesitates" between competing reasoning paths, allowing precise detection of the exact moment a logical or mathematical error occurs.

What Problem Does This Paper Address?

Large Language Models (LLMs) excel at complex reasoning but are prone to subtle, cascading errors in multi-step tasks like mathematics or logic. Traditional Uncertainty Quantification (UQ) methods fall short when trying to audit these intermediate steps.

Probability-based metrics (like Negative Log-Likelihood) are heavily biased by natural language word frequencies—flagging benign transition words like "we" or formatting symbols like "\$" as highly uncertain simply because they are rare in that specific context. Meanwhile, sampling-based methods (generating multiple full responses to check for consistency) are computationally prohibitive if applied to every single intermediate reasoning step.

This paper addresses the need for an efficient, token-level metric that accurately captures "intermediate uncertainty"—the exact point where an LLM's reasoning trajectory begins to deviate into error.

Figure 1: A response of Llama in MATH [17] dataset. The earliest error happens at “216000 = 24 × 33 × 53” (as the peak in red background), while the correct calculation should be 216000 = 26 × 33 × 53. The perturbation-based metrics flag the token ‘4’ with high uncertainty score.

Methods

The authors propose treating token generation probability as a function of preceding token embeddings and measuring the model's sensitivity to minor embedding perturbations. They introduce two variants:

  1. Random Perturbation: Small, independent Gaussian noise is added to all token embeddings across the sequence. The uncertainty score is calculated as the variance of the token's log-probability across multiple forward passes. Because LLMs are autoregressive, perturbations across the entire sequence can be evaluated simultaneously in parallel.
  2. Adversarial Perturbation: Instead of random sampling, the embeddings are shifted slightly in the direction that minimizes the total log-probability of the generated response (using the signed gradient). Tokens whose probabilities drop drastically under this targeted shift are flagged as highly uncertain. This requires only a single forward and backward pass.

Theoretically, both methods approximate the gradient norm of the input, which serves as an inverse proxy for the geometric distance to the model's decision boundary. A high sensitivity indicates that the model is sitting right on the edge of choosing an alternative "rival token" that would lead down a completely different reasoning path.

Datasets

The methods were evaluated across two primary reasoning benchmarks and one factual benchmark:

  • MATH: 6 subsets without graphics (algebra, counting & probability, number theory, precalculus, intermediate algebra, prealgebra).
  • BIG-Bench Hard (BBH): 10 subsets focused on logical deduction (e.g., logical deduction, tracking shuffled objects, web of lies).
  • FactScore: Used specifically to contrast reasoning errors against factual hallucinations.

Key Insights and Ideas

  • Proximity to the Decision Boundary: The core "aha" moment is that an LLM's incorrect reasoning steps don't just have low probability; they happen when the model is intensely torn between multiple competing continuations ("rival tokens"). Perturbing the embeddings causes these rival tokens to surge in probability, exposing the model's hidden hesitation.
Figure 2: An illustration of the (adversarial) embedding perturbation leads the surging of a rival token.
  • Reasoning Errors vs. Hallucinations: The authors discovered a fundamental difference between error patterns. While embedding perturbation excels at catching logical/mathematical missteps, it performs poorly at detecting factual hallucinations (where sampling-based methods like Graph Uncertainty dominate). Hallucinations often stem from spurious correlations or weak grounding in the source context, meaning the incorrect tokens are generated with high, stable confidence that perturbations don't easily shake.
  • Sparsity of the Signal: Perturbation-based metrics yield highly localized, "sparse" signals. Usually, only the exact token triggering the error is flagged, while subsequent tokens generated after the error appear confident because they are logically consistent with the newly established (but incorrect) context.

Key Results

  • Superior Error Localization: On the MATH dataset using Llama-3.1-8B-Instruct, Adversarial Perturbation achieved a top-3 token-level detection rate of 0.54, significantly outperforming standard Negative Log-Likelihood (0.37) and the Bayesian baseline TokUR (0.41).
  • Sentence-Level Performance: At the sentence level on BBH, Adversarial Perturbation consistently outperformed baselines like TokenSAR and CCP across Llama, Qwen, and Mistral models.
  • Extreme Efficiency: Adversarial Perturbation introduces negligible computational overhead, requiring only 0.28 seconds of additional runtime per case, compared to 49.55 seconds for sampling-based Graph Uncertainty.
Figure 4: Time and memory efficiency comparison.

Limitations and Future Work

  • Inability to Detect Hallucinations: As noted, the metric is blind to factual hallucinations driven by strong spurious correlations.
  • Path Ambiguity: The metric cannot reliably distinguish between a model being uncertain because it is about to make a mistake versus being uncertain because there are multiple equally valid, correct reasoning pathways available.
  • Future Directions: The authors suggest scaling these localized uncertainty signals to build better step-level verification models and automated backtracking mechanisms for self-correcting LLMs.

Summary updated

BibTeX
@misc{wen2026embedding,
  author = {Qihao Wen and Jiahao Wang and Yang Nan and Pengfei He and Ravi Tandon and Han Xu},
  title = {{Embedding Perturbation may Better Reflect Intermediate-Step Uncertainty in LLM Reasoning}},
  year = {2026},
  eprint = {2602.02427},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.02427},
}
Figure