Greedy decoding always picks the single highest-probability token at each step, which can miss better overall sequences. Beam search maintains B candidate sequences simultaneously, pruning to the top-B at each step by cumulative log-probability. This demo shows the full generation tree, making it clear why beam=1 equals greedy and wider beams find better sequences.
Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.