Skip to content
mentoor

Topic 4 of 5 · 4 min read

Hallucination, grounding and retrieval

Goal: Explain hallucination, grounding and RAG in plain words and say which one a described answer shows.

Hallucination is when a model states something false as if it were true, grounding ties an answer to a real source, and RAG is a method that fetches sources for the model before it answers. They are the words for being wrong, being checkable and a common way to fix it.

Check yourself · 1 of 3

A chatbot gives you a book title, author and year. The book does not exist. What is this?

Choose one answer

Why it matters

Models write fluent text whether or not the facts are right. A made-up court case or a wrong dosage looks just like a true one. These terms help you ask the right question: where did this come from, and can I check it?

The three words

  1. Hallucination. A confident answer that is invented or wrong: a fake book title, a quote nobody said, a number with no source. The model is not lying. It predicts likely-sounding text, and likely is not the same as true. It happens most with rare facts, recent events, exact numbers and requests for citations.
  2. Grounding. Tying an answer to material you can check. A grounded answer points to a document, a web page or a database, and its claims match what that source says. Grounding does not make errors impossible, but it makes them findable.
  3. RAG (retrieval-augmented generation). A setup where the app first searches your documents or the web, adds the best passages to the prompt, and then the model answers from them. Many "chat with your files" and company-assistant products use it. The model writes the words; the retrieval step supplies the facts.

Before and after

Before: "Tell me our refund policy." The model answers from memory and invents a 30-day rule.

After: The app finds the real policy page, adds it to the prompt, and the model replies with the policy and a link. The prompt also says, "If the answer is not in the text, say so."

The second answer is grounded. If the policy page is outdated or the search finds the wrong page, the answer can still be wrong, but you can see why.

What goes wrong

  • People think "the model checked the web" means the answer is true. Search results can be wrong, old or ignored by the model. Open the source.
  • People trust citations that look right. Models can invent a reference with a real-looking author and title. Click through.
  • People think RAG removes hallucination. It reduces it. The model can still misread a passage or add a claim that is not in it.
  • People assume a source list means a grounded answer. Ask whether each claim is in the source, not whether a source exists.

Examples

Spot the hallucination

You ask for three studies on sleep and memory. The reply lists three titles with authors and years. When you search, one study does not exist. That is a hallucinated citation.

Grounded or not

"According to the handbook page linked here, staff get 25 days of leave" is grounded: you can open the page. "Staff usually get about 25 days" with no source is not.

Key points

  • A hallucination is a confident, fluent answer that is invented or wrong, because models predict likely text, not checked facts.
  • Grounding means tying an answer to a source you can open and check.
  • RAG fetches relevant passages first and puts them in the prompt so the model answers from them.
  • RAG and grounding reduce errors but do not remove them; the model can still misread or add claims.
  • A source list is not proof; check that each claim actually appears in the source.

Common mistakes

  • Treating fluent writing as evidence of truth.
  • Believing a model that searched the web must be right.
  • Assuming RAG makes hallucination impossible.
  • Accepting a citation without opening it.

Check yourself · 2 of 3

In AI products, what does RAG do?

Choose one answer

Check yourself · 3 of 3

Which answer is best described as grounded?

Choose one answer

Practice items, not counted towards your mastery.

Start here