A statistically consistent measure of semantic uncertainty using Language Models
Yi Liu
TL;DR
This work introduces semantic spectral entropy (SSE), a statistically consistent measure of semantic uncertainty for outputs of language models. SSE first encodes semantic similarity among texts into a random graph via a language-model-based equivalence relation, then uses spectral clustering to form semantic clusters and compute entropy over cluster memberships. The authors provide theoretical guarantees, including strong consistency and finite-sample rates, for both fixed-cluster and generative-model scenarios, and analyze how the cluster count $K$ should grow with sample size. Simulations with unordered proposition sets demonstrate phase-transition behavior and model-length effects on SSE, supporting the method’s robustness and broad applicability for unsupervised uncertainty quantification in NLP systems.
Abstract
To address the challenge of quantifying uncertainty in the outputs generated by language models, we propose a novel measure of semantic uncertainty, semantic spectral entropy, that is statistically consistent under mild assumptions. This measure is implemented through a straightforward algorithm that relies solely on standard, pretrained language models, without requiring access to the internal generation process. Our approach imposes minimal constraints on the choice of language models, making it broadly applicable across different architectures and settings. Through comprehensive simulation studies, we demonstrate that the proposed method yields an accurate and robust estimate of semantic uncertainty, even in the presence of the inherent randomness characteristic of generative language model outputs.
