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

Wouter Kool, Herke van Hoof, Max Welling
3/14/2019
cs.LGstat.ML

Official code: wouterkool/stochastic-beam-search (105 stars, last commit 2019-05-13).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

Implementation of Stochastic Beam Search using Fairseq

1056C++, LuaMay 13, 20197 years agoNOASSERTION

Similar Papers

Cite this paper

@article{kool2019stochastic,
  title  = {Stochastic Beams and Where to Find Them: The Gumbel-Top-k Trick for Sampling Sequences Without Replacement},
  author = {Wouter Kool and Herke van Hoof and Max Welling},
  year   = {2019},
  eprint = {1903.06059},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1903.06059}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1903.06059.svg)](https://codeofpaper.com/paper/1903.06059)

Discussion