ToolsPromptsSkillsWorkflowsBlogAbout

Hallucination Detection — identify and reduce fabricated content

Deploy a multi-layered strategy: factuality scoring, citation verification, consistency checks, and self-contradiction detection to catch LLM fabrications.

Evaluation4.4
Hallucination Detection — identify and reduce fabricated content preview

Prompt template

You are a factuality checker. For each claim in the output, determine whether it is supported by the provided context. Label each claim as SUPPORTED, CONTRADICTED, or NOT_FOUND. For unsupported claims, suggest what evidence would be needed.

Context: {source_context}

Output: {model_output}

Claim analysis:

How to use

  1. 1Decompose the model output into atomic, verifiable claims (entities, relationships, numbers)
  2. 2For each claim, check against retrieved source context for explicit support
  3. 3Run a separate NLI (Natural Language Inference) model or LLM judge to classify entailment/contradiction
  4. 4Detect internal contradictions by comparing claims within the same output against each other
  5. 5Flag numerical claims for exact-match verification against source data
  6. 6Route outputs with high hallucination probability to a human reviewer or trigger a regeneration with stronger grounding

Pro tips

  • RAGAS's faithfulness metric and DeepEval's hallucination metric are off-the-shelf implementations
  • Atomic claim decomposition is critical — checking whole paragraphs for factuality misses subtle fabrications
  • Self-consistency (sampling multiple outputs and checking agreement) catches stochastic hallucinations
  • Always require citations in grounded generation so each claim can be traced to a source

Works best with

ragasdeepevallangsmithtruefoundry

Ratings & Reviews

Loading reviews…

Share your experience

Select a rating

Related Skills