CrossChatby SurveysAI
Pillar “Theoretical Concepts & Studies”

Semantic Entropy: How to Measure AI Uncertainty About Meaning, Not Tokens

How Semantic Entropy measures uncertainty about meaning rather than tokens, and why it helps detect confabulations in black-box LLMs.

A model generates ten differently phrased answers to the same question. If they all say the same thing differently, it's confident. If they differ in meaning — one says "yes," another "no," a third "it depends" — that's a signal of uncertainty or hallucination.

Standard token-level entropy can't capture this distinction. Semantic entropy can.

Claims Framework

  • What this article claims: Semantic entropy measures AI uncertainty at the meaning level rather than at the token level; high semantic entropy correlates with confabulations; the method works for black-box APIs without access to model internals.
  • What it is based on: Farquhar et al. (2024) published in Nature; predecessor work by Kuhn et al. (2023) at ICLR; the principle of semantic clustering of sampled answers and computing entropy over clusters.
  • Where it simplifies: The article does not discuss the computational cost of NLI classification or clustering error rates for subtle meaning differences; consistent hallucinations are mentioned as a limitation but their real-world prevalence is not quantified.

Why Token Entropy Fails

The standard way to measure language model uncertainty is entropy over the next tokens. The model assigns each possible token a probability. The more uniform the distribution, the higher the uncertainty.

The problem: "Paris" and "the capital of France" are different tokens with entirely different probabilities — but they mean the same thing. Token-level entropy sees these answers as disagreement, even though they semantically agree.

Consider a model answering "What is 6×7?" When sampled repeatedly, it generates: "42," "It's 42," "The answer is forty-two." Token entropy is high — different character sequences. Semantic entropy is zero — all answers mean the same thing.

Different question: "Who was the first American president?" The model generates: "George Washington," "Thomas Jefferson," "John Adams." Here semantic entropy is also high. The answers differ in meaning, not just phrasing.

The difference is critical. High token entropy without high semantic entropy means the model is confident about the answer, just phrasing it differently. High semantic entropy means the model is uncertain about the factual answer. That's a signal of possible hallucination.

How Semantic Entropy Works

Researchers from Oxford and Cambridge published a method in Nature in 2024 that solves this problem. Instead of measuring uncertainty over tokens, it measures uncertainty over the meaning of answers.

The method has three steps.

Step 1: Generate answers. The model receives a question and generates multiple answers — typically five to twenty — with non-zero temperature to capture variability. Each answer is an independent sample from the model's distribution.

Step 2: Semantic clustering. Answers are grouped into clusters based on semantic equivalence. Two answers belong to the same cluster if A implies B AND B implies A. This means they say the same thing, just with different words. This implication can be tested by another language model or a specialized NLI (natural language inference) model.

Step 3: Calculate entropy. Instead of entropy over individual answers, entropy is calculated over clusters. If all answers belong to one cluster — all saying the same thing — entropy is zero. If they split across multiple clusters, entropy increases.

Practical example: ten answers to "What is the capital of Australia?"

  • Cluster 1: "Canberra," "The capital is Canberra," "Canberra is the capital" — six answers
  • Cluster 2: "Sydney" — three answers
  • Cluster 3: "Melbourne" — one answer

Semantic entropy is non-zero. The model is uncertain.

If all ten answers said Canberra in different ways, semantic entropy would be zero. The model would be confident — and correct.

What Semantic Entropy Detects — Confabulations

High semantic entropy correlates with hallucinations presented as facts. Researchers call these "confabulations" — the model doesn't know, but confidently answers different things.

Confabulation differs from admitted uncertainty. When a model says "I don't know" or "I'm not sure," it acknowledges a gap in its knowledge. Confabulation is the opposite: the model generates factual claims that sound plausible but are unsupported or false.

Why does semantic entropy detect confabulations? If the model "doesn't know" the answer but is forced to respond, its internal representation is unstable. Different samples activate different "guessing" trajectories. The result is variability at the semantic level — sometimes answer A, sometimes B, sometimes C.

If the model "knows" the answer, the internal representation is stable. Different samples converge to the same meaning, even with different phrasing. The model might say "Canberra" or "Australia's capital is Canberra" — different tokens, same meaning, low semantic entropy.

Farquhar and colleagues (2024) tested this hypothesis on a dataset of questions with verifiable factual answers. Questions where the model confabulated — answered confidently but incorrectly — had systematically higher semantic entropy than questions where it answered correctly.

Semantic entropy is thus a proxy for "epistemic uncertainty" — not uncertainty about how to answer, but uncertainty about what is true.

Why the Method Works for Black-Box APIs

