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

  1. Stage 1, supervised fine-tuning (SFT): train the pretrained language model on human-written demonstrations of helpful answers, producing a clean starting assistant model.
  2. 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.
  3. 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.
  4. 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

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 Vπ(s) and the action-value Qπ(s,a), and how are they related? If π(a1∣s)=0.7, π(a2∣s)=0.3, Qπ(s,a1)=4 and Qπ(s,a2)=2, what is Vπ(s)?