How a Model Picks Its Next Word
Two Different Questions
Last timeWhat the Model Actually Hands You
Taking the best token at every step answers one question, and finding the best sequence answers another. They have different answers, and the gap between them is where search algorithms live.
There are two questions that sound like the same question. Which token is most
likely here, and which continuation is most likely overall. Answering the first
one repeatedly does not answer the second.
A case where greedy loses
Take two tokens available at the first step, and look at what each makes
possible at the second.
| step | first step | second step | probability of the pair | what happened |
|---|---|---|---|---|
| 1 | 0.6 | 0.3 | 0.18 | What greedy produces. It wins the first step and loses the product. |
| 2 | 0.4 | 0.8 | 0.32 | The better sequence, which greedy never sees, because it discarded B before the second step existed. |
The condition for greedy to be right at this step is simple enough to write
down, and it involves a quantity greedy does not have access to.
The lesson stops here
7 more paragraphs to go
You have read the opening. The rest of the argument, the problems that check whether it landed, and the lines worth keeping at the end all come with a plan.
The first lesson of every course in the library reads the whole way through, free, so you can see exactly what the rest of them are.
See the planThe contentsThis is the reading half
Starting the course gives you your own copy of it. Every idea on every page has problems standing under it, marked with a reason rather than a tick, and any sentence you do not believe can be opened and argued with. None of that can happen on a page nobody owns.
The contents