
Module 7 Lesson 1: What Hallucinations Are
Why does an AI sometimes lie with total confidence? In this lesson, we define 'Hallucinations' and learn to identify the difference between a creative slip and a factual failure.
Module 7 Lesson 1: What Hallucinations Are
If an LLM says that the first person to walk on the moon was Elvis Presley, and it says it with absolute confidence and professional formatting, you have encountered a Hallucination.
In this lesson, we will define exactly what this phenomenon is and why it's a byproduct of the way LLMs are built—not a "bug" that can be easily fixed with a single line of code.
1. Defining the AI Hallucination
In humans, a hallucination is a sensory experience of something that isn't really there. In AI, a hallucination is a confident statement of a fact that is not true.
Confident but Correctness-Blind
The most dangerous thing about a hallucination is that the model feels just as sure about the wrong answer as it does about the right one. Because it is a probabilistic machine, it is simply following the most likely statistical path of words, even if that path leads to a cliff of misinformation.
2. Creative vs. Factual Contexts
It's important to note that a hallucination is only a problem in certain contexts.
- Creative Context: If you ask an LLM to "Write a story about a flying cat," you want it to hallucinate. You want it to make things up!
- Factual Context: If you ask for the "Summary of my insurance policy," a hallucination is a critical failure.
The model itself does not automatically "know" which mode it should be in unless you tell it.
3. The Confabulation Problem
Some researchers prefer the term Confabulation over Hallucination. Confabulation is a psychological term where a person fills in gaps in their memory with fabricated information that they believe to be true. LLMs do this constantly. They hate saying "I don't know," so they use their billions of parameters to "fill in the blanks" with words that sound plausible.
graph LR
User["User Query: 'What is the population of Mars?'"] --> LLM["LLM Processing"]
LLM -- "Statistical completion" --> Response["Response: 'The population of Mars is approximately 45,000 scientists.'"]
Response -- "Fact Check" --> Reality["Reality: 0 humans live on Mars."]
4. Why Hallucinations Persist
Even the best models (GPT-4, Claude 3.5, Gemini 1.5) still hallucinate. This is because:
- Probability is not logic: Just because a sequence is likely doesn't mean it's true.
- No Grounding: The model doesn't have a "source of truth" database inside its brain; it only has weights and patterns.
- Instruction following: Models are fine-tuned to be helpful. Sometimes, they think being "Helpful" means giving any answer, even a wrong one, rather than admitting ignorance.
Lesson Exercise
The Hallucination Audit:
- Ask an LLM to provide a list of 5 famous researchers in a very niche field (e.g., "The chemistry of high-altitude clouds").
- Now, search for those names on Google Scholar or LinkedIn.
- How many of them actually exist? How many have their biographies mixed up?
Observation: You'll likely find that the AI got the "vibe" of the names right, but might have invented a few people out of thin air!
Summary
In this lesson, we established:
- Hallucinations are confident, factually incorrect statements.
- They are a natural result of probabilistic word prediction.
- Confabulation happens because models are designed to be "helpful" and "fluently complete patterns."
Next Lesson: We look at the "Why." We'll explore the specific Causes of Hallucinations, from training gaps to the "overgeneralization" of the model's weights.