Decoding strategies: greedy to beam

Decoding is the process of generating a sequence of tokens from a trained model. The simplest approach is greedy decoding: at each step, select the token with highest probability. Greedy is fast but often suboptimal — it produces repetitive, generic output and cannot recover from early mistakes.