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

Nguyen Huu Nhat Minh, A. Baker, Clement Neo, Allen G. Roush, Andreas Kirsch, Ravid Shwartz-Ziv

arXiv:2407.01082 · 2026-07-27 공개 · arXiv · PDF

gsm8k llama-3 vllm alpacaeval mistral llm-generation creative-writing token-sampling

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.

한국어 요약

한 줄 요약

min-p 샘플링은 LLM 생성 텍스트의 창의성과 일관성을 동시에 향상시키는 새로운 샘플링 방법이다.

핵심 기여도

핵심 아이디어

기존 샘플링 방법(예: top-p, temperature scaling)은 고온도 설정에서 텍스트의 일관성을 저하시키거나, 창의성을 제한하는 문제가 있었다. min-p 샘플링은 모델의 최상위 토큰 확률을 스케일링 인자로 사용하여 샘플링 임계값을 동적으로 조정함으로써, 모델의 신뢰도에 따라 샘플링 범위를 유연하게 조절한다. 모델이 불확실할 때는 다양한 토큰을 포함하고, 확신할 때는 고확률 토큰만 유지하여 창의성과 일관성을 균형 있게 유지한다. 이는 기존의 고정 임계값 기반 샘플링과는 차별화된 접근법이다.

기술적 접근법

주요 결과

의의 및 한계

min-p 샘플링은 LLM의 창의성과 일관성이라는 장기적 딜레마를 해결하는 실용적 접근법으로, 다양한 모델 가족과 규모에서 일관된 성능을 보인다. 특히 고온도 설정에서 기존 샘플링 방법이 실패하는 상황에서도 안정적인 텍스트 생성을 가능하게 하며, Hugging Face, VLLM 등 주요 오픈소스 프레임워크에 채택되어 빠른 실용화를 이끌고 있다. 그러나 모든 온도 설정에서 최적의 결과를 보장하지는 않으며, 모델 종류나 작업 유형에 따라 최적 파라미터 조정이 필요할 수 있다.

실용적 활용

min-p 샘플링은 창의적 글쓰기, 스토리 생성, 상상력 기반 대화 시스템 등에서 높은 품질과 다양성을 동시에 요구하는 LLM 응용에 적합하다. 특히, 고온도 설정에서 일관성을 유지하면서도 창의성을 확보해야 하는 상황에서 유용하며, 대규모 추론 모델(예: Deepseek R1)에서도 효과적으로 활용 가능하다.