Temperature scaling is a popular technique for tuning the sharpness of a model distribution. It is used extensively for sampling likely generations and calibrating model uncertainty, and even features as a controllable parameter to many large language models in deployment. However, autoregressive models rely on myopic temperature scaling that greedily optimizes the next token. To address this, we propose Long Horizon Temperature Scaling (LHTS), a novel approach for sampling from temperature-scaled joint distributions. LHTS is compatible with all likelihood-based models, and optimizes for the long horizon likelihood of samples. We derive a temperature-dependent LHTS objective, and show that finetuning a model on a range of temperatures produces a single model capable of generation with a controllable long horizon temperature parameter. We experiment with LHTS on image diffusion models and character/language autoregressive models, demonstrating advantages over myopic temperature scaling in likelihood and sample quality, and showing improvements in accuracy on a multiple choice analogy task by $10\%$.
翻译:温度缩放是一种用于调整模型分布锐利度的流行技术。它被广泛用于采样可能生成结果和校准模型不确定性,甚至在部署的许多大型语言模型中作为可控参数。然而,自回归模型依赖短视的温度缩放,即贪婪地优化下一个词元。为了解决这一问题,我们提出长期视界温度缩放(LHTS),一种从温度缩放联合分布中采样的新颖方法。LHTS 兼容所有基于似然的模型,并优化样本的长期视界似然。我们推导了依赖于温度的 LHTS 目标,并证明在一系列温度下微调模型能产生一个可通过可控长期视界温度参数进行生成单一模型。我们在图像扩散模型和字符/语言自回归模型上实验 LHTS,展示其在似然和样本质量上优于短视温度缩放,并在类比多项选择任务上准确率提升 10%。