A large language model (LLM) needs to be trained. The training of an LLM has become more complex over time.
Pretraining is the training stage where the objective is next-token prediction.
The pretraining stage can be split into several substages, one after another, as in curriculum learning. Each substage focuses on a different kind of learning, with later substages enabled by previous substages. All substages of pretraining would still use next-token prediction objective.
Midtraining is a substage in pretraining. Like pretraining, the objective in midtraining is next-token prediction. They mainly differ in the design goals of the dataset that the model is predicting about. The pretraining dataset is designed to be larger and more diverse (such as Common Crawl or the Pile) to make the model generally capable, and the midtraining dataset is designed to be smaller, more specialized, and of higher quality, to efficiently make the model capable in specific areas.
The term "mid-training" was first used by OpenAI in 2024, and came into more widespread use in 2025.
Long-context training is a training substage within pretraining, designed to increase the effective context length of a model. A language model can have a long context length, but unable to use it effectively, a phenomenon sometimes called "context decay". Consequently, it is the effective context length that is of interest, i.e. the length of the context that a model can use effectively.
A simple method of long-context training is simply to do next-token prediction on extended contexts, possibly extending more than once. Concretely, the model can be pretrained on context lengths up to 8K tokens, then up to 64K, then up to 512K. It was found that given a fixed training budget, training on a mixture of long contexts and short contexts resulted in higher performance than training on only long contexts.
Some architectures were designed specifically to enable efficient long-context training. An early example is ALiBi (Attention with Linear Biases), which had been replaced by various schemes for modifying the rotary positional embedding (RoPE) of a model. The modern representative is YaRN (Yet another RoPE extensioN) which has been used across many models, including DeepSeek, Qwen, Kimi, and GPT-OSS.
Supervised fine-tuning (SFT) is the stage where the objective is next-token prediction only on a subset of tokens. Like pretraining, considerations when designing and evaluating the effectiveness of SFT include data composition, context length, token efficiency, downstream performance, and so on. The data composition during the SFT stage critically affects the efficiency of SFT.
Instruction tuning is a type of SFT, in which the SFT dataset contains passages of the form <task instruction> <performing the task>. The objective is to predict only the tokens in the <performing the task> part.
{{cite journal}}: CS1 maint: periodical has ISBN (link){{cite journal}}: CS1 maint: periodical has ISBN (link){{cite journal}}: CS1 maint: periodical has ISBN (link)