AI-ENGINEERING
    intermediate

    Hallucinations: Causes & Mitigation

    AI Engineer path · lesson 73 of 124
    The idea
    An LLM is a fluent guess-the-next-word engine. Its default job is 'sound right,' not 'be right'. Every mitigation swaps some of that fluency for a truth constraint — grounding it, citing it, checking it, or letting it say I don't know.
    How to use
    Play the false continuation first; then flip mitigations to see the answer and the residual-risk meter change.
    UserWhat was Alcatraz's 1974 escape count?
    Untreated model — confidently completes a false premise
    On
    Why the model does this
    Weights encode a distribution over likely next tokens given prior tokens — coherent, not true. When the premise sits far from the training distribution (a wrong year, a nonexistent entity), the top continuations are still fluent and specific. That confidence is the failure mode.

    Key insight

    Alcatraz closed in 1963 — there were no 1974 escapes. A trained-only model often does not push back. Nothing about greedy decoding or a bigger model directly solves this — you have to add a truth constraint from outside: evidence, tools, checks, or permission to abstain.

    Cause or cure?

    Sort

    Sort each item into what causes hallucination and what reduces it.

    Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.

    Makes it worse

    Drop items here

    Reduces it

    Drop items here
    6 pieces left to place

    Test your knowledge

    20 questions
    Question 1 of 20
    Score: 0

    Why does a language model produce fluent but false claims about a topic it doesn't actually know?

    Interview Questions

    Anthropic
    OpenAI
    Notion
    Meta
    Google
    Databricks
    Anthropic
    Amazon
    Google
    Anthropic
    Meta
    OpenAI

    Love this visualization?

    Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.

    100% free • No credit card required