Skip to content

deployment

Beam Search

A search algorithm for text generation that maintains multiple candidate sequences (beams) simultaneously and selects the most probable complete sequence. Beam search produces more coherent text than greedy decoding but is slower.

In practice

With beam width 5, the model explores 5 parallel sequence candidates at each step and keeps the 5 highest-scoring ones.