Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

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

About

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• 2024

Related benchmarks

TaskDatasetResultRank
Mathematical ReasoningGSM8K (test)
Accuracy81.96
954
Visual Question AnsweringChartQA
Accuracy77.71
519
Instruction FollowingMT-Bench
MT-Bench Score7.11
287
Question AnsweringGPQA
Accuracy31.92
258
Visual PerceptionBLINK
Accuracy38.77
241
Mathematical ReasoningAIME 25
Pass@1 Accuracy53.8
178
Open-ended generationCreative Writing Evaluation Prompts
Average Judge Score8.12
108
Mathematical ReasoningAIME 24
Pass@1 Accuracy58.7
103
Scientific ReasoningGPQA Main
Accuracy29.02
101
Multimodal UnderstandingMMMU
Accuracy47.33
76
Showing 10 of 44 rows

Other info

Follow for update