Why Models Hallucinate

Why a language model can state false things fluently and confidently, what causes it, and the habits that make it far less likely to hurt you.

14 minLesson 6 of 6
On this page
  1. Plausible is not the same as true
  2. Watch a fake reference being built
  3. The main causes
  4. What actually reduces it
  5. Common mistakes
  6. Try it yourself
  7. Check yourself
  8. What to practise next

You ask an assistant for three studies to cite in a report. It gives you three neat references: authors, year, journal, a one-line finding each. Two check out. The third looks just as real, with a plausible author and a journal that exists, but the paper does not. Nobody wrote it.

This is called a hallucination: output that is fluent and confident but false or unsupported. It is not a rare glitch, and the model is not lying. It follows directly from how a model makes text.

Plausible is not the same as true

A language model produces text one token at a time, each picked from chances that say what usually comes next (What Is an LLM). Pretraining made those chances match real text, and real text is mostly true, so the model is usually right about things that are written about often.

But nothing in the loop checks facts. In pretraining, the model was rewarded for being a good continuation, not for being true. When it knows a fact well, the true continuation and the plausible one are the same. When it does not, it still produces a plausible one. Every step of the loop must output some token, and there is no separate step that stops when the model is unsure. "I don't know" only comes out if those words are themselves a likely continuation.

Watch a fake reference being built

The chances below are invented to show the pattern. A model is asked for a study showing that houseplants improve exam scores, and suppose no such study is well known. Watch how sure it is at each step.

Writing a reference from guessesUse the arrows or ← → keys
repeat:  chances = model(text so far)  token = sample(chances)  append token to text
  1. next
    0A
    1One
    2Research
    chance
    00.62
    10.21
    20.09
    text
    A study by

    1The first word is "A", at 0.62, and "study by" follows almost automatically. This part is easy: lots of answers start this way, so the model is confident.

  2. next
    0Brennan
    1Lindqvist
    2Okafor
    3Chen
    4Patel
    chance
    00.07
    10.06
    20.05
    30.05
    40.05
    text
    A study by Brennan

    2Now the author. The model has no strong memory of any author for this claim, so the chances are flat: many surnames, none above 0.07. It must still pick one, and sampling lands on "Brennan".

  3. next
    0et al.
    1and
    2(
    chance
    00.81
    10.11
    20.05
    text
    A study by Brennan et al.

    3"et al." is very likely after a surname in a reference. Confident again, and this is real knowledge: of the format, not of the study.

  4. next
    0(2019)
    1(2018)
    2(2021)
    3(2016)
    chance
    00.14
    10.13
    20.12
    30.11
    text
    A study by Brennan et al. (2019)

    4The year is another guess: anything recent is plausible. Sampling picks 2019.

  5. next
    012%
    115%
    210%
    38%
    chance
    00.09
    10.08
    20.08
    30.07
    text
    A study by Brennan et al. (2019) found that ... scored 12% higher

    5The finding. "found that" is near certain; the number is another flat guess. It picks 12%. Everything written so far is now part of the text, and later tokens will tend to stay consistent with it.

  6. piece
    0A study by
    1Brennan
    2et al.
    3(2019)
    4found that
    512%
    chance
    00.62
    10.07
    20.81
    30.14
    40.93
    50.09
    confident steps
    3
    guessed facts
    3

    6The finished sentence reads smoothly. The confident steps (format words) and the guessed ones (author, year, number) look the same on the page, yet all three facts came from chances below 0.15.

1 / 6

What the model really knew was what a reference looks like. That is why the result is convincing. The facts inside were filled in like any other blank.

The main causes

  • Rare facts are stored weakly. A fact seen thousands of times in training gets sharp, confident chances. A fact seen once or twice, like a small company's founding year or a minor paper's author, leaves only a blurry trace. Specific details (names, numbers, dates, quotes, URLs) are the most at risk.
  • Every step commits. Once a wrong token is written, it becomes part of the text the model reads. Later tokens stay consistent with it, so one bad guess can grow into a detailed, coherent false story.
  • Guessing can be rewarded. If training or evaluation scores answers only as right or wrong, a confident guess sometimes scores and "I'm not sure" never does. Researchers point to this as one reason models guess rather than hold back.
  • The answer is not in the text it has. Questions about your private documents, events after its cut-off, or anything it was never told cannot be answered from memory, so a plausible guess is all it can produce.
  • False premises. "Why did the city ban bicycles in 2015?" assumes it happened. A good continuation of that question is an explanation, so the model may supply one.

To be accurate about what is known: research suggests models often carry some internal signal of how sure they are, and for simple facts that signal is partly reliable. Training can teach a model to say "I don't know" more often. But the signal does not reliably show in the wording, and no current method removes hallucinations completely. Treat any specific factual claim as unverified until you check it.

What actually reduces it

The strongest fix is to stop asking the model to remember, and ask it to read instead. Put the source material in the prompt and ask for answers grounded in it.

Asking it to rememberIllustrative example. Real replies vary.
You
What is the notice period in our office lease?
Model
Most commercial office leases have a notice period of 3 to 6 months. Your lease likely requires written notice of 3 months before the end of the term.
Asking it to readIllustrative example. Real replies vary.
You
Using only the lease text below, answer: what is the notice period for ending the lease? Quote the sentence your answer is based on. If the text does not say, reply "Not stated in the lease". <lease> [full lease text] </lease>
Model
The notice period is 90 days, given in writing. Quote: "Either party may terminate this agreement at the end of the initial term by giving not less than ninety (90) days' written notice to the other party."

The second prompt does three things: it supplies the facts, it asks for a quote you can check in seconds, and it gives the model an honest way out. Systems that look up documents automatically and add them to the prompt use the same idea; see RAG Basics. Letting the model run a search or a calculator through tools helps for the same reason.

The last line of defence is you. Check names, numbers, dates, quotes and links before you use them, as carefully as a mistake would cost. Verifying AI Output turns this into a routine.

Common mistakes

Try it yourself

Try it: Ground the answer

This prompt invites a hallucination: the model has never seen the meeting. Rewrite it so the answer must come from material you provide, can be checked, and has an honest way to say something is missing.

Show a sample answer
Rewritten promptIllustrative example. Real replies vary.
You
Below are my notes from Tuesday's product meeting. Using only these notes, tell me what was decided about the launch date. - If a date was decided, give it and quote the line it comes from. - If it was discussed but not decided, say so and list the options mentioned. - If the notes do not mention it, reply "Not in the notes". <notes> [paste meeting notes] </notes>

Why it works: the original asks the model to recall something it never saw, so any answer would be invented. The rewrite gives it the source, restricts it to that source, asks for a quote you can check, and spells out what to say in each case, including "not decided" and "not mentioned", so a guess is never the easiest continuation.

Check yourself

Quick check

Which of these is a model most likely to get wrong without a source?

Why does a hallucinated reference look as convincing as a real one?

What is the most reliable way to get a correct answer about a specific document?

What to practise next

The Prompting Basics lesson starts putting this module to work, and Verifying AI Output shows how to check answers quickly when the stakes are real.