Mirostat: A Neural Text Decoding Algorithm that Directly Controls Perplexity
Not on the map. Why?
Abstract (arXiv)
Neural text decoding is important for generating high-quality texts using language models. To generate high-quality text, popular decoding algorithms like top-k, top-p (nucleus), and temperature-based sampling truncate or distort the unreliable low probability tail of the language model. Though these methods generate high-quality text after parameter tuning, they are ad hoc. Not much is known about the control they provide over the statistics of the output, which is important since recent reports show text quality is highest for a specific range of likelihoods. Here, first we provide a theoretical analysis of perplexity in top-k, top-p, and temperature sampling, finding that cross-entropy behaves approximately linearly as a function of p in top-p sampling whereas it is a nonlinear function of k in top-k sampling, under Zipfian statistics. We use this analysis to design a feedback-based adaptive top-k text decoding algorithm called mirostat that generates text (of any length) with a predetermined value of perplexity, and thereby high-quality text without any tuning. Experiments show that for low values of k and p in top-k and top-p sampling, perplexity drops significantly with generated text length, which is also correlated with excessive repetitions in the text (the boredom trap). On the other hand, for large values of k and p, we find that perplexity increases with generated text length, which is correlated with incoherence in the text (confusion trap). Mirostat avoids both traps: experiments show that cross-entropy has a near-linear relation with repetition in generated text. This relation is almost independent of the sampling method but slightly dependent on the model used. Hence, for a given language model, control over perplexity also gives control over repetitions. Experiments with human raters for fluency, coherence, and quality further verify our findings.
Key facts. Cited by 8 papers in the map (data through 7 Oct 2026). First posted on arXiv 29 Jul 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 2; 2023: 2; 2024: 2; 2025: 0; 2026: 2.
8 papers.
- 2022Locally Typical Samplingcited by 108
- 2024VideoCoT: A Video Chain-of-Thought Dataset with Active Annotation Toolcited by 35
- 2023Closing the Curious Case of Neural Text Degenerationcited by 30
- 2023On the Efficacy of Sampling Adapterscited by 17
- 2022On the probability-quality paradox in language generationcited by 16
- 2024Pseudo-RIS: Distinctive Pseudo-supervision Generation for Referring Image Segmentationcited by 13
- 2026Geometry-Aware Decoding with Wasserstein-Regularized Truncation and Mass Penalties for Large Language Modelscited by 2
- 2026Decoding in Geometry: Alleviating Embedding-Space Crowding for Complex Reasoningcited by 1
- 2026Geometry-Aware Decoding with Wasserstein-Regularized Truncation and Mass Penalties for Large Language Models10 Feb 2026
- 2026Decoding in Geometry: Alleviating Embedding-Space Crowding for Complex Reasoning30 Jan 2026
- 2024Pseudo-RIS: Distinctive Pseudo-supervision Generation for Referring Image Segmentation10 Jul 2024
- 2024VideoCoT: A Video Chain-of-Thought Dataset with Active Annotation Tool7 Jul 2024
- 2023Closing the Curious Case of Neural Text Degeneration2 Oct 2023
- 2023On the Efficacy of Sampling Adapters7 Jul 2023
- 2022On the probability-quality paradox in language generation31 Mar 2022
- 2022Locally Typical Sampling1 Feb 2022