FrontierAI.Engineer
LLM Core & Architecture

Beam Search

Beam search is a decoding algorithm that maintains a fixed number of candidate sequences — the beam width — expanding each by all vocabulary tokens at every step and keeping only the top candidates by cumulative log-probability. Wider beams explore more of the generation space and often produce higher-likelihood sequences than greedy decoding, at the cost of proportionally more compute per step. Beam search is common in machine translation but less so in open-ended generation, where diversity is valued.