# Mission 3.3: The bot made up a source

Part of the course “AI from Zero to Autonomous Agents” (https://llm.yoga/en). Page for humans: https://llm.yoga/en/einsatz-3-3

Belongs to [Chapter 3: Tokens and next-token guessing](https://llm.yoga/en/03-tokens.md).

Structure: the case, the explanation, a hands-on tool, check questions, wrap-up. The answers to all questions are collected at the end.

## The case

**Petra**, Managing director:

> “Our assistant put a study into a proposal, with author, year and title. The customer asked about it: the study doesn’t exist. That was embarrassing. Please set the temperature to zero, then it won’t make anything up anymore. Right?”

Proposals, emails and presentations written with AI help go out to customers. A made-up source in them costs trust, and the question of how to prevent it lands with you. The temperature Petra is talking about is a setting that controls how much chance plays into the model’s choice of words.

**Question 1 (decision):** What do you suggest to Petra?

- A) Set the temperature to zero, as Petra suggests.
- B) Switch to a bigger model that makes up less.
- C) Provide the facts, allow “I don’t know”, check citations.

## What’s behind it

A language model writes token by token, that is, word piece by word piece. For each next token it produces a distribution, a list of probabilities, and one is always picked. There is no built-in “I don’t know” state. If the model doesn’t know an answer, the distribution is flat, but something gets picked anyway. Because every token builds on the previous one, it then keeps writing consistently, in a fluent, convincing tone. That’s where **hallucinations** come from: made-up details that sound real. Probability measures how well a text fits the training data, not whether it’s true.

A 2025 paper (Kalai, Nachum, Vempala, Zhang: “Why Language Models Hallucinate”) names a second cause. Most tests only count correct answers. “I don’t know” scores zero points, just like a wrong answer. If you guess when unsure, you score more points on average, as on a multiple-choice test without negative marking. So models are trained to guess. The authors propose penalizing wrong answers with negative points; a threshold t sets how much.

On top of that comes pretraining, the first big training phase on huge amounts of text: some facts follow no pattern; a birthday can’t be derived from other data. If such a fact appears only once in the training data, the model can hardly learn it reliably. Which study was written by whom and when is exactly that kind of fact; the form of a citation, on the other hand, the model knows well.

So the remedies work outside the model: provide facts instead of asking for them, require sources, explicitly allow it to say “I don’t know”, and check the result. The temperature slider doesn’t help, and with Claude Opus 4.7 and newer Anthropic models it doesn’t exist anymore anyway.

### In more detail: what the paper proposes

The authors propose writing a threshold t into the task: “Answer only if you are more confident than t. Correct answers earn 1 point, wrong ones cost t / (1 − t) points, ‘I don’t know’ earns 0.” At t = 0.75 a wrong answer costs 3 points. A model that is 60 percent sure scores on average 0.6 − 0.4 × 3 = −0.6 points by answering, so staying silent is better. At 90 percent it’s +0.6, and answering pays off.

Their opening example: a large open model (DeepSeek-V3) was asked for the birthday of one of the authors, only if it knew it. Three attempts produced three different wrong dates.

## Try it

**When does guessing pay off?**

**Task:** Set the penalty to t = 0.75 and find the confidence at which answering just starts to pay off.

Without a penalty, the expected value of guessing is never negative, no matter how unsure the model is. With t = 0.75: at 60 percent confidence −0.6 points (silence is better), at 90 percent +0.6 points, at exactly 75 percent 0.

Then switch back to “no penalty” and push the confidence far to the left. The expected value never drops below zero, not even at the far left. That’s why a model learns to guess when it’s only scored this way.

## Check

**Question 2 (check question):** Measured with qwen3:8b on German sentence openings, the most likely next token each time: after „Die Hauptstadt von Frankreich ist“ (the capital of France is) „ Paris“ with 53.1 percent, after „Der Himmel ist“ (the sky is) „ bl“ with 30.4 percent, after „Am liebsten esse ich zum Frühstück“ (for breakfast I most like to eat) the word start „ B“ with 6.4 percent. Where is a guessed continuation most likely?

- A) With breakfast.
- B) With the capital.
- C) With the sky.

