Introduction
Large Language Models (LLMs) are increasingly deployed in sensitive domains, yet their tendency to "hallucinate" facts remains a critical barrier to safe adoption. Reliable Uncertainty Quantification (UQ) is essential to identify when a model's output should be trusted. Traditional UQ methods often rely on Predictive Entropy (PE), which measures the average randomness of predicted tokens. However, this approach suffers from a phenomenon termed "Generative Inequality": linguistic filler words (e.g., "the", "of", "an") often exhibit high entropy due to stylistic variations, despite carrying little semantic weight. Conversely, critical keywords (e.g., "density") define the factual correctness of the response but may be overshadowed by the cumulative entropy of filler tokens.
The SAR Framework
To address the noise introduced by linguistic redundancy, this paper introduces SAR (Shifting Attention to Relevance). SAR re-weights uncertainty by focusing on semantically significant components of a generation through two primary mechanisms:
- Token-Level Shifting (TOKENSAR): This module assigns a "relevance score" to each token by measuring the semantic shift in the overall sentence embedding when a specific token is removed. Tokens that significantly alter the meaning receive higher weights in the final uncertainty calculation, while filler words are down-weighted.
- Sentence-Level Shifting (SENTSAR): Recognizing that LLMs may produce multiple semantically similar answers, SENTSAR evaluates consistency across candidate generations. It employs a "soft" similarity measure to reduce uncertainty for sentences that align with the broader consensus of the model's outputs, offering more robustness than traditional hard-clustering methods.
The final SAR metric integrates both token-level and sentence-level insights into a unified uncertainty score, effectively filtering out "uncertainty noise."
Experimental Evaluation
The authors evaluated SAR across diverse datasets, including general knowledge (CoQA, TriviaQA), science (SciQ), and specialized medical exams (MedQA, MedMCQA). The framework was tested on several open-source model families, including Vicuna, WizardLM, LLaMA-2, and OPT, with scales ranging from 2.7B to 33B parameters.
Key Results
SAR demonstrates significant improvements in identifying incorrect model generations across all tested architectures and domains.
Key findings include:
- Superior Predictive Accuracy: SAR consistently outperformed state-of-the-art baselines like Semantic Entropy (SE). On average, SAR improved the Area Under the Receiver Operating Characteristic (AUROC) curve—a measure of how well uncertainty predicts correctness—by 7.1% over previous methods.
- Enhanced Efficiency: A significant finding is that SENTSAR achieves higher UQ accuracy with only two generated samples than traditional methods achieve with five, leading to a roughly 2.5x speedup in production environments.
- Cross-Domain Robustness: The method's effectiveness remained consistent across general, scientific, and medical domains, proving its versatility for various specialized applications.
Conclusion and Future Work
SAR effectively mitigates the impact of linguistic redundancy on uncertainty quantification. By shifting attention to relevance, it provides a more reliable signal for safe LLM deployment. Future research may focus on adapting these techniques for "black-box" APIs where token-level logits are unavailable and exploring how relevance-shifting can be integrated directly into the decoding process to proactively reduce hallucinations during generation.
Summary updated