Introduction
Large Language Models (LLMs) are central to Retrieval-Augmented Generation (RAG) systems, yet their reliability remains a concern. In contextual question-answering (QA), models often hallucinate or prioritize internal parametric memory over the provided context. Traditional Uncertainty Quantification (UQ) methods, largely designed for closed-book tasks, struggle to distinguish between inherent linguistic noise (aleatoric uncertainty) and the model's own knowledge deficits (epistemic uncertainty). This research introduces a theoretically grounded framework that treats epistemic uncertainty as a measurable "feature gap" within the model's internal representation space.
The Feature-Gaps Framework
The proposed method shifts the focus from output probability scores to the geometric properties of internal hidden states. The core idea is that uncertainty can be quantified by the distance between the actual model's state and an "ideal" model's state.
The framework operates in three primary steps:
- Approximation: Since the "true" distribution $P^*$ is unknown, it is approximated using an "optimal prompt" designed to maximize accuracy. This creates a proxy for an ideal model $\theta^*$.
- Upper Bounding: The authors mathematically demonstrate that the epistemic uncertainty (measured via KL Divergence) is upper-bounded by the Euclidean distance between the last-layer hidden states of the actual model ($h$) and the ideal model ($h^*$).
- Feature Decomposition: Leveraging the Linear Representation Hypothesis, this distance is decomposed into interpretable semantic directions.
Geometric Interpretation of Uncertainty
By viewing uncertainty as a physical distance in "thought space," the researchers identify specific axes that contribute to errors. These include Context-Reliance (reliance on provided text vs. internal memory), Context Comprehension (understanding of the text), and Honesty (truthfulness vs. sycophancy).
These features are extracted using a "top-down interpretability" approach. By applying contrastive prompts (e.g., "be honest" vs. "be a liar") to a small set of examples, the model identifies the specific vectors in the activation space corresponding to these high-level concepts. Uncertainty is then calculated as the sum of the gaps along these semantic axes.
Experimental Results
The "Feature-Gaps" method was evaluated across three model families (LLaMA-3.1-8B, Mistral-v0.3-7B, and Qwen2.5-7B) using diverse benchmarks: Qasper (scientific papers), HotpotQA (multi-hop Wikipedia), and NarrativeQA (long-form stories).
Key findings include:
- Superior Performance: The method achieved up to a 13-point improvement in the Prediction-Rejection Ratio (PRR) compared to existing unsupervised and supervised baselines.
- Extreme Data Efficiency: High accuracy was maintained with as few as 64 labeled samples, making it highly practical for real-world engineering where labeled data is expensive.
- Out-of-Distribution (OOD) Robustness: Unlike many supervised UQ methods that overfit to specific datasets, the feature-based approach generalizes well across domains (e.g., from scientific papers to Wikipedia).
Conclusion and Future Work
This research demonstrates that uncertainty in LLMs is not merely a statistical artifact but a geometric property of their internal representations. By isolating epistemic uncertainty through feature gaps, developers can build more reliable RAG systems with minimal computational overhead. Future work will explore automating the discovery of task-specific features and addressing performance degradation in extremely long context windows.
Summary updated