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.

Level: intermediateTopic: Transformers LLM architecture

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

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.