aiaimodel.cards
Basics04

Temperature

How random or predictable the output is

Temperature

A sampling setting that controls how random the model's word choices are: low values make output more predictable, higher values make it more varied.

Why it matters. Keep it low for extraction and code where consistency matters; note that some reasoning models restrict or ignore it.

How it works

Temperature is a request parameter that changes how the model picks each next token from its predicted probabilities. At low temperature the most likely tokens are strongly favored, so output is more consistent; at higher temperature less likely tokens are chosen more often, so output varies more between runs.

The allowed range and the default differ by API, and it is often offered next to related settings such as top_p. Some reasoning models fix temperature, ignore it or reject requests that set it, so check the model's API reference.

Even at temperature 0, outputs are not guaranteed to be identical on every call, because of how serving systems batch and compute requests. If you need repeatable results, store the outputs rather than regenerating them.

Worked example

Asking for a product name 5 times at a low temperature tends to return the same or very similar names; at a high temperature you are more likely to get 5 different ones. For pulling an invoice total out of a PDF, the low setting is the sensible choice.

Common mistakes

  • Expecting temperature 0 to give byte-identical output on every call.
  • Raising temperature to fix wrong answers; it changes variety, not accuracy.
  • Sending temperature to a model whose API rejects or ignores it, causing errors or having no effect.

Related terms