Beam Search
A search algorithm used in text generation that explores multiple possible output sequences simultaneously, keeping the top-scoring candidates at each step. It finds higher-quality outputs than greedy decoding.
Why It Matters
Beam search produces more fluent and globally optimal text generation, especially important for translation, summarization, and any task where sentence-level quality matters.
Example
With beam width 5, the model tracks the 5 best partial sentences at each step, eventually selecting the complete sentence with the highest overall probability.
Think of it like...
Like planning a road trip by considering the top 5 routes at each intersection rather than always turning onto the most obvious road — you find better overall paths.
Related Terms
Greedy Decoding
A simple text generation strategy where the model always selects the most probable next token at each step. It is fast but can produce repetitive or suboptimal outputs.
Sequence-to-Sequence
A model architecture that transforms one sequence into another, where the input and output can be different lengths. It uses an encoder to process input and a decoder to generate output.