At each step it expands candidates, accumulates sequence scores, and retains the best beam according to a ranking rule. It can improve constrained sequence tasks but increases computation and may favor generic text without length handling.
Beam search keeps several high-scoring partial sequences while decoding instead of committing to one token path.
At each step it expands candidates, accumulates sequence scores, and retains the best beam according to a ranking rule. It can improve constrained sequence tasks but increases computation and may favor generic text without length handling.