A probability is a numerical estimate of how likely an event or outcome is. In language-model generation, every vocabulary token receives a probability for being the next token, even when most tokens are nearly impossible. section 3.2.3 section 3.5
The model does not directly output one word. It produces a probability for every possible next token, then sampling randomly chooses among them according to those probabilities. This controlled randomness explains why the same prompt can produce different answers. section 3.2.3 section 3.5
Probability supports several parts of the generation process:
- Ranks plausible continuations while assigning tiny probabilities to unlikely or nonsensical tokens. section 3.2.3
- Makes weighted random selection possible, balancing predictable text against more varied output. section 3.2.3 section 3.5
- Provides reinforcement-learning systems with information about how probable each generated token was, alongside a quality score. section 5.3.1
“I love to eat”
Food tokens such as “barbeque” and “sushi” receive high probabilities, while a car and the number 42 receive low probabilities. Weighted random selection chooses “tacos,” and generation continues until an end-of-sequence token appears. section 3.2.3
Figure 3.11 We demonstrate text generation by starting with the phrase "I love to eat" and then showing that some possible completions that are foods, such as barbeque and sushi, have high proba-bilities, while a car and the number 42 have low probabilities. Weighted random selection chooses the word tacos. The generation loop is stopped when the EoS token appears.
Use the generation figure to follow probabilities from a partial sentence through weighted selection and stopping at the end-of-sequence token. section 3.2.3















