Next-token prediction trains a language model to continue a sequence by estimating what token should come next. The token might be a word, part of a word, or punctuation. section 1.21
A simple training example
Given “Better safe than,” the desired next token is “sorry.” Given “The Eiffel,” it is “Tower.” Existing sentences can be subdivided this way to create many training examples without manually labeling each one. section 1.27
The model does not produce one certain answer internally. After processing the preceding context, it assigns a probability to every token in its vocabulary. Those probabilities form an output vector whose values add to 1. A wrapper then selects the next token, either by choosing the highest-probability option or by using another selection method that allows more adventurous output. section 1.21
This objective is powerful because language sequences contain examples of many activities, including translation and summarization. It is not the same as following instructions helpfully and safely, however. A model optimized to continue internet text can still invent facts, produce biased or toxic text, or ignore instructions. section 1.28
Table 1.1 In the last step, the LLM assigns a probability value
for each possible token in the vocabulary. All the values add to 1.
| 0.01 |
0.0 |
0.05 |
… |
0.8 |
… |
| “a” |
“b” |
“c” |
“audible” |
Use the probability table to see how every possible next token receives a value, rather than treating prediction as a single fixed guess. section 1.21
