Topic: llm-training-and-post-training

The stages a language model goes through, from pretraining to a served assistant, compared on what each one changes, what data it needs, what it costs and what goes wrong. Sources are linked inline; data as of 3 October 2026; rebuilt on the split layout with one 3D stage on 10 November 2026.
Reading: 26 min, plus 22 in closed details.

The lifecycle on one page

The idea: every stage after pretraining moves the same weights with a narrower signal and far less, far costlier data, so pretraining decides what the model knows and the later stages decide what it does with it; three more stages (distillation, PEFT, quantisation) make any of them cheaper.

Down the line, the signal narrows, the data shrinks by orders of magnitude, and compute falls to a few percent of pretraining

  1. The line. Five learning stages in order, and one set of weights (the purple plate) moving through them. Behind each stage, its data, coloured by who makes it as in Axis 2: grey the web, blue people, green a checker; purple is the model itself. In front, its compute as a share of pretraining on a log scale (100% at the top of the ruler, 0.01% at the floor) derived. Each share pairs a stage with its own model family's pretraining, so read the order of magnitude, not the gap between neighbours.
  2. Pretraining: the next token, from random weights. Trillions of web tokens nobody wrote for the model (Llama 3 405B: 15.6T) stream into randomly initialised weights. Its column is the 100% the others are measured against. How loss falls with model size and tokens is Pretraining's Fig. 3, the scaling surface.
  3. Mid-training, CPT: the next token on a shifted mix. The same objective on billions of curated tokens (OLMo 2 7B: 50B, three times), for 5 to 10% of the FLOPs (OLMo 2); the column stands at the geometric middle of that range.
  4. SFT: imitate a demonstration. Thousands of demonstrations written by people (InstructGPT: about 13k). InstructGPT's SFT on the 175B model took 4.9 petaflop/s-days against GPT-3's 3,640: 0.13% (InstructGPT).
  5. Preference optimisation: the answer a judge ranked higher. Tens of thousands of ranked pairs (InstructGPT: 33k prompts), ranked by people. Its PPO took 60 petaflop/s-days: 1.6% (InstructGPT's PPO).
  6. RLVR: whatever of its own a checker accepts. The data are prompts and environments (MiMo-V2.6: 7,000+ environments); the answers are the model's own, streaming out to the checker while its score streams back. DeepSeek-R1's RL took 147K H800 hours against DeepSeek-V3's 2,788K: 5.3% (DeepSeek-R1 on V3). The first two stages build the base, what it knows; the last three are post-training, what it does with it.
  7. Making it cheaper. Three stages act on the output of any stage above: Distillation (a new, smaller student imitates a teacher), PEFT (LoRA, QLoRA) (runs any learning stage through a small add-on, often under 0.1% of the weights) and Quantisation (stores the weights in fewer bits, with no learning unless it is quantisation-aware).

Compute columns are each stage's FLOPs or GPU-hours as a share of the same model family's pretraining derived: InstructGPT's SFT 4.9 and RLHF 60 petaflop/s-days against GPT-3's 3,640; R1's 147K H800 hours against V3's 2,788K; OLMo 2's mid-training share as its report gives it. The stages' data are in different units (tokens, demonstrations, pairs, environments), so the streams' dot counts are schematic. Every stage name links to the page that owns it.

You need: what a decoder-only Transformer is and how it is trained by next-token prediction (The transformer from zero: one block, every shape, a GPT you train, the block this page trains; the map of the whole family is Topic: llm-architecture); Adam itself is on Optimisers and learning-rate schedulers, but this page only names it.

Mid-training, CPT
more next-token training of a finished base on a shifted mix: curated data, a new domain, longer documents.
SFT
supervised fine-tuning: next-token loss on demonstration answers only.
Preference optimisation
shift probability towards the answer a judge preferred: RLHF with a reward model and PPO, or a direct loss on pairs (DPO).
RLVR
reinforcement learning with verifiable rewards: the model's own attempts scored by a program.
Rollout
one sampled attempt by the policy during RL; GRPO samples a group per prompt.
KL penalty
a charge for moving the policy's distribution away from a frozen reference.
6ND
training FLOPs of a dense model: about 6 per parameter per token.
MFU
model FLOPs utilisation: the share of the hardware's dense peak a run sustains.

The lifecycle in one screen

A language model is built in stages. Pretraining teaches a randomly initialised network to predict the next token of trillions of tokens of text; mid-training and continued pretraining keep the same objective on a shifted mix; post-training turns the result into an assistant (SFT, preference optimisation, RLVR). Three more stages make it cheaper: distillation, PEFT and quantization. Every stage can be compared on the same four questions:

Predict, then click: read the Data column top to bottom. Which way does the count move, and which way does the cost per example move? Then click any cell for the one-paragraph comparison and the page that owns the depth: the data column shrinks from trillions of tokens to a few hundred examples, while the cost column's expensive part moves from training compute to rollouts and environments.

All 32 cells as text (depth)

Building the base

Pretraining (next-token, from scratch; in depth: Pretraining)

What it changes. Every weight, from random initialisation, by predicting the next token over the whole vocabulary. It decides what the model knows and sets the ceiling later stages work under: RL raises pass@1 but base models still solve more problems given many samples (Yue et al.).

Data. Llama 3 405B read 15.6T tokens (Llama 3). About 20 tokens per parameter is compute-optimal (Chinchilla: 70B on 1.4T, paper); serving-bound models go far past it. Made by crawlers and classifiers: filtered web, code, papers. Data improvements gave 12.0 times the compute efficiency of 2019 at a 1e19-FLOP budget, model improvements 3.7 times, both together 15 times (Dwarkesh Patel and Jerry Han; our reading).

Cost. About 6 FLOPs per parameter per token: Llama 3 405B took 3.8 × 1025 FLOPs at 38 to 43% utilisation of up to 16,384 H100s (Llama 3). DeepSeek-V3's whole official run was 2.788M H800 hours, $5.576M at an assumed $2 an hour, research excluded (DeepSeek-V3). Your own numbers: Scaling calculator; disclosed runs: Price list.

What goes wrong. Loss spikes and divergence (OLMo 2's initialisation and normalisation changes cut its spike score from 0.40% to 0.03%, OLMo 2), and at scale the cluster: Llama 3 had 419 unexpected interruptions in 54 days, one every 3.1 hours derived, yet kept over 90% effective training time.

Mid-training, CPT, long context (same objective, shifted mix; in depth: Data mixing, curricula and continued-pretraining ratios, sections 5 to 7)

What it changes. All weights, same next-token objective, on a shifted mix: a high-quality anneal as the learning rate decays (maths, code, instruction-like and synthetic data), a new domain or language, or long documents with rescaled positional encodings for a longer window (Positional Encodings).

Data. OLMo 2 7B anneals on 50B tokens three times and averages the results (OLMo 2); Thomson Reuters kept 200B tokens of a 19T pool (The Batch); Llama 3 went from 8K to 128K context in six stages over about 800B tokens (Llama 3). Made by curation: classifiers, data vendors, synthetic generation.

Cost. OLMo 2's mid-training took 5 to 10% of the FLOPs and added 9.9 points on its 7B (OLMo 2). Thomson Reuters' final mid-training run on Qwen3.5-397B-A17B cost $450,000; its $40M figure is the whole two-year programme, talent included (see the Price list).

What goes wrong. Catastrophic forgetting of general ability, driven mostly by the shift in data (re-warming the learning rate is about a quarter of it in Ibrahim et al.'s Table 12); instruction following breaks until post-training is re-run. Replay of general data (even 1 to 5%) and a lower re-warmed peak are the defences (Ibrahim et al.). Llama 3 ended each long-context stage only once short-context scores had recovered.

Post-training

SFT (imitate demonstrations; in depth: Alignment)

What it changes. All weights (or a LoRA adapter), next-token loss on the response tokens only, so the model answers in a chat template instead of continuing the text. It teaches form more than skill: R1's cold-start SFT scored 59.0% on AIME 2024 against 77.9% for pure RL from the same base (DeepSeek-R1).

Data. InstructGPT: about 13k prompts with demonstrations, written by about 40 contractors (InstructGPT); LIMA: 1,000 curated examples (LIMA). Now mostly written by a stronger model: 400 trajectories from GPT-6 Astra taught a 4B model to plan Postgres queries (write-up).

Cost. InstructGPT's SFT on the 175B model took 4.9 petaflop/s-days against 3,640 for GPT-3's pretraining, 0.13% derived. With LoRA it fits on consumer GPUs: the whole Postgres planner, SFT and RL, cost $1,200 (write-up).

What goes wrong. Off-policy: the model never sees its own mistakes, so it learns the look of an answer. Chat-template mismatches between training and serving are a common silent bug (Tokenizers).

Preference optimisation (RLHF with PPO, DPO family; in depth: Alignment)

What it changes. Shifts probability towards the answer a judge ranked higher, with a KL term keeping the model near its SFT starting point. PPO learns a reward model and optimises against it; DPO turns the same objective into a classification loss on pairs, with no reward model and no sampling (DPO). Labelers preferred the 1.3B InstructGPT to the 175B GPT-3.

Data. InstructGPT: 33k prompts with ranked answers for the reward model, 31k unlabelled prompts for PPO (InstructGPT). Constitutional AI: 182,831 harmlessness comparisons labelled by a model, against 16 written principles, plus 135,296 human helpfulness comparisons (Constitutional AI). AI feedback is now the norm for most labels.

Cost. PPO holds policy, reference, reward model and critic: 252 GB at 7B before activations, twice DPO's 126 GB derived (Axis 3). InstructGPT's PPO on 175B took 60 petaflop/s-days, 1.6% of GPT-3's pretraining derived.

What goes wrong. The policy climbs the learned reward while true quality stalls or falls: verbosity, sycophancy, formatting tricks (Gao et al.; Reward Hacking). Defences: the KL leash (Axis 4), reward-model ensembles, mixing pretraining gradients back in against the "alignment tax".

RLVR (RL against a checker: GRPO and successors; in depth: Alignment)

What it changes. The model's own sampled attempts are rewarded by a program (exact answers, unit tests, an environment's outcome). Long, self-checking chains of thought emerge: DeepSeek-R1-Zero went from 15.6% to 77.9% on AIME 2024 with rule rewards only (DeepSeek-R1). It can also train cost: SWE-2 learned all its effort levels in one RL run (Cognition).

Data. Prompts with checkable answers, and for agents whole environments: MiMo-V2.6 trained across 7,000+ task environments (card); Mercor and SkyRL on 1,928 expert-made tasks (Mercor). The answers are the model's own; people or tools make the tasks and checkers.

Cost. Many samples per prompt (16 for R1-Zero, 64 for DeepSeekMath) make it inference-heavy. R1's RL and SFT data: 147K H800 hours, $294K, 5.3% of V3's official run derived; MiMo-V2.6-Pro's final RL stage: $2.62M in under six days. The sandboxes are their own infrastructure: DSec runs about 3 million a day self-reported (DSec).

What goes wrong. The checker becomes the proxy: hard-coded outputs, edited or skipped tests, exiting before assertions. Long runs lose entropy and stop exploring; large MoE models go unstable (MiMo-V2.6 froze its router). Defences: hidden and mutated tests, a sandboxed grader, an environment that cannot be escaped.

Making it cheaper

Distillation (a student imitates a teacher; in depth: Distillation and Small Language Models)

What it changes. A new, smaller student is trained to imitate a teacher: on the teacher's sampled answers (sequence-level), on its full token distributions (logits, which needs a shared tokenizer), or on-policy, where the student writes and the teacher grades every token. It is the main reason 1B to 8B models are useful now.

Data. Qwen2.5-32B fine-tuned on 800K samples from R1 scored 72.6% on AIME 2024 against 47.0% after R1-Zero-style RL on the same base (DeepSeek-R1); Gemma 3 12B trained on 500 ToolGrad examples scored 83.1 on BFCL against Gemini 2.5 Pro's 83.2 (Google Research).

Cost. SFT-priced: one pass over teacher outputs, plus the teacher's inference. On-policy distillation is reported to need 9 to 30 times less compute than off-policy SFT on teacher samples, and against reasoning RL about a tenth of the GPU-hours (Qwen3) or 7 to 10 times fewer steps reported (Thinking Machines).

What goes wrong. Off-policy students never see their own mistakes; a teacher far stronger than the student can hurt it; mismatched tokenizers block logit distillation; the student inherits the teacher's quirks and, through terms of service, its legal exposure.

PEFT (LoRA, QLoRA) (train a small add-on; in depth: PEFT)

What it changes. The base is frozen and a low-rank update W0 + BA is trained, then merged at no inference cost. On GPT-3 175B, 4.7M trainable parameters reached 73.4% on WikiSQL against 73.8% for full fine-tuning, in a 35 MB adapter instead of a 350 GB copy (LoRA).

Data. PEFT is a way of running SFT, DPO or RL, not a data regime: the data is that stage's. For RL even rank 1 is enough, since policy gradients carry little information per episode (Thinking Machines).

Cost. No optimiser state for frozen weights: QLoRA fine-tunes LLaMA 65B in under 48 GB (45.0 GB measured) where 16-bit fine-tuning needs more than 780 GB (QLoRA). The arithmetic, with a calculator on real configs, is PEFT's section "Memory: full fine-tuning, LoRA and QLoRA".

What goes wrong. An adapter cannot absorb billions of tokens of new knowledge (use CPT); LoRA on attention only underperforms; and the claim that LoRA beats full fine-tuning sits inside the noise of the original paper.

Quantization, precision (fewer bits per weight; in depth: Quantization and Precision)

What it changes. No learning at all after training (post-training quantization), or fake quantization inside training (quantization-aware training). Weights, and sometimes activations, move from bf16 (2 bytes) to FP8 (1) or about 4 bits plus scales; fine-grained FP8 is now used for training itself (DeepSeek-V3).

Data. GPTQ, AWQ and llama.cpp's importance matrix need a small calibration set; dynamic FP8 needs none; quantization-aware training needs training data. A calibration set unlike real use quietly costs capability off its distribution.

Cost. About 0.6 GB per billion parameters at 4 bits; DeepSeek-V3's FP8 training kept the loss within 0.25% of BF16 in its ablations (DeepSeek-V3). llama.cpp's default Q4_K_M is 4.89 effective bits per weight on Llama-3.1-8B (llama.cpp).

What goes wrong. A few channels with huge values wreck naive scaling; dense models fall off a cliff below about 3 bits, while MoE experts tolerate harder quantization; newer, heavily trained small models lose more at the same bits.

Numbers are published, with the source linked, unless marked derived (formula shown), illustrative, reported (the maker's own figure, not independently checked) or unconfirmed.

Axis 1: what each stage changes

Every stage before compression updates the same weights by gradient descent. What differs is the signal: pretraining and mid-training reward predicting text; SFT rewards imitating a demonstration; preference optimisation rewards the answer a judge ranked higher; RLVR rewards whatever the model itself produced that a checker accepted. Each signal is narrower than the last and moves behaviour more per example. The compression stages change something else: distillation makes a new, smaller model; PEFT changes how many weights move (a low-rank add-on, often under 0.1% of the model); quantization changes how the weights are stored, with no learning at all unless it is quantization-aware training.

What each signal buys, and what it cannot

  • Pretraining sets the ceiling. RL with verifiable rewards raises pass@1, but base models solve more problems when given many tries (Yue et al.): RL sharpens what pretraining put there.
  • SFT teaches the form more than the skill. In DeepSeek-R1, a cold-start SFT on thousands of clean reasoning traces scored 59.0% on AIME 2024, against 77.9% for pure RL from the same base; reasoning RL brought it back to 74.0% (Table 3, DeepSeek-R1).
  • A small preference stage moves a lot. Labelers preferred the 1.3B InstructGPT to the 175B GPT-3, 135 times its size (InstructGPT).

What one prompt's answer looks like after each stage, on a real open recipe (Tulu 3 8B, stage by stage), is the hero of Alignment: SFT, RLHF, DPO Family, RLVR; how five open recipes chain the stages is its section 8, "How recipes combine the stages".

2026: RL that trains the cost-quality trade itself (SWE-2), and a correction (depth)

RL can now train the cost-quality trade itself. Cognition's SWE-2, RL post-trained from Moonshot's 2.8T-parameter Kimi K3, learned all its reasoning-effort levels in a single RL run, "with each penalty tuned to the local slope of the base model's Pareto frontier", rather than one checkpoint per tier; SWE-2 medium used 58% fewer turns and cost 81% less than SWE-1.7 on the same work. It matched Fable 5.1 on FrontierCode 1.1 Main (50.0% against 50.9%) at a claimed 64% lower cost reported, but scored 27.3% on Terminal-Bench 4 against 55.8% and 57.9% for Fable 5.1 and GPT-6 Astra (Cognition).

Correction
The old page dated SWE-2 to 12 September and said it runs only in Devin Desktop and CLI. Cognition's post is dated 10 September and says it is also rolling out on Devin Web and Fusion (checked 2 October 2026 in the 14 September tech news issue).
Go deeper: each stage's mechanics on its own page: Pretraining, mid-training and CPT on Data mixing, Alignment, Distillation and Small Language Models, PEFT, Quantization and Precision. How a reasoning model spends its thinking at inference: Topic: llm-landscape, Axis 1.

Fig. 2 · Down the years, the data shrinks and changes hands: the web, then people, a model, a checker

the web, filteredpeoplea modela checker or environment

Every count is the source's own, linked in its step beside this figure; "about" and "+" are the source's wording. Bars are not comparable across the two panels.

Axis 2: what data each stage needs

Down the lifecycle, data gets smaller, more expensive per example, and made by someone other than a web crawler. Pretraining reads trillions of tokens nobody wrote for it; mid-training selects billions of better ones; SFT needs thousands of demonstrations; preference optimisation needs tens of thousands of ranked pairs; RLVR needs prompts or whole environments with a checker, and generates its own answers. The labeller changed too: people, then a model reading a written constitution, then a program that checks the answer, and now the model's own production traffic.

Predict, then watch: which colour will dominate the 2026 bars, people or a model? The record fills in one disclosed dataset at a time, from GPT-3's era to 2026, step by step below. Two scales, because tokens and examples do not compare: each bar's length is its count on a logarithmic axis; its colour is who made the data.

  1. 2020: pretraining reads what the web already holds. GPT-3 trained on 300B tokens of filtered web text, books and Wikipedia (GPT-3 paper page). Nobody wrote any of it for the model.
  2. 2022: more tokens per parameter, and the first labelled post-training. Chinchilla moved pretraining to about 20 tokens per parameter (Chinchilla). InstructGPT hired about 40 contractors for about 13k demonstrations and 33k ranked prompts (InstructGPT); within the year, Constitutional AI had a model label 182,831 harmlessness comparisons from 16 written principles (Constitutional AI).
  3. 2023: less, but better. LIMA argued that 1,000 carefully chosen examples are enough for SFT, since the knowledge is already in the base model (LIMA).
  4. 2024: pretraining scales, and mid-training gets its own data. Llama 3 405B read 15.6T tokens, then about 800B more to extend its context from 8K to 128K (Llama 3); DeepSeekMath mined 120.2B tokens of maths from Common Crawl (DeepSeekMath); OLMo 2 annealed on a curated 50B-token mix, three times, and averaged the results (OLMo 2).
  5. 2025: a model writes the training set for smaller models. DeepSeek-R1's 800K samples (about 600K reasoning traces, 200K other) taught 1.5B to 70B students to reason by SFT alone (DeepSeek-R1).
  6. 2026: checkers and environments, and selection from huge pools. Thomson Reuters kept 200B of 19T tokens (The Batch). RL data is now tasks with a checker: 1,928 expert-made tasks (Mercor), 7,000+ environments (MiMo-V2.6 card), 13,646 queries timed by Postgres itself after 400 SFT trajectories from GPT-6 Astra (write-up), 500 API chains verified before their questions were written (ToolGrad).

Data quality carries more of pretraining's progress than modelling. From 2019 to 2025, at a 1e19-FLOP budget, data improvements gave 12.0 times and model improvements 3.7 times more compute efficiency, so 12.0 / 3.7 = 3.24 times more from data derived. The two effects add in benchmark points (88% of variance additive) but overlap in compute: together they saved 15 times, not the 45 of their product (Dwarkesh Patel and Jerry Han; our reading). Chinchilla's rule of about 20 tokens per parameter still says how to split a compute budget; it never said that one token is worth another. Curation is on Topic: data-curation-and-datasets; who curated each open recipe's data, stage by stage, and how much: Open recipes compared.

2026: where the data is coming from now (selection, answer-first synthesis, production traffic, operational records), and corrections (depth)
  • Magic says its pretraining recipe is ">10x more compute-efficient than that of leading open-weight base models", matching DeepSeek V4 Pro Base with about 50 times fewer FLOPs reported, not independently reproduced (Magic, 8 September 2026).
  • Mid-training is a selection problem. Thomson Reuters kept 200B tokens of a 19T-token pool, 1.05% derived, curated with DatologyAI, for a legal and news model on Qwen3.5-397B-A17B (The Batch; report). The technical report mixes about one third general data back in as replay, although Thomson Reuters told LawNext the CPT used its own content exclusively; the details are on Data mixing, curricula and continued-pretraining ratios.
  • Write the answer first, then the question. ToolGrad builds a verified chain of API calls and only then writes the user request that needs it: 99.8% of generated examples valid across 16,000 real APIs, and Gemma 3 12B trained on 500 of them scored 83.1 on BFCL against Gemini 2.5 Pro's 83.2 (Google Research, paper). It works wherever an answer is cheap to check and expensive to find, for evaluation sets as well as training sets.
  • Production traffic as the curriculum. NeoHorse-1 routes requests across a pool of models, turns served interactions into training examples (structural validation, a six-dimensional semantic evaluation, labels for sub-scenes within a conversation), orders them into a three-stage SFT curriculum and adds on-policy distillation. Over ten agent, tool, coding and instruction benchmarks, Qwen3.5-4B went from 58.94 to 64.87 and 9B from 65.60 to 69.04: the 4B closed 89% of the gap to the untrained 9B derived. No experiment switches the routing curriculum off, and the loop ran once (NeoHorse-1 paper page).
  • Operational records beat curated corpora in narrow domains. Periodic's Neon, mid-trained and RL-trained on real laboratory data from a Kimi K2.6 base, went from 2.7% to 55.3% on FrontierXRD (134 lab samples), ahead of GPT-6 Astra and Fable 5.1 at lower cost per analysis reported; the final run used 1,300 H200s (Periodic, 15 September 2026). The shared ingredient with the Postgres planner in Axis 3: a checker that already exists in the domain.
Corrections
The old page said NeoHorse-1 averaged over 11 benchmarks; the paper has ten, and its self-improvement loop ran once (paper page). The data decomposition and Magic's post are dated 8 September, not 9; the line that small models gain most from data quality is unconfirmed (not found in the post, whose study stops at 1e19 FLOPs). Neon's post is dated 15 September, not 16 (checks of 2 October 2026 in the 14 September and 21 September tech news issues).
Go deeper: pretraining mixtures, curricula and the anneal on Pretraining; replay ratios and the CMR mixture law on Data mixing, section 6; preference data, RLAIF and Constitutional AI on Alignment; teacher traces and on-policy distillation on Distillation and Small Language Models; what a tokenizer does to data cost (low-resource languages pay several times more tokens for the same text) on Tokenizers.

Axis 3: what each stage costs

Pretraining's cost is arithmetic: about 6 floating-point operations per parameter per token, so C ≈ 6ND, divided by what the cluster sustains. Post-training used to be a rounding error on top of it, and reasoning and agentic RL changed that, by moving the cost from the backward pass to generating rollouts and running the environments they act in:

  • 2022: InstructGPT's RLHF on the 175B model took 60 petaflop/s-days against 3,640 to pretrain GPT-3: 60 / 3,640 = 1.6% derived, and SFT 0.13% more (InstructGPT, §5.1).
  • 2025: DeepSeek-R1's RL and SFT data took 147K H800 hours ($294K at an assumed $2 an hour), on top of 2,788K for DeepSeek-V3's official run: 147 / 2,788 = 5.3% derived (DeepSeek-R1, DeepSeek-V3).
  • 2026: the final RL stage of Xiaomi's MiMo-V2.6-Pro (1.02T total, 42B active) ran live for under six days across 7,000+ task environments for $2.62M; Flash's cost about $850,000 (model card, alphaXiv). A stage short enough to rerun weekly is limited by how many environments and evaluations a lab can supply, not by the run.

Those are the ratios; every disclosed run with its dollar figure and what that figure includes (one stage, one run, or a whole programme) is on the Price list, and FLOPs and GPU-days for any model and token count, Chinchilla-optimal or over-trained, are in the Scaling calculator.

Fig. 3 · One batch of four prompts: PPO holds four models, GRPO pays in rollouts, DPO samples nothing

Models in GPU memory, 7B each
Rollouts

Memory derived: a trained model holds 16 bytes per parameter (bf16 weights and gradients, fp32 master weights and two Adam moments, ZeRO §3.1), a frozen one 2; activations and the rollout engine's cache are left out. PPO 36 bytes per parameter, 252 GB at 7B; GRPO with a verifier and DPO 18, 126 GB: "roughly half the memory", as the RL page puts it. Group size 8 and the right or wrong answers are illustrative; DeepSeekMath used 64 per prompt and R1-Zero 16. DPO's reference log-probabilities can be computed once and cached, which removes the reference from memory during training (4 forward passes per pair, 2 cacheable: DPO).

Same batch, three algorithms

The memory side of post-training is set by how many models must sit on the GPUs at once. PPO, the algorithm of InstructGPT-style RLHF, holds four: the policy being trained, a frozen reference copy for the KL penalty, a reward model, and a critic that estimates how good each partial answer is. GRPO (from DeepSeekMath) drops the critic: it samples a group of answers per prompt and scores each against the group's mean. DPO drops sampling altogether and trains on fixed pairs.

Predict, then watch: PPO holds four models and GRPO three; how much bigger is PPO's memory bar at the same size, and what does GRPO pay instead? Step one batch of four prompts through each (switch algorithm above the figure): PPO's memory bar is twice GRPO's at the same model size; GRPO pays instead in rollouts, 8 per prompt here where PPO samples one.

PPO, step by step

  1. Load four models. PPO trains the policy and a critic, and keeps a frozen reference copy (for the KL penalty) and a frozen reward model beside them. Two of the four carry gradients and Adam state.
  2. Sample one answer per prompt. The policy writes one answer for each of the four prompts. Generation is the slow part of every RL step.
  3. The reward model scores each answer. A learned model, trained on human rankings, gives each answer a number. It is a proxy for what people want, and the policy will learn its blind spots (Axis 4).
  4. The critic estimates what was expected. The critic predicts the reward from each partial answer; the advantage is reward minus prediction, so the policy learns only from surprises. It needs its own training, and a second full model's memory.
  5. The reference charges for drift. Each token pays a KL penalty for moving away from the frozen reference, the leash that keeps the policy near the SFT model.
  6. Update the policy and the critic. Clipped policy-gradient step on the policy, regression step on the critic: two optimiser states, two backward passes.

Model by model, with the streams between them, PPO against GRPO is Alignment's Fig. 4; a verifier scoring a group of eight is its Fig. 7. This figure keeps what only shows when the three are side by side: the memory each needs and the answers each generates.

The trade is visible in what each wins. DPO is cheap and stable and was adopted everywhere; on harder tasks, later controlled studies found well-tuned on-policy RL ahead, which is why reasoning models use GRPO and its successors. GRPO's memory saving was argued, not measured, in the paper that introduced it (DeepSeekMath); its standing rests on cost and on R1.

The environment is now the expensive part

For agentic RL the bill moves again, from the trainer to the machines the rollouts act in: every rollout needs its own isolated sandbox, the harness decides as much as the algorithm, and at the cheap end one task with a cheap checker lets a 4B model beat a built-in planner for $1,200. The cases, with their numbers, are in the closed block.

2026: sandboxes at rollout rate, harnesses, the cheap end, fewer wasted experiments, and corrections (depth)
  • Sandboxes at rollout rate. Each agentic rollout needs its own isolated machine. DeepSeek's DSec offers four isolation levels behind one SDK (function call, container, microVM, full VM), so a rollout pays only for the isolation it needs, and keeps stateful rollouts alive when the GPU trainer is preempted. One unit of about 160 nodes runs about 3 million sandboxes a day and creates over 5,000 a second, peaking near 380,000 at once self-reported: about 31 creations per node per second derived (DSec, arXiv). A lab without such a layer cannot run the same experiments, whatever recipe it copies.
  • The harness decides as much as the algorithm. Mercor and SkyRL's account of RL on Qwen3.5-397B-A17B over 1,928 expert-made tasks is mostly token accounting, asynchronous RL, environment robustness and harness design; APEX-Agents Pass@1 rose from 16.11% to 27.29%, +69.4% relative (Mercor). Terminal-Universe industrialises the environment supply.
  • The cheap end: one task, one checker. A Qwen 3.8 4B model learned to write Postgres query plans from 400 GPT-6 Astra trajectories (SFT through a 21.2M-parameter LoRA) and then anchored-GRPO RL on 13,646 queries: 1.81 times the built-in planner's speed (geometric mean, 113 held-out queries) for $1,200 in total (write-up). With a cheap verifier, specialisation beats scale.
  • Fewer GPU hours on the wrong experiment. Meta FAIR's AI Research Preference Models have frozen language models rank 15 candidate experiments in a pairwise knockout before running any: average normalised score 0.684 for random choice, 0.711 and 0.729 for the two variants, reaching the baseline's 24-hour result about 1.6 times sooner (arXiv); the margins are narrow and pairwise judges carry the biases of Topic: evaluation-and-llm-judges. Dream-RSI re-scores new search policies against a finished search tree instead of paying for new evaluations (a Lasso-solver search fell from 550 to 317 agent calls), on single runs whose kernel speedups shrink at matched performance (Dream-RSI).
Corrections

The Postgres planner used 400 SFT trajectories, not 420, and cost $1,200 in total, not "hundreds of dollars"; "best of three" meant the best of up to 15 candidates, and a single rollout gives 1.41 times with 2 regressions; the untrained model produced a valid plan for 14 of the 113 queries. The 35B Thomson Reuters sibling (on Qwen3.6-35B) will be released for academic and non-commercial use, not alongside. The research preference models have been on arXiv since 14 August, not 6 September; WinoGrande 94.1% is the agentic variant's best and SVAMP 95.7% the inference-only one's. Sources: checks of 2 October 2026 in the 7 September and 21 September tech news issues.

The old page also reasoned that MiMo's $2.62M RL stage and Thomson Reuters' $40M "are not separated by an order of magnitude", treating the $40M as a three-month mid-training run. It was not: the $40M covers talent and compute over about two years, and Thomson Reuters' CTO put the final training run at $450,000 (LawNext, 24 Aug 2026; The Batch's "three months" is the outlier among the sources). Like for like, MiMo's final RL stage cost about 5.8 times Thomson Reuters' final run derived. Both figures, with what each covers, are on the Price list.

Go deeper: PPO, GRPO, DAPO, GSPO and the DPO family in detail on Alignment and RL for LLMs: RLHF, GRPO, RLVR; what LoRA and QLoRA save on PEFT; the bytes behind every format on Quantization and Precision; the price of every disclosed run on the Price list.

Axis 4: what goes wrong

Each stage has a characteristic failure, and the dangerous ones look like success on the stage's own metric: the loss keeps falling, the reward keeps rising.

StageWhat goes wrongStandard defence
PretrainingLoss spikes and divergence; at scale, hardware: Llama 3's 405B run had 419 unexpected interruptions in 54 days, one every 3.1 hours derived, 78% of them hardware (Llama 3)Initialisation and normalisation fixes (OLMo 2's cut its spike score from 0.40% to 0.03%, OLMo 2), z-loss, QK-norm; frequent asynchronous checkpoints, which kept Llama 3 above 90% effective training time
Mid-training, CPTCatastrophic forgetting of general ability, driven mostly by the shift in data (re-warming the learning rate is about a quarter of it in Ibrahim et al.'s Table 12); instruction following breaks until post-training is re-runReplay of general data (even 1 to 5% helps), a lower re-warmed peak, staged mixes (Ibrahim et al.)
SFTImitation without the skill; off-policy, so the model never sees its own mistakes; chat-template mismatches between training and servingFewer, better examples; follow with RL or on-policy distillation
Preference optimisationReward hacking: verbosity, sycophancy, format tricks; an "alignment tax" on benchmarksA KL penalty to the reference (below), reward-model ensembles, mixing pretraining gradients back in (InstructGPT's PPO-ptx)
RLVRVerifier gaming (hard-coded outputs, edited tests, exiting before assertions); entropy collapse in long runs; instability in large MoE modelsHidden and mutated tests, a sandboxed grader; MiMo-V2.6 froze the MoE router and describes "a multi-layer defense against reward hacking" (card)
DistillationThe student inherits the teacher's quirks; too strong a teacher can hurt a tiny student; different tokenizers block logit distillationVerified traces only, an intermediate teacher, on-policy distillation; but choose the KL direction first: in a controlled study the token-level KL direction shaped results more than who wrote the rollouts, and the on-policy edge did not reliably survive later RLVR (Piskorz et al., arXiv 2609.35259; the two directions drawn: Distillation's Fig. 2)
PEFTToo little capacity to absorb bulk knowledge; attention-only LoRA underperformsLoRA on every matrix, especially the MLPs; full fine-tuning or CPT for billions of tokens
QuantizationA few outlier channels wreck naive scaling; dense models fall off a cliff below about 3 bitsOutlier-aware methods (AWQ, rotations), FP8 or 4-bit with fine-grained scales, quantization-aware training

Reward hacking, and the leash against it

A learned reward model is a proxy for what people want. Optimised hard enough, the policy finds what the proxy over-rewards: the proxy score keeps climbing while the true ("gold") score peaks and falls. The KL penalty to the reference is the leash: it charges the policy for distance, so it decides where the policy stops, near where the proxy still tracks the gold; it does not lift the curve. The measured curves (Gao, Schulman and Hilton's best-of-n and RL fits, the gap shrinking with reward-model size) are drawn on Reward Hacking, section 2, "The curve: proxy up, gold down"; one riddle under best-of-n, answer by answer, is its Fig. 1.

RLVR replaces the learned proxy with a checker, which removes this curve but not the problem: the checker is the new proxy, narrower and still gameable (where each coding hack cuts into the reward: Reward Hacking's Fig. 2; what a policy can reach, scorer to harness: its Fig. 3). Two 2026 responses move the defence out of the reward. DSec treats misbehaviour, reward hacking included, as a property of the sandbox: an environment that cannot be escaped removes a class of shortcut before the reward has to resist it (DSec). And reward hacking learned in training can generalise into broad misalignment, which telling the model during training that the hack is acceptable ("inoculation prompting") largely prevents (Anthropic; detail on Reward Hacking).

2026: loops that train on their own history narrow (Dream-RSI, Agora), and a correction (depth)

Loops that train on their own history narrow. Dream-RSI's replay is valid only inside the region its history covers, so it sharpens a mapped search rather than extending it (Dream-RSI). NVIDIA's Agora had 13 agents publish 1,703 contributions over 11 days and 19 hours as Git commits, taking a language-model evaluator from 3.39 to 1.899 bits per byte with 165 independent reproductions and no reported failure, but effort converged on one lineage ("shared visibility supported reuse, but did not by itself sustain broad exploration"), and the authors stepped in several times during the run; with one task, one run and no comparison, their changes cannot be separated from the effect of the system's diversity views (Agora).

Correction
The old page said Agora needed "one human intervention mid-run" to restore diversity. Version 4 of the paper lists more: the authors changed the server three times and the H100 workers' prompt once, edited one record by hand and ran three agent sessions themselves, reconstructed from the commit history since no intervention log survives. And its database takeaway's "165 reproductions failed zero times" is, more carefully, 165 verification posts by other accounts, covering 95 targets, none reporting a failure; an unposted failed attempt would leave no trace (Agora paper page, §4.5, §4.8).
Go deeper: the measured over-optimisation curves, hacking patterns, detection, activation monitors and inoculation prompting on Reward Hacking; forgetting and the CMR law on Data mixing, section 6; outliers and the low-bit cliff on Quantization and Precision; failures and recovery at 16,000 GPUs on Fault tolerance at scale (summary in Running the job).

The machinery under every stage

Every stage runs on the same machinery: a memory budget per parameter, a way of splitting the model across GPUs, a number format, and a cluster that fails. The stages differ mainly in how much of it they need.

Bytes per parameter

Training with Adam in mixed precision holds about 16 bytes per parameter before activations: 2 for bf16 weights, 2 for gradients, 12 for fp32 master weights and two moments (ZeRO). Freezing the base (PEFT) drops that to the 2 bytes of the frozen weights plus a small adapter; storing the frozen base in 4 bits (QLoRA) to about half a byte; serving needs only the weights, in whatever format they ship. The calculator for full fine-tuning, LoRA and QLoRA on real configs (LLaMA 65B on one 48 GB card included) is PEFT, section "Memory: full fine-tuning, LoRA and QLoRA", whose Fig. 5 stacks the three side by side; what every format costs in bits is Quantization and Precision.

Splitting the work

Five ways to split one training step across GPUs, one line each; each split, with a step-through of what every GPU holds and sends, is a section of Distributed Training (numbers in the last column), and its Layout calculator tab composes them for a real run. To see the memory every split fights, Llama 3 8B on one 80 GB H100, to scale, is its Fig. 2; a published layout laid out as a mesh of GPUs, its Fig. 14.

SplitWhat each GPU holdsCost and where it fitsDistributed Training
Data parallel, sharded (ZeRO, FSDP)A slice of the batch; with ZeRO-3 also a 1/N slice of weights, gradients and optimiser stateAt most 1.5 times plain data parallelism's communication; a 7.5B model on 64 GPUs drops from 120 to 1.9 GB per GPU (ZeRO). FSDP2 with hybrid sharding covers most fine-tuning and pretraining below about 70Bsections 3, 4
Tensor parallelA slice of every weight matrixFour all-reduces per layer, so it needs NVLink-class links and stays inside a node (Megatron-LM)section 5
Pipeline parallelA run of consecutive layersIdle "bubbles" while the pipeline fills; across nodes for 100B and upsection 6
Expert parallelSome of an MoE model's expertsAll-to-all traffic for every token's route (Switch Transformers)section 7
Context parallelA slice of a long sequenceFor long-context phases: Llama 3 used it at 128Ksection 8
2026: bounding long-context MoE training memory by scheduling, and a correction (depth)

Memory can also be bounded by scheduling when each tensor must exist rather than by approximating anything. A September 2026 paper does this for the four memory peaks of long-context MoE training (expert dispatch, vocabulary projection, activation checkpoints, optimiser state): the vocabulary projection's peak falls 86.6%, from 79.5 to 10.6 GiB, for 4.4% more time with an exact loss, and the whole stack trains 120B to 667B MoE models at a 1M-token context on 16 to 64 H200s, 8 to 32 times the context of a tuned FSDP2 baseline, a weak baseline and single runs (paper page, arXiv).

Correction
The old page, written from a newsletter abstract, called this paper "the first thing to reach for when sizing a sparse run against a fixed pair of consumer cards". Everything in it is measured on H200 nodes with 2 TB of host memory, 16 to 64 GPUs end to end; two of its four operators are scheduled offload; and it builds on ZeRO-3 and Megatron's vocabulary sharding rather than replacing them (paper page, Table 5, §7).

Precision, kernels, clusters

  • Precision: bf16 is the training default; DeepSeek-V3 showed fine-grained FP8 training at 671B, under 0.25% relative loss gap against BF16 in its ablations (DeepSeek-V3), and Blackwell's NVFP4 and MXFP4 are now arriving for training, not just storage (NVFP4 pretraining); which format each matmul of one layer takes in such a recipe is Quantization and Precision's Fig. 10.
  • Kernels: FlashAttention computes exact attention in tiles that stay in on-chip memory, moving 9 times fewer bytes through GPU memory on GPT-2 medium and making attention memory linear in sequence length (FlashAttention).
  • Clusters: Llama 3 trained at 38 to 43% model FLOPs utilisation on 8,192 to 16,384 H100s (Llama 3); the stack that runs such a job, its frameworks and its failures are in Running the job below. The Hugging Face Ultra-Scale Playbook distils 4,000+ benchmarked runs into how to combine the splits above.
  • Components fixed before training: the tokenizer (vocabularies grew from 32K to 128K to 256K entries: fewer tokens per text, larger embedding matrices; Tokenizers) and the positional encoding (RoPE is the default; extending context means rescaling it during a long-document CPT phase, Positional Encodings). Both are architecture choices, owned by Topic: llm-architecture.
  • The inference end: how a trained model is sampled changes what it appears to have learned, and RL and best-of-n draw from the same sampling stack (Sampling and Decoding, under Topic: inference-and-serving).

Running the job: the stack, the frameworks, the failures

A pretraining run is one synchronous program on thousands of GPUs: every step waits for every GPU, so one broken part stops all of them. Each layer of the stack owns one job, and when something breaks they act in a fixed order, bottom to top. Each row names the page that owns it in depth.

Layer, bottom to topWhat it ownsDepth
Accelerators and fabricGPUs, NVLink inside a server, InfiniBand, RoCE or EFA between servers. This is what fails: about 78% of Llama 3's unexpected interruptions were confirmed or suspected hardwareTopic: hardware; how the hardware reports a fault on Power, cooling, reliability
Collectives (NCCL)Moving gradients and activations between GPUs; usually the first to notice a failure, because every other GPU is left waiting in a collectiveDistributed Training, Launching distributed training
SchedulerHanding out whole servers, all or nothing (every node or none, often called gang scheduling), queues and priorities: Slurm, Kubernetes with an add-on such as Kueue or Volcano, or an in-house one (Llama 3 used Meta's MAST, §3.3.1)Slurm, Kubernetes for ML, Topic: ml-infra-and-orchestration
LauncherStarting one process per GPU, rendezvous, restarting workers (torchrun's elastic agent)Launching distributed training
FrameworkThe training loop, the parallel layout, mixed precision and the checkpoint format (table below)Libraries on top of PyTorch, Distributed PyTorch
Checkpoints and storageSharded saves (one file per rank) that can be reloaded on a different layout, asynchronous saves. Llama 3's bursty checkpoint writes saturated a 240 PB storage fabric on 7,500 servers that sustains 2 TB/s and peaks at 7 TB/s (§3.3.1)Storage and data movement
Health checks and recoveryFinding the bad machine, replacing it from spares, restarting from the last checkpoint, or continuing without itFault tolerance at scale
Experiment layerMetrics, dashboards, alerts, configs and data versions (Weights & Biases, MLflow, TensorBoard)ML platforms and workflows, Observability and cost
The training frameworks and what each brings to running a job (as of 3 October 2026) (depth)

Frameworks (as of 3 October 2026). Which parallel split to use is on Distributed Training; how each library is used, with code, on Libraries on top of PyTorch. What each brings to running a job:

FrameworkWhere it fits
Megatron-LM and Megatron CoreNVIDIA's reference for tensor, pipeline, expert, context and data parallelism with FP16, BF16, FP8 and FP4; most frontier-scale codebases trace their kernels and layouts back to it (Megatron-LM paper). Megatron-LM is the reference scripts, Megatron Core the library
NVIDIA NeMoThe suite around Megatron Core: data curation, training recipes, RL, evaluation, export; from the 26.02 container, LLM training is documented under Megatron Bridge, which also converts checkpoints to and from Hugging Face (NeMo docs)
torchtitanPyTorch-native pretraining: FSDP2, TP, PP and CP composed on DTensor, torch.compile, MXFP8 and NVFP4, asynchronous Distributed Checkpoint, torchft, replay-based silent-corruption checks, and since August 2026 TitanRL for RL on the same model code. Its paper reports 65.08%, 12.59% and 30% speed-ups at 1D, 2D and 3D parallelism over its own baselines (Liang et al.). The cleanest codebase to learn 4D parallelism from
DeepSpeedThe ZeRO family and offload to CPU and NVMe (ZeRO); still common through the Hugging Face Trainer and Accelerate
Fine-tuning tierHugging Face Accelerate, Trainer, TRL and nanotron; Axolotl. torchtune is no longer maintained: development wound down in 2025 (The future of torchtune)
RL post-trainingA rollout engine (vLLM or SGLang) beside the trainer, with a weight sync between them: verl, OpenRLHF, SkyRL, NeMo RL, TitanRL. Agentic RL also needs environment sandboxes: DeepSeek's DSec runs about 3 million a day on roughly 160 nodes (DSec). Algorithms on Alignment

Failures, in three numbers. Over a 54-day snapshot of Llama 3 405B pretraining on up to 16,384 H100s, Meta logged 419 unexpected interruptions, one every 3.1 hours (54 × 24 / 419) derived, and still kept over 90% effective training time (§3.3.4, July 2024). The time between failures belongs to the job, not the hardware: if servers fail independently it is one server's divided by the number of servers, so at Meta's research-cluster rate of 6.50 failures per thousand node-days it is 1.8 hours at 16,384 GPUs and about 14 minutes at 131,072 (Kokolis et al., HPCA 2025). And each checkpoint trades a pause now against lost work later, which gives a best interval of about √(2 × pause × time between failures) (Young 1974, Daly 2006). What a checkpoint weighs follows from the bytes above: the fp32 master weights and Adam's two moments are 12 bytes per parameter, 14 if the bf16 weights are saved too, so a full restart checkpoint of a 405B model is about 4.9 to 5.7 TB, 297 to 346 MB per GPU on 16,384 GPUs derived, inside Llama 3's reported 1 MB to 4 GB per GPU (§3.3.1).

Go deeper (optional): every published failure table read and checked, detection, recovery designs from requeue to replica groups, silent data corruption, stragglers and goodput accounting on Fault tolerance at scale; the checkpoint-interval maths derived from zero with an exact simulator, power swings and the hardware's error reporting on Power, cooling, reliability; checkpoint I/O and formats on Storage and data movement; training stability and loss spikes on Pretraining.
A checklist for a big run (depth)

A checklist for a big run, each item owned in depth by the page named:

  1. Burn in and health-check nodes before the job; keep hot spares (Fault tolerance at scale).
  2. Asynchronous checkpoints sized to the time between failures; test restore, including resharded restore onto a different world size, before day 1 (Power, cooling, reliability for the interval, Storage and data movement for the I/O).
  3. Determinism where affordable (seeds, dataloader state in the checkpoint) so restarts are comparable; replay-based silent-corruption checks need it too.
  4. Dashboards on step time, per-rank timing spread, loss, gradient norm, NCCL errors and ECC counts; alert on stalls, not just crashes (Observability and cost).
  5. Log data order and shard state so loss spikes can be traced to data.
  6. Rehearse the failure playbook: who cordons nodes, how requeue works, where flight-recorder dumps land.

Choosing a path

Pick what you need; each path names its stages, its data, its cost and its usual failure.

All seven paths as text (depth)

A format, tone or persona: sFT with LoRA, then DPO if taste matters

Stages
SFT on a few thousand good examples, through LoRA on every weight matrix; DPO on preference pairs if people disagree about what "good" is
Data
Hundreds to a few thousand demonstrations, often written by a stronger model; quality over count (LIMA used 1,000)
Cost
One GPU: QLoRA fits a 65B base under 48 GB
Watch for
A chat template that differs between training and serving; verbosity creeping in from DPO

Domain knowledge: mid-training or continued pretraining, then post-training again

Stages
Full-parameter next-token training on the domain, then re-run SFT and preference optimisation, since CPT breaks instruction following
Data
Billions of tokens, selected hard (Thomson Reuters kept 200B of 19T), with general replay mixed in
Cost
A few percent of the base model's pretraining; Thomson Reuters' final run on a 397B base cost $450K (its $40M is a two-year programme including staff)
Watch for
Forgetting: replay general data, re-warm to a lower peak, and compare against the base model fine-tuned without CPT

A narrow task with a checker: distil, adapt cheaply, then RL against the checker

Stages
SFT on traces from a frontier model through LoRA, then RLVR (GRPO or a variant) in the real environment
Data
A few hundred teacher trajectories plus thousands of tasks the checker can score (the Postgres planner: 400 and 13,646)
Cost
Hundreds to a few thousand dollars at 4B: $1,200 for the Postgres planner, SFT and RL
Watch for
The checker being gamed; gains that need the same workload to repeat to pay off

Reasoning in a small model: distil from a reasoning teacher, ideally on-policy

Stages
SFT on a reasoning model's verified traces, then on-policy distillation or a short RL stage
Data
Hundreds of thousands of verified traces (R1: 800K)
Cost
SFT-priced: on the same 32B base, SFT on R1's samples beat 10,000+ steps of RL, 72.6% to 47.0% on AIME 2024
Watch for
A teacher too far above the student; traces that teach the format without the checking

An agent that acts: rL in environments, with the sandbox as part of the budget

Stages
SFT for the tool format, then RL over many task environments, often asynchronous
Data
Thousands of environments with their own checkers (MiMo-V2.6: 7,000+; Mercor: 1,928 expert tasks)
Cost
Dominated by rollouts and sandboxes; MiMo-V2.6-Pro's final RL stage cost $2.62M in under six days
Watch for
Reward hacking through the environment; an inescapable sandbox removes a class of it before the reward has to

Less hardware at serving: quantize first, then distil or go sparse

Stages
Post-training quantization (FP8 is close to lossless; about 4.9 bits is llama.cpp's default), quantization-aware training for lower, distillation for a smaller model
Data
A small calibration set that looks like real use
Cost
Hours of compute for quantization; a training run for distillation
Watch for
The low-bit cliff below about 3 bits for dense models, and calibration data unlike your traffic

Pretrain from scratch: only for a new language, modality, domain or research question

Stages
Pretraining, a mid-training anneal, long-context extension, then the whole post-training pipeline
Data
Trillions of filtered tokens; data quality is the bigger lever
Cost
About 6 × parameters × tokens FLOPs: size it in the Scaling calculator, copy a recipe from Open recipes compared
Watch for
Loss spikes and hardware failures; plan checkpoints around a failure every few hours at scale

The pages under this one

In the lifecycle's order. Times are each page's own header: core reading, plus what sits in closed details.

Figures: the loss on every character as a toy trains; loss over model size and tokens, the scaling surface. The objective and how to read the loss; compute and scaling laws (C = 6ND, Kaplan against Chinchilla, why everyone over-trains); data in stages and what the anneal buys; running at scale; open recipes. Tab: Speedrun records. (33 min, plus 4 in closed details)

Holds what the former Continued Pretraining (CPT) page taught (sections 6 and 7): domain adaptation and long-context extension, forgetting, replay ratios, learning-rate re-warming, the CMR and D-CPT mixture laws, a run checklist. Tab: CPT recipes compared. A child of Topic: data-curation-and-datasets. (45 min, plus 23 in closed details)

Figures: eight real Tulu 3 SFT rows in one batch; four answers, six pairs, one score each; one RL step, model by model; one DPO pair; a verifier scores a group of eight. Which tokens SFT learns from and how batching weights them; reward models; PPO and GRPO in the pipeline; DPO and its family; online against offline; RLVR; how open recipes combine the stages. Tab: Method family tree. (33 min, plus 4 in closed details)

Figures: one riddle under best-of-n; where each coding hack cuts into the reward; what the policy can reach. Goodhart made precise; the proxy-against-gold curve, measured; chat-model and coding-agent hacks; detection; mitigations and what defeats each; hacking that generalises into misalignment. Tab: Case gallery. (32 min, plus 11 in closed details)

Figures: LoRA on one real matrix; the real update, direction by direction; one Llama 3 8B block, to scale; training state for full fine-tuning, LoRA and QLoRA; five adapters in one batch. The methods and what each trains; how low a real update's rank is; which matrices to adapt; memory, with a calculator; LoRA against full fine-tuning; DoRA; serving many adapters. Tab: Trainable parameters. (26 min, plus 2 in closed details)

Figures: real logits, softmax at a temperature; forward and reverse KL; the teacher's text against the student's own; Llama 3.1 8B pruned two ways. Soft targets and temperature; the KL direction; whose text the student learns from; distil or RL; pruning then distilling; what makes a good small model. Tabs: Distil a toy student, Small models compared. (24 min, plus 8 in closed details)

Figures: five ways to share a scale; GPTQ on one row; 16 real tokens by 64 channels; one linear layer, three matmuls, one recipe. Number formats; sharing a scale; post-training quantisation (GPTQ, AWQ); outliers, migration and rotation; quantisation-aware training and ternary models; FP8 and NVFP4 training; serving formats and their names. (31 min, plus 10 in closed details)

Figures: Llama 3 8B on one 80 GB H100; five collectives, four GPUs; one feed-forward block, two GPUs; a published layout as a mesh of GPUs. The memory every split fights; the five collectives; data parallel, ZeRO and FSDP; tensor and sequence, pipeline, expert and context parallelism; composing them; activation checkpointing; frameworks. Tab: Layout calculator. (35 min, plus 5 in closed details)

Depth

How we got here: the lifecycle, paper by paper, 2019 to 2026 (depth)

The lifecycle was assembled in about seven years, mostly by papers that changed one stage each. The recipes that put them together in the open, stage by stage, are compared in Open recipes compared.

2019

Pretraining becomes an experiment you can control: T5 fixes one pipeline and moves one choice at a time; denoising beats plain language modelling, cleaned web text (C4, 745 GB) beats eight times more unfiltered text, and multi-task pretraining then fine-tuning only matches plain pretraining (T5). ZeRO and Megatron-LM make models bigger than one GPU trainable.

2020

Scaling laws: loss falls as a smooth power law in parameters, data and compute; the paper's advice to spend compute mostly on parameters was later overturned (Kaplan et al.).

2021

LoRA makes fine-tuning a 35 MB adapter instead of a 350 GB copy (LoRA); RoPE (RoFormer) and top-1 MoE routing (Switch Transformers) arrive.

2022

Chinchilla: grow parameters and tokens together, about 20 tokens per parameter; a 70B model on 1.4T tokens beat the 280B Gopher at the same compute, 67.6% against 60.0% on MMLU (Chinchilla). InstructGPT fixes the three-step recipe (SFT, reward model, PPO with a KL penalty) (InstructGPT); Constitutional AI replaces human harmlessness labels with a model reading 16 written principles (Constitutional AI). FlashAttention (paper).

2023

DPO removes the reward model and the RL loop (DPO); QLoRA fine-tunes 65B on one GPU (QLoRA); LIMA argues 1,000 curated examples suffice for SFT (LIMA).

2024

GRPO drops PPO's critic (DeepSeekMath); Llama 3 publishes the most detailed frontier-scale run, with six rounds of reward model, rejection sampling, SFT and DPO (Llama 3); DeepSeek-V3 trains in FP8; OLMo 2 releases everything, logs included (OLMo 2).

2025

DeepSeek-R1: outcome-only RL on a base model produces long self-checking reasoning, and SFT on 800K of its samples beats RL for smaller models (DeepSeek-R1). Open replications follow; DAPO releases algorithm, data and code, reaching 50 points on AIME 2024 from the Qwen2.5-32B base (GitHub, paper), the runnable baseline for RLVR.

2026

RL moves into environments (MiMo-V2.6, SWE-2, Mercor's 397B run) and its infrastructure gets published (DSec); training data comes from production traffic (NeoHorse-1); and models do part of the research. Anthropic's internal measurements: over 80% of code merged into its production codebase written by Claude by May 2026; the model's research suggestions beating the human choice 64% of the time in April 2026, against 51% in November 2025; Claude leading 26% of its AI research work, with over 30,000 agents active on its most-used internal platform; continuous-integration load up 25 times in six months self-reported (When AI builds itself, measuring the pace). Z.ai reports GLM-5.3 building the inference stack that serves it in 13 days, while saying it has not reached recursive self-improvement because humans kept the objectives (Z.ai). Both labs draw the line in the same place: the loop closes on execution, not on choosing goals. The full series with every check is in the 21 September tech news issue.

Corrections

The old page listed DAPO among September 2026 results; it was released in March 2025 (the 50-point checkpoint in May 2025). "When AI builds itself" first appeared in early June 2026, and 18 September updated one chart. The model's research suggestions beat the human choice 64% of the time, not "matched"; the "roughly 90% of their work" is the share of work at or above "AI collaborates", not staff time; the 30,000 agents are those on Anthropic's most-used internal platform; and the CI post gives the 10-fold growth of the test suite as a cause of the 25-fold CI growth, not a response to it (checks of 2 October 2026 in the 21 September and 28 September issues).

Five misreadings that cut across stages (depth)

The stage-specific ones live with their owners: "DPO is RLHF without the downsides" on Alignment, a rising reward on Reward Hacking, "LoRA always matches full fine-tuning" on PEFT, "quantization is free" on Quantization and Precision.

Treating "20 tokens per parameter" as how long to train
Chinchilla's ratio minimises training compute for a given loss. A model that will serve many tokens is trained far longer, because a smaller model is cheaper to run: Llama 3 405B saw 15.6T tokens, 38.5 per parameter derived, and its small models many times more. Compare both regimes in the Scaling calculator.
Reading a published training cost as the cost of the model
DeepSeek-V3's $5.576M is 2.788M H800 hours at an assumed $2 for the final official run only, with research and ablations excluded; R1's $294K sits on top of it. Each figure on the Price list says what it includes.
"SFT taught it to reason" or "RL gave it new abilities"
SFT teaches the format of reasoning and RL sharpens what the base model already reaches with enough samples (see Axis 1). A capability absent from pretraining rarely appears later.
Reading a self-improvement paper as measured self-improvement
NeoHorse-1's loop ran once; Agora and Dream-RSI are single runs without a comparison; Anthropic's figures are internal measurements on internal tasks. The mechanisms are real; the compounding is not yet measured.
Comparing token counts across models
Token counts depend on the tokenizer: the same text costs several times more tokens in a low-resource language, and a 256K vocabulary packs more text per token than a 32K one (Tokenizers).