01 FoundationsLesson 5 of 69 minBeginnerHelps to have seen:What an LLM is
Why the answer varies
- + the same message, run more than once
The diagram shows: Customer (conversation s08), The text of the call (the same on every run), LLM (draws each piece), Run 1 (same input), Run 2 (same input), Run 3 (same input) and Code (checks before acting).
Highlighted: The text of the call and Run 1.
Customer sends to The text of the call carrying "exchange for M".
The text of the call sends to LLM.
The text of the call sends to Run 1 carrying "exchanges both".
The text of the call sends to Code carrying "would open 2 exchanges".
Added: the same message, run more than once.
Step 1 of 9: The same message, three answers
- Why the model does not always answer the same way
- What temperature used to do, and why it went away
- How to reduce variation where it gets in the way
- Why testing once is not enough: pass@k and pass^k
pass^3: conversations where the agent is right on all 3 runs, out of the store's 50 test conversations
Coming soon: I will measure this on the example agent and publish the number with the report.
The whole lesson as textEvery step, to read at once, search or print.
The same message, three answers
The customer asks to exchange "the t-shirt" from order 4802 for size M. The order has two t-shirts, and the message does not say how many.
On the first run, the agent answers that it will exchange both, and the code would open that exchange. Run it again, without changing anything, and see what happens.
An LLM is not a function that always returns the same result.
The first piece decides the path
The model writes one at a time, drawn from the likely continuations: this is , which you saw in the lesson about the LLM.
Here, "I'll" and "Should" are close. If "I'll" comes out, the answer goes on to open the exchange. If "Should" comes out, it becomes a question. One piece at the start changes the whole answer.
Variation is not a defect: it is how the model generates text.
Temperature used to tweak the draw
was a setting for the draw: low, it concentrated on the most likely continuations; high, it spread them out.
Even at zero, it did not guarantee repetition. Anthropic warns that the result is not fully deterministic, and Thinking Machines showed one reason: the server processes several calls together, and the result changes with the batch.
Low temperature reduced variation, but never to zero, and it did not fix the mistake.
On current Claude models, the setting is gone
On Claude Opus 5.5, Sonnet 5.5 and Haiku 5.5, a non-default temperature returns an error, and since the 21/10/2026 API version sending the parameter returns an error on any model. Anthropic advises steering through the prompt.
And a lot of variation comes from a doubt nobody settled. The order has two t-shirts and the message does not say how many. A rule in the prompt settles what the draw used to decide.
Where the answer varies, look for the doubt the text left open.
Effort changes how much it thinks, not the draw
The setting that exists today on Claude models is : how much the model thinks and how many tokens it spends before answering.
More effort helps on hard tasks and costs more. The documentation does not present it as a consistency setting: the draw is still there. In the t-shirt exchange, what fixed it was the rule in the text.
Effort is about depth and cost. Consistency comes from the text, the schema and the code.
Tested once, passed, shipped
If the answer varies, a test that passed once may fail the next time. On run 1 the exchange of both went out without asking, and whoever tested only once would approve it, without noticing it was a guess.
But on run 3 it exchanged just one t-shirt. Running each conversation once hides exactly this kind of mistake.
For an agent that serves customers, "always right" is worth more than "right once".
Right once or right every time
Anthropic separates two measures. pass@k: the chance of being right at least once in k attempts. pass^k: the chance of being right on all of them.
With 75% success per run, pass@3 comes to about 98% and pass^3, about 42%. For customer support, each customer is a run: the measure that matters is pass^k.
An agent with 75% per run gets 3 in a row right less than half the time.
The test that created pass^k
What the source says: in 2024, Sierra published τ-bench, a test of customer support agents in retail and airline settings, with simulated customers, and proposed pass^k. gpt-4o solved less than half of the tasks, and in retail pass^8 came in below 25%.
Our reading: before shipping, run each test conversation more than once.
Consistency is a measure separate from accuracy, and it is usually much lower.
Variation: where it comes from and what to do
The model draws each piece, so the same input can give different answers. Temperature only concentrated the draw, and on current Claude models it is gone.
Where variation gets in the way, settle the doubt in the text, pin the format down in a schema and check in code what must not vary. And test each conversation more than once.
Questions in this lesson
- Why can the same message produce different answers?
- The model draws each piece from the likely continuations. It is sampling. The model does not change between calls, but the draw does.
- The exchange runs disagreed. What fixed it?
- A rule in the prompt for the doubt that was open. The message did not say how many t-shirts. The rule removed the doubt, and the runs started to agree.
- With 75% success per run, what is the chance of getting 3 in a row right?
- About 42%. 0.75 × 0.75 × 0.75 ≈ 0.42. 98% is pass@3, getting at least one right.
- Claude Docs, Glossary ↗
- Claude Docs, sampling parameters ↗
- Claude Docs, Effort ↗
- Claude Docs, migration to API version 2026-10-21 ↗
- Claude Docs, Opus 5.5 migration guide ↗
- Thinking Machines, Defeating Nondeterminism in LLM Inference (Sep 2025) ↗
- Anthropic, Demystifying evals for AI agents (Jan 2026) ↗
- Yao et al., τ-bench (Sierra, Jun 2024) ↗
- Stephen Wolfram, What is ChatGPT doing (Feb 2023) ↗