Improving Diversity in Language Models: When Temperature Fails, Change the Loss

Alexandre Verine, Florian Le Bronnec, Kunhao Zheng, Alexandre Allauzen, Yann Chevaleyre, Benjamin Negrevergne
Proceedings of the 42nd International Conference on Machine Learning, PMLR 267:61266-61300, 2025.

Abstract

Increasing diversity in language models is a challenging yet essential objective. A common approach is to raise the decoding temperature. In this work, we investigate this approach through a simplistic yet common case to provide insights into why decreasing temperature can improve quality (Precision), while increasing it often fails to boost coverage (Recall). Our analysis reveals that for a model to be effectively tunable through temperature adjustments, it must be trained toward coverage. To address this, we propose rethinking loss functions in language models by leveraging the Precision-Recall framework. Our results demonstrate that this approach achieves a substantially better trade-off between Precision and Recall than merely combining negative log-likelihood training with temperature scaling. These findings offer a pathway toward more versatile and robust language modeling techniques.

Cite this Paper


BibTeX
@InProceedings{pmlr-v267-verine25a, title = {Improving Diversity in Language Models: When Temperature Fails, Change the Loss}, author = {Verine, Alexandre and Le Bronnec, Florian and Zheng, Kunhao and Allauzen, Alexandre and Chevaleyre, Yann and Negrevergne, Benjamin}, booktitle = {Proceedings of the 42nd International Conference on Machine Learning}, pages = {61266--61300}, year = {2025}, editor = {Singh, Aarti and Fazel, Maryam and Hsu, Daniel and Lacoste-Julien, Simon and Berkenkamp, Felix and Maharaj, Tegan and Wagstaff, Kiri and Zhu, Jerry}, volume = {267}, series = {Proceedings of Machine Learning Research}, month = {13--19 Jul}, publisher = {PMLR}, pdf = {https://raw.githubusercontent.com/mlresearch/v267/main/assets/verine25a/verine25a.pdf}, url = {https://proceedings.mlr.press/v267/verine25a.html}, abstract = {Increasing diversity in language models is a challenging yet essential objective. A common approach is to raise the decoding temperature. In this work, we investigate this approach through a simplistic yet common case to provide insights into why decreasing temperature can improve quality (Precision), while increasing it often fails to boost coverage (Recall). Our analysis reveals that for a model to be effectively tunable through temperature adjustments, it must be trained toward coverage. To address this, we propose rethinking loss functions in language models by leveraging the Precision-Recall framework. Our results demonstrate that this approach achieves a substantially better trade-off between Precision and Recall than merely combining negative log-likelihood training with temperature scaling. These findings offer a pathway toward more versatile and robust language modeling techniques.} }
Endnote
%0 Conference Paper %T Improving Diversity in Language Models: When Temperature Fails, Change the Loss %A Alexandre Verine %A Florian Le Bronnec %A Kunhao Zheng %A Alexandre Allauzen %A Yann Chevaleyre %A Benjamin Negrevergne %B Proceedings of the 42nd International Conference on Machine Learning %C Proceedings of Machine Learning Research %D 2025 %E Aarti Singh %E Maryam Fazel %E Daniel Hsu %E Simon Lacoste-Julien %E Felix Berkenkamp %E Tegan Maharaj %E Kiri Wagstaff %E Jerry Zhu %F pmlr-v267-verine25a %I PMLR %P 61266--61300 %U https://proceedings.mlr.press/v267/verine25a.html %V 267 %X Increasing diversity in language models is a challenging yet essential objective. A common approach is to raise the decoding temperature. In this work, we investigate this approach through a simplistic yet common case to provide insights into why decreasing temperature can improve quality (Precision), while increasing it often fails to boost coverage (Recall). Our analysis reveals that for a model to be effectively tunable through temperature adjustments, it must be trained toward coverage. To address this, we propose rethinking loss functions in language models by leveraging the Precision-Recall framework. Our results demonstrate that this approach achieves a substantially better trade-off between Precision and Recall than merely combining negative log-likelihood training with temperature scaling. These findings offer a pathway toward more versatile and robust language modeling techniques.
APA
Verine, A., Le Bronnec, F., Zheng, K., Allauzen, A., Chevaleyre, Y. & Negrevergne, B.. (2025). Improving Diversity in Language Models: When Temperature Fails, Change the Loss. Proceedings of the 42nd International Conference on Machine Learning, in Proceedings of Machine Learning Research 267:61266-61300 Available from https://proceedings.mlr.press/v267/verine25a.html.

Related Material