LLM Hallucination Debugger

Language models do not look things up. They predict the next most plausible token, one at a time. Step through a generation below and watch a fluent, confident sentence drift away from anything the model actually knows.

Generation stream

Press Step or Auto-run to begin generating.
Supported by training evidenceFluent but unsupportedNeutral glue words

Ready. Prompt: "The inventor of the pocket calculator was"

Next-token probabilities

Candidate tokens and their sampled probabilities appear here at each step. Higher temperature flattens the distribution and makes rare, riskier tokens more likely.

Claim inspector

As claims form, each is checked against the simulated evidence base and flagged here.

Why does this happen?

A language model is trained to continue text plausibly, not truthfully. When a prompt asks for a specific fact, the model samples from a probability distribution over tokens. If the true answer is weakly represented in training data, a confident-sounding wrong answer can score nearly as well, and the sampler may pick it.

Every token is chosen without any lookup, citation, or verification step. Fluency is a property of the language pattern; truth is not. That is why hallucinations read smoothly: the grammar machinery is working perfectly even when the facts are invented.

How to reduce hallucinations

Lower temperature reduces risky samples but cannot create knowledge the model lacks. Retrieval-augmented generation grounds claims in documents. Asking models to cite sources, express uncertainty, or answer "I don't know" all shift probability mass toward honest completions. Try temperature 0.1 versus 1.8 above and compare the claim inspector results.

Report copied
Enjoy this tool? Build your own with Super