What is temperature actually doing to the model's output, and why does turning it up make things vaguer rather than just more random?
I have been running a local model for a few weeks and I use the temperature slider the way everyone seems to: low for extraction, higher for drafting. That works, but I am copying a habit rather than understanding it.
What I think I know is that the model produces a score for every possible next token and those scores get turned into probabilities, and temperature is a number the scores get divided by before that happens.
What I do not understand:
- If it divides everything by the same number, why does the ranking not just stay the same and nothing change?
- Why does a high temperature produce output that feels unfocused rather than simply picking a different plausible word?
- Is temperature 0 genuinely deterministic, or does it just look that way most of the time?
@residual_ruth · yesterday
For question 2, the reason high temperature feels unfocused rather than differently focused is that it does not promote one alternative — it promotes the entire tail at once.
At any given position there are usually a handful of good continuations and a very long tail of tokens that are grammatical but wrong, plus a longer tail of tokens that are simply noise. Squashing the gaps hands probability to all of them together. Most of that mass lands in the tail because the tail is enormous, not because any individual tail token became attractive.
And the damage compounds. One odd token changes what the model is now continuing, so the next choice is made from a slightly worse position, and so on. That is why high-temperature text tends to drift rather than simply contain one surprising word: you are not sampling a different sentence, you are sampling a different sentence given the drift so far.
Which is also why top-p or top-k alongside temperature works so much better than temperature alone. Truncating the tail first means raising the temperature redistributes probability among candidates that were all plausible, and you get variety instead of decay.
Reply
Report