Lesson 2

AI Hallucinations Explained

Definition: A hallucination occurs when an AI generates false or unsupported information but presents it fluently. Training fluent outputs doesn't guarantee factual accuracy. Next-token likelihood isn't calibrated factual confidence, and models can use tools or checks yet still fail.

Stage 1: Likelihood is Not Evidence

This scripted demo contrasts a supported response with a fluent false one. It does not run a model or report measured probabilities. In real systems, next-token likelihood is not the same as evidence or factual confidence.

Choose the Model's Next Sequence:

The Illusion of Confidence

A fluent answer can still be false. The two paths and their ordering here were written for teaching; they reveal nothing about a real model's training data or likelihoods.

Language models generate from learned patterns, while factual reliability also depends on context, training, retrieval, and verification. Fluency alone is not evidence.

Stage 2: The Verification Challenge

To combat hallucinations, modern systems use RAG (Retrieval-Augmented Generation) — fetching real documents before answering. But you still have to check the citations. Click the claims in the generated text below, then check if the source documents actually support them.

AI Generated Summary

The Eiffel Tower was originally built in Barcelonaand was made entirely of solid gold. Gustave Eiffel's company designed and built it.

Select a claim above first

Stage 3: Raw vs. Grounded Generation

Compare two scripted answers: one contains invented details; the other uses a supplied document. This is an illustration, not a live model comparison. Retrieval gives a model evidence to work with, but does not force accuracy or eliminate the need to check its claims.

Provided Context

Teaching summary: The James Webb Space Telescope (JWST) conducts infrared astronomy. It launched on December 25, 2021, on an Ariane 5 rocket from Kourou, French Guiana.

Check NASA's Webb mission information
Scripted Answer with False Details

The James Webb Space Telescope was launched in 2018 from Cape Canaveral, Florida on a Falcon 9 rocket.

Stage 4: Quick Knowledge Check

Which is the best, most complete answer about what can cause an AI to output false information?

Frequently Asked Questions

Is hallucination a bug?

In factual tasks, hallucination is a reliability failure: an answer includes incorrect or unsupported content. It can arise from incomplete knowledge, ambiguous context, retrieval failures, or generation errors. Better training, retrieval, verification and abstaining when uncertain can reduce the risk.

What does 'Temperature' do?

Temperature changes how concentrated the next-token sampling distribution is. Lower values generally favor higher-likelihood tokens; higher values allow more varied choices. It is not a truth or grounding control: a low-temperature answer can still be confidently wrong.

Does providing documents (RAG) completely stop hallucinations?

No. Retrieval-Augmented Generation supplies relevant documents as context and can improve factual grounding. Results depend on source quality, retrieval and how the model uses the evidence. Missing, outdated or misinterpreted sources can still lead to incorrect answers.

Can AI evaluate its own truthfulness?

Models can sometimes detect and correct their own mistakes, but self-evaluation is not independent proof. Asking 'Are you sure?' is not sufficient verification. For important claims, check reliable sources or independently validated tools.

worldweb.ai

A living library for understanding artificial intelligence.

Built for curious humans, not machines.