Temperature sampling draws the next token randomly from the probability distribution produced after rescaling logits by a temperature value, rather than always selecting the single highest-probability token the way greedy decoding does. The temperature value directly controls how much randomness this sampling introduces: a temperature near zero makes the sampling behave almost identically to greedy decoding, while a higher temperature allows progressively more lower-probability tokens a realistic chance of being selected.