Abstract
For open-ended language generation tasks such as storytelling and dialogue, choosing the right decoding algorithm is critical to controlling the tradeoff between generation quality and diversity. However, there presently exists no consensus on which decoding procedure is best or even the criteria by which to compare them. We address these issues by casting decoding as a multi-objective optimization problem aiming to simultaneously maximize both response quality and diversity. Our framework enables us to perform the first large-scale evaluation of decoding methods along the entire quality-diversity spectrum. We find that when diversity is a priority, all methods perform similarly, but when quality is viewed as more important, the recently proposed nucleus sampling (Holtzman et al. 2019) outperforms all other evaluated decoding algorithms. Our experiments also confirm the existence of the 'likelihood trap', the counter-intuitive observation that high likelihood sequences are often surprisingly low quality. We leverage our findings to create and evaluate an algorithm called selective sampling which tractably approximates globally-normalized temperature sampling.
The Problem: The Likelihood Trap
When using large language models like GPT-2 for open-ended tasks, a fundamental challenge arises in how to select the next token. Standard training objectives encourage models to maximize the likelihood of human-written text. However, at inference time, simply picking the most likely words often leads to the "likelihood trap": sequences that are mathematically probable but repetitive and low-quality. Conversely, excessive randomness leads to incoherent "gibberish."
As shown in Figure 1, the relationship between sequence likelihood and human-perceived quality is non-monotonic. Initially, higher likelihood correlates with better quality, but after a specific inflection point (approximately $\log p(x) \approx -58$), quality plummets as the model enters repetitive loops.
A Framework for Fair Comparison
To address the lack of consensus on decoding strategies, this paper frames decoding as a multi-objective optimization problem: maximizing both Quality (human judgment) and Diversity (Shannon entropy). The authors argue that decoders cannot be compared in isolation; they must be evaluated at equivalent levels of diversity to determine which provides the best quality for a given amount of variety.
The study compared several standard autoregressive decoding algorithms:
- Temperature Sampling: Scaling logits before the softmax.
- Top-k Sampling: Sampling from the $k$ most likely tokens.
- Nucleus Sampling (Top-p): Sampling from the smallest set of tokens whose cumulative probability exceeds $p$.
Additionally, the authors introduced Selective Sampling, a global approach using rejection sampling to draw from a temperature-adjusted distribution of entire sequences while explicitly discarding high-likelihood sequences that fall into the likelihood trap.
Key Results and Insights
Nucleus Sampling Superiority
When viewed across the entire quality-diversity spectrum, the choice of decoder matters most when quality is prioritized. As illustrated in Figure 4, while most methods perform similarly at high-diversity levels, nucleus sampling (top-p) consistently maintains higher human judgment scores as entropy decreases, outperforming both top-k and temperature sampling.
The Failure of Global Decoders
Surprisingly, the "Selective Sampling" method—despite its theoretical rigor in optimizing globally—underperformed local token-by-token decoders. This suggests that local decoders like top-p provide a beneficial structural "prior" that helps maintain coherence, which is lost when only considering the total joint likelihood of a sequence.
Reproducibility of Human Judgment
Through "A/A" testing (comparing different groups of human raters), the authors demonstrated that while individual judgments of text are subjective, the relative preferences between different decoding algorithms are highly stable and reproducible. This validates the use of large-scale human evaluation as a robust benchmark for generation quality.
Conclusion
This research provides a systematic way to navigate the quality-diversity tradeoff in NLG. By identifying the likelihood trap and establishing entropy-based comparisons, it clarifies why certain decoding strategies succeed. Nucleus sampling remains the most effective method for balancing these objectives, while the underperformance of global sampling methods highlights the importance of local constraints in autoregressive generation.
Summary updated