InstructGPT: Training Language Models to Follow Instructions with Human Feedback
Read first: Proximal Policy Optimization (PPO) · Reward modeling: Bradley–Terry, label disagreement and a worked example
TL;DR. Take GPT-3 and apply three steps. (1) SFT: fine-tune on about 13k prompts with labeller-written demonstrations. (2) RM: have labellers rank 4–9 model outputs for about 33k prompts and train a 6B reward model on all pairs. (3) PPO: on about 31k unlabeled API prompts, maximise the RM score minus a per-token KL penalty to the SFT model, optionally mixing in pretraining gradients (PPO-ptx). Labellers prefer the 1.3B result to the 175B GPT-3. This is the recipe ChatGPT-style post-training started from.
Why it matters now. Almost every later method is defined by which piece of this pipeline it removes or replaces. DPO drops the separate RM and the online loop. RLOO and GRPO drop the critic. Constitutional AI replaces human harmlessness labels with AI labels, and verifiable rewards replace the RM entirely. To read any of those papers you need this pipeline and its parts clearly in mind.
Key idea
Section titled “Key idea”Stage 2: reward model. For a prompt with ranked responses, the loss over all pairs is
and all pairs from one prompt form one batch element. Shuffling them separately made the RM overfit in a single epoch. See the reward modelling hub for the Bradley–Terry model worked through.
Stage 3: RL. Each prompt and response is a one-step bandit episode. The policy is trained with PPO to maximise (paper Eq. 2)
with . “PPO” means ; “PPO-ptx” (the model called InstructGPT) uses . The KL term is applied per token, so most tokens get a small reward of and the last token also gets the RM score. For example, with log-ratios 0.2, 0.5 and −0.1 and RM score 1.5, the return is .
The five roles in PPO-based RLHF
Section titled “The five roles in PPO-based RLHF”| Role | Trained? | InstructGPT initialisation | What it contributes |
|---|---|---|---|
| Policy | yes | SFT model (with 10% pretraining mix) | numerator of the PPO ratio; generates the final model |
| Old / rollout policy | frozen snapshot | copy of at the start of each iteration | samples the batch; denominator of the PPO ratio and clip at 0.2 |
| Reference | frozen all run | SFT model | per-token KL penalty; limits total drift |
| Reward model | frozen | 6B, trained in stage 2 | one scalar per response |
| Critic | yes | initialised from the RM (6B) | baseline for GAE advantages (no discount) |
The old policy and the reference are easy to confuse. The ratio keeps one update small (PPO). The KL to keeps the whole run where the RM was trained. Four of the five are large networks held in memory. That cost is why critic-free (RLOO) and RL-free (DPO) methods became popular.
Key results
Section titled “Key results”- Preference (Fig. 1). 175B InstructGPT is preferred to 175B GPT-3 85 ± 3% of the time, and to few-shot-prompted GPT-3 71 ± 4% of the time. The 1.3B PPO-ptx model is preferred to 175B GPT-3.
- Held-out labellers prefer InstructGPT at about the same rate. RM accuracy drops only from 72.4 ± 0.4% to 69.6 ± 0.9% on their preferences.
- Truthfulness. About twice as many truthful and informative TruthfulQA answers. Closed-domain hallucination falls from 41% to 21%.
- Toxicity and bias. About 25% fewer toxic outputs than GPT-3 when prompted to be respectful; no significant improvement on Winogender or CrowS-Pairs bias.
- FLAN and T0. GPT-3 fine-tuned on these public instruction datasets is worse than the SFT baseline; InstructGPT is preferred to them 78 ± 4% and 79 ± 4% of the time. The authors’ explanation: about 57% of API prompts are open-ended generation or brainstorming, and only about 18% are classification or QA.
Limitations & open questions
Section titled “Limitations & open questions”- Simple mistakes remain. It sometimes accepts false premises, hedges too much (the authors suspect labellers rewarded epistemic humility) and degrades on instructions with several explicit constraints.
- Whose preferences? “Aligned” here means aligned to the labellers, the researchers who wrote their instructions, and the API customers who sent the prompts. The authors say none of these is claimed to be the right source of preferences.
- It follows harmful instructions. The model is allowed to produce harmful or dishonest output when the user asks for it, because helpfulness was prioritised during training.
- Reward model overoptimisation is controlled only by β and early stopping. See RM overoptimisation scaling.
Connections
Section titled “Connections”- Before: Christiano et al., summarize from feedback (the same pipeline on TL;DR).
- RL machinery: PPO, GAE, actor-critic and advantage.
- Simplifications: DPO, RLOO, DPO family.
- Replacing human labels: Constitutional AI, LLM-as-judge.
- Recipes that followed: Tülu 3. For more depth, see the RLHF Book.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Derive / compute
A labeller ranks K = 4 responses A over B over C over D, and the reward model scores them 2.0, 1.0, 0.5 and −0.5. Using the paper's ranking loss, compute how many pairs it uses, each pair's loss, and the prompt's total loss. Then explain why the paper puts all pairs from one prompt into one batch element instead of shuffling them into the dataset.
What a strong answer covers
- K choose 2 = 6 pairs, each with loss −log σ(r_better − r_worse).
- Gaps 1.0, 1.5, 2.5, 0.5, 1.5 and 1.0 give losses of about 0.313, 0.201, 0.079, 0.474, 0.201 and 0.313.
- The sum is about 1.582, and dividing by 6 gives about 0.264. The B over C pair, with the smallest gap, contributes most.
- Shuffled pairs from one prompt are strongly correlated, and each response would be seen K − 1 times per epoch, so the RM overfit within one pass.
- As one batch element, each response needs one RM forward pass instead of one per pair, and validation accuracy and log loss improved.
- Derive / compute
In PPO the KL term is applied per token. A three-token response gets RM score 1.5, and its per-token log-ratios log(π/π_SFT) are 0.2, 0.5 and −0.1, with β = 0.02. Write the reward at each token, the episode return, and what changes with β = 0. How does this connect to the sequence-level objective in the paper's Eq. 2?
What a strong answer covers
- Per-token rewards: −0.004, −0.010 and +0.002 + 1.5 = 1.502. The RM score arrives only at the last token.
- The undiscounted return is 1.5 − 0.02 × 0.6 = 1.488.
- The per-token log-ratios add up to the sequence log-ratio log(π(y|x)/π_SFT(y|x)), so the sum matches r − β·log-ratio in Eq. 2. Its expectation under π is the KL.
- With β = 0 the return is the RM score alone, and nothing stops the policy drifting to text where the RM is wrong.
- Tokens where the policy is more confident than SFT (positive log-ratio) are penalised. Tokens where it is less confident are slightly rewarded.
- Mechanism
PPO-based RLHF keeps five roles in play: the policy being trained, the old or rollout policy, the reference (SFT) policy, the critic or value function, and the reward model. For each, say whether it is trained or frozen, what it is initialised from in InstructGPT, and the exact quantity it contributes to the update.
What a strong answer covers
- Policy π_φ: trained; starts as the SFT model (with 10% pretraining mix). It provides the numerator of the PPO ratio.
- Old or rollout policy: a frozen snapshot of π_φ that sampled the batch. It provides the denominator of the PPO ratio and the clipping anchor, and is refreshed every iteration.
- Reference π_SFT: frozen for the whole run. It provides the per-token KL penalty β·log(π_φ/π_SFT), so it anchors the whole run, not just one step.
- Reward model r_θ: frozen 6B model. It provides one scalar at the end of the response.
- Critic V: trained 6B model initialised from the RM. It provides the baseline for GAE advantages (no discount).
- It is a common mistake to merge the old policy and the reference: the ratio to the old policy limits one step; the KL to SFT limits total drift.
- What if…
RLHF made GPT-3 worse on SQuAD, DROP, HellaSwag and WMT French–English, an "alignment tax". Compare the two remedies the paper considers, raising the KL coefficient β and mixing in pretraining gradients (PPO-ptx). Say what each changes in the objective and which worked.
What a strong answer covers
- Raising β pulls the policy back towards SFT everywhere. In the paper this cut validation reward significantly and never fully recovered DROP and SQuAD.
- PPO-ptx adds γ·E[log π(x)] on pretraining text, so the model keeps assigning probability to the original data distribution while optimising reward.
- The paper finds that pretraining mixing beats simply raising the KL coefficient: a suitable γ reverses the SQuADv2 and DROP regressions with minimal loss of validation reward.
- PPO-ptx removes most regressions without hurting labeller preference, although large PPO-ptx models were slightly worse on prompts submitted to GPT-3.
- Critique
The paper itself asks "who are we aligning to?". Use its numbers on labellers and RM accuracy, and its admission that labellers rewarded hedging, to critique the claim that InstructGPT is aligned to human intent. What experiment would test whether the RM generalises to a different population?
What a strong answer covers
- About 40 contractors wrote the demonstrations and comparisons. Training labellers agreed with each other 72.6 ± 1.5% of the time, so about a quarter of labels reflect disagreement.
- RMs predicted held-out labellers 69.6 ± 0.9% vs 72.4 ± 0.4% for training labellers, which is encouraging but covers only one vendor pool.
- Labellers prioritised helpfulness during training but truthfulness and harmlessness during final evaluation, so the training signal and the evaluation target differ.
- The authors suspect the hedging behaviour came from rewarding epistemic humility, a labeller preference that the RM learned and the policy amplified.
- Test: collect comparisons from a demographically or professionally different group on the same prompts. Measure RM accuracy and policy win rate per group, especially on prompts where the groups disagree.
- Design
You are building a retrieval-augmented answer generator for a library search service and want to use the InstructGPT recipe. Define the three datasets, how the RM is initialised and what it sees, which model is the KL reference, and two evaluations that would catch the failure modes this paper reports.
What a strong answer covers
- SFT: librarian-written answers to real queries with retrieved passages in the prompt. RM: K-way rankings of model answers to other queries. RL: unlabeled queries only, as in the paper's 13k / 33k / 31k split.
- Initialise the RM from the SFT model with a scalar head. Its input must include the retrieved passages so it can judge grounding.
- Use the SFT model as the frozen KL reference, and consider PPO-ptx-style mixing on general text to limit the alignment tax.
- Measure closed-domain hallucination (the paper reports 21% vs 41% for GPT-3) by checking answers against the passages, and test false-premise queries.
- Hold out users and labellers, and track RM score against human win rate during RL to detect overoptimisation.