Seeds and Reproducibility

Seeds

Part of: Temperature & Sampling

Sampling is random, that's the whole point. But "random" and "untestable" are not the same thing. If you've ever needed a sampled model to give the exact same output twice (to write a unit test, reproduce a bug, or compare two prompts fairly), the tool you reach for is the seed . A seed makes randomness replayable : same seed, same dice rolls, same output, every time. What it is Computers don't produce true randomness; they run a pseudo-random number generator (PRNG) : a deterministic formula that spits out a stream of numbers that look random. The seed is the starting point of that stream. Give the PRNG the same seed and it produces the identical sequence of "random" numbers, which means the sampler makes the identical draws, which means you get the identical generated text. So a seed doesn't turn off randomness. It pins it. Temperature and top-p still shape the distribution exactly as before; the seed just guarantees the weighted draws come out the same way on a re-run. How it works Seed the generator before you sample, and the sequence of draws is locked: run(7) twice gives byte-for-byte the same list. Change to run(8) and the sequence shifts. Many model APIs expose exactly this

Challenge: The Reproducibility Checker