AI Concepts·intermediate
Hallucination
When the AI says something false with full confidence.
A hallucination is when an AI generates something that sounds right but isn't. Invented book titles. Fake citations. Code that references functions that don't exist. Historical events that never happened.
This isn't a bug the model catches. From inside, a hallucination and a correct answer look identical — both are just the most statistically likely continuation.
Why it happens:
- Training data was imperfect.
- The model is pattern-matching, not looking things up.
- Some prompts push it into territory where no clean answer exists, so it fabricates one.
How to protect yourself:
- Verify anything that matters. Names, numbers, dates, citations.
- For code, run it. Don't trust it until it works.
- If you're not sure, ask how confident the model is — or ask it to cite a source you can check yourself.