# What Is a Hallucination?

> What an AI hallucination is, why language models make things up, and how teams limit the damage, explained for your AI interview.

**In short:** A hallucination is when an AI model states something false or made up in a confident, believable way. It happens because models learn to predict likely next words, and rare facts have no pattern to copy, so they fill the gap with a plausible guess.

AI and LLM interview question Q023, LLM fundamentals. Beginner, very common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/what-is-an-ai-hallucination

## Say it in 30 seconds

A hallucination is when an AI model states something false in a confident, believable way. It happens because the model learns to predict likely next words. Rare facts have no pattern to copy, so it fills the gap with a plausible guess. Tests also tend to reward a confident guess over an honest I don't know. Nobody has removed it completely, so I limit the damage. I give the model the real text, make it quote its source, and let it say it doesn't know.

## Say it in 2 minutes

A hallucination is when a language model gives an answer that sounds right but is false or made up. The model is not trying to deceive anyone. It writes a likely next word, again and again, until the answer is finished, and a wrong answer comes out in the same smooth tone as a right one.

It happens for two reasons. First, the model learns by predicting the next word in huge amounts of text, with no true or false label on each sentence. Spelling and parentheses repeat, so it learns them well. A rare fact, such as one bank's late fee for one card, has no pattern to copy, so the model fills the gap with a guess. Second, tests often reward a confident guess over an honest I don't know. Adam Tauman Kalai and colleagues argued this in a 2025 arXiv paper.

At work the risk is real. Picture a support assistant at a mid-size bank that quotes a late fee the tariff does not list. The customer trusts it, and the bank has a complaint to handle. So I don't let the bot answer from memory alone. It answers from the real tariff, quotes the line it used, and code checks that the quote exists. If no quote is found, it says it doesn't know.

No one has fully solved this. Anthropic's guidance is that these techniques reduce hallucinations a great deal but don't eliminate them. So I test the bot with questions the documents can't answer, and I watch for confident replies to those.

## What is a hallucination, in plain words?

A hallucination is when a language model states something false or made up, in a confident and believable way. The wrong answer reads just as smoothly as a right one, so a reader can't tell them apart by tone.

Picture a new teller at a bank counter. A customer asks about a fee the teller has never seen. A careful teller checks the fee schedule. A weak one answers from memory, sounds sure, and gets it wrong. The customer leaves with the wrong number and trusts it.

The same thing happens in AI products. A support assistant at a mid-size bank is asked about a card's late fee. It replies with a confident figure and says it comes from the tariff. The tariff says £12. The reply is a hallucination, and the bank now has an angry customer.

- **Hallucination:** A confident answer that is false or made up.
- **Pretraining:** The first training stage, where the model learns to predict the next word in huge amounts of text.
- **Grounding:** Giving the model real source text to answer from, instead of relying on its memory.
- **Abstain:** Admitting it does not know, instead of guessing an answer.

## Why does a model make things up?

The first training stage is pretraining. The model learns by predicting the next word in huge amounts of text. Nobody labels each sentence as true or false, so the model never gets a clear signal about which facts are correct.

Patterns that repeat get learned well. Spelling and parentheses follow consistent patterns, so errors there fade as the model grows. A rare fact has no repeating pattern, so the model cannot work it out from other text. It fills the gap with the most likely-sounding answer, and that answer can be false.

*Diagram, Where a hallucination comes from: Training asks the model to predict the next word in huge amounts of text, with no true or false labels. Patterns like spelling get learned well. Rare facts have no pattern to copy, so the model fills the gap with a confident guess.*
1. The model reads huge amounts of text and learns to predict each next word.
2. Patterns that repeat, like spelling, get learned well.
3. A rare fact has no repeating pattern, so the model has to fill the gap.
4. The gap gets filled with a guess that reads smoothly but may be false.

> "If incorrect statements cannot be distinguished from facts, then hallucinations in pretrained language models will arise through natural statistical pressures." (Kalai, Nachum, Vempala and Zhang, arXiv 2025)
>
> "Hallucinations remain a fundamental challenge for all large language models, but we are working hard to further reduce them." (OpenAI, 2025)

## Why don't models just say I don't know?

Most tests score answers, not honesty. A right answer earns a point. A wrong answer earns nothing extra. A blank earns nothing. So a model that guesses can score higher than one that admits it does not know. OpenAI says most scoreboards rank models on accuracy, so models learn to guess.

1. **Scoring A: right is 1, wrong is 0, blank is 0:** A bot guesses a fee answer it has a one in four chance of getting right. The guess scores 0.25 on average. A blank scores 0, so the guess wins.
2. **Scoring B: right is 1, wrong is -1, blank is 0:** The same guess now scores 0.25 minus 0.75, which is -0.5 on average. Saying I don't know now wins.

OpenAI suggests scoring tests so that confident errors cost more than honest uncertainty. That idea is not new. Some standardised exams have long used negative marking for wrong answers.

Even so, OpenAI says accuracy will never reach 100%, because some real-world questions cannot be answered from the information available. Honest abstaining is part of the fix.

## How do teams limit hallucinations at work?

Teams can't count on a model never to make things up, so they limit the damage. The steps below sit on top of each other, so one missed step is not the end.

*Diagram, Limiting hallucinations in a work bot: A staff question is answered from the real policy text, with a quote for each claim. Code checks that each quote exists in the source. If one is missing, the claim is dropped or the bot says it does not know.*
1. The question starts a lookup of the right document.
2. The model reads that text and writes its answer with quotes.
3. Code checks that each quote is really in the source.
4. Quote found: the answer goes out with its source.
5. Quote missing: the claim is dropped, or the bot says it does not know.

