Distinguishing the Knowable from the Unknowable with Language Models
Using linear probes to distinguish epistemic from aleatoric uncertainty in LLMs, achieving over 0.9 AUC in predictions.
Key Findings
Methodology
This work introduces a framework where linear probes trained on frozen model embeddings predict the confidence of larger models at token level. The approach leverages model comparison: tokens where small models are uncertain but large models are confident are labeled as epistemic. Both supervised probes and an unsupervised in-context learning test (ICLT) are developed. The supervised method trains probes on different activations, validated across datasets like Wikipedia and code. ICLT exploits the model’s tendency to repeat confident predictions, inferring uncertainty without labels. Experiments with LLaMA, Llama 2, and Pythia demonstrate high accuracy (AUC > 0.9) and transferability across domains.
Key Results
- Linear probes accurately predict when large models are confident (AUC > 0.9), with strong transferability across datasets and model sizes, including out-of-distribution data (AUC > 0.8).
- Unsupervised ICLT method achieves significant results by analyzing model repetition behavior, indicating internal representations of different uncertainty types.
- Layer-wise analysis shows deeper embeddings encode more robust uncertainty signals, and the methods generalize well to code and multilingual data.
Significance
This research uncovers that large language models internally encode diverse uncertainty signals, which can be exploited to improve trustworthiness and reduce hallucinations. By distinguishing epistemic from aleatoric uncertainty, it enables targeted interventions during inference, such as avoiding high-risk tokens. This advances the interpretability and safety of AI systems, addressing long-standing challenges in model calibration and reliability. The findings also open pathways for developing more transparent, controllable models, crucial for real-world deployment.
Technical Contribution
The paper pioneers the use of simple linear probes on frozen embeddings to detect epistemic uncertainty, validated through cross-domain transfer. It introduces a novel unsupervised ICLT mechanism based on model repetition, providing a label-free way to infer internal uncertainty states. The approach is computationally efficient, scalable, and compatible with existing large models, offering a practical tool for uncertainty estimation that surpasses prior Bayesian or ensemble methods in efficiency and applicability.
Novelty
This is the first work to systematically identify internal representations of epistemic uncertainty in large language models without supervision, using a combination of model comparison and in-context learning. Unlike prior methods limited to classification tasks or requiring fine-tuning, this approach applies directly to free-form text and generalizes across domains, filling a critical gap in understanding model confidence in generative settings.
Limitations
- The method relies on the assumption that larger models are less epistemically uncertain, which may not hold in all cases due to their own internal uncertainties.
- Focuses on token-level uncertainty, not capturing sequence-level or semantic ambiguities comprehensively.
- Performance may degrade in highly noisy or out-of-distribution scenarios, and further work is needed to incorporate multi-layer and multimodal signals.
Future Work
Future research will explore multi-layer and multi-modal uncertainty representations, integrate reinforcement learning and human feedback, and extend methods to sequence-level and semantic uncertainties. Developing explainability tools based on internal signals and applying these techniques to real-world tasks like fact-checking and dialogue safety are promising directions. Enhancing robustness and generalization across diverse models and tasks remains a key goal.
AI Executive Summary
Large language models (LLMs) have revolutionized NLP with their impressive capabilities, yet understanding their internal confidence remains a challenge. Traditional calibration methods often conflate different sources of uncertainty, making it difficult to identify when models truly 'know' something versus when their outputs are inherently ambiguous. This paper addresses this gap by proposing a novel approach to distinguish epistemic uncertainty—stemming from lack of knowledge—from aleatoric uncertainty, which is intrinsic to the data distribution.
The core innovation lies in training simple linear probes on frozen model embeddings to predict the confidence levels of larger models at the token level. By comparing the outputs of small and large models across datasets like Wikipedia, code, and multilingual texts, the authors demonstrate that these probes can achieve an AUC exceeding 0.9, with strong transferability. This indicates that internal representations of uncertainty are embedded within the models themselves, accessible via straightforward linear classifiers.
Complementing this, the authors introduce an unsupervised method called the In-Context Learning Test (ICLT). This technique leverages the model’s tendency to repeat confident predictions during multiple inference passes, providing a label-free way to infer uncertainty. Experiments show that ICLT can reliably identify tokens where the model's confidence is primarily epistemic, even without explicit labels.
These findings have significant implications for AI safety and reliability. By accurately pinpointing uncertain tokens, systems can avoid hallucinations, improve fact-checking, and offer more transparent explanations. The methods are computationally efficient, scalable, and applicable across diverse domains, marking a step toward more trustworthy AI.
Despite these advances, limitations remain. The reliance on larger models as proxies introduces bias, and the focus on token-level uncertainty overlooks broader semantic ambiguities. Future work will aim to incorporate multi-layer, multi-modal signals and extend these techniques to sequence-level and semantic uncertainties, ultimately fostering AI systems that are not only powerful but also interpretable and safe.
Deep Analysis
Background
The evolution of large language models (LLMs) such as GPT, BERT, and LLaMA has significantly advanced NLP tasks. Prior work on uncertainty quantification includes Bayesian neural networks, ensemble methods, and calibration techniques, but these often face scalability and computational challenges. Recent efforts have explored internal model representations, like probing hidden states for confidence signals, yet these are limited to specific tasks or models. The need for scalable, domain-agnostic, and label-free methods remains pressing, especially for generative tasks prone to hallucinations and unreliable outputs. This research builds on these foundations, aiming to uncover intrinsic uncertainty signals within models, enabling more interpretable and safer AI systems.
Core Problem
A key challenge in deploying LLMs is distinguishing between knowledge-based (epistemic) uncertainty and inherent data randomness (aleatoric). Existing calibration methods often cannot separate these sources, leading to overconfidence or underconfidence. Moreover, in free-form text generation, the absence of explicit ground-truth probabilities complicates uncertainty estimation. The core problem is developing methods that can reliably identify when a model’s uncertainty reflects a genuine lack of knowledge versus natural ambiguity, without relying on extensive labeled data or fine-tuning. This distinction is crucial for reducing hallucinations and improving trustworthiness.
Innovation
The paper introduces a novel framework combining model comparison and internal representation analysis. It trains linear probes on frozen embeddings to predict the confidence of larger models, using the assumption that bigger models are less epistemically uncertain. Additionally, it proposes an unsupervised ICLT method, which analyzes the model’s repetition behavior during multiple inference passes to infer uncertainty. These approaches are innovative because they do not require labeled data, leverage existing model states, and demonstrate transferability across domains. This contrasts with traditional Bayesian or ensemble approaches that are computationally intensive and less scalable.
Methodology
- �� Extract intermediate layer embeddings from pre-trained models like LLaMA and Pythia.
- �� Train linear and nonlinear probes on these embeddings to predict the large model’s confidence, using labels generated by model comparison.
- �� Generate labels based on the large model’s predictive entropy, with low entropy indicating high confidence.
- �� Validate probes across multiple datasets, including Wikipedia, code, and multilingual texts, ensuring transferability.
- �� Develop the ICLT: for a given prompt, generate multiple next-token candidates, prepend each to the prompt, and observe the model’s repetition behavior.
- �� Measure the degree of token repetition or entropy change to infer whether the model’s uncertainty is epistemic.
- �� Evaluate using metrics like AUC and accuracy, compare with baselines such as entropy thresholds and random guessing.
Experiments
Experiments utilize open-source models (LLaMA, Llama 2, Pythia) on datasets like Wikipedia, Pile, and EuroParl. The probes are trained with early stopping, hyperparameters tuned for optimal performance. The evaluation includes in-distribution and out-of-distribution tests, cross-model transfer, and ablation studies on embedding layers. The unsupervised ICLT is tested by analyzing the repetition patterns across multiple inference runs. Baselines include entropy-based heuristics and random classifiers, demonstrating the robustness and superiority of the proposed methods. Results consistently show high AUROC (>0.9) for supervised probes and significant detection capability for ICLT.
Results
Supervised linear probes achieve AUROC > 0.9 in predicting large model confidence, with transferability across datasets and models, including out-of-distribution scenarios (AUROC > 0.8). The unsupervised ICLT method also performs well, indicating that internal repetition behavior correlates with epistemic uncertainty. Deeper layer embeddings encode more reliable signals, and the methods generalize across domains like code and multilingual texts. These results confirm that internal model states contain meaningful uncertainty representations, accessible without supervision.
Applications
This work enables more reliable AI deployment by identifying uncertain tokens during generation, reducing hallucinations, and improving fact-checking. It can be integrated into real-time systems for adaptive response filtering, confidence-based reranking, or human-in-the-loop interventions. The methods also support model debugging, safety testing, and transparency efforts, fostering trust in AI outputs. Long-term, these techniques could underpin self-aware models capable of explaining their confidence levels, facilitating safer AI in critical applications like healthcare, legal, and autonomous systems.
Limitations & Outlook
The approach depends on the assumption that larger models are less epistemically uncertain, which may not always hold due to their own internal uncertainties. It primarily targets token-level uncertainty, neglecting broader semantic or sequence-level ambiguities. Performance may degrade in highly noisy or adversarial scenarios. Additionally, reliance on existing models as proxies introduces bias, and the methods may need adaptation for multimodal or multi-task settings. Future work should address these limitations by incorporating multi-layer, multi-modal signals and refining the interpretability of internal representations.
Plain Language Accessible to non-experts
想象你在一个厨房里做饭,有两个厨师:一个经验丰富(大模型),一个新手(小模型)。当你问他们怎么做一道菜时,经验丰富的厨师总能给出确定的答案,而新手有时候会犹豫。我们可以观察他们的反应,判断哪个厨师更有信心。比如,经验厨师说“这道菜一定好吃”,而新手说“我不太确定”。如果让更厉害的厨师帮忙,他会告诉你哪些步骤他非常确定,哪些还在犹豫。通过比较两个厨师的反应,我们可以知道哪些步骤可能出错,提前避免失败。这个过程就像用不同规模的模型对比,识别出“疑点”,让我们做饭更有把握。这种方法帮助我们理解AI在生成内容时,哪些部分是“知道”的,哪些是“猜”的,从而让AI变得更可靠、更聪明。
ELI14 Explained like you're 14
想象你在玩一个超级复杂的游戏,你的朋友(大模型)非常厉害,总能猜出下一步会发生什么。而你(小模型)还在学习,有时候不太确定下一步怎么走。现在,你想知道哪些地方你还不太懂,哪些地方你可以放心继续玩。你可以让更厉害的朋友帮忙,观察他们的反应——如果他们很确定,而你还犹豫,那说明你还需要多练练。或者,你可以用一种特殊的“魔法”方法,反复试验一些动作,看他们是不是一直坚持某个选择。这样,你就能知道哪些地方你还不够自信,提前做好准备。这就像用不同模型的对比和反复试验,帮你找到“疑点”,让你玩得更稳、更有信心。未来,这种方法还能帮你在游戏中变得更厉害,避免出错,赢得更多胜利!
Abstract
We study the feasibility of identifying epistemic uncertainty (reflecting a lack of knowledge), as opposed to aleatoric uncertainty (reflecting entropy in the underlying distribution), in the outputs of large language models (LLMs) over free-form text. In the absence of ground-truth probabilities, we explore a setting where, in order to (approximately) disentangle a given LLM's uncertainty, a significantly larger model stands in as a proxy for the ground truth. We show that small linear probes trained on the embeddings of frozen, pretrained models accurately predict when larger models will be more confident at the token level and that probes trained on one text domain generalize to others. Going further, we propose a fully unsupervised method that achieves non-trivial accuracy on the same task. Taken together, we interpret these results as evidence that LLMs naturally contain internal representations of different types of uncertainty that could potentially be leveraged to devise more informative indicators of model confidence in diverse practical settings.