Urgent.News

What's breaking now, across hundreds of outlets.

AI

Same model, same prompt, different answer: where LLM nondeterminism really comes from

Every number below comes from a script I ran on my laptop (PyTorch 2.10, CPU, 8 threads). The script is at the end, so you can run it on yours. Set temperature to 0. Send the same prompt to the same model twice. You'd expect the same answer twice. Often you don't get it, and not because of sampling. Greedy decoding is deterministic by definition: take the highest-scoring token, every time. So…

Floating-point arithmetic doesn't adhere to the associative property, meaning (a + b) + c may not equal a + (b + c). In floating-point numbers, rounding occurs at each step, and the order of addition affects where that rounding takes place. For example, with three numbers, adding them in different orders yields slightly different results due to rounding. A transformer layer performs thousands of such additions per output value, resulting in varying final answers even when using the same model and prompt.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in AI

Agent Evals: Can a Score Block a Release?

I used AI tools to help draft and edit this post. I checked the facts and the wording, and the original lives at geekindata.com . The diagrams are on that page.

  • Agent evaluations required for any prompt, tool, or model changes.
  • Comprehensive evaluation using real questions and production traces.
  • Rubric evaluator primary measure, safety evaluators also recommended.

More from Sunday, 29 November 2026 →