← Back to Glossary
Greedy Decoding vs. Beam Search
Phase 02 · LLM Fundamentalstechnique

Decoding strategies where greedy picks the single top word each step, while beam search keeps multiple candidate paths active.

Why it exists

Picking the best single word at step 1 can lead to a suboptimal overall sentence. Beam search explores multiple multi-word candidate paths.

How it works

Greedy decoding picks top probability token at each step. Beam search maintains N candidate beams in parallel, scoring full sequence probabilities.

Where you'll use this