Unlike many other uncertainty measurement methods, semantic entropy doesn't require access to model internals. It works for GPT-4, Claude, and Gemini through standard APIs.

Most uncertainty methods require access to log-probabilities of individual tokens or internal neural network activations. Commercial APIs typically don't provide these values or provide them in limited form.

Semantic entropy requires only two things: the ability to generate multiple answers to the same question, and the ability to compare answers for semantic equivalence. Both are available through standard chat APIs.

Practical implementation: Ask the model the same question ten times with non-zero temperature. Use an NLI model or another LLM to test semantic equivalence between answer pairs. Cluster answers that say the same thing. Calculate entropy over clusters.

The trade-off is clear: the method is more expensive than a single query — ten queries instead of one — and slower. But for questions with high error costs, where reliability matters, it's an acceptable investment.

Limits and Edge Cases

Semantic entropy isn't a universal hallucination detector. It fails on certain question types.

Consistent hallucinations. If the model hallucinates but consistently — all answers say the same wrong thing — semantic entropy is low. The model is "confidently wrong." The method doesn't detect this. It requires external fact-checking.

Consider the question "Who wrote Hamlet?" The model answers "Christopher Marlowe" ten times. Low semantic entropy, but wrong answer. The method doesn't know Shakespeare is correct.

Legitimate ambiguity. Some questions have multiple correct answers. "Name a famous physicist" — Einstein, Newton, Feynman are all correct. High semantic entropy here isn't a hallucination signal, but legitimate answer diversity.

The method doesn't distinguish "doesn't know, so guessing" from "knows multiple correct answers." Question context matters.

Clustering quality. If the model or NLI system testing semantic equivalence misclassifies answers, clusters are skewed and entropy is inaccurate. The method is only as good as its clustering component.

Semantic entropy is a useful signal, not a definitive verdict. Combining it with other signals — cross-model agreement, citation verification — is more robust than relying on a single metric.

Practical Applications

Semantic entropy is most useful for factual questions with a single correct answer, where detecting confabulations matters before passing the answer to users.

Automated fact-checking pipelines. Before publishing AI-generated content, verify that key factual claims have low semantic entropy. High entropy means flag for human review. Low entropy doesn't mean "definitely correct," but "model is consistent."

Medical and legal AI assistants. Answers to high-stakes questions — diagnosis, legal advice — should pass through a semantic entropy filter. Don't present high-entropy answers as certain. Flag for expert review.

Multi-model workflows. Semantic entropy as part of the "when to escalate" decision process. If one model has high entropy on a factual question, consult a second model or human expert. Escalation is expensive — semantic entropy helps decide when it's worth it.

Tools like CrossChat implement variants of this logic. Multi-model queries naturally generate diverse answers, and consensus scores reflect the degree of semantic agreement. High disagreement between models is an analogous signal to high semantic entropy within a single model.

Conclusion

Semantic entropy solves a fundamental problem in measuring AI uncertainty: it separates linguistic variability from semantic uncertainty.

"42" and "forty-two" are different tokens but the same meaning — low semantic entropy. "42" and "43" are similar tokens but different meanings — high semantic entropy.

For practical use: high semantic entropy is a red flag, not a definitive verdict. It signals that the model isn't stable in its "belief" — whether because it doesn't know, or because the question is legitimately ambiguous.

Combining with external verification — another model, primary source, human expert — provides a more robust answer than relying on any single metric. Semantic entropy is a tool in the toolbox, not the final arbiter of truth.

Sources

  • Farquhar, S. et al. (2024). Detecting hallucinations in large language models using semantic entropy. Nature. DOI: 10.1038/s41586-024-07421-0.
  • Lin, S.-C. et al. (2024). Semantic Entropy Probes: Robust and Cheap Hallucination Detection in LLMs. arXiv:2406.15927. DOI: 10.48550/arXiv.2406.15927.
  • Kuhn, L. et al. (2023). Semantic Uncertainty: Linguistic Invariances for Uncertainty Estimation in Natural Language Generation. ICLR 2023. arXiv:2302.09664. DOI: 10.48550/arXiv.2302.09664.
  • Wang, X. et al. (2023). Self-Consistency Improves Chain of Thought Reasoning in Language Models. arXiv:2203.11171. DOI: 10.48550/arXiv.2203.11171.

Editorial History

Concept: Claude Code + Anthropic Sonnet 4.6 Version 1: Claude Code + Anthropic Sonnet 4.6 Version 2: Codex + GPT-5.2 Quality audit (2026-03-23, Claude Code + Claude Opus 4.6): added Claims Framework, verified sources, language polish.

Share this article