The Curious Case of Neural Text Degeneration
The Curious Case of Neural Text Degeneration
Problem
Framing
Open-ended text generation lacked a decoding rule that avoids both beam-search repetition and unconstrained-sampling incoherence. The paper closes this gap with nucleus sampling, which truncates the unreliable tail adaptively and attains the best combined human-statistical score, HUSE .
Currently Used Methods
Direct antecedents
- @vaswaniAttentionAllNeed2017 — Transformer architecture behind large neural language models.
- Limitation in context: architecture strength does not determine a good open-ended decoding rule.
- @radfordGPT2_2019 — large-scale autoregressive language model with top- decoding.
- Limitation in context: fixed truncation mismatches context-dependent distribution shape.
- "A Hierarchical Neural Autoencoder for Paragraphs and Documents" — stochastic beam search for diverse decoding.
- Limitation in context: beam-style maximization still drifts toward bland or repetitive continuations.
- "Hierarchical Neural Story Generation" — top- sampling for long-form generation.
- Limitation in context: constant- sampling either admits tail noise or over-truncates.
- "Language Modeling with Gated Convolutional Networks" — alternative neural LM backbone for next-token prediction.
- Limitation in context: better LMs still expose an unreliable low-probability tail at decoding time.
Proposed Method
Architecture
The method is a decoding rule layered on an autoregressive LM, not a new network. At step , it reads the model distribution and adaptively truncates to a context-specific candidate set before sampling.
Loss / Objective
The underlying LM still optimizes standard autoregressive likelihood:
Sampling Rule / Algorithm
Nucleus sampling defines the smallest top-probability set whose cumulative mass exceeds , then renormalizes and samples from it.
Training Procedure
- LM family: GPT-2.
- Model scales discussed: Large and XL for examples.
- Evaluation corpora: WebText prompts, WritingPrompts, WikiText-103.
- Generation length for loop analysis: first tokens.
- HUSE classifier: KNN with .
Evaluation
Datasets
- WebText continuations.
- WritingPrompts generations.
- WikiText-103 reference text.
- Human-written continuations as calibration target.
Metrics
- Perplexity.
- Self-BLEU4.
- Zipf coefficient.
- Repetition .
- HUSE.
Headline results
- Human reference: perplexity , Self-BLEU4 , Zipf , repetition .
- Greedy: perplexity , repetition .
- Beam, : perplexity , repetition .
- Top-: Self-BLEU4 , repetition , HUSE .
- Nucleus, : perplexity , Self-BLEU4 , repetition , HUSE .
Table 1: Main results for comparing decoding methods with selected parameters
| Method | Perplexity | Self-BLEU4 | Zipf Coefficient | Repetition % | HUSE |
|---|---|---|---|---|---|
| Human | 12.38 | 0.31 | 0.93 | 0.28 | - |
| Greedy | 1.50 | 0.50 | 1.00 | 73.66 | - |
| Beam, b=16 | 1.48 | 0.44 | 0.94 | 28.94 | - |
| Stochastic Beam, b=16 | 19.20 | 0.28 | 0.91 | 0.32 | - |
| Pure Sampling | 22.73 | 0.28 | 0.93 | 0.22 | 0.67 |
| Sampling, t=0.9 | 10.25 | 0.35 | 0.96 | 0.66 | 0.79 |
| Top-k=40 | 6.88 | 0.39 | 0.96 | 0.78 | 0.19 |
| Top-k=640 | 13.82 | 0.32 | 0.96 | 0.28 | 0.94 |
| Top-k=40, t=0.7 | 3.48 | 0.44 | 1.00 | 8.86 | 0.08 |
| Nucleus p=0.95 | 13.13 | 0.32 | 0.95 | 0.36 | 0.97 |


Ablations
- Beam width: larger beams push perplexity unnaturally low and worsen repetition loops.
- Temperature: lower improves coherence but collapses diversity and still repeats.
- Top-: small over-truncates; large restores diversity but admits tail noise.
- Top-: values in best match human Self-BLEU and keep repetition low.
Method Strengths and Weaknesses
Strengths
- One-parameter rule. No retraining or architecture change.
- Best overall HUSE: nucleus reaches .
- Matches human perplexity far better than beam or greedy decoding.
- Avoids both dominant failure modes in qualitative examples.
Weaknesses
- Still heuristic. The threshold remains hand-tuned.
- Gains are decoding-time only; LM tail unreliability remains unsolved.
- Nucleus examples still contain factual drift and topic confusion.
- Evaluation centers on GPT-2-era English open-ended generation.
Suggestions from the authors
- Study better decoding schemes for open-ended generation beyond likelihood maximization.
- Improve language models so low-confidence tail tokens are better calibrated.
- Test whether larger models reduce degeneration without truncation.
- Develop evaluations that jointly measure coherence and diversity.
Links
Prior Papers
- @radfordGPT2_2019 — supplies the autoregressive LM and top- decoding baseline that nucleus sampling critiques.
- @vaswaniAttentionAllNeed2017 — provides the Transformer backbone underlying the language models studied.
Further Papers
- @brownGPT3_2020 — scales autoregressive open-ended generation, where decoding pathologies and truncation choices remain central.
- @leviathanSpeculativeDecoding2023 — studies faster inference for autoregressive generation, another decoding-time intervention.
- @ouyangInstructGPT2022 — shifts generation quality via alignment, complementing this paper's decoding-side fix.
- @rafailovDPO2023 — optimizes preference-aligned text generation, reducing reliance on decoding heuristics alone.