HallucinationDetector.ai

LLM Hallucination Detector and Grounding Guide

Evaluate large language model responses for intrinsic contradiction, extrinsic drift, and ungrounded claims in production.

EX-02 · LLM EVAL
Samples:
Draft Under Inspection · Inline Claim Markup

In Varghese v. China Southern Airlines Co. Ltd., 925 F.3d 1339 (11th Cir. 2019), the court held that the Montreal Convention two-year statute of limitations is tolled during an automatic bankruptcy stay.

A subsequent review by Martinez & Patel (2024), Nature Vol. 628, DOI 10.1038/s41586-024-99104-x reported that retrieval grounding eliminates 99.4% of factual errors across legal filings.

By contrast, in Moffatt v. Air Canada, 2024 BCCRT 149, the British Columbia Civil Resolution Tribunal held an airline liable for negligent misrepresentation after its support chatbot invented a bereavement-fare policy.

+ Optional Source Context: Attach retrieved passages to check strict RAG faithfulness
96 / ~1,000 words
HIGH
4 Claims 2 Fabricated 1 Unsupported 1 Grounded
Interactive Sample · Live Engine Coming Soon
Struck · Fabricated Caseverdict_source: docket_index
Varghese v. China Southern Airlines, 925 F.3d 1339 (11th Cir. 2019)
No matching 11th Circuit opinion at 925 F.3d 1339. Documented fabricated citation from Mata v. Avianca, Inc., 678 F. Supp. 3d 443 (S.D.N.Y. 2023).
Struck · Fake DOIverdict_source: citation_index
Martinez & Patel (2024), Nature Vol. 628, DOI 10.1038/s41586-024-99104-x
DOI does not resolve in Crossref registry; no Nature Vol. 628 article by these authors exists.
Query · Unsupported Statverdict_source: claim_check
"retrieval grounding eliminates 99.4% of factual errors across legal filings"
Attributed to a non-existent study. Stanford RegLab (2024) still measured 17% to 33% error rates on legal RAG tools.
Grounded · Primary Recordverdict_source: public_record
Moffatt v. Air Canada, 2024 BCCRT 149
Verified against Civil Resolution Tribunal of British Columbia decision 2024 BCCRT 149 (February 14, 2024).
Interactive sample desk active · Live custom-text API activates once route is enabled No signup wall · Claim-by-claim reasoning · Primary-sourced methodology
Aligned index cards, charcoal document trays, and reference dividers on a cool grey desk
Production LLM evaluation pairs atomic claim decomposition with NLI entailment and deterministic identifier checks.

Intrinsic vs Extrinsic LLM Hallucinations

In machine learning evaluation, hallucinations fall into two formal categories. An intrinsic hallucination directly contradicts the source text supplied in the prompt (for example, reporting a 12% revenue decline when the retrieved earnings table shows 12% growth). An extrinsic hallucination introduces claims that cannot be verified from the supplied context at all (such as inventing a regional sales breakdown that never appeared in the retrieved passage).

A production LLM hallucination detector must catch both. Relying on perplexity or token log-probabilities alone is unreliable because modern instruction-tuned models produce low-perplexity, high-confidence falsehoods. Robust evaluation stacks combine claim decomposition, specialized natural language inference (NLI) models, and retrieval grounding.

Explore our Hallucination Detector workbench, review RAG-specific metrics on our RAG hallucination detector page, check multi-step workflows on AI agent hallucination detector, and compare published model error rates in AI hallucination rates ranked.

Core LLM Hallucination Detection Methods Compared

Engineering teams typically combine two or more of the following four evaluation methods depending on latency and accuracy budgets:

  1. NLI Entailment Models (e.g., Vectara HHEM, DeBERTa): Fast, low-cost classifiers that score whether each generated sentence is entailed by, neutral to, or contradicted by the retrieved source context.
  2. LLM-as-a-Judge (e.g., Patronus Lynx, ChainPoll): Dedicated judge models prompted to decompose an answer into atomic claims and verify each against evidence, trading higher latency for stronger reasoning.
  3. Self-Consistency / Semantic Entropy: Sampling multiple responses at non-zero temperature and measuring semantic disagreement; works without external ground truth but multiplies inference cost.
  4. Deterministic Registry & Tool Verification: Validating structured outputs (DOIs, URLs, SQL IDs, SKU codes, statute citations) directly against live databases or APIs with zero probabilistic ambiguity.

Selecting the Right Detection Architecture

Match your evaluation method to latency, cost, and whether source context is available at inference time:

Flagged PatternWhy Models Produce ItPrimary Verification Step
Low-latency RAG guardrail (<100ms)Lightweight NLI faithfulness scorer (HHEM / cross-encoder)Flag or block responses whose entailment score drops below threshold
Offline QA & CI regression suiteClaim-level LLM-as-judge + curated golden datasetTrack faithfulness regressions across prompt and model upgrades
Open-book research or legal assistantAtomic claim split + live Crossref/docket API verificationStrike any citation that fails deterministic registry resolution

Evaluating the Evaluator

Verification Boundary

Judge models can share blind spots with generator models. Always calibrate automated hallucination detectors against a human-annotated golden set from your own domain.

Public benchmarks like Vectara HHEM and HaluEval provide useful baselines, but enterprise failure modes depend heavily on domain jargon, table parsing, and prompt templates. Measure precision and recall of your detector on 200 to 500 real production traces before enabling automated blocking.

For vendor-specific comparisons, see our Vectara HHEM alternative and Patronus AI alternative reviews.

Related Reading

Frequently Asked Questions

What is the fastest LLM hallucination detection method for production?
Cross-encoder NLI faithfulness models such as Vectara HHEM run in tens of milliseconds, making them practical as inline RAG guardrails.
Can self-consistency detect hallucinations when a model is consistently wrong?
No. Semantic entropy catches uncertainty, but if a model holds a consistent misconception in its weights, all sampled answers will agree on the wrong fact.
Why does RAG still hallucinate even with relevant documents?
Models can ignore retrieved passages in favor of parametric memory, misread tables, or extrapolate unsupported conclusions beyond the snippet.
What is an atomic claim in hallucination evaluation?
An atomic claim is the smallest standalone factual proposition extracted from a sentence so it can be verified independently as grounded, unsupported, or contradicted.
How do I test whether my hallucination detector works?
Label 200+ real domain outputs with human reviewers and measure false-positive and false-negative rates before putting the detector in the critical path.