Next-Token Gradient Sensitivity Probing for LLM Hallucination Detection

Shuhai Zhang, Xutao Wen, Jiahao Yang, Zhiquan Wen, Feng Liu, Bo Han, Yuanqing Li, Mingkui TanOpenReview 2026 · Submission to ICLR 2026 · Rejected

TL;DR

Hallucinations in Large Language Models (LLMs) are fundamentally "fragile"—small tweaks to their internal states cause massive shifts in prediction confidence. This paper introduces Next-token Gradient Sensitivity (NGS), a method that uses a single backward pass to measure this instability and detect hallucinations with high accuracy and efficiency, outperforming existing sampling-based and internal-state baselines.

What Problem Does This Paper Address?

Despite their power, LLMs frequently "hallucinate"—generating facts that are either inaccurate or unfaithful to the source. Detecting these errors is notoriously difficult because they are often localized (a single wrong name in a perfectly fluent paragraph) and subtle (the model might sound very confident while being wrong).

Current detection methods usually fall into two camps:

  1. Uncertainty-based: These require "sampling" the model many times (e.g., generating 10 different answers to the same prompt), which is computationally expensive.
  2. Internal-state-based: These look at the model's hidden layers but often aggregate information across the whole sentence, losing the "fine-grained" signal needed to catch a single hallucinated word.

The authors set out to find a more efficient, token-level signal that captures the "unstable reasoning" inherent in a hallucination.

Methods

The core innovation is Next-token Gradient Sensitivity (NGS).

  • The Intuition: If a model is hallucinating, its prediction is likely based on "weak priors" rather than robust logic. Therefore, if you slightly nudge the embedding of the current token, the model's confidence in the next token should swing wildly.
  • The Math: Instead of actually adding noise and running the model multiple times (which is slow), the authors use gradients. NGS is defined as the gradient of the maximum log-probability of the next token with respect to the current token’s embedding. This provides a first-order measure of "prediction fragility" in a single backward pass.
  • NGS-HD (The Detector): To turn this into a detector, the authors collect reference sets of NGS vectors from known "truthful" and "hallucinated" tokens. For a new test sentence, they calculate the Maximum Mean Discrepancy (MMD)—a statistical tool to compare distributions—between the test tokens' NGS vectors and the reference sets. This results in a "truthfulness score."

Datasets

The authors evaluated their method across a wide range of Question Answering (QA) and long-form generation benchmarks:

  • Standard QA: TruthfulQA, SciQ, TriviaQA, and NQ Open.
  • Long-Context/Reading Comprehension: SQuAD and NarrativeQA (the latter involving documents over 60k tokens).
  • Free-form Generation: Wikipedia paragraph continuations.
  • Models: Evaluated on LLaMA-3.1-8b, Qwen-2.5-7b, Qwen-3-8b, and Qwen-3-14b.

Key Insights and Ideas

  • Hallucinations are "Fragile": The most striking insight is the empirical proof that hallucinated tokens are significantly more sensitive to internal perturbations than truthful ones.
  • The "Instability Cascade": Visualizations show that a hallucination isn't just a single bad token; it often triggers a "cascade of instability" where several subsequent tokens also show high gradient sensitivity, even if they look okay on the surface.
  • Gradients are "Free" Information: By using the gradient of the output with respect to the input embedding, the authors get the same information as perturbation-based sampling but at a fraction of the cost.
  • Distribution vs. Averaging: Most methods average scores across a sentence. By using MMD to compare the distribution of token-level gradients, NGS-HD preserves the signal of localized errors that would otherwise be washed out by the surrounding correct text.

Key Results

  • Superior Accuracy: NGS-HD achieved an average AUROC of ~80.8% on LLaMA-3.1-8b, outperforming the previous state-of-the-art (TSV) by about 3.5% and crushing simple logit-based methods (which hovered around 54-56%).
  • Massive Speedup: NGS-HD is incredibly efficient. It takes roughly 0.13 seconds per instance, compared to 9.04 seconds for Semantic Entropy or 21.94 seconds for Lexical Similarity methods that require multiple samples.
  • Long-Context Robustness: On NarrativeQA (very long texts), traditional methods dropped to near-random performance (~50% AUROC), while NGS-HD maintained a robust 80.33%.
  • Model Agnostic: The method worked even in a "gray-box" setting—using gradients from a Qwen model to detect hallucinations in text generated by a Gemma model.

Limitations and Future Work

  • White-Box Requirement: The method requires access to the model's gradients and embeddings. This means it cannot be used on "closed" API-only models like GPT-4 or Claude unless the providers expose these signals.
  • Reference Set Dependency: While the authors showed that only 20 labeled samples are needed to build a reference set, the method still requires some initial "ground truth" data for the specific model being tested.
  • Future Directions: The authors suggest integrating NGS directly into the decoding process to suppress hallucinations in real-time (active prevention) and extending the framework to multimodal models (e.g., detecting unfaithful image captions).

Summary updated

BibTeX
@misc{zhang2026next,
  author = {Shuhai Zhang and Xutao Wen and Jiahao Yang and Zhiquan Wen and Feng Liu and Bo Han and Yuanqing Li and Mingkui Tan},
  title = {{Next-Token Gradient Sensitivity Probing for LLM Hallucination Detection}},
  year = {2026},
  url = {https://openreview.net/forum?id=yzWGQNTbHQ},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2026},
}
Figure