Why AI Hallucinates: Simple Examples and How to Check Answers

AI BASICS TO ADVANCED · LESSON 08
Sounds convincing.
But is it supported?
A beginner’s guide to AI hallucinations and checking evidence.

Raju asks his AI helper to write a description of his ginger tea. The draft says, “Our award-winning tea has delighted customers since 1995.” It sounds impressive. But Raju never mentioned an award or an opening year. The sentence is polished—and its factual claims are unsupported. This is the problem we will learn to spot today.



01. What is an AI hallucination?

An AI hallucination is generated content that is false or unsupported but presented as though it were factual. Examples include an invented source, a made-up delivery date, or a summary that adds information absent from its source. Terminology varies across research; here we focus on claims readers should verify.

FLUENT TEXT IS NOT PROOF
01
Claim
This tea won an award
02
Evidence
No award information supplied
03
Action
Verify the claim or remove it
Unsupported does not always mean proven false. It means the available evidence does not justify treating the claim as established.

02. Why can a language model do this?

A language model learns patterns that help it generate plausible continuations. Producing a likely sentence is not the same task as checking every claim against reality. If the needed fact is missing, it may still produce a familiar-looking answer. Its training and later tuning can reduce this behavior without eliminating it.

PLAUSIBILITY AND VERIFICATION
01
Generation
Produce a plausible continuation
02
Evidence
Locate information about the claim
03
Verification
Check whether evidence supports it
A model can produce many correct answers. The problem is that fluent wording alone does not tell us which claims are correct.

03. Raju’s missing delivery date

Raju gives the model an order note: “Order placed Monday. Delivery date not confirmed.” He asks when the milk will arrive. An answer such as “Tuesday morning” fills a gap without evidence. A suitable source-based answer is: “The note does not confirm a delivery date. Please check with the supplier.”

DO NOT TURN A GAP INTO A FACT
01
Known
Order placed Monday
02
Unknown
Confirmed arrival date
03
Useful response
Say what is missing and how to check
“Usually next day” would also need a real source and still would not confirm this particular delivery.



04. Notice common warning signs

Check precise dates, prices, quotations, statistics, named awards, and references especially carefully. Also watch for an answer that contradicts the source or gives details the source never mentions. These are reasons to investigate, not an automatic test that labels every detailed answer as false.

CLAIMS TO CHECK
01
Exact details
Dates, quantities, prices
02
Attribution
Quotes, authors, studies
03
Source mismatch
Added or contradicted information
A vague answer can be wrong too. Detail and writing style are not reliable truth detectors.

05. Separate facts, inferences, and unknowns

Suppose a sales record shows that Raju sold more tea on two rainy days. That observation is a fact within the supplied record. “Rain caused the increase” is an inference that the record alone does not establish. Tomorrow’s exact sales remain unknown. Labeling these categories helps prevent guesses from becoming apparent facts.

THREE DIFFERENT LABELS
01
Observed
Two rainy days had higher sales
02
Inferred
Rain may have contributed
03
Unknown
Tomorrow’s exact sales
A reasonable inference should be identified as an inference and supported with its assumptions.

06. Give the model a clear evidence boundary

Provide the relevant document or confirmed facts and specify what to do when an answer is absent. Asking it to use only the supplied source and mark missing details can help reduce unsupported additions. It remains an instruction to be checked, not a guarantee the model will follow perfectly.

A BETTER SOURCE-BASED REQUEST
01
Scope
Use the supplied order note
02
Support
Identify the supporting passage
03
Missing detail
Say “not stated” instead of guessing
Source-based prompting works best when the source itself is relevant, readable, and trustworthy.
Copy this practical prompt
Answer the question using only the source below. If the source does not contain the answer, say “Not stated in the source.” Do not invent dates, prices, names, or references. Give the answer, a short supporting quotation if available, and any uncertainty. SOURCE: Order placed Monday. Delivery date not confirmed. QUESTION: When will the milk arrive?

Suitable answer: Not stated in the source. Supporting text: “Delivery date not confirmed.”

07. A citation is a starting point, not proof

If an AI answer includes a link, open it. Confirm the source exists, then find the passage supporting the exact claim. A real article can be cited for something it never says. Check dates and scope too: an older announcement might not describe the current situation.

CHECK THE LINK AND THE CLAIM
01
Exists?
Does the source actually open?
02
Supports?
Does it state this claim?
03
Applies?
Right date, topic, and context?
A plausible title or a long reference list is not enough. Do not publish a citation you have not checked.

