What are the three stages of reinforcement learning from human feedback (RLHF) used to fine-tune a language model, and what does each stage produce?
Reinforcement learning, RLHF
Level L1 Beginner. Length Short. Nature Th Theoretical.
What's being asked
Whether you can describe the standard three-stage RLHF pipeline and see where human preferences and reinforcement learning enter it.
Key idea
Stage 1 uses supervised fine-tuning (SFT) on human-written examples to teach the model how to answer. Stage 2 trains a separate reward model (a scorer) from human rankings of model answers. Stage 3 uses reinforcement learning (RL) to adjust the language model so it earns higher scores while staying close to the Stage 1 model.
Steps
- Stage 1, supervised fine-tuning (SFT): train the pretrained language model on human-written demonstrations of helpful answers, producing a clean starting assistant model.
- Stage 2, reward modelling: show the Stage 1 model a prompt, generate two or more answers, and ask humans which one is better. Train a separate scoring network (the reward model) to give higher scores to the human-preferred answers.
- Stage 3, reinforcement learning (RL): let the language model generate answers and receive scores from the frozen reward model, updating the language model to produce higher-scoring answers.
- Explain the stay-close guardrail: Stage 3 adds a penalty if the language model drifts too far from the Stage 1 model, because otherwise it can exploit quirks in the reward model and output strange text that scores high ("reward hacking"). The formal KL-penalty objective and algorithms such as PPO come later.
Common mistakes
- Saying humans give a reward for every generated word or token: humans only compare or rank whole answers, and the reward model turns those comparisons into a score.
- Forgetting the guardrail that keeps the model close to Stage 1: without it, the model can game flaws in the reward model (reward hacking).
- Describing the reward model as the generator: the reward model stays frozen as a judge during Stage 3.
How long your answer should be
Under 2 minutes (4–5 sentences), listing the three stages in order.
Read this
Previous in Reinforcement learning: What is the difference between model-free and model-based reinforcement learning, and what is the main trade-off between them?
Next in Reinforcement learning: What is the difference between the state-value and the action-value , and how are they related? If , , and , what is ?