Source-linked AI summary
The Curious Case of Neural Text Degeneration
Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, Yejin Choi
TL;DR
Neural language models can produce bland, repetitive text when likelihood guides decoding, despite strong language modeling performance. This paper analyzes text distributions and decoding strategies, proposing Nucleus Sampling, which achieves the best overall quality and diversity among the evaluated strategies.
Problem
Likelihood-maximizing decoding produces generic, repetitive text despite language models assigning high scores to well-formed human text.
Method
The paper proposes Nucleus Sampling, dynamically selecting the smallest set of tokens whose cumulative probability exceeds a threshold.
Results
Human Unified with Statistical Evaluation identifies Nucleus Sampling as the best overall decoding strategy, while matching human distributional statistics without top-k’s incoherence.
Takeaways & Limitations
Nucleus Sampling captures the model’s confidence region while avoiding both repetitive likelihood maximization and low-confidence sampling tails.
Abstract
from arXiv · showhide
Despite considerable advancements with deep neural language models, the enigma of neural text degeneration persists when these models are tested as text generators. The counter-intuitive empirical observation is that even though the use of likelihood as training objective leads to high quality models for a broad range of language understanding tasks, using likelihood as a decoding objective leads to text that is bland and strangely repetitive. In this paper, we reveal surprising distributional differences between human text and machine text. In addition, we find that decoding strategies alone can dramatically effect the quality of machine text, even when generated from exactly the same neural language model. Our findings motivate Nucleus Sampling, a simple but effective method to draw the best out of neural generation. By sampling text from the dynamic nucleus of the probability distribution, which allows for diversity while effectively truncating the less reliable tail of the distribution, the resulting text better demonstrates the quality of human text, yielding enhanced diversity without sacrificing fluency and coherence.
1 INTRODUCTION
The introduction identifies a mismatch between likelihood-based decoding and human-like text: maximization becomes repetitive and pure sampling incoherent. It presents Nucleus Sampling as a dynamic-tail-truncation method that improves diversity, fluency, and coherence.
- Problem: Likelihood-maximizing decoding, including beam search, produces highly degenerate and repetitive text even with state-of-the-art models.Human token probabilities show greater variance, whereas Beam Search exhibits endless repetition.
- Problem: Pure sampling is incoherent because tens of thousands of low-probability candidate tokens form an over-represented unreliable tail.The unreliable tail is identified as the source of pure sampling’s degeneration.
- Method: Nucleus Sampling samples from a dynamic nucleus containing most probability mass, typically ranging from one to a thousand vocabulary candidates.It avoids relying on fixed top-k or temperature-based suppression that inadequately removes the unreliable tail.
- Results: Maximization and top-k sampling are too probable and insufficiently diverse, whereas pure sampling is significantly less likely than gold text and lower quality.These conclusions follow comparisons of repetition likelihood, generated-text perplexity, vocabulary usage, and Self-BLEU against human reference distributions.
- Results: Nucleus Sampling matches reference perplexity without the incoherence associated with high-k top-k sampling and achieves the best overall decoding performance under HUSE.Tuning p matches human distributional statistics while avoiding the variance issues observed at high k.
2 BACKGROUND
The background distinguishes directed generation, where outputs are constrained transformations of inputs, from open-ended generation, where many continuations are plausible. It also notes that maximization-based decoding produces grammatical but insufficiently diverse text, motivating interest in alternative generation approaches.
- Generation quality: Generation by maximization tends to produce highly grammatical output with low diversity.Prior work has identified this as a disadvantage of maximization-based generation.
- Directed generation: Directed generation maps inputs to outputs through constrained transformations, including translation, data-to-text generation, and summarization.These tasks typically use encoder-decoder architectures with attention mechanisms.
- Open-ended generation: Open-ended generation includes story generation and contextual continuation, where context restricts outputs but leaves considerable freedom in plausible continuations.Its promise has grown alongside advances in neural language models.
3 LANGUAGE MODEL DECODING
Open-ended generation produces a coherent continuation token by token using a decoding strategy. The section contrasts maximization and fixed top-k sampling with Nucleus Sampling, which dynamically truncates the distribution according to cumulative probability mass.
- Open-Ended Generation: Open-ended generation extends a context of m tokens with n continuation tokens, computing sequence probability through a left-to-right decomposition and generating token by token.The completed sequence is x1...xm+n, with each next token selected using a particular decoding strategy.
- Maximization-based Decoding: Maximization-based decoding seeks the highest-likelihood continuation, commonly using beam search because exact sequence optimization is intractable.Recent studies report that this approach does not produce high-quality open-ended text.
- Nucleus Sampling: Nucleus Sampling defines a top-p vocabulary as the smallest token set whose cumulative probability exceeds a chosen threshold, then samples from its rescaled distribution.The sampling set adapts dynamically to the probability-distribution shape at each time step.
- Top-k Sampling: Top-k sampling truncates each distribution to its k highest-probability tokens, whereas Nucleus Sampling determines truncation from cumulative probability mass.The truncation boundary represents the generative model’s trustworthy prediction zone.
- Difficulty in Choosing k: A constant k is sub-optimal because distributions may be flat across many reasonable options in some contexts and concentrated on a few tokens in others.Small k can produce bland or generic text in flat contexts, while large k can include unreliable alternatives when probability mass is concentrated.
4 LIKELIHOOD EVALUATION
Likelihood evaluation shows that good generation should match human text’s perplexity rather than minimize it, because higher-probability decoded text can be bland and repetitive. Nucleus Sampling comes closest to human perplexity, while beam search assigns natural text lower per-token probability than its own outputs.
- Evaluation criterion: The optimal decoding strategy should produce text with perplexity close to gold text, rather than simply maximizing model probability.The authors note that lower-perplexity, higher-probability text tends to have low diversity.
- Sampling behavior: Pure sampling yields worse perplexity than gold because unlikely tokens create contexts that are difficult for the model to recover.Lowering temperature creates diversity and repetition issues.
- Sampling behavior: Nucleus Sampling obtains the perplexity closest to human text despite a fine-grained parameter sweep.The passage contrasts Nucleus Sampling with pure sampling and temperature adjustment.
- Likelihood maximization: Natural text has lower average per-token probability than beam-search text, indicating that maximization is not merely a search failure.Human language rarely stays in a high-probability zone for multiple consecutive time steps.
- Likelihood maximization: The authors conjecture that human language intrinsically avoids making every word as predictable as possible because people optimize against stating the obvious.They connect this conjecture to Grice’s Maxims of Communication.
5 DISTRIBUTIONAL STATISTICAL EVALUATION
The evaluation finds that Sampling and Nucleus Sampling most closely match human vocabulary and n-gram distributions, while decoding parameters strongly affect diversity, repetition, perplexity, and coherence. Nucleus Sampling remains close to human behavior across usual parameter ranges, whereas alternatives often require problematic tuning.
- N-gram distributions: Sampling and Nucleus Sampling are by far closest to the human n-gram distribution, whereas Beam Search follows a clearly different distribution.
- Diversity: Normal Nucleus Sampling values of p ∈[0.9, 1) closely match human Self-BLEU, while common t ∈[0.5, 1] and k ∈[1, 100] values produce high self-similarity.Lower Self-BLEU indicates higher diversity; very high k and t are needed for other methods to approach the reference distribution, but these settings produce unnaturally high perplexity.
- Vocabulary distributions: Sampling is closest to the human vocabulary distribution, followed by Nucleus Sampling, while pure sampling slightly overestimates rare-word usage.Vocabulary distributions are compared using Zipf coefficients against the theoretically perfect exponential curve, where s = 1.
- Repetition: Nucleus Sampling and top-k sampling have the least repetition over reasonable parameter ranges, while temperature sampling needs very high temperatures that negatively affect coherence.All stochastic methods face repetition issues when tuning parameters are set too low, which tends to over-truncate.
6 HUMAN EVALUATION
Human evaluation is required because statistical metrics do not fully measure generated-text coherence, while pure human evaluation misses diversity. Using HUSE and typicality annotations, the study finds Nucleus Sampling performs best among the tested decoding methods.
- Evaluation method: Statistical metrics cannot properly measure generated-text coherence, while pure human evaluation does not capture generated-text diversity.The study therefore combines human and statistical evaluation with HUSE.
- Evaluation method: Direct HUSE evaluation gave top-k and Nucleus Sampling scores near 0 because truncation assigns probability 0 to most potential tokens.The study instead interpolates the original probability distribution with mass 0.1 when generating text for HUSE.
- Evaluation protocol: Each decoding algorithm receives 200 generations annotated for typicality by 20 different annotators, yielding 4000 annotations.The annotations provide the human-evaluation component of the assessment.
- Results: Nucleus Sampling obtains the highest HUSE score, with Top-k sampling performing second best.HUSE is computed with a KNN classifier using k = 13 neighbors, selected for higher discrimination accuracy.
- Qualitative examples: Beam search becomes trapped in repetition, full sampling is hardest to understand, and Nucleus Sampling produces imperfect but comparatively interpretable text.The examples include full sampling inventing “umidauda” and Nucleus Sampling confusing whales with birds.
7 CONCLUSION
The paper analyzes decoding methods for open-ended language generation, showing that likelihood maximization causes repetitive, generic text while untruncated sampling risks low-confidence outputs. It proposes Nucleus Sampling to capture the confidence region of language models effectively.
- 7 CONCLUSION: Likelihood-maximizing decoding causes repetition and overly generic language usage.The conclusion identifies this as a central property of common decoding methods for open-ended language generation.
- 7 CONCLUSION: Untruncated sampling risks drawing from the low-confidence tail of a model’s predicted distribution.The paper contrasts this risk with the problems caused by likelihood maximization.
- 7 CONCLUSION: Nucleus Sampling captures the region of confidence of language models effectively.The method is presented as a solution to the limitations of likelihood maximization and untruncated sampling.
A BEAM WIDTH EFFECT
Beam Search generations become shorter as beam width increases, while their diversity remains constant and extremely low compared with human text. This shows a beam-width effect on generation length without improving distinct-trigram counts.
- A BEAM WIDTH EFFECT: Average generation length decreases linearly as beam width increases.The figure reports this pattern across varying beam widths.
- A BEAM WIDTH EFFECT: The number of distinct trigrams stays constant and extremely low relative to gold human data.Gold data are included for comparison in the figure.
B EXAMPLE GENERATIONS
The example generations show that several decoding strategies produce repetitive or incoherent text, while Pure Sampling and especially Nucleus Sampling can escape repetition and more closely match the ground-truth style. The section provides qualitative examples across multiple prompts and domains.
- Additional examples: The section presents additional generations from initial tag lines, with further examples made available online.Figures 11 and 13 refer to additional example generations and provide the degen repository for the complete set.
- Qualitative examples: Examples include repeated phrases, duplicated instructions, malformed wording, and topic drift across generated responses.Repetition appears in outputs such as “high-performance” repeated many times, duplicated wallpaper instructions, and repeated vacation entries.
- Decoding comparison: Pure Sampling and Nucleus Sampling are the only algorithms that escape the repetition loop in the illustrated generations.The figure specifically identifies these two methods as escaping repetition.
- Decoding comparison: Nucleus Sampling’s generation is far closer in style to the ground-truth text than the other illustrated generations.The comparison is qualitative and is stated in the caption for Figure 12.