Exploring the Impact of Temperature on Large Language Models: Hot or Cold?

计算机科学
作者
Lujun Li,Lama Sleem,Niccolò Gentile,Geoffrey Nichil,Radu State
出处
期刊:Procedia Computer Science [Elsevier BV]
卷期号:264: 242-251 被引量:16
标识
DOI:10.1016/j.procs.2025.07.135
摘要

The sampling temperature, a critical hyperparameter in large language models (LLMs), modifies the logits before the softmax layer, thereby reshaping the distribution of output tokens. Recent studies have challenged the “Stochastic Parrots” analogy by demonstrating that LLMs are capable of understanding semantics rather than merely memorizing data and that randomness, modulated by sampling temperature, plays a crucial role in model inference. In this study, we systematically evaluated the impact of temperature in the range of 0 to 2 on data sets designed to assess six different capabilities, conducting statistical analyses on open source models of three different sizes: small (1B–4B), medium (6B–13B), and large (40B–80B). Our findings reveal distinct skill-specific effects of temperature on model performance, highlighting the complexity of optimal temperature selection in practical applications. To address this challenge, we propose a BERT-based temperature selector that takes advantage of these observed effects to identify the optimal temperature for a given prompt. We demonstrate that this approach can significantly improve the performance of small and medium models in the SuperGLUE datasets. Furthermore, our study extends to FP16 precision inference, revealing that temperature effects are consistent with those observed in 4-bit quantized models. By evaluating temperature effects up to 4.0 in three quantized models, we find that the “Mutation Temperature”—the point at which significant performance changes occur—increases with model size 1 .

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
1秒前
白石人家应助D调的华丽采纳,获得10
1秒前
清秀芸遥发布了新的文献求助10
1秒前
朱华彪完成签到,获得积分10
2秒前
歪比巴卜完成签到 ,获得积分10
2秒前
2秒前
3秒前
3秒前
Liranran完成签到,获得积分10
4秒前
大个应助勿念采纳,获得10
4秒前
4秒前
hetty完成签到,获得积分10
5秒前
木子木公完成签到,获得积分10
6秒前
8R60d8应助启程牛牛采纳,获得10
6秒前
7秒前
锡嘻完成签到 ,获得积分10
7秒前
LUMOS发布了新的文献求助10
7秒前
婳婳华华发布了新的文献求助30
7秒前
Nannan完成签到,获得积分10
7秒前
9秒前
balabala发布了新的文献求助30
10秒前
机灵的沂应助啦啦啦啦啦采纳,获得10
12秒前
12秒前
冰下之鲸发布了新的文献求助10
12秒前
NexusExplorer应助kiko采纳,获得10
14秒前
14秒前
dywen完成签到,获得积分10
14秒前
清秀芸遥完成签到,获得积分10
14秒前
鲤鱼诗桃完成签到,获得积分10
14秒前
舒适的如花完成签到 ,获得积分10
16秒前
17秒前
17秒前
17秒前
Moyanmisheng发布了新的文献求助10
17秒前
婳婳华华发布了新的文献求助30
18秒前
18秒前
liya完成签到,获得积分20
18秒前
冰下之鲸完成签到,获得积分10
19秒前
张先伟完成签到,获得积分10
20秒前
0+0完成签到,获得积分10
20秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Health Psychology 800
Matrix Methods in Data Mining and Pattern Recognition Second Edition 510
Electric machines: theory, operating applications, and controls 500
The Analytical and Numerical Solution of Electric and Magnetic Fields 500
When Is Two-Stage Sample Robust Optimization Asymptotically Optimal? 500
Discerning Saints: Moralization of Intrinsic Motivation and Selective Prosociality at Work 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 内科学 物理 复合材料 催化作用 细胞生物学 无机化学 光电子学 物理化学 电极 基因
热门帖子
关注 科研通微信公众号,转发送积分 7593252
求助须知:如何正确求助?哪些是违规求助? 9170397
关于积分的说明 19628655
捐赠科研通 7171154
什么是DOI,文献DOI怎么找? 3267600
关于科研通互助平台的介绍 2432443
邀请新用户注册赠送积分活动 2260188