Mid-level interview questionAsked at Cohere · interview write-up
Walk me through an LLM's lifecycle: pretraining, supervised fine-tuning, RL, and how each stage is evaluated.
Model answer
Pretraining learns language and knowledge by next-token prediction on trillions of tokens, most of the compute. SFT trains on curated prompt-response pairs so the model follows instructions and a format. Then preference or RL training goes beyond imitation: RLHF with a reward model, DPO on preference pairs, or verifiable rewards for maths and code.
Evaluation runs throughout: loss and benchmarks, then instruction-following, safety and preference scores, so no stage undoes the last.
Scroll sideways to see the whole diagram
RLHF: fit a reward model to human preferences, then optimise the policy against it with reinforcement learning.
Text version
- RLHF: fit a reward model to human preferences, then optimise the policy against it with reinforcement learning.
- DPO: one supervised-style loss on the same pairs. No reward model, no sampling loop, far fewer moving parts.
Ouyang et al. (2022), Training language models to follow instructions with human feedback; Rafailov et al. (2023), Direct Preference Optimization.
Practise the rest
20 Fine-tuning & alignment questions, 492 in all, each with a model answer. Free.
More from Cohere interview questions.
More Fine-tuning & alignment interview questions
- Prompting, RAG or fine-tuning: how do you choose?
- What is LoRA, and why is it so much cheaper than full fine-tuning?
- You're handed fine-tuning code whose loss behaves oddly. What do you check?
- Compare RLHF with a reward model to DPO.
- Debug a GRPO training loop. What is the probability ratio, and what goes wrong with it?
- Design a platform for fine-tuning LLMs on AWS, covering distributed training and security between tenants.