How a Model Picks Its Next Word
Throwing Away the Worst Options
Last timeOne Knob on the Scores
The tail of the distribution holds almost no probability and almost every token. Sampling without removing it is the main reason generated text goes wrong, and there are two standard ways to cut.
Sampling from the model's distribution exactly as it stands sounds like the
honest thing to do. It produces noticeably worse text than sampling from a
truncated version, and the reason is a matter of arithmetic rather than taste.
The tail is visited more often than it looks
Suppose the bottom of the distribution holds eight percent of the mass, spread
across fifty thousand tokens that would each be wrong here. Each step, the
chance of drawing one of them is small. Over a paragraph, it is not.
Note what makes this bad rather than merely random. The token drawn is not a
reasonable alternative that happened to be less likely. It is one of fifty
thousand tokens the model placed at the very bottom, so the text now contains
something the model itself considered close to impossible, and every subsequent
step is conditioned on it.
The lesson stops here
5 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