The other dials — top-k & top-p.
Temperature reshapes the whole spread of odds. These two dials instead cut the long shots out before the draw.
A real appeal has more than three possible calls — in a real model, thousands of possible next words, most of them nonsense. Temperature, last page, squeezed or stretched the whole set at once. Top-k and top-p are blunter: before the model draws, they throw the least likely options away entirely, so those simply cannot be picked.
Top-k keeps only the k most likely calls and bins the rest. Set k = 3 and the model may choose only among its top three; everything below that is gone.
Top-p (also called nucleus) is smarter: it keeps the fewest calls whose odds add up to at least p. Set p = 0.9 and it keeps just enough of the top calls to cover 90% of the probability — only a few when the model is confident, more when it is torn.
Either way, whatever survives is re-scaled so its odds add back up to 100%, and the draw happens only among those. The long tail of odd, unlikely calls can no longer sneak out.
Cut the tail with top-k or top-p and watch the unlikely calls drop away while the survivors share out the odds between them.
Two more arguments on the call.
Like temperature, these are just settings you pass. They are usually combined — temperature to flatten the odds, top-p to lop off the tail.
Trim the tail, then draw.
Temperature reshapes the odds; top-k and top-p cut the unlikely calls out before the draw — a fixed number of them (k), or as many as it takes to cover a share of the probability (p). Whatever survives is re-scaled to 100%, and the draw happens only there.
The three often work together: temperature sets how flat the odds are, and top-p or top-k lop off the long tail — so the model stays varied without wandering into nonsense.