Closing the Curious Case of Neural Text Degeneration

Matthew Finlayson, John Hewitt, Alexander Koller, Swabha Swayamdipta, Ashish Sabharwal
2/12/2026

No official code found. Best implementation: mattf1n/basis-aware-threshold (12 stars, last commit 2025-04-09).

Abstract

Despite their ubiquity in language generation, it remains unknown why truncation sampling heuristics like nucleus sampling are so effective. We provide a theoretical explanation for the effectiveness of the truncation sampling by proving that truncation methods that discard tokens below some probability threshold (the most common type of truncation) can guarantee that all sampled tokens have nonzero true probability. However, thresholds are a coarse heuristic, and necessarily discard some tokens with nonzero true probability as well. In pursuit of a more precise sampling strategy, we show that we can leverage a known source of model errors, the softmax bottleneck, to prove that certain tokens have nonzero true probability, without relying on a threshold. Based on our findings, we develop an experimental truncation strategy and the present pilot studies demonstrating the promise of this type of algorithm. Our evaluations show that our method outperforms its threshold-based counterparts under automatic and human evaluation metrics for low-entropy (i.e., close to greedy) open-ended text generation. Our theoretical findings and pilot experiments provide both insight into why truncation sampling works, and make progress toward more expressive sampling algorithms that better surface the generative capabilities of large language models.

View on arXivView PDF

Code Implementations(1)

Code for the paper "Closing the Curious Case of Neural Text Degeneration"

122PythonOct 2, 20231 years ago

Similar Papers

Cite this paper

@article{finlayson2026closing,
  title  = {Closing the Curious Case of Neural Text Degeneration},
  author = {Matthew Finlayson and John Hewitt and Alexander Koller and Swabha Swayamdipta and Ashish Sabharwal},
  year   = {2026},
  eprint = {2310.01693},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2310.01693},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.01693.svg)](https://codeofpaper.com/paper/2310.01693)

Discussion