ModelRefs / Random Seed — AI Glossary

Random Seed — AI Glossary

An integer seed controlling the random number generator for sampling, enabling reproducible model outputs. Also called inference seed.

Overview

Setting a fixed seed makes sampling deterministic for the same model, prompt, and parameters. OpenAI and compatible APIs expose `seed`; the response header includes `system_fingerprint` to detect infrastructure changes that break reproducibility. Essential for regression testing, benchmark reproducibility, and auditing.

Reference details

Topicinference
Also known asinference seed
Last reviewed2026-06-24

How it works

  1. The seed initialises the pseudo-random generator that sampling draws from, so the same seed with the same distribution produces the same token choices.
  2. That makes sampling reproducible in principle, and only sampling: everything else that can vary between two requests is outside the seed's control.
  3. Floating-point arithmetic is not associative, so changing the order in which values are summed changes the result slightly — and batch composition, kernel selection and device type all change that order.
  4. A different batch therefore produces marginally different logits, which can flip a close token choice even under an identical seed.
  5. Providers expose a system fingerprint alongside the response precisely because of this: it identifies the serving configuration, and a change in it means reproducibility is void regardless of the seed.
  6. So reproducibility requires three things to be fixed — seed, model snapshot and serving configuration — and only the first two are under the caller's control.

Example: What a fixed seed does to a regression suite

Suppose a fixed seed reproduces the output on all but one request in a thousand, where batch-composition differences flip a close token choice. Run a 10,000-case regression suite and 10,000 / 1,000 = 10 cases differ from the stored baseline on every run, with no code change — ten spurious diffs a reviewer must triage each time. At one in a hundred it is 100, which is enough for the suite to be abandoned. The number matters because the response to it is a design decision rather than a bug fix: either compare semantically, scoring whether the output still satisfies the assertion rather than whether it matches byte for byte, or set temperature to zero and accept that even greedy decoding inherits the same floating-point non-determinism and merely reduces its frequency. The third option is to pin the serving configuration, which is available on dedicated infrastructure and not on a shared endpoint — which is why byte-exact reproducibility is a property of where you run rather than of what you pass.

Commonly confused with

A seed is not a determinism guarantee, and the gap is where audit requirements get into trouble. It fixes the random draws; it does not fix the logits those draws are applied to, which vary with batch composition and serving configuration. So two requests with the same seed, prompt and model can differ, and the system fingerprint is the provider's way of saying when that is expected. The related confusion is with temperature zero, which removes sampling altogether and therefore removes the seed's relevance — while leaving the underlying floating-point non-determinism exactly where it was.

When to use it

Reach for it when:

  • Regression testing and benchmark reproduction, where reducing output variance makes diffs interpretable.
  • Debugging a specific failure, where reproducing the exact output is what makes it investigable.
  • Alongside the system fingerprint, which tells you when reproducibility has been invalidated by something you do not control.
  • With semantic rather than byte-exact comparison, which is what survives the residual non-determinism.

Reach for something else when:

  • As a reproducibility guarantee for an audit trail, since serving configuration is outside the caller's control.
  • Byte-exact comparison in a large suite, where a low divergence rate still produces many spurious diffs.
  • Expecting temperature zero to fix it, which removes sampling and leaves floating-point non-determinism untouched.
  • Across model snapshots or providers, where the seed means nothing in common.

Continue your research

Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Random Seed — AI Glossary.

Frequently asked questions

What is Random Seed?

An integer seed controlling the random number generator for sampling, enabling reproducible model outputs.

Is Random Seed the same as inference seed?

Yes — inference seed are common aliases for Random Seed.

What concepts are related to Random Seed?

Closely related concepts include sampling, temperature, logprobs.