A language model hands you a probability for every next token. Decoding is what turns that into one token, and it is decided after training. Move the three sliders and watch the same model behave very differently. Every number comes from decoding.py, so you can check it against the chapter.
what the model says what is left after your settings
A tiny model with a three-word tree. Slide the beam width and see which three-word sentence it returns.
| rank | sequence | probability |
|---|
Width 1 is greedy: it takes the at 0.40 over a at 0.35 and never sees that a leads to bird and then sang.
This is the first half of Steering LLMs: Decoding and Prompting. Run decoding.py to print the same tables as text.