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.
Methods
The authors propose Shifting Attention to Relevance (SAR), which operates at two levels:
- 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.
- 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.
- 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.
- 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.
- 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.
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