Beam Search — AI Glossary

Beam search is a decoding strategy that explores multiple candidate output sequences simultaneously during text generation, keeping the top-k most probable sequences (the "beam width") at each step. Unlike greedy decoding which always picks the single highest-probability token, beam search considers that a lower-probability token at one step might lead to a better overall sequence.