Reproduce “Best-First Beam Search” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Clara Meister, Tim Vieira, Ryan Cotterell

Best-First Beam Search (BFBS) re-conceptualizes beam search as an agenda-based algorithm, significantly accelerating decoding in neural NLP tasks. The method achieves up to 10x faster inference for large beam sizes while provably maintaining the exact same k-optimal solutions as standard beam search for monotonic scoring functions.

Key insights

  • The monotonicity of scoring functions (like log-probabilities) is crucial for efficient best-first search, allowing for provable k-optimality with early pruning and stopping.
  • Re-framing beam search as an A*-like best-first approach can yield substantial speed improvements, especially as beam size increases, by reducing redundant computations.
  • A memory-reduced variant of BFBS, which aggressively prunes active hypotheses, can achieve further speed-ups and, surprisingly, sometimes lead to improved downstream evaluation metrics despite introducing search errors.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.