Semantic Density: Uncertainty Quantification in Semantic Space for Large Language Models

Xin Qiu, Risto Miikkulainen
2/3/2026

No official code found. Best implementation: cognizant-ai-labs/semantic-density-paper (22 stars, last commit 2025-09-28).

Abstract

With the widespread application of Large Language Models (LLMs) to various domains, concerns regarding the trustworthiness of LLMs in safety-critical scenarios have been raised, due to their unpredictable tendency to hallucinate and generate misinformation. Existing LLMs do not have an inherent functionality to provide the users with an uncertainty/confidence metric for each response it generates, making it difficult to evaluate trustworthiness. Although several studies aim to develop uncertainty quantification methods for LLMs, they have fundamental limitations, such as being restricted to classification tasks, requiring additional training and data, considering only lexical instead of semantic information, and being prompt-wise but not response-wise. A new framework is proposed in this paper to address these issues. Semantic density extracts uncertainty/confidence information for each response from a probability distribution perspective in semantic space. It has no restriction on task types and is"off-the-shelf"for new models and tasks. Experiments on seven state-of-the-art LLMs, including the latest Llama 3 and Mixtral-8x22B models, on four free-form question-answering benchmarks demonstrate the superior performance and robustness of semantic density compared to prior approaches.

View on arXivView PDF

Code Implementations(1)

This repo contains the source code for reproducing the experimental results in semantic density paper (Neurips 2024)

225PythonOct 30, 20241 years agoNOASSERTION

Similar Papers

Cite this paper

@article{qiu2026semantic,
  title  = {Semantic Density: Uncertainty Quantification in Semantic Space for Large Language Models},
  author = {Xin Qiu and Risto Miikkulainen},
  year   = {2026},
  eprint = {2405.13845},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2405.13845},
  url    = {https://arxiv.org/abs/2405.13845},
  journal = {NEURIPS 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2405.13845.svg)](https://codeofpaper.com/paper/2405.13845)

Discussion