Hallucination & Countermeasures
LLM Hallucination
The model doesn't know facts — it's just doing probabilistic sampling. Watch it fabricate with confidence: choose a case, click "Start Generating," and observe how hallucinations emerge token by token.
Choose a Prompt
CASE 1 · Misattribution
黛玉捧着月光宝盒,轻声问:
The Moonlight Treasure Box belongs to Zixia, but the model only sees co-occurrence weights and has no idea who owns what. (Chinese literary crossover example)
CASE 2 · Cross-Universe Mashup
花千骨对郭靖急道:靖哥哥,
Hua Qiangu and Guo Jing are from entirely different franchises, yet the model fluently continues their dialogue. (Chinese fiction crossover)
CASE 3 · Fabrication
女儿国国王望着杏花簪叹道:
The Apricot Blossom Hairpin is Shen Meizhuang's prop; the model incorrectly assigns it to the Queen of the Women's Kingdom. (Chinese period drama example)
CASE 4 · Character Collapse
小龙女转头对杨过急道:
Xiaolongnü is calm and aloof and would never speak urgently; but the model doesn't understand characterization — it only sees word frequency. (Chinese wuxia example)
CASE 5 · Code Hallucination API
Sort a DataFrame by multiple columns stably using pandas:
The model generates non-existent parameter combinations: the code looks real, but the API doesn't work that way at all.
CASE 6 · Everyday Chat Hallucination
Good evening, have you eaten?
AI has no mouth, yet it says "Yes, I ate" and can even invent "tomato egg noodles." Probabilistic continuation makes it role-play a non-existent character.
Step-by-Step Generation
Slow
Medium
Fast
← Select a Prompt and click "Start Generating"
Root Cause: Two Separate Worlds
📚 Model Parameters (Long-term Memory)
Written at training time, read-only at inference. Has a knowledge cutoff date; knowledge stored in compressed form — imprecise and non-updatable.
Analogy: an encyclopedia sealed after it was written
Analogy: an encyclopedia sealed after it was written
💬 Context Window (Working Memory)
Dynamically injected during conversation, precise and trustworthy. Contains the system Prompt, files, and current conversation history.
Analogy: reference materials on your desk
Analogy: reference materials on your desk
⚠ The model has no concept of "I don't know" — it can only continue text. When there's no answer in its parameters, it generates content that "sounds about right," with confidence that does not decrease because the information is inaccurate