Next-token prediction trains a model to predict the token following a sequence of preceding tokens. In decoder-only models, causal attention restricts each prediction to prior context. section 3.2
During generation, the model produces one token at a time and feeds its outputs back into the input. This recursive process supports sequences of arbitrary length within the model’s context window. section 3.2
Figure 3.1 Abstracted decoder-only architecture
The decoder-only architecture diagram illustrates how causal attention and autoregressive generation relate to next-token prediction. section 3.2








