SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.03968 · ICLR · 2025

Decoding Game: On Minimax Optimality of Heuristic Text Generation Strategies

Sijin Chen, Omar Hagrass, Jason Klusowski

arXiv · PDF · Open in the Atlas

Code that ran

13 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 12 failures of our instrument; 1 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2410.03968.json · badge: /api/ran/2410.03968.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
omar-hagrass/decoding-game canonical (classifier label)
classifier basis: census
13 ran · 1 no recorded run
FunctionStatusWhere it lives
calc_banned_bad_words_ids Ran
ran; our contract draft was wrong, not the code
omar-hagrass/decoding-game/src/transformers_utils.py
pointer only (licence: NONE) · get_code("0d835437222e1e6d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

calc_banned_ngram_tokens Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
omar-hagrass/decoding-game/src/transformers_utils.py
pointer only (licence: NONE) · get_code("0cd7c4bac19d0a72")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_default_batch_size Ran
ran, honoured the contract we drafted
omar-hagrass/decoding-game/src/generation_utils.py
pointer only (licence: NONE) · get_code("b09e82915aef7777")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_device_from_arg Ran
ran; our contract draft was wrong, not the code
omar-hagrass/decoding-game/src/utils.py
pointer only (licence: NONE) · get_code("97257a99af745347")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_save_filename_from_args Ran
ran; our contract draft was wrong, not the code
omar-hagrass/decoding-game/src/utils.py
pointer only (licence: NONE) · get_code("45247d3017cb5356")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_tokenwise_log_probs_seq Ran
ran; our contract draft was wrong, not the code
omar-hagrass/decoding-game/src/model_utils.py
pointer only (licence: NONE) · get_code("1ec3ed89ec1e6fe0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

js_score_1_naive Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
omar-hagrass/decoding-game/src/metrics.py
pointer only (licence: NONE) · get_code("8a290c9c72f2e73a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

kl Ran
ran; our contract draft was wrong, not the code
omar-hagrass/decoding-game/src/metrics.py
pointer only (licence: NONE) · get_code("13bc3a2c1b6935e2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

my_top_k_top_p_filtering Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
omar-hagrass/decoding-game/src/model_utils.py
pointer only (licence: NONE) · get_code("608dc997f8339999")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

postprocess_next_token_scores Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
omar-hagrass/decoding-game/src/transformers_utils.py
pointer only (licence: NONE) · get_code("1ae24b697c22fe66")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

reshape_logit_scores Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
omar-hagrass/decoding-game/src/model_utils.py
pointer only (licence: NONE) · get_code("4c1e687ffecb3ee8")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

sp_score_1 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
omar-hagrass/decoding-game/src/metrics.py
pointer only (licence: NONE) · get_code("67a0f936fc116fcb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

split_dataset Ran
ran; our contract draft was wrong, not the code
omar-hagrass/decoding-game/src/utils.py
pointer only (licence: NONE) · get_code("7a47a92a0aa77a70")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

cluster_feats Not yet run
unverified (harvested, no recorded run)
omar-hagrass/decoding-game/src/mauve_metrics.py
pointer only (licence: NONE); the stored copy get_code serves, from krishnap25/mauve-experiments, is pointer only (licence: NONE) · get_code("58f653b7d38067cb")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, omar-hagrass/decoding-game when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 12 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
calc_banned_bad_words_ids 2 other papers
2 dated earlier
1910.13461 (2019-10)
BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension
2109.04096 (2021-09)
A Three-Stage Learning Framework for Low-Resource Knowledge-Grounded Dialogue Generation
cluster_feats 1 other paper
1 dated earlier
2102.01454 (2021-02)
MAUVE: Measuring the Gap Between Neural Text and Human Text using Divergence Frontiers

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2410.03968")
get_code_for_paper("2410.03968")
have("2410.03968")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2410.03968.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2410.03968.svg)](https://syntology.ai/paper/2410.03968)

Connect an agent — have() is free.