08. Does web search or RAG solve everything?

Retrieval-Augmented Generation, or RAG, supplies retrieved material to a model as context for its answer. This can help when the needed facts are in relevant sources. However, the system might retrieve the wrong document, use outdated information, or misread a correct passage. The final claims still need checking.

EVIDENCE CAN FAIL AT DIFFERENT STEPS
01
Retrieve
Find relevant source material
02
Read
Interpret it correctly
03
Answer
Stay within what it supports
Retrieval provides evidence; it does not automatically establish the truth of every generated sentence. We will explore RAG later in the series.

09. Will temperature zero stop hallucinations?

No. As we learned in Lesson 7, temperature changes token-selection probabilities. It does not verify facts. A system can repeatedly produce the same unsupported answer. Similarly, asking the same model “Are you sure?” can trigger a revision, but agreement with its earlier answer is not independent confirmation.

REPETITION IS NOT VERIFICATION
01
Low variation
The wording may repeat
02
Self-check
The model may revise or agree
03
Evidence check
Compare with an actual source
Use sampling settings for their documented purpose. Use evidence and evaluation to assess factual reliability.

10. Use a four-step publishing check

Before publishing Raju’s description, extract each factual claim: award, opening year, ingredients, price. Compare each with the relevant record. Correct unsupported details or remove them. Then read the revised draft once more to make sure the edit did not introduce another claim.

CLAIM → SOURCE → DECISION → REVIEW
01
Identify
List factual claims
02
Compare
Find supporting evidence
03
Decide
Keep, correct, qualify, or remove
04
Review
Check the final wording
For this example, remove the award and opening-year claims unless reliable evidence confirms them.



11. A developer example: an invented method

A coding assistant might suggest a Java library method that looks sensible but does not exist in your installed version. Check the official documentation for that version, compile the code, and test representative inputs. Compilation can catch a missing method; it cannot prove that the business logic is correct.

MATCH THE CHECK TO THE FAILURE
01
API existence
Read version-specific documentation
02
Syntax and types
Compile the code
03
Behavior
Test normal and edge cases
Do not invent a dependency version to make an example look current. Confirm it before adding it to a real project.

12. Decide when an answer is safe to use

For a fictional tea-shop slogan, imaginative wording may be welcome. For a real price, ingredient list, or delivery promise, unsupported invention is a problem. Match the review to the consequences. Medical, legal, financial, or safety-critical decisions need suitable authoritative evidence and qualified review.

THE TASK CHANGES THE STANDARD
01
Fiction
Invent within the requested story
02
Factual writing
Support factual claims
03
High-stakes use
Use appropriate expert review
Requested fiction is not a hallucination simply because it is invented. The issue is presenting unsupported content as fact.

Practice: spot the unsupported detail

Source

Raju sells ginger tea for ₹20. His shop is closed on Sundays.

AI draft

Enjoy Raju’s award-winning ginger tea for ₹20, available every day.

Which parts are supported, unsupported, or contradicted?

Reveal the explanation
  • Supported: Ginger tea costs ₹20.
  • Unsupported: “Award-winning.” No award is mentioned.
  • Contradicted: “Every day.” The source says the shop is closed on Sundays.

Corrected version: Enjoy Raju’s ginger tea for ₹20. The shop is closed on Sundays.

Quick questions

Does confident wording mean the AI knows?

No. Confidence in the wording is not proof that a claim has been checked.

Can I prevent every hallucination with one prompt?

No. Clear instructions and reliable source material help, but you still need verification appropriate to the task.

Is “I don’t know” a bad answer?

When the necessary information is missing, acknowledging the gap is more useful than inventing a fact. A good response can also explain what information is needed next.

YOUR ONE-MINUTE RECAP

A convincing answer can still be unsupported.

Provide relevant sources. Allow uncertainty. Open citations. Check each important claim before using it.

Next lesson: Embeddings explained simply

How can a system find related text even when the words are different? We will explore numerical representations and semantic search through Raju’s tea shop.

Join the conversation: What would you check first in an AI-written article: its dates, quotations, or sources—and why?


Sources and further reading

The examples and exercises are fictional teaching scenarios, not benchmark results.

Comments

Popular posts from this blog

Beyond Standard RAG: The Architecture of Agentic Retrieval and Self-Correction Loops

The Architecture of Vision-Language Models: How Multimodal AI Sees and Understands the World

Java Collection Framework: A Practical Guide with Examples