AI & LLMs

Beam Search

Decoding that keeps the k best partial sequences instead of one — search, not sampling.

Beam search expands the k highest-scoring partial sequences at each step and keeps the best continuations, approximating the most-likely overall sequence. It shines where there is a right answer (translation, speech) and underwhelms in open-ended generation, where it produces bland, repetitive text — which is why chat models sample with temperature/top-p instead.