Case Study

Why a beam-search run can miss the best-scoring result

Scenario: A team is generating short product descriptions with a sequence model. They use beam search to rank partial outputs by an internal score, G(x). The search keeps a fixed-width set of partial sequences at each step. In testing, the final text is acceptable but not the highest-scoring sequence the model could have produced.

Prompt: Explain why the search procedure can return a non-best result and name the setting that controls how many partial sequences survive each step.

Model response: Beam search makes a speed-versus-completeness tradeoff. Because it examines only a limited frontier instead of every possible sequence, it can discard the branch that would have led to the highest score. The setting that controls this is the beam width; only that many partial candidates are retained at each expansion.

What to remember:

  • Beam search is an approximate method, so the top-scoring sequence is not guaranteed.
  • Beam width determines how many candidates remain under consideration at each step.

Rubric:

  1. The student says the method is approximate and may miss the global best score.
  2. The student identifies beam width as the limiter on surviving candidates.

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