liveBook · Manning

Nondeterminism

As explained in Machine Learning Platform Engineering

Nondeterminism is behavior in which identical inputs can produce different valid outputs across executions.

Nondeterminism means that identical inputs can produce different valid outputs across executions. In LLM systems, sampling strategies, temperature settings, and model architecture introduce this variation. section 12.1.1

Nondeterminism changes how production systems are designed and operated:

  • Replace exact-output assertions with evaluations of semantic correctness, factual accuracy, guideline adherence, and safety. section 12.1.1 section 13.2
  • Tune temperature, top-k, and top-p to trade response variety against coherence and predictability. section 12.1.1
  • Treat variable outputs as an operational concern requiring systematic testing, monitoring, and safety controls. section 13.0 section 13.5

Controlling output randomness

A temperature of 0.0 and top_k=1 favor deterministic output. Increasing temperature to 0.7 or 1.5, or using top_k=40 or 100, allows more varied token choices. Values such as top_p=0.1, 0.9, and 1.0 adjust the probability-based candidate set. section 12.1.1

Listing 12.1 Parameters that control output randomness
temperature=0.0  #1
temperature=0.7  #2
temperature=1.5  #3

top_k=1 #4
top_k=40  #5
top_k=100  #6

top_p=0.1  #7
top_p=0.9  #8
top_p=1.0 #9

Browse the parameter listing for a compact comparison of settings that control output randomness. section 12.1.1

How Machine Learning Platform Engineering covers it

How deep it goes
Explains probabilistic variation through sampling parameters and stops short of detailed model internals.
Examples
Uses temperature, top-k, and top-p settings to demonstrate deterministic and increasingly varied outputs.
What it assumes
Assumes familiarity with traditional assertion-based testing while teaching why probabilistic outputs require different evaluation criteria.
What you can do after
Evaluate LLM responses semantically and tune sampling settings instead of relying on exact string matches.
How it connects
Connects LLMs with sampling strategies, temperature, top-k sampling, top-p sampling, semantic evaluation, and safety guardrails.

Also explained in

Compare how 3 books explain nondeterminism →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.