Autoregressive Generation

A next-token model predicts one step ahead. To produce a response, we choose a token, append it to the existing text, and ask the model to predict again with that new context.

10 sections · 9 questions · 4 coding challenges

1 / 10

How Does One Prediction Become a Whole Passage?

BOTIE

A model that predicts the next token produces only one distribution at a time. To write a passage, we need to decide what happens after that prediction. The token we select becomes part of the context for the following decision.

Autoregressive sequence modelling predates today's large language models. GPT-2, described by Radford and colleagues in 2019, is a familiar application: a Transformer language model trained to predict text from its preceding context could continue supplied passages and perform tasks expressed through that context.

Generation repeats a short procedure. Read the available context, calculate next-token probabilities, choose a token, append it, and continue until a stopping condition is reached. Every choice changes the input to later predictions. This explains both the flexibility and a weakness of the procedure: an early mistake can become context that later tokens elaborate rather than correct.

Sources for this history