arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2407.01082cs.CL
收藏

提升采样温度:用于生成创意且连贯LLM输出的min-p采样

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

Apart Research;Independent(独立研究者);New York University(纽约大学)

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

AI总结:

min-p采样通过动态截断方法提升LLM生成文本的质量和多样性,尤其在高温度下表现优异,已获多个开源框架采用。

摘要:

大型语言模型(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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