Skip to content
derpx06.dev
WritingExplainersNotesAbout
works on my machineit's always DNSship itLGTMTODO: sleepoff by oneread the docsgit push --force-with-lease404: sleep not foundhave you tried turning it off and on againrubber duck says: explain itpremature optimisationworks on my machineit's always DNSship itLGTMTODO: sleepoff by oneread the docsgit push --force-with-lease404: sleep not foundhave you tried turning it off and on againrubber duck says: explain itpremature optimisation

Learning in public.

A student's notebook on system design, distributed systems and databases. Shared as I learn.

ReadWritingExplainersNotesAbout
ElsewhereGitHubLinkedInHugging FaceLeetCode
Say hellomanaskhairnar1511@gmail.com
derpx06
NORMALmain© 2026 Derpx06Pune, Indiatop ↑
Explainers/LLM Systems

Why do AI chatbots make things up?

A proof-based paper arguing chatbots hallucinate because learning from text forces some errors and tests reward guessing over saying I do not know.

Derpx0622 Nov · 7 min read
Contents
The idea in one sentenceHow it worksStep 1: Pretraining learns the distribution of textStep 2: Generating valid text is at least as hard as checking itStep 3: Facts with no pattern, and the singleton rateStep 4: Other causesStep 5: Why tests keep guessing aliveStep 6: Confidence targetsWhat the paper foundWhat to be careful aboutSources
0% read · 7 min leftBack to top ↑
On this page0%
Contents
The idea in one sentenceHow it worksStep 1: Pretraining learns the distribution of textStep 2: Generating valid text is at least as hard as checking itStep 3: Facts with no pattern, and the singleton rateStep 4: Other causesStep 5: Why tests keep guessing aliveStep 6: Confidence targetsWhat the paper foundWhat to be careful aboutSources

Chatbots sometimes state false things in a sure voice. People call this hallucination. This paper asks a plain question: why does it happen, and why does it survive after companies work hard to remove it? Its answer has two parts. One part comes from how models learn. The other comes from how models are graded.

Paper

Why Language Models Hallucinate. Adam Tauman Kalai, Ofir Nachum, Santosh S. Vempala, Edwin Zhang. OpenAI and Georgia Tech. arXiv:2509.04664, 4 September 2025. It is a theory paper: it proves bounds and gives examples. It trains no new model. arxiv.org/abs/2509.04664

The idea in one sentence

Models hallucinate because learning from text makes some wrong answers unavoidable, and because most tests give a guess a better score than "I don't know".

The paper says hallucinations "need not be mysterious". Telling true statements from false ones is an ordinary classification problem, and classifiers make mistakes. Then tests that score only right or wrong reward bluffing.

How it works

Step 1: Pretraining learns the distribution of text

A language model gives every possible text a probability. Pretraining fits those probabilities to a large pile of text. Fitting a probability distribution to data is called density estimation. The usual loss for this is cross-entropy: it is low when the model gives high probability to the texts that really occur.

The paper stresses that this is not only about "predict the next word". Its analysis holds for any model fitted to the language distribution.

Step 2: Generating valid text is at least as hard as checking it

Call a text valid if it is true, and an error if it is a plausible falsehood. The paper defines a yes/no task called Is-It-Valid (IIV). It is binary classification: given a text, say "valid" or "error".

The test set is half real valid texts and half errors picked at random. The paper shows that any language model can be used as an IIV classifier: call a text "valid" if the model gives it a probability above 1/|E|, where |E| is the number of possible errors. Then it proves a link between the two tasks:

(generation error rate) is at least about 2 × (IIV misclassification rate)

The exact statement (Corollary 1) subtracts two small terms. One is |V|/|E|, the ratio of valid to error texts. The other, δ, measures how badly the model's probabilities are calibrated. Calibrated means that when the model says 70%, it is right about 70% of the time. The paper argues δ is small after pretraining, because cross-entropy training pushes it toward zero.

1Pretrained model
2Probability above a threshold?
3Label: valid or error
4Compare with truth
5Generation errors at least 2x the IIV errors
How the paper turns a language model into a yes/no classifier.

Toy example (ours, small terms ignored): if the best classifier you can build for some topic is wrong on 10 of 100 test texts, then any model fitted to that topic must produce errors in at least about 20% of its generations. The only way around it is to be badly calibrated, which the paper argues pretraining avoids.

This is the key step: the generator inherits the classifier's mistakes.

Step 3: Facts with no pattern, and the singleton rate

Some things have a pattern. Spelling and brackets that close are learned reliably. A birthday has no pattern. If the training text never says someone's birthday, nothing can be learned about it. The paper calls these arbitrary facts.

For arbitrary facts the paper gives a number you can compute. A fact is a singleton if it appears exactly once in the training data. The singleton rate is the fraction of facts that are singletons. The paper's Theorem 2 says the error rate of a base model is at least about the singleton rate, minus small terms. The idea comes from the Good-Turing estimate, which says that the share of things seen once tells you how much probability is left for things you have not seen yet.

The paper's own example: if 20% of birthday facts appear exactly once in pretraining data, expect a base model to be wrong on at least 20% of birthday questions.

