Concepts

Hallucination Mitigation

Techniques to reduce LLMs generating false but plausible information, from RAG to factual verification and prompt design.

seed#hallucination#factuality#grounding#rag#verification#llm

What it is

Hallucinations are LLM responses that sound correct but contain fabricated information. The model generates plausible text based on statistical patterns, not verified facts. Mitigating hallucinations is critical for applications where accuracy matters.

Types of hallucinations

TypeExampleDetectionMitigation
FactualIncorrect data as factsVerification against sourcesRAG with citations
FabricationInventing URLs, papers, citationsValidate sources existInstruct "I don't know" + verification
InconsistencyContradicting itself in same responseCompare assertionsChain-of-thought
ExtrapolationGeneralizing from limited examplesEvaluate model confidenceLimit prompt scope

Mitigation strategies

Grounding with RAG

RAG anchors responses in real documents:

  • The model cites specific sources
  • Information can be verified against original documents
  • Reduces (doesn't eliminate) fact fabrication

Prompt design

  • Instruct the model to say "I don't know" when it lacks information
  • Ask it to cite sources for factual claims
  • Use chain-of-thought to make reasoning explicit
  • Clearly separate facts from opinions

Post-generation verification

  • Secondary models that verify factual claims
  • Web search to validate specific claims
  • Comparison with structured knowledge bases

Confidence calibration

  • Ask the model to indicate its certainty level
  • Generate multiple responses and compare consistency
  • Detect linguistic patterns associated with hallucinations

Evaluation metrics

  • Faithfulness: is the response faithful to the provided context?
  • Factuality: are the facts verifiably correct?
  • Attribution: are citations real and relevant?

Limitations

No perfect solution exists. Even with RAG, the model can:

  • Misinterpret retrieved context
  • Combine information in incorrect ways
  • Invent details that "complete" the information

Mitigation reduces frequency, it doesn't eliminate the problem.

Why it matters

Hallucinations are the most visible risk of AI systems in production. A model that generates false information with confidence can cause real harm. Mitigation techniques — RAG, grounding, verification — are engineering requirements, not optional improvements.

References

Concepts