KL-Divergence Guided Temperature Sampling

Chung-Ching Chang, David Reitter, Renat Aksitov, Yun-Hsuan Sung
6/2/2023
cs.CLcs.AI

No official code found. Best implementation: google-research/google-research (39,000 stars, Apache-2.0, last commit 2026-04-30).

Abstract

Temperature sampling is a conventional approach to diversify large language model predictions. As temperature increases, the prediction becomes diverse but also vulnerable to hallucinations -- generating tokens that are sensible but not factual. One common approach to mitigate hallucinations is to provide source/grounding documents and the model is trained to produce predictions that bind to and are attributable to the provided source. It appears that there is a trade-off between diversity and attribution. To mitigate any such trade-off, we propose to relax the constraint of having a fixed temperature over decoding steps, and a mechanism to guide the dynamic temperature according to its relevance to the source through KL-divergence. Our experiments justifies the trade-off, and shows that our sampling algorithm outperforms the conventional top-k and top-p algorithms in conversational question-answering and summarization tasks.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Google Research

39,0008,488C, ROct 4, 20185 months agoApache-2.0
aimachine-learningresearch

Similar Papers

Cite this paper

@article{chang2023kldivergence,
  title  = {KL-Divergence Guided Temperature Sampling},
  author = {Chung-Ching Chang and David Reitter and Renat Aksitov and Yun-Hsuan Sung},
  year   = {2023},
  eprint = {2306.01286},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.01286v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2306.01286.svg)](https://codeofpaper.com/paper/2306.01286)

Discussion