[Paper Review] EDT: Improving Large Language Models' Generation by Entropy-based Dynamic Temperature Sampling
This paper proposes Entropy-based Dynamic Temperature (EDT), a novel sampling strategy that dynamically adjusts the temperature parameter in large language model (LLM) decoding based on the entropy of the current token distribution. By adapting temperature to the model's uncertainty, EDT improves both generation quality and diversity, outperforming fixed and other dynamic temperature methods across multiple benchmarks with minimal computational overhead.
Recently, Large Language Models (LLMs) have demonstrated outstanding performance across a wide range of downstream language tasks. Temperature sampling is a commonly used decoding strategy for LLMs' generation process. However, a fixed temperature parameter is used in most cases, which may not always be an optimal choice for balancing generation quality and diversity. In this paper, we propose an effective Entropy-based Dynamic Temperature (EDT) Sampling method, to achieve a more balanced performance in terms of both generation quality and diversity by dynamically selecting the temperature parameter. Additionally, we also show model performance and comprehensive analyses for 4 different generation benchmarks. Our experiments show that EDT significantly outperforms the existing strategies across different tasks.
Motivation & Objective
- To address the limitations of fixed temperature sampling in balancing generation quality and diversity across diverse NLP tasks.
- To develop a lightweight, task-agnostic dynamic temperature strategy that adapts to the model's confidence during decoding.
- To empirically validate that entropy-based temperature adjustment leads to superior performance compared to existing dynamic and fixed strategies.
- To provide comprehensive analysis of temperature's impact on LLM decoding behavior and generation outcomes.
- To inspire future research on learnable, adaptive decoding mechanisms for LLMs.
Proposed method
- EDT dynamically sets the temperature at each decoding step using the entropy of the current token probability distribution.
- The temperature is calculated as $ T = T_0 \cdot \theta^{\text{entropy}(p_t)} $, where $ T_0 $ controls the range and $ \theta $ controls sensitivity to entropy.
- Lower entropy (higher confidence) leads to lower temperature, favoring more focused, high-quality generations.
- Higher entropy (lower confidence) leads to higher temperature, increasing diversity and exploration.
- The method is applied during autoregressive decoding without modifying the model architecture or requiring additional training.
- The approach is evaluated using composite metrics like EDA and EDA_range, combining quality and diversity.
Experimental results
Research questions
- RQ1Can dynamic temperature sampling based on entropy improve the balance between generation quality and diversity in LLMs?
- RQ2How does the performance of EDT compare to fixed temperature and other dynamic temperature strategies across diverse NLG tasks?
- RQ3What is the impact of hyperparameters $ T_0 $ and $ \theta $ on EDT's effectiveness and robustness?
- RQ4Does EDT reduce redundancy in generated outputs while maintaining or improving factual consistency and fluency?
- RQ5Can entropy-based temperature adjustment serve as a general-purpose, lightweight decoding strategy across multiple language generation tasks?
Key findings
- EDT significantly outperformed fixed temperature sampling on the MS MARCO question-answering benchmark, achieving an EDA score of 12.15 compared to 12.44 for fixed temperature.
- EDT achieved a 17.7% reduction in EDA_range (from 35.82 to 29.49), indicating better diversity control and reduced redundancy.
- On the XLSum summarization dataset, EDT-generated outputs were more succinct and accurate, achieving a higher ROUGE-L F1 score while maintaining similar self-BLEU scores.
- The ablation study showed that optimal hyperparameters $ T_0 $ and $ \theta $ are crucial: setting $ \theta = 0.5 $ and $ T_0 = 0.5 $ yielded the best performance on MS MARCO.
- EDT incurred nearly zero computational cost and saved approximately half the GPU memory compared to other dynamic temperature methods.
- Case studies confirmed that EDT reduces redundant background information, producing more concise and meaningful outputs than UDT and fixed temperature baselines.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.