Temperature Scaling in Discrete Sequence (Language) Models

Hannah Scheufele, Peter Blohm, Vikas K Garg
Proceedings of the 43rd International Conference on Machine Learning, PMLR 306:108163-108176, 2026.

Abstract

Temperature scaling (TS) is widely used to control generation behavior in discrete sequence models. However, TS at the sequence level is challenging as the needed partition function is typically intractable and naive token-wise TS induces bias. Discrete diffusion settings exacerbate this issue: enhanced flexibility due to multiple potential orderings for generating tokens complicates likelihood computation and incurs high variance. We propose and investigate fine-tuning objectives for sequence-level TS, along with metrics to quantify the success of a given TS procedure. Specifically, our contributions are threefold. First, we introduce our objective across a wide class of sequence models through a unifying formalism. Second, we design two metrics that quantify TS based on likelihood ratios and thus obviate access to the partition function. Finally, we introduce fine-tuning objectives that reliably achieve the desired change in model temperature. Our experiments with language models (GPT2, BD3LM) show that the proposed approach leads to more consistent generation with lower Negative Log-Likelihood (NLL). Furthermore, we provide empirical evidence that it can enhance the reasoning performance in language models. Code is available at github.com/Aalto-QuML/temp_lm.

Cite this Paper


BibTeX
@InProceedings{pmlr-v306-scheufele26a, title = {Temperature Scaling in Discrete Sequence ({L}anguage) Models}, author = {Scheufele, Hannah and Blohm, Peter and Garg, Vikas K}, booktitle = {Proceedings of the 43rd International Conference on Machine Learning}, pages = {108163--108176}, year = {2026}, editor = {Zhang, Tong and Dudik, Miroslav and Jaggi, Martin and Agarwal, Alekh and Li, Sharon and Schuurmans, Dale and Zhu, Jerry and Berkenkamp, Felix and Dong, Hanze and Bietti, Alberto}, volume = {306}, series = {Proceedings of Machine Learning Research}, month = {06--11 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v306/main/assets/scheufele26a/scheufele26a.pdf}, url = {https://proceedings.mlr.press/v306/scheufele26a.html}, abstract = {Temperature scaling (TS) is widely used to control generation behavior in discrete sequence models. However, TS at the sequence level is challenging as the needed partition function is typically intractable and naive token-wise TS induces bias. Discrete diffusion settings exacerbate this issue: enhanced flexibility due to multiple potential orderings for generating tokens complicates likelihood computation and incurs high variance. We propose and investigate fine-tuning objectives for sequence-level TS, along with metrics to quantify the success of a given TS procedure. Specifically, our contributions are threefold. First, we introduce our objective across a wide class of sequence models through a unifying formalism. Second, we design two metrics that quantify TS based on likelihood ratios and thus obviate access to the partition function. Finally, we introduce fine-tuning objectives that reliably achieve the desired change in model temperature. Our experiments with language models (GPT2, BD3LM) show that the proposed approach leads to more consistent generation with lower Negative Log-Likelihood (NLL). Furthermore, we provide empirical evidence that it can enhance the reasoning performance in language models. Code is available at github.com/Aalto-QuML/temp_lm.} }
Endnote
%0 Conference Paper %T Temperature Scaling in Discrete Sequence (Language) Models %A Hannah Scheufele %A Peter Blohm %A Vikas K Garg %B Proceedings of the 43rd International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2026 %E Tong Zhang %E Miroslav Dudik %E Martin Jaggi %E Alekh Agarwal %E Sharon Li %E Dale Schuurmans %E Jerry Zhu %E Felix Berkenkamp %E Hanze Dong %E Alberto Bietti %F pmlr-v306-scheufele26a %I PMLR %P 108163--108176 %U https://proceedings.mlr.press/v306/scheufele26a.html %V 306 %X Temperature scaling (TS) is widely used to control generation behavior in discrete sequence models. However, TS at the sequence level is challenging as the needed partition function is typically intractable and naive token-wise TS induces bias. Discrete diffusion settings exacerbate this issue: enhanced flexibility due to multiple potential orderings for generating tokens complicates likelihood computation and incurs high variance. We propose and investigate fine-tuning objectives for sequence-level TS, along with metrics to quantify the success of a given TS procedure. Specifically, our contributions are threefold. First, we introduce our objective across a wide class of sequence models through a unifying formalism. Second, we design two metrics that quantify TS based on likelihood ratios and thus obviate access to the partition function. Finally, we introduce fine-tuning objectives that reliably achieve the desired change in model temperature. Our experiments with language models (GPT2, BD3LM) show that the proposed approach leads to more consistent generation with lower Negative Log-Likelihood (NLL). Furthermore, we provide empirical evidence that it can enhance the reasoning performance in language models. Code is available at github.com/Aalto-QuML/temp_lm.
APA
Scheufele, H., Blohm, P. & Garg, V.K.. (2026). Temperature Scaling in Discrete Sequence (Language) Models. Proceedings of the 43rd International Conference on Machine Learning, in Proceedings of Machine Learning Research 306:108163-108176 Available from https://proceedings.mlr.press/v306/scheufele26a.html.

Related Material