Greedy Decoding.

A text generation strategy that always selects the token with the highest probability at each step, producing deterministic but potentially repetitive output.

Greedy decoding is the simplest text generation strategy used by language models, where the model always chooses the token with the highest probability at each generation step. This approach produces completely deterministic output - given the same input, the model will always generate identical text. While computationally efficient and predictable, greedy decoding often leads to repetitive, generic, or suboptimal text because it never explores alternative paths that might lead to more interesting or contextually appropriate responses.

The strategy works by examining the probability distribution over the vocabulary at each token position and selecting the single most likely candidate without considering any alternatives. This contrasts sharply with sampling-based approaches like temperature sampling or nucleus sampling, which introduce controlled randomness to explore different generation paths. Greedy decoding essentially performs a depth-first search through the most probable sequence, but this locally optimal choice at each step doesn't guarantee a globally optimal sequence.

In practice, greedy decoding is useful for tasks requiring consistency and predictability, such as structured data extraction or when reproducible outputs are essential for testing. However, it often produces bland, repetitive text in creative applications and can get stuck in loops where the model repeatedly generates the same phrases. Most modern applications use sampling strategies instead, reserving greedy decoding for specific use cases where determinism outweighs creativity, or as a baseline for comparing other generation methods.