Pretraining is the initial large-scale stage of language-model development. It trains a randomly initialized model on massive unlabeled text to predict the next token, building general language patterns, knowledge, and capabilities before later adaptation. section 1.2 section 6.1
A typical pretraining workflow includes:
- Collect massive text corpora, potentially spanning terabytes of data and trillions of tokens. section 1.2
- Split text into tokens, which may be words, word parts, or punctuation, then convert them into numerical IDs. section 1.2
- Train the model to predict each next token from preceding context. section 1.2 section 1.4
- Continue with post-training stages such as instruction fine-tuning and preference tuning when better instruction following or alignment is required. section 1.2 section 1.8
Figure 1.3 Overview of a typical LLM training pipeline. The process begins with a model initialized with random weights, followed by pretraining on large-scale text data to learn language patterns by predicting the next token. Post-training then refines the model through instruction fine-tuning and preference fine-tuning, enabling the LLM to better follow human instructions and align with human preferences.
Follow the pipeline from random model initialization through large-scale next-token prediction and into instruction and preference tuning. section 1.2
Pattern matching during pretraining
Given “The capital of Germany is…”, a pretrained model generates “Berlin” by recalling a strong statistical association learned from text rather than applying explicit logical rules. The same mechanism produces fluent continuations but does not guarantee formal inference. section 1.4













