Running Models YourselfLesson 53 of 82

Module 6 · Getting good output

Why the same seed gives different answers

In this lesson

  • 8 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 7 of 9 in this chapter

This chapter’s goalDiagnose a disappointing local output to its actual cause (sampler, template, prompt, context length, quantisation or the weights) in a defined order, and build a small evaluation harness that tells you whether any change you make is an improvement or noise.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

Two sources of variation, and only one is the sampler

Set temperature to 0 and the sampler always picks the highest-probability token. That removes sampling randomness completely. Many people are then surprised to find the output still varies between runs, and conclude something is broken.

It is not. The logits themselves are not bit-identical between runs, because floating-point addition is not associative. Adding a set of numbers in a different order gives slightly different results, and a GPU reduction adds them in whatever order the scheduling happened to produce. Usually the differences are far below the gap between the top token and the second, so the argmax is unchanged. Occasionally two tokens are nearly tied, a difference in the twelfth decimal place flips which is larger, and from that token onward the two outputs diverge completely.

That is the whole mechanism. It is not a bug and it cannot be switched off by a seed.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Open Model Ecosystem exam.

Stuck on something?Ask Tri, your AI tutor

How to cite: Addaly (2026) ‘Why the same seed gives different answers’, in Running Models Yourself. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/running-models-yourself/determinism-and-reproducibility (Accessed: 29 November 2026).