1. **Let it say I don't know:** Tell the model it may admit uncertainty. Anthropic says this technique can drastically reduce false information.
2. **Make it quote its source:** Each claim comes with a quote from the real text. On long documents, ask for word-for-word quotes first. If no quote can be found, the claim goes.
3. **Check the quotes in code:** Anthropic's method has the model find each quote itself. Our extra step: code confirms the quote is really in the source, so the model cannot mark its own homework.

> "although these techniques significantly reduce hallucinations, they don't eliminate them entirely." (Anthropic, Claude docs)
>
> "Misinformation can arise from hallucination, incomplete or stale context, weak grounding, ambiguous prompts, biased or corrupted data, misleading summaries, or unvalidated tool outputs." (OWASP, LLM07:2026 Misinformation)

Here is the check in plain Python. The model states a claim and quotes its source, and the marked lines decide whether it goes out. The check proves the quote exists. It does not prove the quote supports the claim, so a person still reviews important answers.

```python
# A citation check: the model states a fact and quotes its source, and code checks the quote is really there.
# It proves the quote exists, not that it supports the claim.
SOURCE = """Refunds are paid within 7 working days of approval.
A late payment on a card attracts a fee of £12."""

answers = [
    ("Refunds take 7 working days.", "Refunds are paid within 7 working days"),
    ("A late card payment costs £35.", "A late payment on a card attracts a fee of £35"),
]

for claim, quote in answers:
    if quote in SOURCE:
        print("OK:  " + claim)
    else:
        print("CUT: " + claim + " (quote not in source)")
```

Output:

```text
OK:  Refunds take 7 working days.
CUT: A late card payment costs £35. (quote not in source)
```

### How would you stop a support bot from quoting fees it made up?

Start with the fee schedule. The bot answers from that document only, quotes the line it used, and says it does not know when the document is silent. A code check tests each quote against the file before the reply is sent.

- **Without the fix: Answer from memory.** The bot names a fee from what it learned in training. It sounds sure, and nothing checks it.
- **With the fix: Quote, check, then send.** The bot quotes the tariff line. Code confirms the quote is there, or the reply says it does not know.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain definition: a confident answer that is false or made up.
- [ ] Why it happens: next-word prediction, and rare facts have no pattern.
- [ ] Why it persists: tests often reward a confident guess over I don't know.
- [ ] Honest limits: it can be reduced, but it remains a fundamental challenge.
- [ ] Fixes you can build: grounding, quotes, permission to abstain, and checks in code.
- [ ] A work example, such as a bot quoting a fee the tariff does not contain.

**Common traps**

- Trap: "Hallucinations mean the model is broken." Better: It is a known limit of how models are trained and scored, so plan around it.
- Trap: "A bigger model stops hallucinating." Better: Size does not remove the pressure to guess. Keep grounding and checks at any size.
- Trap: "If the answer sounds confident, it's probably right." Better: Fluent text can still be false. The core risk is that a wrong output gets trusted and acted on.

## Can you spot the hallucination?

**Spot the hallucination:** The bot's documents say the card late fee is £12. A customer asks about it. Which reply is a hallucination?

A. I can't confirm the exact fee from here, so please check with a colleague.
B. Thanks for getting in touch. Is there anything else I can help with?
C. Your late fee is £35, as set out in our tariff.
D. I can help you set up a reminder for your payment date.

**Answer:** C. The reply gives a specific figure and says it comes from the tariff, but the tariff says £12. The other replies admit what the bot cannot see or stay with what it can do.

**Quick check:** A support bot is asked about a fee that is not in its documents. Which setup most reduces the chance it invents an answer?

A. A bigger model with no other changes
B. Give it the real text to quote from, and let it say I don't know
C. A higher temperature (how random its wording is) so it sounds more creative
D. A longer system prompt that says never to make mistakes

**Answer:** B. Grounding gives the bot real text to answer from, and permission to abstain stops it guessing. A bigger model or a stronger prompt does not remove the pressure to guess.

## Can you answer these from memory?

**Flash cards**

- **What is a hallucination?** A confident answer that is false or made up, sounding as sure as a true one.
- **Why does it happen?** Models learn by predicting likely next words. Rare facts have no pattern, so the model guesses.
- **Why don't models say I don't know?** Many tests score a guess above a blank, so guessing gets rewarded.
- **Can it be removed completely?** Not fully. Techniques reduce it but do not eliminate it, so limit the damage.
- **What is a grounding fix?** Give the model real source text, make it quote the source, and check each quote in code.
- **Why does it matter at work?** People trust fluent answers, so a wrong fee or clause can get acted on.

## Likely follow-up questions

- Q220 What is grounding? https://designervenkat.online/interview/ai/what-is-grounding
- Q134 How do you reduce hallucinations in RAG? https://designervenkat.online/interview/ai/how-to-reduce-hallucinations-in-rag
- Q219 How do you detect hallucinations? https://designervenkat.online/interview/ai/how-do-you-detect-hallucinations
- Q390 "Your model hallucinates too much." What do you do in the first 48 hours? (full answer coming)
- Q135 How do you add citations? https://designervenkat.online/interview/ai/how-do-you-add-citations

## Learn it in depth

- [Grounded generation](https://designervenkat.online/learn/ai-engineering/generation)
