A Hallucination Score is a quantitative metric that estimates the degree of factual inconsistency between an AI-generated response and its source material. It operationalizes the detection of fabricated content by applying Natural Language Inference (NLI) models or semantic similarity calculations to measure how well each generated claim is entailed by the provided context.
Glossary
Hallucination Score

What is Hallucination Score?
A quantitative metric estimating the degree of factual inconsistency in a generated response, typically derived from semantic similarity or natural language inference models.
The score is typically computed by decomposing a generated text into atomic facts, then using a critic model to classify each fact as supported, contradicted, or neutral relative to the grounding documents. The final metric represents the ratio of unsupported claims, enabling automated guardrail systems to trigger rejection or human review when a confidence threshold is breached.
Key Characteristics of a Hallucination Score
A hallucination score is not a monolithic metric but a composite signal derived from multiple computational strategies. Understanding its constituent characteristics is essential for engineering reliable guardrails.
Semantic Similarity Grounding
Measures the cosine similarity between the embedding of the generated response and the embedding of the source ground-truth text. This technique, often using models like Sentence-BERT or proprietary embedding APIs, quantifies conceptual overlap rather than exact lexical matching.
- High Score: Indicates strong semantic alignment with the reference.
- Low Score: Suggests the agent has drifted into unrelated or fabricated territory.
- Limitation: Fails to detect subtle contradictions where the generated text is topically similar but factually inverted.
Natural Language Inference (NLI) Entailment
Utilizes a dedicated NLI classifier to determine if a source document logically entails the generated hypothesis. A hallucination is flagged when the output contradicts the premise or is classified as neutral.
- Entailment Score: Probability that the generation is strictly supported by the evidence.
- Contradiction Score: Probability that the generation directly opposes the source.
- Advantage: Detects factual inversions that semantic similarity misses, such as 'The patient has a fever' vs. 'The patient has no fever.'
Self-Consistency Sampling
Leverages the stochastic nature of LLMs by sampling multiple reasoning paths (temperature > 0) for the same prompt. The hallucination score is derived from the entropy or divergence of these outputs.
- Low Variance: Indicates high confidence and likely factual accuracy.
- High Variance: Suggests the model is 'guessing' between multiple hallucinated realities.
- Mechanism: Often uses semantic entropy to cluster equivalent answers before calculating variance, preventing penalization for valid paraphrasing.
Retrieval-Augmented Faithfulness
In RAG architectures, the score evaluates if the generated answer is attributable to the specific retrieved chunks. It measures hallucination as the proportion of generated entities or claims that cannot be mapped back to the provided context.
- Context Precision: Verifies if the model used the right chunk.
- Context Recall: Verifies if the model missed crucial information.
- Faithfulness Metric: Calculated as
(Number of claims supported by context) / (Total number of claims in response).
Uncertainty Quantification (Conformal Prediction)
Applies statistical methods to produce a prediction set with a mathematical guarantee of correctness. Instead of a single output, the agent produces a set of plausible answers.
- Non-Hallucination Guarantee: The score represents the probability that the true answer lies within the generated set.
- Abstention Trigger: If the set size exceeds a threshold (e.g., the model must include 50 options to reach 95% confidence), the score is low, and the system abstains from answering.
- Key Differentiator: Provides a formal, distribution-free risk bound rather than a heuristic score.
Chain-of-Verification (CoVe) Self-Correction
An agentic workflow where the LLM generates an initial response, then independently drafts and answers a series of fact-checking questions based on its own output. The hallucination score is the ratio of verification questions that the model fails to answer consistently.
- Process: 1. Draft response. 2. Plan verifications. 3. Execute verifications. 4. Generate final revised output.
- Score Derivation:
(Failed Verifications) / (Total Verification Questions). - Utility: Highly effective for detecting closed-book hallucinations where no external retrieval is available.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
A hallucination score is a quantitative metric that estimates the degree of factual inconsistency in a generated response. The following questions address the core mechanisms, calculation methods, and operational integration of this critical evaluation metric for autonomous systems.
A hallucination score is a quantitative metric that estimates the degree of factual inconsistency between a generated response and its source material. It is typically calculated using a Natural Language Inference (NLI) model, such as a fine-tuned DeBERTa or T5 variant, which classifies the relationship between a premise (the source text) and a hypothesis (the generated claim) as entailment, contradiction, or neutral. The score is often expressed as a ratio of contradicted claims to total claims, or as a continuous probability of faithfulness. Alternative methods use semantic similarity via cosine distance between the embeddings of the source and the generated text, where a low similarity score indicates a high probability of hallucination. Advanced implementations decompose long-form text into atomic facts using an LLM, then independently verify each fact against a knowledge base, aggregating the results into a final composite score.
Related Terms
Core concepts that interact with hallucination scoring to form a complete output validation pipeline.
Semantic Entropy
A complementary uncertainty metric that measures meaning-level variance rather than token-level probability. Unlike naive perplexity, semantic entropy clusters generations by bidirectional entailment—if two outputs convey the same fact, they are grouped—then calculates entropy across these meaning clusters. This provides a more robust hallucination signal because an LLM can be highly confident in its token choices while being deeply uncertain about the underlying facts. Used alongside hallucination scores to catch confident confabulations that surface-level metrics miss.
Chain-of-Verification (CoVe)
A self-correcting prompting technique that directly reduces hallucination scores. The process unfolds in four stages:
- Draft: Generate an initial response to the query
- Plan: Formulate a list of independent verification questions targeting each factual claim
- Execute: Answer each verification question separately, without referencing the original draft
- Finalize: Revise the initial response to align with verified answers This method systematically exposes unsupported assertions and improves factual consistency without external tools.
Citation Grounding
The process of anchoring every factual claim in an agent's output to an explicit, retrievable source document. Citation grounding transforms hallucination scoring from a probabilistic estimate into a binary audit: either a claim has a supporting citation or it does not. Modern implementations use Natural Language Inference (NLI) models to verify that the cited passage actually entails the generated statement, preventing the common failure mode where agents cite irrelevant sources to appear credible. This is the gold standard for enterprise deployments requiring auditability.
Critic Model
A secondary LLM or classifier that evaluates the primary agent's outputs for factual consistency, forming the computational backbone of many hallucination scoring pipelines. Common architectures include:
- NLI-based critics: Fine-tuned on datasets like ANLI or FEVER to classify entailment vs. contradiction
- LLM-as-judge: A stronger model (e.g., GPT-4 evaluating GPT-3.5 outputs) that provides nuanced consistency ratings
- Cross-encoder rerankers: Models that score the alignment between a claim and its purported evidence source The critic's confidence score often serves directly as the hallucination score.
Uncertainty Quantification
A statistical framework that moves beyond point estimates to measure how much a model 'knows that it doesn't know.' Key techniques relevant to hallucination scoring include:
- Conformal prediction: Produces prediction sets with guaranteed coverage probabilities, flagging outputs where the model cannot commit to a single answer
- Monte Carlo dropout: Runs multiple stochastic forward passes to estimate output variance
- Deep ensembles: Trains multiple models and measures disagreement as a proxy for uncertainty High uncertainty correlates strongly with hallucination risk, making these methods essential for selective prediction—knowing when to abstain.
Constrained Decoding
A generation-time technique that prevents hallucinations by restricting the LLM's output to a predefined schema or grammar. Rather than detecting hallucinations post-hoc, constrained decoding makes certain categories of fabrication structurally impossible. Implementation methods include:
- Logit masking: Applying a boolean mask to invalid tokens before softmax, forcing the model to sample only from valid continuations
- Grammar-constrained sampling: Using finite-state automata to enforce JSON schemas, regular expressions, or domain-specific languages
- Retrieval-anchored generation: Forcing the model to only generate tokens found in retrieved context windows This approach eliminates syntactic hallucination but does not address semantic factual errors within valid structures.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us