Large language models (LLMs) have demonstrated remarkable capabilities across diverse tasks. However, the truthfulness of their outputs is not guaranteed, and their tendency toward overconfidence further limits reliability. Uncertainty quantification offers a promising way to identify potentially unreliable outputs, but most existing methods rely on repeated sampling or auxiliary models, introducing substantial computational overhead. To address these limitations, we propose Semantic Token Clustering (STC), an efficient uncertainty quantification method that leverages the semantic information inherently encoded in LLMs. Specifically, we group tokens into semantically consistent clusters using embedding clustering and prefix matching, and quantify uncertainty based on the probability mass aggregated over the corresponding semantic cluster. Our approach requires only a single generation and does not depend on auxiliary models. Experimental results show that STC achieves performance comparable to state-of-the-art baselines while substantially reducing computational overhead.
Figures & tables
Figure 1: Illustration of the proposed method. Token embedding clustering is performed in the pre-computation stage. During inference, we aggregate next-token probability mass over embedding-clustered and prefix-matched tokens to quantify uncertainty.
Figure 2: Performance comparison between our method and baseline approaches across different models and datasets. For clarity, only the top seven methods ranked by performance are shown in each subfigure, with methods ordered by descending performance. Metric: AUROC.
Figure 3: Efficiency comparison across methods. The performance (AUROC) and relative execution time overhead (%) are plotted on the y-axis and x-axis, respectively, illustrating the efficiency of the proposed method. The relative execution time overhead represents the additional execution time required for uncertainty quantification relative to basic inference. For clarity, only the top ten methods ranked by performance are shown in each subfigure.
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
Model
Time (mm:ss)
Llama-2-7B
01:08
Llama-3-8B
18:24
Mistral-7B
00:48
Qwen2.5-3B
23:46
Qwen2.5-7B
28:05
Qwen2.5-14B
33:46
Appendix
Table 4: Execution time of embedding clustering in the pre-computation stage for different models.
Dataset
Method
Llama-2-7B
Llama-3-8B
Mistral-7B
Qwen2.5-3B
Qwen2.5-7B
Qwen2.5-14B
NQ
Perplexity
0.697
0.705
0.712
0.760
0.744
0.708
Predictive Entropy
0.716
0.730
0.722
0.767
0.763
0.742
LN Entropy
0.702
0.712
0.714
0.764
0.755
0.721
tokenSAR
0.673
0.682
0.683
0.736
0.724
0.708
P(True)
0.550
0.546
0.488
0.680
0.727
0.725
ConU
0.706
0.708
0.715
0.759
0.788
0.748
Appendix
Table 5: Full experimental results for performance comparison across methods. Metric: AUROC.
Dataset
Method
Llama-2-7B
Llama-3-8B
Mistral-7B
Qwen2.5-3B
Qwen2.5-7B
Qwen2.5-14B
NQ
Perplexity
0.442
0.496
0.508
0.502
0.513
0.460
Predictive Entropy
0.500
0.563
0.537
0.559
0.573
0.564
LN Entropy
0.462
0.519
0.514
0.536
0.545
0.501
tokenSAR
0.415
0.446
0.455
0.483
0.490
0.491
P(True)
0.111
0.153
-0.058
0.383
0.512
0.495
ConU
0.381
0.376
0.406
0.413
0.499
0.451
Appendix
Table 6: Full experimental results for performance comparison across methods. Metric: PRR.
Dataset
Method
Llama-2-7B
Llama-3-8B
Mistral-7B
Qwen2.5-3B
Qwen2.5-7B
Qwen2.5-14B
NQ
Perplexity
0.129
0.064
0.075
0.108
0.173
0.148
Predictive Entropy
1373.943
1006.703
1028.696
824.862
863.792
1717.797
LN Entropy
1374.020
1006.781
1028.779
824.943
863.880
1717.879
tokenSAR
50.865
49.245
68.746
51.428
71.280
59.225
P(True)
41.669
41.258
50.507
25.471
47.472
61.176
ConU
1387.134
910.635
1030.129
713.243
747.901
1655.025
Appendix
Table 7: Full experimental results on absolute execution time overhead at inference. Metric: seconds.
Dataset
Method
Llama-2-7B
Llama-3-8B
Mistral-7B
Qwen2.5-3B
Qwen2.5-7B
Qwen2.5-14B
NQ
Perplexity
0.023
0.019
0.021
0.039
0.047
0.024
Predictive Entropy
239.879
302.765
286.607
298.737
235.837
279.658
LN Entropy
239.893
302.789
286.630
298.766
235.861
279.672
tokenSAR
8.881
14.811
19.153
18.625
19.461
9.642
P(True)
7.275
12.408
14.072
9.225
12.961
9.960
ConU
242.183
273.873
287.006
258.312
204.196
269.439
Appendix
Table 8: Full experimental results on relative execution time overhead at inference. Metric: %.
Large language models (LLMs) demonstrate remarkable performance across diverse tasks, but they often generate responses that appear plausible while being factually incorrect. This problem is compounded by the lack of explicit uncertainty estimates, which makes it difficult for users to judge the reliability of model outputs. Existing uncertainty quantification methods typically rely on indirect signals, such as entropy across sampled generations. These signals can be difficult to interpret and do not fully leverage the model's ability to assess its own uncertainty. We propose a simple yet effective self-assessment method for uncertainty quantification in LLMs. Our approach groups sampled generations into semantically distinct clusters, converts them into answer options in a structured multiple-choice question, and uses the probability assigned by the LLM to each option as a confidence estimate. Experiments across multiple models and datasets show that our method consistently outperforms baseline approaches. Notably, it achieves competitive performance with as few as two additional samples, demonstrating both its effectiveness and efficiency.
Uncertainty Quantification (UQ) is widely regarded as the primary safeguard for deploying Large Language Models (LLMs) in high-stakes domains. However, we argue that the field suffers from a category error: mainstream UQ methods for LLMs are just unsupervised clustering algorithms. We demonstrate that most current approaches inherently quantify the internal consistency of the model's generations rather than their external correctness. Consequently, current methods are fundamentally blind to factual reality and fail to detect ``confident hallucinations,'' where models exhibit high confidence in stable but incorrect answers. Therefore, the current UQ methods may create a deceptive sense of safety when deploying the models with uncertainty. In detail, we identify three critical pathologies resulting from this dependence on internal state: a hyperparameter sensitivity crisis that renders deployment unsafe, an internal evaluation cycle that conflates stability with truth, and a fundamental lack of ground truth that forces reliance on unstable proxy metrics to evaluate uncertainty. To resolve this impasse, we advocate for a paradigm shift to UQ and outline a roadmap for the research community to adopt better evaluation metrics and settings, implement mechanism changes for native uncertainty, and anchor verification in objective truth, ensuring that model confidence serves as a reliable proxy for reality.
Tiejin Chen, Longchao Da, Xiaoou Liu +1
School of Computing and Augmented Intelligence, Arizona State University
Claim-level Uncertainty Quantification (UQ) aims to mitigate the lack of reliability of Large Language Models (LLMs) by evaluating the factuality of each claim in their outputs. We introduce Kernel Token Contradiction (KTC), a lightweight approach to compute claim-level UQ under realistic white-box conditions. KTC represents the candidate tokens involved in LLM generation as a positive semi-definite kernel that integrates both the LLM's conditional distribution and a token contradiction score. We then use the Von Neumann entropy to quantify the uncertainty of this kernel. To estimate token contradiction, we develop a new approach based on frequency statistics from the Wikipedia corpus. Although CPU-only, our approach achieves over an 8.2x speedup compared to state-of-the-art GPU-accelerated methods based on cross-encoders, and over a 65x speedup compared to CPU-only methods with comparable performance. Our evaluation spans two benchmarks across four European languages and 16 different models. KTC not only matches the average performance of existing methods but also outperforms them in high-precision regimes. This combination of computational efficiency and accuracy makes real-time monitoring of LLM outputs practical in production.
Jérémie Dentan, Alexi Canesse, Mahammed El Sharkawy +1