Why did the same LLM question get a different answer?

I ask the same question twice and get two different answers. Where did the difference enter?

The model produces scores. A separate selection step chooses the next token. One different choice changes the context for the choices that follow.

This comic uses a three-token toy to explain sampling, temperature and top-p. It also covers why temperature zero alone isn't a complete reproducibility plan.

Download this comic as a PDF

Comic page 1 of 6: Why did the same LLM question get a different answer?
Read page 1 as text

Why did the same LLM question get a different answer?

Same question. Two answers. Where did the variation enter?

WHAT WE WILL FIGURE OUT

01

Prediction and selection are different

02

How sampling changes a choice

03

What repeatability really requires

OUR EXAMPLE

Three-token toy: The 60%, A 25%, It 15%. The same toy as comic 01.

Follow the steps. Ask the obvious questions. Check the result.

Part 4 of 18 · Challenge: page 5 · Suggested answers: page 6

Comic page 2 of 6: Prediction and selection are different
Read page 2 as text

Prediction and selection are different

1

SAME QUESTION

FIXED MODEL WEIGHTS

Draw 1: The

Draw 2: A

fixed weights

varying choice

Did the weights change?

A different answer does not mean the model learned between requests. Token selection can vary with unchanged weights.

Same prompt; same model; different selection

2

THE MODEL SCORES OPTIONS

TOY NEXT-TOKEN DISTRIBUTION

The

60%

A

25%

It

15%

The: 60%

A: 25%

It: 15%

The model computes logits (raw scores). Turning these scores into probabilities gives a distribution over candidate next tokens.

Toy distribution: The 60%, A 25%, It 15%

3

A CHOICE COMES NEXT

ONE DRAW FROM THE SAME ODDS

The

60

A

25

It

15

A remains a valid sampled result

distribution

→

random draw

Sampling selects an ID from the distribution. A more likely token is more likely to be selected, not guaranteed.

A 60% candidate can lose a random draw

4

ONE EARLY FORK

Different first selection

The cat…

A cat…

The cat...

A cat...

After a different first token, the context changes. Later predictions then condition on a different sequence.

The cat... versus A cat...

Comic page 3 of 6: How sampling changes a choice
Read page 3 as text

How sampling changes a choice

5

GREEDY SELECTION

GREEDY: SELECT THE LARGEST SCORE

The

60

A

25

It

15

Chosen: The

largest score

→

The

Why not always pick the top one?

Greedy selection chooses the largest score. It removes intentional random sampling at that selection step.

Toy greedy choice: The

6

TEMPERATURE

TEMPERATURE RESCALES RAW SCORES

sharper

flatter

Qualitative shapes, not new toy odds

logits

→

temperature

→

probabilities

Temperature rescales logits before sampling. Lower positive values sharpen the distribution; higher values flatten it.

It changes the odds, not the stored weights

7

TOP-P

TOP-P: KEEP THE + A (85%)

The

60%

A

25%

It

15%

RENORMALIZED SHARES

The ≈ 71% A ≈ 29%

85% retained

The ≈71%, A ≈29%

Top-p restricts sampling to a set of likely tokens whose cumulative probability reaches a threshold.

Keep 85%; then The ≈ 71%, A ≈ 29%

8

DO NOT MIX THE DIALS

Hold fixed model + input

Change one sampling setting

Run trials compare outcomes

Record full configuration

one setting

→

one experiment

Temperature and top-p act differently. Hold settings fixed while testing one change, or you will not know what helped.

Change one sampling setting in an experiment

Comic page 4 of 6: What repeatability really requires
Read page 4 as text

What repeatability really requires

9

ZERO IS NOT A PROMISE

Greedy rule largest score

Kernel numerical behavior

Batch execution context

Model version record the snapshot

greedy

runtime variation

So temperature zero repeats forever?

Providers often interpret zero as greedy behavior. Operational reproducibility can still depend on kernels, batching and model versions.

No universal identical-output guarantee

10

SAVE THE REAL INPUT

Instructions

Visible question

History

Retrieved evidence

instructions

sources

history

The visible question is only part of the input. Instructions, retrieved documents, tool results and history may differ.

Same typed question can hide different context

11

CONTROL THE EXPERIMENT

Model version

Complete input

Sampling + seed

Runtime + batch

version

prompt

settings

Record model version, prompt, settings and supported seed. A seed can help without guaranteeing every deployment repeats exactly.

Track configuration with the result

12

MY NEW MENTAL MODEL

Input

Token selection

Execution

Different sources of variation

input

selection

execution

The model gives odds; selection chooses.

Separate intentional sampling variation from differences in input, model version or execution.

Variation is not evidence of learning

Comic page 5 of 6: Your turn. Can you explain what happens?
Read page 5 as text

Your turn. Can you explain what happens?

Use the same example. Change one detail. What follows?

KEEP THIS EXAMPLE IN MIND

Three-token toy: The 60%, A 25%, It 15%. The same toy as comic 01.

Try first. Suggested answers are on the next page.

1

Does choosing A from the toy distribution mean the model is broken?

What makes you say that?

2

Does temperature change model weights?

What makes you say that?

3

Name two things besides the visible question that must be controlled for a repeatability test.

What makes you say that?

Write your answers in the comments.

Comic page 6 of 6: Suggested answers
Read page 6 as text

Suggested answers

Why did the same LLM question get a different answer?

01

Does choosing A from the toy distribution mean the model is broken?

No. It is a possible sampled outcome.

02

Does temperature change model weights?

No. It changes how scores are used for selection.

03

Name two things besides the visible question that must be controlled for a repeatability test.

Model version, complete context, sampling settings, seed support, runtime and batching conditions are examples.

Try the challenge on page 5. Suggested answers follow on page 6.