HackerPapers

arXiv:2407.01082cs.CL

Turning Up the Heat: Min-p Sampling for Creative and Coherent LLM Outputs

Minh Nhat Nguyen, Andrew Baker, Clement Neo, Allen Roush, Andreas Kirsch, Ravid Shwartz-Ziv

Abstract

Large Language Models (LLMs) generate text by sampling the next token from a probability distribution over the vocabulary at each decoding step. Popular sampling methods like top-p (nucleus sampling) often struggle to balance quality and diversity, especially at higher temperatures which lead to incoherent or repetitive outputs. We propose min-p sampling, a dynamic truncation method that adjusts the sampling threshold based on the model's confidence by using the top token's probability as a scaling factor. Our experiments on benchmarks including GPQA, GSM8K, and AlpacaEval Creative Writing show that min-p sampling improves both the quality and diversity of generated text across different model families (Mistral and Llama 3) and model sizes (1B to 123B parameters), especially at higher temperatures. Human evaluations further show a clear preference for min-p sampling, in both text quality and creativity. Min-p sampling has been adopted by popular open-source LLM frameworks, including Hugging Face Transformers, VLLM, and many others, highlighting its considerable impact on improving text generation quality.

arXiv comments
Oral presentation at ICLR 2025. Camera-ready version available at https://iclr.cc/virtual/2025/poster/30358
Journal reference
In Proceedings of the 2025 International Conference on Learning Representations (ICLR), 2025
DOI
Subjects
cs.CLComputation and Language

On Hacker News

Linked by 2 identifiable commenters in 3 comments across 3 threads, from Oct 2024 to May 2025. Found in 3 HN submissions from Aug 2024 to Feb 2025. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments3 threads

    • Related to this, our min_p paper was ranked #18 out of 12000 submission at ICLR and got an oral: https://iclr.cc/virtual/2025/oral/31888 Our poster was popular: poster: https://iclr.cc/media/PosterPDFs/ICLR%202025/30358.png?t=174... oral presentation (watch me roast yoshua…

      Der_EinzigeView on HNParent context

    • You and the OP talk a lot of smack about logprobs but we show that using them in even the simple case of dynamic truncation of your cutoff point (min_p sampler vs static top_p/top_k) leads to extreme performance improvements (especially on small models) and unlocks very high…

      Der_EinzigeView on HNParent context

    • Is this [1] the paper you're referring to? Unless I'm reading Table2 (page7 - pdf version) wrong, on math, min_p is shown to score worse than top_p. For temp 0.7 it scores 1 point lower than top_p. And from temps 1.0 and up, while scoring higher than top_p for the same temp, it…

      NitpickLawyerView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.