Artificial Intelligence

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