Why AI makes things up (hallucinations)
Saket Bhatnagar, Updated , 10 min, Beginner, Early access
Summary
- AI is trained to produce text that sounds right, not to look facts up. When it lacks a fact, it still writes something fluent.
- That confident but wrong text is called a hallucination: fake references, wrong numbers, invented quotes, events that never happened.
- Giving it trusted sources, letting it say “I don’t know”, using tools and checking important facts cut the risk a lot, but never to zero.
Asha is finishing her college project in Bhopal at midnight. She asks an AI for three books on water conservation in India. It gives her three neat references: authors, titles, publishers, years. The next morning, the librarian searches every catalogue. Two of the books do not exist. The authors sound real. The titles sound real. They were made up, word by fluent word.
Nobody programmed the AI to lie. So where did those books come from? The answer follows straight from everything you have learned so far.
What is an AI hallucination?
When an AI states something false as if it were true, people call it a hallucination. The word is a bit dramatic. The model is not seeing things. It is producing text that fits the pattern of a good answer, without anything inside it checking whether the content is real.
- Made-up facts: a wrong date, a wrong capital, an award someone never won.
- Fake references: books, research papers, court cases or web links that do not exist.
- Invented quotes: words put in a famous person’s mouth.
- Wrong numbers: sums, percentages and prices that look exact but are not.
- Unfaithful summaries: a summary that adds or changes things the document never said.
Ask for directions in a crowded lane of Old Delhi, and some kind uncle will always answer. “Seedha jao, second left, then ask for the sweet shop.” On the main roads he is right every time; he has walked them for forty years. But ask about a tiny galli he has never visited, and he still answers in the same sure voice, because saying “I don’t know” feels rude. His tone never changes. Only his accuracy does. A smart traveller checks a map for the small gallis.
| In real life | In AI |
|---|---|
| Uncle who always answers, to be helpful | A model trained to always give an answer |
| Main roads he has walked for years | Common facts seen many times in training |
| A tiny galli he has never visited | Rare, recent or private facts |
| The same sure voice every time | Fluent text whether right or wrong |
| Checking a map | Grounding in sources and verifying facts |
Why does a model make things up?
Remember how the model was built. It learned by predicting the next token across a huge library. Then it was fine-tuned to always respond helpfully, and rated by people who liked clear, confident answers. Nowhere in that recipe is a step that says “look this up and check it”.
A model does not store facts like a database stores rows. It stores patterns in its numbers. A fact seen thousands of times, like “Jaipur is the capital of Rajasthan”, becomes a strong pattern. A fact seen once or twice becomes a faint one. A fact it never saw is not there at all. But in every case, the model still knows what an answer usually looks like.
Why right and wrong answers sound the same
Drag to exploreStrong patterns give right answers, weak ones give guesses, and both come out in the same confident voice.
Diagram connections:
- Your question to Patterns in the model (asks)
- Patterns in the model to Strong pattern (well known)
- Patterns in the model to Weak or no pattern (rare fact)
- Strong pattern to Same confident tone (right)
- Weak or no pattern to Same confident tone (guess)
- Your question: For example, three books on water conservation in India.
- Patterns in the model: What the model absorbed in training, stored as numbers, not…
- Strong pattern: Seen many times in training, so the answer is likely right.
- Weak or no pattern: Rare, recent or private: the model fills the gap with plaus…
- Same confident tone: Both paths produce smooth, sure-sounding text.
So when Asha asked for books, the model knew the shape of a reference perfectly. It gave an Indian-sounding author, a title with “water” and “India” in it, a real publisher and a believable year. It filled in each slot with the most likely tokens. The result looked exactly like a real reference, because looking like one is what it was trained to do.
Researchers have also pointed out a quieter cause. In training and in many tests, a guess can score points while “I don’t know” scores zero. Like a student in an exam with no negative marking, the model learns that guessing pays. Labs now try to reward honest uncertainty, but the habit runs deep.
| Trigger | What goes wrong | Linked lesson |
|---|---|---|
| Rare or niche facts | Faint patterns, so the model fills gaps | How language models are trained |
| Events after the cutoff | The model never read about them | Why AI doesn’t know your data |
| A detail fell out of the chat | The fact is no longer in view | Context window: how much AI can keep in mind |
| High temperature | Long-shot tokens get picked more often | Temperature: the creativity dial |
| A false premise in the question | The model plays along instead of correcting you | This lesson |
That last trigger is sneaky. Sachin Tendulkar’s highest Test score is 248 not out. Ask a model why he scored a triple century, and a weaker one may cheerfully explain the innings that never happened. The question itself pulled the answer off track.
Spot the made-up fact
Hallucinations are hard to catch because they sit right next to true facts, in the same calm tone. Train your eye with a few real-looking examples.
How to make AI more truthful
You cannot remove hallucinations completely. You can make them much rarer and much quicker to catch. The biggest fix is to stop asking the model to remember, and start asking it to read.
Grounding: answer from sources, then check
Drag to exploreInstead of recalling from memory, the model reads trusted text and points to where each claim came from.
Diagram connections:
- Question to Trusted sources (find)
- Trusted sources to Prompt with sources (paste in)
- Prompt with sources to Model answers (read)
- Model answers to You verify (cites)
- Trusted sources: Your documents, an official website or a search tool.
- Prompt with sources: The relevant text is pasted in with the rule: answer only f…
- Model answers: Allowed to say “not in the sources”.
- You verify: Open the cited source for anything important.
Give it the facts
Paste the document, policy or notes into the prompt and say “answer only from this text”. Module 4 shows how apps do this at scale with RAG.
Allow “I don’t know”
Say it in plain words: “If the answer is not in the text, say you don’t know.” Models follow this far better when it is stated.
Ask where it came from
Request a quote or source for each claim. Then open the source. A citation you have not checked is still a claim.
Use tools for exact work
Let a search tool fetch fresh facts and a calculator do the maths. Module 5 explains tool calling.
Turn the dial down
For facts, use a low temperature. It will not fix wrong knowledge, but it stops long-shot guesses.
Keep a human in the loop
For health, money, law and anything you will publish, a person checks before it counts.
Check yourself
Check yourself
What is the main reason language models hallucinate?
Pick an answer to see why it is right or wrong.
Check yourself
Rohan builds a college help bot. Which change will reduce made-up answers the most?
Pick an answer to see why it is right or wrong.
Check yourself
An AI gives you a quote from a famous scientist with the exact year and city of the speech. What does the detail tell you?
Pick an answer to see why it is right or wrong.
Remember these three
- A hallucination is fluent, confident text that is false; it comes from a model trained to sound right, not to check facts.
- Rare facts, recent events, lost context, high temperature and false premises all make it more likely.
- Ground the model in trusted sources, let it say “I don’t know”, use tools, and check anything that matters.
Questions people ask
Why does AI hallucinate?
Language models are trained to predict likely next words, not to look facts up. When a fact is rare, recent or missing from what they learned, they still produce fluent text that fits the pattern of an answer. That text can be confidently wrong.
How can I reduce AI hallucinations?
Give the model the source text and ask it to answer only from it, tell it that “I don’t know” is allowed, and ask for citations you then check. Use search or calculator tools for fresh facts and maths, and a low temperature for factual tasks.
Can AI hallucinations be stopped completely?
Not today. Grounding, tools and better training make them much rarer, but any model that writes text from patterns can still get something wrong. For important uses, a person should check the answer.
Why does AI make up fake references and links?
The model knows exactly what a reference looks like: author, title, year, publisher, link. If it does not recall a real one, it fills each slot with likely words, producing a citation that looks perfect but does not exist.
Keep learning
Practise it with Lala
A question on this lesson, hints and a review.