Skip to content
New Year BoostTop up
Apixo
Blog
news· 4 min read· via Towards AI

Why Semantic Entropy Flags Good Answers as Hallucinations and How to Fix It

New benchmarks show semantic entropy misinterprets diverse open-ended answers as hallucinations, but measuring sample contradiction helps separate model guesses from valid responses.

Why Semantic Entropy Flags Good Answers as Hallucinations and How to Fix It

Semantic entropy has become a prominent black-box technique for identifying when a language model is hallucinating. By generating several answers to the same query and clustering them by meaning, the metric assumes that high semantic variance signals uncertainty. However, an empirical evaluation by researcher Abdul M. highlights a fundamental flaw in this approach: semantic entropy cannot tell the difference between a model making wild guesses on a factual prompt and a model correctly offering diverse viewpoints for an open-ended question.

In testing with Qwen 2.5 1.5B Instruct and Llama 3.2 1B Instruct across 1,400 questions, semantic entropy routinely penalized legitimate answers. When asked to name the villain in The Fifth Element, Qwen hallucinated ten completely different incorrect actors at temperature 1.0. When asked for reasons to learn a foreign language, the model also returned eight distinct valid ideas, spanning career benefits, cultural appreciation, and travel. Because both prompts resulted in high semantic dispersion, standard semantic entropy flagged both as likely errors, improperly catching 91% of list-shaped open questions on a threshold tuned to intercept 80% of factual mistakes.

Separating Guesses From Diverse Answers

To address this blind spot, the experiment evaluated natural language inference (NLI) using DeBERTa-v3 large to inspect pairwise contradictions rather than mere divergence. The premise is straightforward: when an LLM confabulates factual answers, the sampled outputs actively contradict one another, such as conflicting birth years or incompatible names. In contrast, valid answers to list-style questions can all be true simultaneously.

By evaluating 90 ordered pairs across ten samples per question, the conflict score successfully differentiated wrong factual statements from list-shaped open prompts. On Qwen 2.5 1.5B, contradiction achieved an AUROC of 0.95 when distinguishing confabulations from open list responses, outperforming spread-only metrics like U_EigV (0.86) and baselines like SelfCheckGPT-NLI (0.89). Testing on Llama 3.2 1B showed a comparable pattern, maintaining an AUROC of 0.92 on list-shaped queries despite the smaller Llama model generally struggling with high sample scatter on factual questions.

Where the Contradiction Method Fails

Despite its success on multi-item lists, contradiction scoring hit sharp limits on two specific query types: single-claim open questions and ambiguous prompts.

For single-claim open queries—such as asking for the single most important factor in personal happiness or job interview success—the metric dropped to an AUROC of 0.81. Because the phrasing asks for a single superlative, distinct valid perspectives naturally contradict one another logically (if factor A is paramount, factor B cannot be). DeBERTa-v3 correctly tagged these alternative viewpoints as contradictions, showing a tiny 2% false-contradiction rate on these pairs, but the system could not infer that the disagreement stemmed from subjective judgment rather than factual confabulation.

Ambiguous prompts from AmbigQA presented an even steeper hurdle, dragging performance down to an AUROC near random chance (0.52 to 0.55). At the 1.5B parameter scale, the model lacked the knowledge to identify alternative valid readings of ambiguous queries, defaulting instead to raw guesses that resembled standard factual confabulations.

Running this uncertainty detection pipeline locally also revealed substantial compute overhead. Benchmarked on an Intel i7-1265U CPU, Qwen took 11.2 seconds to generate eleven single-sentence responses, but running DeBERTa-v3 large across the sample pairs took 25.3 seconds—more than double the generation time. Reducing the sample count from ten to five decreased pairwise comparisons from 90 to 20, cutting latency while only slightly lowering the factual AUROC from 0.84 to 0.80.

What it means for developers

For engineers building selective classification or guardrail systems that decide when an AI should answer or abstain, relying exclusively on semantic entropy risks aggressive over-censorship. Production pipelines that serve user requests for brainstorming, advice, or recommendations will routinely trigger false alarms if variance is treated as hallucination.

Pairing spread metrics with contradiction checks provides a viable remedy for list-like prompts, but teams should be mindful of the significant compute tax added by secondary NLI models. When deploying these checks in real-time applications, reducing sample counts or utilizing lighter verification passes can keep processing overhead reasonable. Developers exploring model reliability across different architectures can try top AI models cheaply through one API at https://apixoai.online to evaluate how larger foundation models handle ambiguity and semantic variance compared to lightweight local alternatives.


Source: I Asked a 1.5B Model Every Question 10 Times to Catch Its Guesses — Towards AI. Written by the Apixo team from that report.

#ai-news#ai#llm#hallucination#benchmarks#machine-learning
Try it with your own tools

One key for Claude, GPT, GLM, DeepSeek and more. Pay per token with crypto.

Get your API key

Keep reading