Page languageFrançaisEnglish
Teacher area
Laurent PoupetClaude trainer and artificial intelligence architectStudent area

Category · Models and how they work

What is a hallucination?

A hallucination is a wrong answer given with confidence. The model produces the most plausible text, not necessarily the true one. It is limited by allowing the model to say “I don’t know”, by requiring sources and by checking the facts.

By , Claude trainer and artificial intelligence architect · Updated

How it works

  • It comes from the very nature of the model, trained to produce plausible text; when information is missing, it fills the gap rather than stopping.
  • The most costly hallucinations are the most believable ones, such as an invented procedure reference or a configuration setting that does not exist.
  • The rate is measured on a set of questions, some of which have no answer in the documents, to check that the assistant knows how to say so.

The trap to avoid

The trap is believing a newer model no longer hallucinates; the rate goes down, but no model is free of it, hence permanent checks.

A concrete example

You ask for the reference of a legal article on a precise subject. The model confidently answers “article L. 1234-56”: the number has the right shape, but it does not exist. You guard against it by giving the model the legal text to read, requiring it to quote the passage, and allowing it to answer “I cannot find it”.

What is the difference with a calculation or code error?

CriterionHallucinationa calculation or code error
What is wrongAn invented fact, presented as trueA badly computed result
How you spot itBy checking the source of the factBy re-running the calculation or the tests
RemedyProvide the documents, require sourcesTest, let code do the calculation

Related terms

Where this is taught

This idea comes up throughout the lessons; we work on it with your own examples during a lesson.

Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.

See the full program

Sources

All glossary terms

Trial lesson · 30 min · $20

Book (new tab)