Papers › Stochastic Beams and Where to Find Them: The Gumbel-Top-k Trick for Sampling Sequences...

Stochastic Beams and Where to Find Them: The Gumbel-Top-k Trick for Sampling Sequences Without Replacement

14 Mar 2019arXiv:1903.06059archive 2025-07-28

Wouter Kool, Herke van Hoof, Max Welling

The well-known Gumbel-Max trick for sampling from a categorical distribution can be extended to sample k elements without replacement. We show how to implicitly apply this 'Gumbel-Top-k' trick on a factorized distribution over sequences, allowing to draw exact samples without replacement using a Stochastic Beam Search. Even for exponentially large domains, the number of model evaluations grows only linear in k and the maximum sampled sequence length. The algorithm creates a theoretical connection between sampling and (deterministic) beam search and can be used as a principled intermediate alternative. In a translation task, the proposed method compares favourably against alternatives to obtain diverse yet good quality translations. We show that sequences sampled without replacement can be used to construct low-variance estimators for expected sentence-level BLEU score and model entropy.

PaperPDFCodeCode 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="1903.06059")

Code

Syntology Ran 5 of 17 code samples harvested from 2 repositories linked to this paper; 12 have no recorded run. Of those that ran: 2 ran · honoured contract; 1 ran · violated contract; 2 ran · our draft was wrong.

By repository: community (archive-listed): 17 samples from 2 repositories, 5 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

wouterkool/stochastic-beam-search officialmentioned in papermentioned on GitHubpytorchNOASSERTION report
manueldeprada/decoders mentioned on GitHubpytorchApache-2.0 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

17 samples harvested; 5 ran; 2 honoured the contract we drafted; 12 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · honoured contract
1ran · violated contract
2ran · our draft was wrong
12unverified

Licence: 17 of the 17 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 2 repositories linked to this paper, official or community; each sample names its own and says which. “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.

drop_blocks evanthebouncy/stoicastic_beam/env.py community (archive-listed) ran · violated contract fingerprinted no licence file found · pointer only · 8409b65e19e7556b · report
get_bigram evanthebouncy/stoicastic_beam/policy.py community (archive-listed) ran · our draft was wrong no licence file found · pointer only · 698bb1dd63143c23 · report
get_spec evanthebouncy/stoicastic_beam/env.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · c27e7c7d0429cf3a · report
random_rollout evanthebouncy/stoicastic_beam/inference.py community (archive-listed) ran · honoured contract no licence file found · pointer only · e7f3eac1d9074f71 · report
sample_program evanthebouncy/stoicastic_beam/env.py community (archive-listed) ran · our draft was wrong fingerprinted no licence file found · pointer only · 48fbdb9b7b3a7e1a · report
batched_bin_vec_to_decimal manueldeprada/decoders/src/decoders/binary_transformer.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 7d28841f30ab263f · report
beam_k evanthebouncy/stoicastic_beam/inference.py community (archive-listed) unverified no licence file found · pointer only · 382342955f67f3f5 · report
compute_logprobs_from_scores manueldeprada/decoders/src/decoders/toolbox.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 5318e71a079395fc · report
compute_transition_scores_nonbeam manueldeprada/decoders/src/decoders/toolbox.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 887fa7fd3a8a0e90 · report
compute_true_logprobs manueldeprada/decoders/src/decoders/toolbox.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · a42599a4d43260f4 · report
decimal_to_bin_vec manueldeprada/decoders/src/decoders/binary_transformer.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 5a227174a2c67965 · report
f_experiment manueldeprada/decoders/src/decoders/small_prob_transformer.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · cb389fa56b7724b7 · report
get_binary_completions manueldeprada/decoders/src/decoders/binary_transformer.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 42dff7fcdf075def · report
pad_tensors manueldeprada/decoders/src/decoders/simple/simple_beam_utils.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · e2f7ccfbe5b7cadd · report
random_rollout_k evanthebouncy/stoicastic_beam/inference.py community (archive-listed) unverified no licence file found · pointer only · f7417c6b895e0503 · report
route2length manueldeprada/decoders/src/decoders/small_prob_transformer.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 14699971d77c31de · report
stack_model_outputs manueldeprada/decoders/src/decoders/strategies/beam_decoder.py community (archive-listed) unverified Apache-2.0 recorded; this copy not marked cleared · pointer only · 2644babce129f019 · report

Tasks

SentenceTranslation

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