Skip to main content

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 (the 'beam') at each step, resulting in higher-quality but slower output than greedy generation.

Explain like I'm 12

Instead of picking one next word and moving forward (like following one path in a maze), beam search explores several paths at once and keeps the most promising ones. This helps find better sentences but takes more time.

In context

Example: With beam width=3, the AI generates 3 different versions of the text at each step and keeps developing the 3 best. Used in translation, summarization, and when quality matters more than speed. Most chatbots don't use beam search because it's slower.

See also