Pretraining
The large-scale initial training stage that teaches a model broad patterns before task-specific adaptation.
How can ordinary text supply a training target?
Imagine training on the sentence “Return the atlas to the shelf.” In causal language modeling, each position can supply context for predicting what follows. The observed next token in the training text provides the target.
- Construct examples
A prefix ending just before “shelf” supplies the context. The actual next token depends on the tokenizer, which can divide words or punctuation into pieces.
- Compare predictions
The model assigns scores to possible tokens. Its training loss rewards assigning higher probability to the observed continuation.
- Update across a corpus
Repeated updates capture regularities shared across examples. The resulting checkpoint can later be adapted to a particular task.
What else can pretraining look like?
Predicting masked content, matching images to text and reconstructing corrupted inputs are other possible objectives. To understand a checkpoint, ask which observations supplied the targets and what material was represented in training.

What remains to be tested?
A model can learn the wording of shelf instructions while missing a library’s current shelving policy. Evaluate local performance and document the corpus, objective and known coverage limits when those details are available.
Follow the idea
Self-Supervised Learning · See how data can supply its own training targets.
Fine-Tuning · Follow the later adaptation of a checkpoint.
Source · Devlin and colleagues on masked-language pretraining with BERT
Return to Pretraining in the A–Z glossary