Introduction
A language model returns probabilities. Decoding turns those probabilities into generated text.
This choice matters. The same model can behave differently under greedy decoding, temperature sampling, top-k sampling, or nucleus sampling. The model has not changed. The policy for choosing tokens has changed.
What this chapter covers
- greedy decoding;
- temperature;
- top-k sampling;
- nucleus sampling preview;
- repetition and uncertainty.