SevyDevy

Module 2 · How a language model thinks · Lesson 12 of 32

Why AI makes things up (hallucinations)

10 minFree GenAI course · BeginnerLesson 2.8By Saket Bhatnagar

Researched and drafted with AI, reviewed and edited by Saket Bhatnagar.

In short

  • 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.
Soon

Video lesson · coming soon

Why AI makes things up: hallucinations explained

Lala, your AI mentor, will walk you through this lesson in a short animated video. Until then, everything is here to read and try.

  1. 01 Two of these three books do not exist
  2. 02 The uncle who never says pata nahi
  3. 03 Right and wrong sound the same
  4. 04 Spot the made-up fact
  5. 05 Make it read, not remember
  6. 06 Confidence is not evidence
  7. 07 Play the game, then start prompting

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.

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

Strong 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.

Common triggers for hallucinations, and the lesson they connect to
TriggerWhat goes wrongLinked lesson
Rare or niche factsFaint patterns, so the model fills gapsHow language models are trained
Events after the cutoffThe model never read about themWhy AI doesn’t know your data
A detail fell out of the chatThe fact is no longer in viewContext window: how much AI can keep in mind
High temperatureLong-shot tokens get picked more oftenTemperature: the creativity dial
A false premise in the questionThe model plays along instead of correcting youThis 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.

Try it yourselfSpot the made-up factEach card shows something an AI might say. Pick the part that is made up, or the right way to treat it.

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

Instead 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.
  1. 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.

  2. 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.

  3. 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.

  4. Use tools for exact work

    Let a search tool fetch fresh facts and a calculator do the maths. Module 5 explains tool calling.

  5. Turn the dial down

    For facts, use a low temperature. It will not fix wrong knowledge, but it stops long-shot guesses.

  6. 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

  1. A hallucination is fluent, confident text that is false; it comes from a model trained to sound right, not to check facts.
  2. Rare facts, recent events, lost context, high temperature and false premises all make it more likely.
  3. 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.