about
Higher Temperatures and Min_p Sampling (arxiv.org)
1 point by danielhanchen on Aug 23, 2024 | hide | past | pdf | 1 comment on HN

In plain words: When choosing the next word, it keeps only options at least a fraction of the top word's chance, instead of a fixed slice of the most likely words. This held up quality and variety at high randomness, and human raters preferred the results.

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

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.

Minh Nhat Nguyen, Andrew Baker, Clement Neo, Allen Roush, Andreas Kirsch, Ravid Shwartz-Ziv
arXiv:2407.01082 · cs.CL · submitted Jul 1, 2024 · updated Nov 20, 2025
abstract · pdf · html · Oral presentation at ICLR 2025. Camera-ready version available at https://iclr.cc/virtual/2025/poster/30358

add comment on HN
Also discussed: Feb 2025 (1 point, 0 comments) · Aug 2024 (1 point, 0 comments)

Using a min_p of 0.1 and a temperature of 1.5 does very well vs the common default of temperature = 1.0.