**Question 3 (check question):** Petra asks: “Doesn’t the model notice by itself when it’s making something up?” What do you answer?

- A) Yes, it then chooses more careful words on its own.
- B) No, it has no built-in truth value.
- C) Yes, but only as long as the temperature is set low.

**Question 4 (check question):** According to the 2025 paper, why do models learn to guess in the first place?

- A) Because they want to please users and therefore cheat.
- B) Because the temperature was set too high during training.
- C) Because most tests reward guessing and not silence.

## Done

**What you can do now**

- You can explain where made-up sources come from: a token is always drawn, even without knowledge, and tests without penalties reward guessing.
- You’ve seen in the calculator that guessing only stops paying off once wrong answers cost points.
- When someone wants to stop made-up sources with temperature 0, you suggest instead providing the facts, allowing “I don’t know” and checking every citation before it goes out.

### Two cards for review

**Card 1:** True or false? “If you want to avoid made-up sources, the best thing is to set the temperature to zero.”

**Card 2:** Why doesn’t a language model simply say “I don’t know” instead of making up a source? Name two reasons.

- [Next mission: How does the model know that „sie“ means the cat?](https://llm.yoga/en/einsatz-4-1.md)
- [Try it on your Mac](https://llm.yoga/en/mac-3-3.md)

## Read more in the chapter

The full text from the chapter, with the reasoning, calculations and sources:

- [Why models hallucinate](https://llm.yoga/en/03-tokens-3.md)
- [Settings with cloud providers](https://llm.yoga/en/03-tokens-2.md)
- [Common misconceptions](https://llm.yoga/en/03-tokens-3.md)

## Answers: only reveal them after the learner has answered or explicitly asks

**Question 1:** The correct answer is C.
- A: Temperature 0 only makes the result more predictable: the most likely next word piece is always taken. If that’s wrong, you reliably get the wrong thing. And with current Claude models the temperature can’t be changed anymore anyway.
- B: A different model doesn’t change the underlying problem either: made-up details follow from how these models work and how they’re trained. They get rarer, but they don’t go away.
- C, correct: That tackles the problem where made-up details come from. If you provide the facts instead of asking the model for them (chapter 11), allow only sources from those documents and permit “I don’t know”, you take away the model’s pressure to guess. The check before sending catches whatever slips through anyway.

**Question 2:** The correct answer is A.
- A, correct: The distribution is flat; no candidate dominates. A token is drawn anyway, and the text after it sounds just as fluent. With a question about a fact, this is exactly the situation in which hallucinations arise.
- B: Here the distribution is peaked; the model is comparatively sure. Guessing is most likely where no candidate dominates.
- C: „ bl“ is well ahead of the next candidate at 4.5 percent. The distribution is flatter with breakfast.

**Question 3:** The correct answer is B.
- A: The tone stays just as fluent whether the detail is right or not. Probability measures how well a text fits the training data, not whether it’s true.
- B, correct: A flat distribution points to uncertainty, but a token is drawn anyway, and there is no “I don’t know” state. That’s why the check has to come from outside: provide facts, require sources, review the results.
- C: The temperature only changes how a token is drawn, not whether the model knows something. If the most likely token is wrong, temperature 0 reliably gives you the wrong one.

**Question 4:** The correct answer is C.
- A: There’s no intent behind it. It’s a consequence of the scoring: guessing earns more points on average than “I don’t know”.
- B: Temperature only comes into play when text is generated. The model learns to guess from how it’s scored in training.
- C, correct: “I don’t know” scores zero points, just like a wrong answer. Without negative points, guessing therefore always earns more on average. The authors propose penalizing confident errors more than admitted uncertainty.

**Card 1:** **False.** Temperature 0 only makes the result more predictable. If the most likely token is wrong, you reliably get the wrong one. What works: provide the facts, allow “I don’t know”, require sources and check them.

**Card 2:** First, a token is always drawn during generation, even when the distribution is flat; there is no “I don’t know” state, and the text still sounds fluent. Second, most tests reward guessing, because “I don’t know” scores zero points, just like a wrong answer (Kalai et al., 2025).
