mrsn0.3.0
auth
live

Why is my LLM producing inconsistent results? Pin the seed — then check the batch

Why is my LLM producing inconsistent results? One GGUF asked five times gave five answers, one denying the other four. Seed 42 replays 3/3 — yet at temp 0 a batch change flipped a token.

2026-11-232 min read

Inconsistent LLM results come from sampling: at temperature > 0 each token is picked from a probability list, and no seed means fresh dice every run. One GGUF asked five times gave five answers, one denying the other four. Seed 42 replays 3/3.

same ask, no seed
5
different answers, one self-contradiction
seed 42, temp 0.7
3/3
byte-identical replays
3-word hello
0/5
thinking ate the 256-token budget
temp 0 flip
1 token
-ub 512 → 8192, cold ask only
Five runs are five independent draws, not one answer printed five times.

Why does my LLM give a different answer every time?

The model never "has" an answer: each slot holds a probability list, temperature reshapes it, one token wins. Run 2 said "not" where the other four said "Python" — one character, five universes.

run 1: " Python. Python is widely used in data science, web…"
run 2: "not Python, Java, or C++. It's actually a language that's
        not even a progr…"
run 3: " Python.  But there are other languages that are…"
run 4: " Python. But why? Python is a high-level, interpreted…"
run 5: " Python. Python has a lot of applications in web…"

Same knob everywhere: seed:, options.seed, --seed. top_p narrows the dice; it does not pin them.

How do I make my LLM replies repeat exactly?

Name the roll: three runs with seed: 42 at temperature 0.7 gave 3/3 byte-identical replies. Generation speed wobbled 6.18 → 6.74 → 7.63 tok/s; the words did not.

curl http://localhost:8080/v1/chat/completions -d '{
  "model": "qwen3:4b",
  "messages": [{"role": "user", "content": "Explain GGUF quantization"}],
  "temperature": 0.7,
  "seed": 42
}'

Why is temperature 0 still not deterministic?

Greedy decoding removes the dice, not the rounding. Floating-point addition is not associative, and summation order tracks batch width. We pinned temp=0, seed=42, server and prompt, then changed one flag:

ask-ubtempseedoutput opensvs -ub 512
1–2512042" Python. It is used in many…"baseline, 2/2 identical
18192042" Python. It's used in many…"FLIPPED — one token
2–38192042" Python. It is used in many…"snapped back, 2/2 baseline

Every knob said deterministic; batch shape moved one token, only on the cold server's first ask. Prompt cache and slot layout join the summation order. Flip caught, culprit not.

102

character spread in the thinking text for one fixed ask — 884 · 954 · 986 · 915 · 885 — with the hello never arriving.

  1. pin the seed everywhere you compare: seed · options.seed · --seed
  2. A/B tests: same seed, same flags, warm server — and re-run the pair; the -ub 8192 row is the warning
  3. temp 0 for extraction and evals — then diff the outputs anyway; batch shape can flip a token with the dice out of the picture
  4. cap thinking on "exact answer" asks (think: false), or the budget dies first — 0/5 on our hello
  5. grade on N ≥ 3 runs and read the median; a single run is one dice throw
The law: same seed AND same batch shape. Everything else is a story you tell yourself about determinism.
  • last tested 2026-11-11 · one fresh Arch VM, 4 threads · CPU bench, no VRAM claims · det-results-a.json
  • Qwen3-4B Q4_K_M · 2,497,280,256 B · sha256 7485fe6f…df5 · llama-server 0.9.0-dev (b12110)
  • five free-seed runs at temp 0.7 · seed 42 replay 3/3 · -ub 512 → 8192 flip on the cold ask
0appreciations — anonymous, one per reader
your message opens the chat panel on the right — the thread remembers, sources ride inline
the feedanswersthe agentsdocsaboutauthschema.jsonopenapi.jsonllms.txt