Best-First Beam Search

Clara Meister, Tim Vieira, Ryan Cotterell
7/8/2020
cs.CLcs.DS

Official code: rycolab/bfbs (16 stars, Python, last commit 2020-08-20).

Abstract

Decoding for many NLP tasks requires an effective heuristic algorithm for approximating exact search since the problem of searching the full output space is often intractable, or impractical in many settings. The default algorithm for this job is beam search -- a pruned version of breadth-first search.

Show full abstract

Quite surprisingly, beam search often returns better results than exact inference due to beneficial search bias for NLP tasks. In this work, we show that the standard implementation of beam search can be made up to 10x faster in practice. Our method assumes that the scoring function is monotonic in the sequence length, which allows us to safely prune hypotheses that cannot be in the final set of hypotheses early on. We devise effective monotonic approximations to popular nonmonontic scoring functions, including length normalization and mutual information decoding. Lastly, we propose a memory-reduced variant of Best-First Beam Search, which has a similar beneficial search bias in terms of downstream performance, but runs in a fraction of the time.

View on arXivView PDF

Code Implementations(1)

rycolab/bfbsOfficial100%
163Python, PerlAug 18, 20206 years ago

Similar Papers

Cite this paper

@article{meister2020bestfirst,
  title  = {Best-First Beam Search},
  author = {Clara Meister and Tim Vieira and Ryan Cotterell},
  year   = {2020},
  eprint = {2007.03909},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2007.03909}
}

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/2007.03909.svg)](https://codeofpaper.com/paper/2007.03909)

Discussion