Temperature is the single knob that controls how adventurous the output is.
It divides the logits before softmax, which reshapes the distribution.
A value below one spreads the scores apart and concentrates probability on the front-runner.
A value above one pulls them together and gives unlikely tokens a real chance.
At zero it is effectively deterministic and always takes the most likely token.
That is what you want for classification, extraction, code and anything with a right answer.
Around 0.7 is the usual default for conversation, giving variety without drifting.
Above about 1.2 the output becomes noticeably strange, and higher still it degrades into nonsense.
Higher temperature is not more creative in any deep sense, only less predictable.
The effect compounds, since one unusual token pushes the rest of the sentence somewhere unusual.
Even at zero the output is not guaranteed identical, because of batching and floating-point order.
It is usually combined with top-p rather than used alone.
Temperature reshapes the distribution and top-p truncates it, so they do different jobs.
If output is repetitive, raise it slightly before reaching for anything else.
If output is unreliable or invents details, lower it before rewriting the prompt.