Skip to main content
BETAThis is a new design — give feedback

Beam Search

Also known as: Beam Width, Search Algorithm

In one sentence

A text generation strategy where the AI explores multiple possible word sequences simultaneously and keeps the best few at each step, resulting in higher-quality but slower output than greedy generation.

Explain like I'm 12

Imagine you're solving a maze. Instead of always going left (greedy), you explore three paths at once and keep the most promising ones. Beam search does this with words, finding better sentences by keeping multiple options open.

In context

With beam width set to 3, the AI generates three different continuations at each step and scores them by probability. It keeps developing only the top three sequences and discards the rest. This produces more coherent and natural-sounding text than greedy decoding, which just picks the single most likely next word. Beam search is commonly used in machine translation (like Google Translate) and text summarisation, where output quality matters more than speed. Most real-time chatbots use sampling methods instead because beam search is slower.

See also