Self-supervised learning trains a model without human-provided labels by deriving targets from the input data itself. In LLM pretraining, the next word becomes the label for the preceding sequence, allowing training on massive unlabeled text collections. section 1.3 section 1.6
The GPT pretraining workflow connects self-supervision to the model pipeline:
- Prepare large amounts of raw text, with filtering such as removing formatting characters or documents in unknown languages. section 1.3
- Use each sequence to create training pairs: preceding words provide the input, and the upcoming word provides the target. section 1.6
- Train a decoder-style GPT model autoregressively, predicting one word at a time from the words that precede it. section 1.6
- Continue with supervised fine-tuning when task-specific labeled data, instruction-answer pairs, or class labels are available. section 1.3
Next-word prediction
Given a sentence prefix, the model predicts the next word. Repeating this task across large text datasets teaches patterns in how words and phrases fit together, producing a pretrained model that can later support text completion, spelling correction, classification, and translation. section 1.6 section 1.3
Figure 1.7 In the next-word prediction pretraining task for GPT models, the system learns to predict the upcoming word in a sentence by looking at the words that have come before it. This approach helps the model understand how words and phrases typically fit together in language, forming a foundation that can be applied to various other tasks.
Shows how GPT predicts each upcoming word from the preceding sequence and uses the resulting language patterns as a foundation for other tasks. section 1.6







