Essay

Why beam search is useful but not exact during decoding

Question: Explain why beam search is used to approximate the best output during inference and why it can still miss the true highest-scoring result.

Sample answer: Beam search is a heuristic search method for decoding. At each step, it keeps only the B most promising partial candidates according to a scoring function such as J(z), instead of expanding every possible continuation. Because some options are pruned early, the search may never examine the globally best complete output, so beam search is not guaranteed to return the score-maximizing result.

Key points:

  • Beam search is a heuristic, approximate search method used during inference.
  • It retains only the B highest-scoring partial candidates at each step.
  • Because it prunes alternatives, it may miss the global maximum.

Rubric: The response should identify beam search as approximate search, explain that it keeps only the top B candidates during expansion, and state that this pruning means the optimum is not guaranteed.

0

1

Updated 2026-08-12

Contributors are:

Who are from:

Tags

Machine Learning

Deep Learning

Supervised Learning

Dive into Deep Learning @ D2L

Data Science

Machine Learning Strategy

Machine Learning Yearning @ DeepLearning.AI