Why it matters

Beam search shapes deterministic decoding. Understanding shapes non-LLM.

Advertisement

The architecture

Maintain K beams.

Extend each by all tokens.

Keep top-K by cumulative log-prob.

Beam search structureK beamscurrent partialsExtend + scoreadd tokenKeep top-Kby log-probFor chat LLMs sampling dominates; beam still useful for translation + summarization
Beam search.
Advertisement

How it works end to end

Length normalization prevents bias.

Diverse beam search variants.

Coverage penalty.