Jacky LightBlock Island
AI Notes

How does a model pick its next token?

Give three candidates a probability each and see how one opening can lead to different answers.

Start with “Outside, it’s…”. A language model assigns a score to each candidate token in its vocabulary. A token is a unit of text used by the tokenizer. It can be a whole word or part of one. For this example, all three candidates are written as words.

One choice, up close

Suppose the probabilities are 60% for “raining,” 30% for “snowing,” and 10% for “clearing.” Picking the highest probability always gives “raining.” Sampling from the distribution gives the other two a chance as well.

If the model picks “snowing,” that word joins the input. The next distribution now depends on “Outside, it’s snowing.” An early difference can send the rest of a sentence in a different direction.

Narrow the sample

Sort the candidates by probability and keep the smallest group whose total reaches a chosen threshold. Then rescale the probabilities within that group. At top-p = 0.85, the first two candidates total 0.90, enough to pass the threshold. Their new probabilities are two-thirds and one-third.

These are illustrative numbers. The candidate set is recalculated at each step, so the same threshold can leave one option or many. Holtzman et al., The Curious Case of Neural Text Degeneration