Toy example (ours): the data mentions five people's birthdays 10 times in total. Person A appears 5 times, B twice, and C, D and E once each.

A: 5 times
B: 2 times
C: 1 time
D: 1 time
E: 1 time

Count how often each fact appears

Step 1 of 4
Toy singleton-rate calculation. The real theorem adds small correction terms.

A famous person's birthday appears many times, so it is not a singleton and is rarely wrong.

Step 4: Other causes

The paper also names a poor model, where the model type cannot represent the task. A trigram model predicts each word from only the two before it. For "She lost it and was completely out of ..." and "He lost it and was completely out of ...", the right endings are "her mind" and "his mind". The model cannot see "She" or "He", so it is wrong at least half the time (Corollary 2). Other causes are very hard problems, questions unlike the training data, and wrong facts in the training data.

Step 5: Why tests keep guessing alive

After pretraining comes post-training, which tries to remove such errors. The paper argues that most benchmarks (shared tests with a leaderboard) use binary grading: 1 point for a correct answer, 0 for a wrong answer, and 0 for "I don't know". Under that rule, abstaining is never the best choice (Observation 1). Whatever the model believes, a guess has an expected score of at least 0, and "I don't know" always scores exactly 0.

Toy example (ours): you are asked for a birthday with no idea of the answer. A guess is right with chance 1/365, so its expected score is 1/365, about 0.003. "I don't know" scores 0. The guess wins every time, so a model trained and ranked on this rule learns to guess.

The paper reviewed ten popular benchmarks (Table 2). Nine use binary grading with no credit for "I don't know", including GPQA, MMLU-Pro, MATH and SWE-bench. The tenth, WildBench, is not binary, but its rubric may score "I don't know" below a fair answer that contains a hallucination.

Step 6: Confidence targets

The fix the paper proposes is to put the penalty in the question. Add a sentence such as: "Answer only if you are more than t confident. A mistake costs t/(1 − t) points, a correct answer gets 1 point, and 'I don't know' gets 0."

Then answering beats abstaining exactly when your chance of being right is above t. Check it for t = 0.9, so the penalty is 9 points.

Toy example (ours): you are 95% sure. Expected score of answering = 0.95 × 1 − 0.05 × 9 = 0.50, which is above 0, so answer. You are only 50% sure: 0.5 × 1 − 0.5 × 9 = −4.0, which is below 0, so say "I don't know".

Target tPenalty for a wrong answer
0.51
0.99
0none (this is binary grading)

The paper also lists t = 0.75 with penalty 2, but the formula gives 3, so that looks like a typo. It calls the behavior that is best under every target behavioral calibration: answer when you are at least t sure, otherwise abstain.

What the paper found

This is a theory paper, so its results are proofs, not benchmark scores.

ResultWhat it says
Corollary 1 / Theorem 1Generation error is at least about 2 × the Is-It-Valid error, minus small terms.
Theorem 2For arbitrary facts, error is at least about the singleton rate, minus small terms. The paper also gives a calibrated algorithm whose error is close to that rate.
Table 29 of 10 popular benchmarks use binary grading with no credit for "I don't know".

The paper reports no hallucination rate for any model. Its examples, such as three wrong birthday dates from one open model, show the problem but do not measure it.

What to be careful about

  • The theory sets lower bounds for base models after pretraining. It does not say post-trained models must hallucinate at that rate, and the paper notes that a model backed by a fixed question-answer database that says "I don't know" otherwise would not hallucinate.
  • The bounds assume calibrated base models and random, independent facts. Real facts are messier.
  • The paper says search and retrieval are not enough. If search finds nothing, binary grading still rewards guessing.
  • It treats each answer as correct, wrong, or "I don't know". It admits that real uncertainty has more shades, such as hedging or asking a question.
  • It does not test its proposal. No one has shown here that confidence targets make leaderboards better. The paper calls the change "socio-technical": it only works if the main leaderboards adopt it.
Key takeaways
  • Pretraining must make some errors: for facts that appear once, a good model still gets about that share wrong.
  • Is-It-Valid links hallucination to ordinary classification: if a fact cannot be told from a convincing fake, the generator cannot avoid it.
  • Binary 0/1 benchmarks make guessing the best strategy, so post-training keeps the habit alive.
  • The proposed fix is a stated confidence target with a penalty, so "I don't know" wins when you are unsure.

Sources

  • Kalai, Nachum, Vempala, Zhang. Why Language Models Hallucinate. arXiv:2509.04664, 2025. Read in full (PDF).
ShareXLinkedInEmail
Written by Derpx06A developer who builds AI search tools and the code around them. I explain what I got wrong first, so you can skip it. Spotted a mistake? Tell me — corrections get credited.
Distributed Systems · 7 minHow does Raft work? Getting computers to agreeResearch Papers · 5 minMamba explained: an alternative to TransformersInference · 7 minWhat is quantization? Running AI models in 4 bits
Start here
01How does Raft work? Getting computers to agree02Mamba explained: an alternative to Transformers03What is quantization? Running AI models in 4 bits