Describe the modern LLM training pipeline: pretraining → mid-training → SFT → RL.
Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.
Model answer: the part to lead with
Pretraining - next-token prediction over trillions of tokens (web crawl, code, books, papers; heavily filtered, deduplicated, and mixture-weighted). This is where most compute has traditionally gone (months on thousands of accelerators) and where capabilities - language, knowledge, code, latent reasoning - actually come from. Output: a base model that completes text but doesn't follow instructions or converse; it might answer your question or continue it with three more questions.
Full worked answer with diagram
Pretraining - next-token prediction over trillions of tokens (web crawl, code, books, papers; heavily filtered, deduplicated, and mixture-weighted). This is where most compute has traditionally gone (months on thousands of accelerators) and where capabilities - language, knowledge, code, latent reasoning - actually come from. Output: a base model that completes text but doesn't follow instructions or converse; it might answer your question or continue it with three more questions.
Mid-training (continued pretraining) - the messy-but-crucial middle stage labs now name explicitly: still next-token prediction, but on deliberately curated data for targeted goals: injecting high-quality domain data (math, code, synthetic textbooks), context-length extension (long documents + RoPE rescaling - long context is a mid-training deliverable, not a pretraining default), and annealing - decaying the learning rate over the highest-quality data, upweighting instruction-formatted and exam-style material so the base model lands closer to its post-trained destination.
SFT (supervised fine-tuning) - cross-entropy on curated (prompt, response) pairs, loss usually masked to response tokens. Teaches format and behaviour: chat structure, instruction following, tool-call syntax, refusal style, persona. Relatively tiny (order of 10⁴ - 10⁶ examples) and cheap versus pretraining. Key mental model: SFT elicits and shapes what pretraining built; it adds behaviour, not (much) knowledge - pushing new facts via SFT tends toward memorisation and can even encourage hallucination-shaped behaviour.
RL / preference optimisation - align outputs with human or verifiable preferences beyond what demonstrations capture. Classic RLHF: train a reward model on human preference pairs, optimise the policy with PPO under a KL leash to the SFT model. DPO and successors skip the explicit reward model, optimising preferences directly - simpler, cheaper, widely used. RLVR (RL from verifiable rewards, e.g. GRPO): reward comes from checkable outcomes (unit tests pass, math answer matches) - this is what trains o1/R1-style reasoning models and represents the current frontier, because it can extend capabilities rather than just steer style.
Framing that lands well: pretraining ≈ building the engine; mid-training ≈ upgrading components; SFT ≈ teaching it to drive on roads; RL ≈ coaching it against outcomes. Historically each stage was orders of magnitude cheaper than the previous; reasoning-focused RL has narrowed that gap sharply since 2025, with RL budgets at some labs now a substantial fraction of pretraining. Either way, the later stages disproportionately determine perceived quality.
Worth sketching. Labelling the edges with what each stage adds stops the four stages all sounding like the same stage.
flowchart LR
PT["pretraining: trillions of tokens,<br/>next-token prediction"] -->|"the bulk of compute"| BM["base model: completes text,<br/>does not converse"]
BM -->|"curated data, long documents"| MT["mid-training: domain mix,<br/>context extension, annealing"]
MT -->|"10^4 to 10^6 pairs"| SFT["SFT: chat format, instruction following,<br/>tool syntax, refusal style"]
SFT -->|"preferences or verifiers"| RL["RL: RLHF and DPO for style,<br/>RLVR and GRPO for checkable outcomes"]
RL --> SHIP["shipped model"]
What a good answer covers
- Pretraining - next-token prediction over trillions of tokens (web crawl, code, books, papers; heavily…
- This is where most compute has traditionally gone (months on thousands of accelerators) and where…
- Output: a base model that completes text but doesn't follow instructions or converse; it might answer…
- Mid-training (continued pretraining) - the messy-but-crucial middle stage labs now name explicitly
- SFT (supervised fine-tuning) - cross-entropy on curated (prompt, response) pairs, loss usually masked to…
Key terms: Pretraining · Mid-training · context-length extension · annealing · SFT (supervised fine-tuning) · RL / preference optimisation · RLHF · DPO · RLVR · GRPO
In the glossary: RLHF · PPO · DPO · RLVR · Verifiable reward · GRPO
Interviewer follow-ups to expect
Why does SFT on new facts encourage hallucination?
What does the KL constraint in RLHF prevent?
RL / preference optimisation - align outputs with human or verifiable preferences beyond what demonstrations capture. Classic RLHF: train a reward model on human preference pairs, optimise the policy with PPO under a KL leash to the SFT model. DPO and successors skip the explicit reward model, optimising preferences directly - simpler, cheaper, widely used. RLVR (RL from verifiable rewards, e.g. GRPO): reward comes from checkable outcomes (unit tests pass, math answer matches) - this is what trains o1/R1-style reasoning models and represents the current frontier, because it can extend capabilities rather than just steer style.
Why did verifiable rewards unlock reasoning gains that preference-based RLHF didn't?
RL / preference optimisation - align outputs with human or verifiable preferences beyond what demonstrations capture. Classic RLHF: train a reward model on human preference pairs, optimise the policy with PPO under a KL leash to the SFT model. DPO and successors skip the explicit reward model, optimising preferences directly - simpler, cheaper, widely used. RLVR (RL from verifiable rewards, e.g. GRPO): reward comes from checkable outcomes (unit tests pass, math answer matches) - this is what trains o1/R1-style reasoning models and represents the current frontier, because it can extend capabilities rather than just steer style.
Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep