Papers › Decoding Game: On Minimax Optimality of Heuristic Text Generation Strategies

Decoding Game: On Minimax Optimality of Heuristic Text Generation Strategies

4 Oct 2024arXiv:2410.03968archive 2025-07-28

Sijin Chen, Omar Hagrass, Jason M. Klusowski

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.

PaperPDFCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2410.03968")

Code

Syntology Ran 13 of 14 code samples harvested from 1 repository linked to this paper; 1 has no recorded run. Of those that ran: 13 ran with no contract checked.

By repository: found in paper text by Syntology: 14 samples from 1 repository, 13 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

omar-hagrass/decoding-game found in paper text by Syntology report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

14 samples harvested; 13 ran; 0 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

13ran
1unverified

Licence: 14 of the 14 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from omar-hagrass/decoding-game. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

calc_banned_bad_words_ids omar-hagrass/decoding-game/src/transformers_utils.py found in paper text by Syntology ran no licence file found · pointer only · 0d835437222e1e6d · report
calc_banned_ngram_tokens omar-hagrass/decoding-game/src/transformers_utils.py found in paper text by Syntology ran no licence file found · pointer only · 0cd7c4bac19d0a72 · report
get_default_batch_size omar-hagrass/decoding-game/src/generation_utils.py found in paper text by Syntology ran no licence file found · pointer only · b09e82915aef7777 · report
get_device_from_arg omar-hagrass/decoding-game/src/utils.py found in paper text by Syntology ran no licence file found · pointer only · 97257a99af745347 · report
get_save_filename_from_args omar-hagrass/decoding-game/src/utils.py found in paper text by Syntology ran no licence file found · pointer only · 45247d3017cb5356 · report
get_tokenwise_log_probs_seq omar-hagrass/decoding-game/src/model_utils.py found in paper text by Syntology ran no licence file found · pointer only · 1ec3ed89ec1e6fe0 · report
js_score_1_naive omar-hagrass/decoding-game/src/metrics.py found in paper text by Syntology ran no licence file found · pointer only · 8a290c9c72f2e73a · report
kl omar-hagrass/decoding-game/src/metrics.py found in paper text by Syntology ran fingerprinted no licence file found · pointer only · 13bc3a2c1b6935e2 · report
my_top_k_top_p_filtering omar-hagrass/decoding-game/src/model_utils.py found in paper text by Syntology ran no licence file found · pointer only · 608dc997f8339999 · report
postprocess_next_token_scores omar-hagrass/decoding-game/src/transformers_utils.py found in paper text by Syntology ran no licence file found · pointer only · 1ae24b697c22fe66 · report
reshape_logit_scores omar-hagrass/decoding-game/src/model_utils.py found in paper text by Syntology ran no licence file found · pointer only · 4c1e687ffecb3ee8 · report
sp_score_1 omar-hagrass/decoding-game/src/metrics.py found in paper text by Syntology ran no licence file found · pointer only · 67a0f936fc116fcb · report
split_dataset omar-hagrass/decoding-game/src/utils.py found in paper text by Syntology ran no licence file found · pointer only · 7a47a92a0aa77a70 · report
cluster_feats omar-hagrass/decoding-game/src/mauve_metrics.py found in paper text by Syntology unverified no licence file found · pointer only · 58f653b7d38067cb · report

Tasks

Text Generation

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections