TL;DR
This paper investigates the crucial trade-off between the quality and diversity of text generated by language models. The authors introduce a comprehensive evaluation framework and conduct a large-scale study, revealing a "likelihood trap" where maximizing model likelihood doesn't always lead to the best human-perceived quality. They find that nucleus sampling emerges as the top performer when quality is prioritized.
What Problem Does This Paper Address?
Open-ended natural language generation (NLG) tasks, like storytelling or dialogue, require models to produce not just coherent and grammatically correct text, but also a variety of outputs. This is a delicate balancing act: generating text that is too predictable might be high quality but lacks diversity, while generating highly diverse text might become nonsensical. The challenge lies in finding the right "decoding algorithm" – the method used to select the next word during generation – to navigate this quality-diversity trade-off effectively. However, there's no clear consensus on which algorithms are best or how to compare them systematically across the entire spectrum of possible outputs. This paper aims to fill this gap by providing a rigorous, large-scale evaluation of various decoding methods.
Methods
The core of the paper is a comprehensive evaluation framework designed to measure both quality and diversity.
- Quality Measurement: Human crowdworkers were employed to rate the quality of generated sentences on a five-point scale. To improve reliability, they used pairwise preference ratings, where workers chose which of two sentences was better.
- Diversity Measurement: The authors adopted conditional Shannon entropy as their metric for diversity. They validated this choice by showing it correlates well with other common diversity metrics like distinct n-grams.
- Decoding Algorithms Evaluated: The study focused on three commonly used decoding algorithms, each with a hyperparameter to control the quality-diversity trade-off:
- Temperature Sampling: Controls randomness by scaling token probabilities.
- Top-k Sampling: Restricts sampling to the
kmost likely tokens. - Nucleus Sampling (Top-p): Samples from the smallest set of tokens whose cumulative probability exceeds a threshold
p. - The Likelihood Trap: A key aspect of their investigation was to empirically quantify the relationship between a model's assigned likelihood to a sequence and human judgments of its quality. This is framed as the "likelihood trap," an observation that very high likelihood sequences can sometimes be of low quality.
Datasets
The paper does not introduce new training datasets. Instead, it uses the publicly available 774M parameter variant of GPT-2 (Radford et al., 2019) for generation. For evaluation, they selected 48 examples from the GPT-2 test set, filtering out explicit content. Prompts were created by taking the first 20 space-delimited words of these examples. Human ratings were collected from a pool of 146 Amazon Mechanical Turk workers.
Key Insights and Ideas
- The Likelihood Trap is Real and Quantifiable: The paper provides strong empirical evidence that maximizing a language model's likelihood doesn't always correlate with human-perceived quality. Beyond a certain point, higher likelihood can lead to worse quality, often manifesting as repetitive or nonsensical text. This challenges the intuition that simply picking the "most probable" output is best.
- Diversity vs. Quality Trade-off is Spectrum-Dependent: When diversity is the primary goal, most decoding algorithms perform similarly. However, when quality is prioritized, nucleus sampling significantly outperforms other methods.
- Nucleus Sampling Shines for Quality: When tuning for higher quality, nucleus sampling consistently yields better results than temperature or top-k sampling. This suggests its approach of dynamically selecting a subset of tokens based on cumulative probability is more effective for generating high-quality text.
- Fair Comparison Requires Equal Diversity: The authors emphasize that comparing decoding algorithms fairly necessitates controlling for diversity. Simply comparing them at arbitrary points can be misleading.
Key Results
- The study involved over 38,000 human ratings on nearly 10,000 generated samples.
- Figure 2a shows that nucleus sampling generally received the highest human judgment scores, while random sampling ("model") performed the worst.
- Figure 2b illustrates the quality-diversity trade-off, showing that as entropy (diversity) increases, quality generally decreases. Nucleus sampling is shown to achieve higher quality at comparable diversity levels compared to top-k and temperature sampling.
- The "likelihood trap" is visualized in Figure 1, where human quality ratings peak and then decline as model log-likelihood increases.
Limitations and Future Work
- Inter-Rater Agreement: The authors acknowledge that inter-rater agreement on quality judgments is not perfect (Fleiss' Kappa of 0.1964), indicating the subjective nature of text quality. However, they argue this reflects the inherent difficulty of the task rather than a flawed methodology, and consistency across experiments supports their findings.
- Model Specificity: While they used GPT-2, the findings might not generalize perfectly to all language models.
- Future Work: The paper's framework provides a solid basis for future research into decoding algorithms. The authors suggest that further exploration of methods that can effectively balance quality and diversity, especially in nuanced ways, is warranted. The concept of "superhuman performance" (generating text better than humans would) is also hinted at as a possibility due to the human-judgment-based evaluation.
Summary updated