Introduction
Stochastic sampling is a cornerstone of modern Large Language Model (LLM) decoding, enabling the generation of creative and diverse text. However, standard methods like top-$p$ (nucleus sampling) and top-$k$ rely on "auxiliary hyperparameters"—fixed thresholds that must be manually tuned. This paper introduces Entropy Equilibrium Sampling (EES), a principled, hyperparameter-free approach that dynamically adjusts the sampling pool based on the model's internal confidence.
The Challenge of Auxiliary Hyperparameters
Current industry standards are highly sensitive to the model's "temperature" ($\tau$). A $p$-value optimized for $\tau=0.5$ may lead to repetitive outputs at higher temperatures, while a value suited for $\tau=1.0$ might include nonsensical tokens at lower temperatures. This sensitivity forces engineers into costly grid searches to find optimal settings for every model and task.
Entropy Equilibrium Sampling (EES)
EES eliminates manual tuning by finding a "natural" truncation point grounded in information theory. The method identifies an equilibrium between two competing metrics:
- Normalized Entropy ($\bar{H}_k$): Measures the uncertainty or "flatness" of the top $k$ tokens, scaled to a [0, 1] range.
- Probability Mass ($P_k$): The cumulative probability of the top $k$ tokens.
The algorithm expands the candidate set until the Normalized Entropy drops below the Probability Mass ($\bar{H}_k < P_k$). The final truncation point $k^*$ is the largest $k$ where $ar{H}_k \ge P_k$.
When the model is confident, the probability mass accumulates quickly while entropy remains low, resulting in a narrow candidate set. Conversely, when the model is uncertain, the flatter distribution keeps entropy high, allowing for a broader, more diverse set of tokens. The authors provide a formal proof that this equilibrium point $k^*$ is unique and always exists for any valid distribution.
Experimental Evaluation
The researchers benchmarked EES against seven baselines, including top-$p$, top-$k$, and typical sampling, using models such as Qwen2.5 (7B, 32B) and Llama3.1 (8B). Evaluation tasks spanned reasoning (CommonsenseQA, StrategyQA) and open-ended generation (WikiText-103).
Key Insights and Results
- Automatic Robustness: EES maintains stable performance across temperatures from 0.5 to 1.5. In StrategyQA tests, while top-$p$ performance fluctuated by over 5% based on hyperparameter choice, EES remained consistently high.
- Competitive Quality: Despite having zero parameters to tune, EES consistently ranked among the top-performing methods. Human evaluations favored EES for its coherence and ability to avoid the "chatter" of low-probability tokens often seen in poorly tuned top-$p$ setups.
- Efficiency: EES introduces minimal computational overhead, maintaining an $O(|V| \log |V|)$ complexity similar to standard sampling methods.
Conclusion
Entropy Equilibrium Sampling offers a robust "set and forget" solution for LLM decoding. By replacing heuristic thresholds with a self-adjusting mechanism based on entropy-mass equilibrium, it simplifies deployment and ensures high-quality generation across diverse tasks and temperatures. Future work will explore the applicability of EES to multimodal models and cross-lingual generation.
Summary updated