Decoding Game: On Minimax Optimality of Heuristic Text Generation Strategies
Sijin Chen, Omar Hagrass, Jason M. Klusowski
TL;DR
Decoding strategies for open-ended text generation exhibit a gap between MAP-like likelihood maximization and practical, diverse outputs. The authors formulate Decoding Game, a two-player zero-sum framework where Strategist seeks high true-distribution log-likelihood and Nature adversarially perturbs the distribution within a TV budget around the model, yielding a minimax objective $\max_{\mathbb{Q}}\min_{\mathbb{P}\in N(\widehat{\mathbb{P}})} \mathbb{E}_{\mathbb{Q}}[\log\mathbb{P}(X_1,\dots,X_T|X_0)]$. They derive that Nature induces an $\ell_\infty$-type regularization on the log-likelihood and show tail truncation-normalization as a first-order optimal strategy (with precise per-step conditions and thresholds), while also generalizing to other objective functions that recover temperature-based methods. The framework unifies and justifies popular heuristic sampling strategies and introduces Game sampling, which demonstrates competitive or superior open-ended generation performance across several models. Overall, the work provides a rigorous, minimal-assumption theory for decoding strategy design with practical, testable implications for robust text generation.
Abstract
Decoding strategies play a pivotal role in text generation for modern language models, yet a puzzling gap divides theory and practice. Surprisingly, strategies that should intuitively be optimal, such as Maximum a Posteriori (MAP), often perform poorly in practice. Meanwhile, popular heuristic approaches like Top-$k$ and Nucleus sampling, which employ truncation and normalization of the conditional next-token probabilities, have achieved great empirical success but lack theoretical justifications. In this paper, we propose Decoding Game, a comprehensive theoretical framework which reimagines text generation as a two-player zero-sum game between Strategist, who seeks to produce text credible in the true distribution, and Nature, who distorts the true distribution adversarially. After discussing the decomposibility of multi-step generation, we derive the optimal strategy in closed form for one-step Decoding Game. It is shown that the adversarial Nature imposes an implicit regularization on likelihood maximization, and truncation-normalization methods are first-order approximations to the optimal strategy under this regularization. Additionally, by generalizing the objective and parameters of Decoding Game, near-optimal strategies encompass diverse methods such as greedy search, temperature scaling, and hybrids thereof. Numerical experiments are conducted to complement our theoretical analysis.
