TempQuant:为量化语言模型学习自适应温度参数
TempQuant: Learning Adaptive Temperatures for Quantized Language Models
TempQuant 通过为量化模型学习温度和 top-p 设置,使其下一 token 概率分布更接近全精度模型。研究发现量化平均会"加热"模型,且温度对量化模型性能的影响远大于全精度模型。在 3-bit Qwen3-4B 上,全局 TempQuant 将 MATH 准确率从推荐配置下的 34% 提升至 51%。
arXiv:2611.22128v1 Announce Type: new Abstract: Large language models are increasingly deployed at low precision, yet quantization can degrade their performance. We study how quantization interacts with decoding settings such as the sampling temperature and top-p by examining how it distorts the model's next-token probabilities. Measuring entropy during generation across deployed temperatures, we find that quantization warms the model on average, and that temperature matters much more for the performance of a quantized model than for its full-precision counterpart. Because quantization and temperature both shape the next-token distribution, we investigate how much the sampling settings can undo what quantization changes, through our method TempQuant, which learns the quantized model's temperature and top-p to bring its next-token probabilities closer to the full-precision model's. We learn these settings at two granularities. The first is a single global setting per requested temperature, which finds nearly the same temperatures that tuning on labeled answers would, without any labels. Model cards typically recommend sampling a quantized model with the same settings as its full-precision counterpart, while we find that different settings can substantially improve its accuracy. On 3-bit Qwen3-4B, for example, global TempQuant raises MATH accuracy from 34% under the configuration recommended for Qwen's quantized releases to 51%. The second sets the temperature and top-p for every token, motivated by our finding that tokens whose rankings flip under quantization tend to need warming, while tokens whose rankings are preserved tend to need cooling. When quantization degrades accuracy substantially, TempQuant recovers much of it, and when degradation is lighter, it still brings the quantized model's behavior closer to the full-precision model's.
来源:arXiv (AI + Vision + Imaging) · arxiv.org