AI 101

Beam search

Also known as: beam

Inference

Beam search keeps the top b most-likely partial sequences alive at each step, then returns the best full sequence at the end.

It beats greedy on structured tasks (translation, ASR) but tends to produce overly safe, repetitive text for open generation.

  • b = 1 → greedy.
  • b > 1 → explores a few paths, picks the best.

Where it fits: great for tasks with a clear "correct" output. For chat and creative text, sampling usually wins.