AI engineering glossary · Transformers LLM architecture
What is beam search?
Beam search: A decoding method that keeps the several most probable partial sequences at each step, called the beam, extends each, and keeps the best again, finally returning the highest-scoring sequence. It explores more than greedy decoding and suits translation, but tends to be bland for open-ended chat.
Beam search: an example
With beam width 4, the decoder tracks 4 candidate sentences at each step instead of 1.
Related terms
More Transformers LLM architecture terms
- BERT
- Bidirectional attention
- BigBird
- Capacity factor
- Causal masking
- Constrained decoding
- Context window
- Contrastive decoding
Where you learn it
Beam search is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.