大型语言模型(LLMs)通过在每个解码步骤中从词汇的概率分布中采样下一个标记来生成文本。流行的采样方法如top-p(核采样)往往难以在质量和多样性之间取得平衡,尤其是在较高温度下导致输出不连贯或重复。我们提出了min-p采样,一种动态截断方法,通过使用顶部标记的概率作为缩放因子,根据模型的置信度调整采样阈值。我们在包含GPQA、GSM8K和AlpacaEval创意写作的基准测试中发现,min-p采样在不同模型家族(Mistral和Llama 3)和模型大小(1B到123B参数)上提高了生成文本的质量和多样性,特别是在较高温度下。人类评估进一步显示,min-p采样在文本质量和创造力方面受到明显偏爱。min-p采样已被广泛采用,包括Hugging Face Transformers、VLLM和其他许多流行开源LLM框架,突显了其在提高文本生成质量方面的重大影响。
英文摘要:
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.
Rethinking Creativity Evaluation: A Critical Analysis of Existing Creativity Evaluations
Graduate Institute of Communication Engineering, National Taiwan University(台湾大学通信工程研究院);Computer Science Department, University of California, Los Angeles(加州大学洛杉矶分校计算机科学系);Graduate Institute of Networking and Multimedia, National Taiwan University(台湾大学网络与多媒体研究院);Department of Electrical Engineering, National Taiwan University(台湾大学电子工程系)
Playing with Words, Improving with Rewards: Training Language Models for Creative Association
University of Massachusetts Lowell(马萨诸塞大学洛市分校);Dartmouth College(达特茅斯学院);University of Amsterdam(阿姆斯特丹大学);Pennsylvania State University(宾夕法尼亚州立大学);Amazon AGI(亚马逊人工智能研究院)
Applying Text Mining to Analyze Human Question Asking in Creativity Research
Faculty of Mathematics and Information Sciences, Warsaw University of Technology(华沙技术大学数学与信息科学学院);Faculty of Data and Decision Sciences, Technion - Israel Institute of Technology(技术学院-以色列理工学院数据与决策科学学院);School of Applied Data Science, Modul University Vienna(维也纳模尔大学应用数据科学学院);Systems Research Institute Polish Academy of Sciences(波兰科学院系统研究 institute)