Once the model has produced its probabilities, something has to choose a token.
That choice is the sampling strategy, and it is not part of the model.
Greedy decoding always takes the single most likely token.
It is repeatable and safe, and it tends to be flat and prone to repeating itself.
Sampling draws from the distribution instead, so a token with 20 per cent probability wins one time in five.
That gives variety and is what makes the same prompt return different answers.
Beam search keeps several candidate continuations alive and expands each of them.
It compares whole sequences rather than committing to one token at a time.
That suits translation, where there is a best answer worth searching for.
It suits open generation badly, producing safe repetitive text, and it costs several times more.
Most systems today use temperature together with top-p and nothing else.
Repetition penalties can be layered on to discourage tokens that have already appeared.
They help with loops and can also damage text that legitimately repeats a term.
Structured output enforcement sits at this layer too, by masking every disallowed token.
The important point is that decoding is a choice you control, separate from the model itself.