Decoding strategies decide how to pick the next token from the vocabulary distribution during generation. Greedy takes the argmax; beam search keeps the top-
B paths; temperature rescales the logits (
T→0 recovers greedy,
T>1 flattens the distribution for more randomness); top-k samples only among the
k highest-probability tokens; top-p (nucleus) samples from the smallest set whose cumulative probability exceeds
p. Standard order: temperature on the logits first, then top-p truncation, then sampling.