next-token prediction
At each step, the model looks at all the text so far and predicts the single most likely next piece — usually not a whole word but a token, a chunk like to, ken, or a punctuation mark. It then adds that token to the text and repeats, one token at a time, until it decides to stop. Watching a chatbot type word by word is literally this loop running.
The prediction is a probability distribution: the model assigns a score to every possible next token in its vocabulary, and then one is chosen — sometimes the top pick, sometimes a slightly more surprising one for variety. Everything an LLM does, from answering questions to writing code, is this same next-token guess repeated thousands of times.
The model estimates the probability of the next token given all the previous ones.