[Paper Review] Locally Typical Sampling
This paper proposes locally typical sampling, a decoding strategy for probabilistic language models that enforces each generated word to have information content close to its expected value given the context, based on information-theoretic principles. By constraining sampling to words with near-expected entropy, the method reduces degenerate repetitions and produces text that is more fluent and human-like than nucleus or top-k sampling, with human evaluations showing competitive or superior quality on summarization and story generation tasks.
Today's probabilistic language generators fall short when it comes to producing coherent and fluent text despite the fact that the underlying models perform well under standard metrics, e.g., perplexity. This discrepancy has puzzled the language generation community for the last few years. In this work, we posit that the abstraction of natural language generation as a discrete stochastic process--which allows for an information-theoretic analysis--can provide new insights into the behavior of probabilistic language generators, e.g., why high-probability texts can be dull or repetitive. Humans use language as a means of communicating information, aiming to do so in a simultaneously efficient and error-minimizing manner; in fact, psycholinguistics research suggests humans choose each word in a string with this subconscious goal in mind. We formally define the set of strings that meet this criterion: those for which each word has an information content close to the expected information content, i.e., the conditional entropy of our model. We then propose a simple and efficient procedure for enforcing this criterion when generating from probabilistic models, which we call locally typical sampling. Automatic and human evaluations show that, in comparison to nucleus and top-k sampling, locally typical sampling offers competitive performance (in both abstractive summarization and story generation) in terms of quality while consistently reducing degenerate repetitions.
Motivation & Objective
- To address the paradox that high-probability text from language models is often dull or repetitive despite strong perplexity scores.
- To investigate whether enforcing information-theoretic typicality in word-level entropy can lead to more human-like text generation.
- To propose and evaluate a new decoding strategy—locally typical sampling—that enforces per-word information content close to expected entropy.
- To demonstrate that this method reduces degenerate repetitions while maintaining or improving text quality compared to existing stochastic decoding strategies.
Proposed method
- Reframes language modeling as a discrete stochastic process, modeling sequences as indexed random variables {Yt} rather than a single string-valued variable.
- Defines local typicality as the condition where each word’s information content (−log p(yt|y<t)) is close to the conditional entropy H(Yt|y<t), ensuring information efficiency.
- Proposes a sampling procedure that restricts choices at each step to words whose information content falls within a threshold τ of the expected entropy, using a dynamic thresholding mechanism.
- Applies this criterion during decoding by filtering candidate words based on their information content relative to the model’s predicted entropy.
- Uses a temperature-like hyperparameter τ to control the width of the acceptable range around the expected entropy, enabling trade-offs between diversity and typicality.
- Employs a greedy selection within the filtered set to maintain efficiency while ensuring typicality is preserved across the sequence.
Experimental results
Research questions
- RQ1Can enforcing per-word information content close to expected entropy improve the fluency and coherence of generated text?
- RQ2Why do high-probability sequences from language models often fail to be perceived as natural or fluent despite strong autoregressive performance?
- RQ3How does locally typical sampling compare to nucleus and top-k sampling in reducing degenerate repetitions while maintaining or improving text quality?
- RQ4To what extent does locally typical sampling align generated text with human-like properties in terms of information density and repetition?
Key findings
- Locally typical sampling reduces degenerate repetitions to a level comparable to human-written text, achieving a REP score on par with human benchmarks.
- Human evaluations show that text generated via locally typical sampling is rated as higher quality than that from nucleus or top-k sampling on both abstractive summarization and story generation tasks.
- The method produces more fluent and coherent stories, with fewer repeated phrases and better narrative structure than other stochastic decoding strategies.
- Text generated using locally typical sampling exhibits information content per word that is more consistent with human language patterns, supporting the hypothesis that humans produce text with near-constant information density.
- The approach maintains competitive performance in automatic metrics while significantly improving qualitative properties, particularly in reducing repetition and improving coherence.
- The method is efficient and can be implemented within existing inference pipelines, with an open-source implementation available in Hugging Face’s Transformers library.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.