NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Shifting Attention to Relevance: Towards the Predictive Uncertainty Quantification of Free-Form Large Language Models

Jinhao Duan, Hao Cheng, Shiqi Wang, Alex Zavalny, Chenan Wang, Renjing Xu, Bhavya Kailkhura, Kaidi Xu

TL;DR

LLMs often hallucinate, making accurate uncertainty quantification (UQ) vital for building trust. This paper introduces SAR (Shifting Attention to Relevance), a method that improves UQ by recognizing that not all tokens or sentences contribute equally to a generation's meaning. By focusing on semantically "heavy" keywords and consistent sentences, SAR provides a significantly more reliable measure of model trustworthiness than traditional entropy-based methods.

What Problem Does This Paper Address?

When an LLM generates text, how do we know if it's "sure" of its answer? Standard Uncertainty Quantification (UQ) methods, like Predictive Entropy, calculate uncertainty by looking at the probability distribution of every token generated.

However, the authors identify a major flaw: generative inequality. Human language is redundant. In the phrase "the density of an object," the word "density" carries the core semantic weight, while "of" and "an" are functional fillers. Current UQ methods treat these tokens equally. If a model is slightly confused by a filler word, the overall uncertainty score spikes, leading the system to "refuse to answer" a perfectly correct generation.

Figure 1: Irrelevant tokens (or sentences) may commit majority uncertainty in free-form generations, such as the token “of” committing extremely large uncertainty misleads the uncertainty quantification of LLMs. We term these observations as generative inequalities and tackle them by shifting attention to more relevant com- ponents.

Methods

The authors propose Shifting Attention to Relevance (SAR), which operates at two levels:

  1. Token-Level Shifting (TOKENSAR): Instead of averaging entropy across all tokens, SAR calculates a "relevance score" for each token. This is done by measuring how much the sentence's meaning changes (using a semantic similarity model like RoBERTa) when that specific token is removed. Uncertainty is then re-weighted to favor these high-relevance tokens.
  2. Sentence-Level Shifting (SENTSAR): When multiple candidate answers are generated, SAR looks for semantic consistency. A sentence that is semantically similar to many other generated samples is considered more "relevant" and its uncertainty is reduced.
  3. SAR (Combined): The full SAR metric integrates both token-level importance and sentence-level consistency into a single, robust uncertainty score.

Unlike previous state-of-the-art methods like Semantic Entropy (SE), which rely on binary "entailment" (does sentence A imply sentence B?), SAR uses "soft" semantic similarity. This makes it much more effective for long-form, complex generations where binary logic often fails.

Datasets

The researchers evaluated SAR across a diverse set of models (from 2.7B to 33B parameters) including OPT, LLaMA, Vicuna, WizardLM, and LLaMA-2-chat. They tested these models on five free-form question-answering benchmarks:

  • General QA: CoQA (conversational), TriviaQA (reading comprehension), and SciQ (science).
  • Medical QA: MedQA and MedMCQA (professional medical board exam questions).

Key Insights and Ideas

  • The "Noise" of Redundancy: The authors demonstrate that irrelevant tokens actually commit the majority of uncertainty in standard metrics. As shown in Figure 3, tokens with low relevance scores often have the highest "Uncertainty Proportion," effectively drowning out the signal from the actual answer.
Figure 3: Correlations between relevance scores and un- certainty proportions in both token-level and sentence- level situations. Irrelevant tokens and sentences domi- nate the total volume of uncertainty quantification.
  • Linguistic Redundancy is Pervasive: Figure 2 shows that the vast majority of tokens in LLM generations have very low relevance scores, confirming that linguistic "filler" is a primary source of UQ error.
Figure 2: Distributions of relevance scores in both token- level and sentence-level situations. It is shown that irrelevant tokens and sentences take considerable pro- portions.
  • Generation Efficiency: One of the most practical findings is that SAR is highly efficient. It can achieve better uncertainty estimates with just 2 generated samples than standard methods can achieve with 5, significantly reducing computational costs.

Key Results

SAR consistently outperformed all baselines (Predictive Entropy, Length-Normalized PE, and Semantic Entropy) across every model and dataset tested.

  • AUROC Gains: On instruction-tuned models like Vicuna and LLaMA-2-chat, SAR improved the AUROC (a measure of how well uncertainty predicts correctness) by an average of 7.1% over the previous state-of-the-art.
  • Robustness: The method proved superior in specialized domains like Medical QA, where precision is critical.
  • Scalability: The performance gap between SAR and baselines remained consistent as model size increased from 2.7B to 33B parameters.
Figure 4: The AUROCs of TOKENSAR, SENTSAR, SAR, and baseline methods, across various “off-the-shelf” LLMs and datasets (e.g., CoQA, and Trivia QA). Rouge-L with a threshold of 0.5 is used as the correctness metric. The proposed SAR substantially outperforms existing methods across all the scenarios.

Limitations and Future Work

  • Latency: Calculating semantic similarity for every token and sentence pair introduces additional computational overhead. While the authors use a small "backbone" model to keep this manageable, it is still slower than simple entropy calculation.
  • Logit Dependency: SAR requires access to the model's token-level logits (probabilities). This makes it difficult to apply to "black-box" models like GPT-4, which often only provide text output via API.
  • Future Directions: The authors suggest exploring more efficient ways to calculate relevance and extending the framework to even longer, multi-paragraph document generation where generative inequality may be even more pronounced.

Summary updated

BibTeX
@inproceedings{duan2024shifting,
  author = {Jinhao Duan and Hao Cheng and Shiqi Wang and Alex Zavalny and Chenan Wang and Renjing Xu and Bhavya Kailkhura and Kaidi Xu},
  title = {{Shifting Attention to Relevance: Towards the Predictive Uncertainty Quantification of Free-Form Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.276},
}
Figure