RLHF: Aligning with Human Preferences
Introduction
Supervised Fine-Tuning (SFT): Teaching Instruction-Following closed on what SFT cannot do: it shows the model good answers and nothing else, so it never learns that one answer is better than another. Reinforcement learning from human feedback (RLHF) adds that signal. People compare answers, and the model is trained toward the ones they prefer.
It worked. In InstructGPT's human evaluations, "outputs from our 1.3B PPO-ptx model are preferred to those from the 175B GPT-3", a model more than a hundred times smaller.
You'll learn:
- why comparisons are the feedback
- the three steps: SFT, a reward model, then reinforcement learning
- the leash that keeps the model near where it started
- reward hacking, measured on a small model
- how AI feedback scales the labelling
From a Good Answer to the Better One
SFT's feedback is one good answer to imitate. RLHF's is a comparison: two or more answers to the same prompt, and which one a person prefers.
Comparisons were chosen on purpose. Christiano and colleagues asked people to compare short clips of an agent's behaviour rather than score them: "We found comparisons to be easier for humans to provide in some domains, while being equally useful for learning human preferences." A comparison also carries what SFT cannot: every pair has a loser, so the model learns what to avoid as well as what to do.
RLHF in Three Steps
InstructGPT's recipe, in its own words, is three steps: "(1) supervised fine-tuning (SFT), (2) reward model (RM) training, and (3) reinforcement learning via proximal policy optimization (PPO) on this reward model."
- Start from the SFT model, the assistant of the last stage.
- Train a reward model on people's comparisons, so that it scores any answer.
- Optimize the SFT model against the reward model with reinforcement learning, while a penalty keeps it close to where it started.

Step 2a: Collecting Preferences
The raw material is preference data. Take a prompt, have the model write several answers, and ask a person to rank them. InstructGPT's labellers ranked "anywhere between K = 4 and K = 9 responses" per prompt, and each ranking gives every pair of them as a comparison: a chosen answer and a rejected one.
Here is a real pair from the lab below. The tiny GPT of Supervised Fine-Tuning (SFT): Teaching Instruction-Following wrote both answers to the same question, and the function's real docstring line is Same as a > b.
{
"prompt": "What does operator.gt do?",
"chosen": "Same as b years and % esymle.",
"rejected": "Return the file_alse scriptor text lines, fit_ex_dn."
}The lab's gold judge scores an answer by how close it is to that real line: 38.3 for the chosen answer, 3.9 for the rejected one. The lab's proxy reward model, which never sees the real line, scored them the other way round, 2.38 and 3.01: a first sign of what follows. A comparison needs no one to write the better answer, only to pick it.
Step 2b: Training the Reward Model
No person can grade every answer during training, so a model learns to stand in for them. InstructGPT's reward model: "Starting from the SFT model with the final unembedding layer removed, we trained a model to take in a prompt and response, and output a scalar reward." It is trained on the comparisons with one goal, to score the chosen answer above the rejected one. Its loss for a pair is the negative log of the sigmoid of the difference of the two scores, so that "the difference in rewards represents the log odds that one response will be preferred to the other by a human labeler".
The reward model is a learned stand-in, not the people. It is right only as far as its training pairs reach.
Step 3: Optimize, on a Leash
The SFT model, now called the policy, writes answers; the reward model scores them; PPO, the reinforcement learning algorithm, updates the policy so that higher-scoring answers become more likely. Repeated many times.
Chasing the score alone goes wrong, so the reward carries a penalty for drifting from the SFT model. InstructGPT: "we add a per-token KL penalty from the SFT model at each token to mitigate overoptimization of the reward model." KL divergence measures how far the policy's word choices have moved from the SFT model's. The policy is paid for reward and charged for distance.
The Catch: Reward Hacking, Measured
The reward model is a proxy, and optimizing a proxy too hard can make the real thing worse: Goodhart's law. Gao, Schulman and Hilton put it this way for the reward model: "optimizing its value too much can hinder ground truth performance". They measured it in 2022 with a setup that needs no people: a fixed "gold" reward model plays the people, a smaller proxy is trained on its preferences, and the policy is optimized against the proxy.
The lab below does the same on a laptop. Its policy is the answer-only model of Supervised Fine-Tuning (SFT): Teaching Instruction-Following. Its gold judge scores how close an answer is to the function's real docstring line (chrF, 0 to 100), a stand-in for a person who knows the answer. Its proxy is a small reward model trained with InstructGPT's loss on 2,206 pairs the gold judge labelled; it sees the question and the answer, never the real line, and on held-out pairs it agrees with the gold judge 65% of the time. The policy is optimized by best-of-n: write n answers, keep the one the proxy scores highest.
The proxy's score of its pick rose at every doubling of n, from 2.29 with one answer to 3.83 with 512. The gold judge's score of the same picks barely moved: 18.8 with one answer, 20.1 with two, 19.3 with 16 and 22.0 with 512, while the gold judge, picking from the same 512 for itself, reached 44.9. The pressure went where the proxy could see: the picked answers grew from 38.5 characters to 57.8, the length effect below. On some questions the pick got worse: for operator.gt the first answer scored 38.3, and the proxy's pick among 16 scored 3.9. In Gao and colleagues' runs, with a policy of 1.2 billion parameters, a gold reward model of 6 billion and best-of-n taken as far as 60,000 answers, "the gold reward initially increases and later decreases".
Two symptoms are measured in large models. Length: Singhal and colleagues found that "improvements in reward to largely be driven by increasing response length". Sycophancy: Sharma and colleagues found it in five assistants, "likely driven in part by human preference judgments favoring sycophantic responses". The defences are the penalty for distance, and a better proxy: Gao and colleagues found the effect's coefficients "scale smoothly with the number of reward model parameters".
See It: Pick the Best of n
Double n and watch which answer the proxy picks, and what the gold judge gives it. Each dot is one of the policy's answers to the question, placed by the proxy's score and the gold judge's. The curves are the averages over all 40 held-out questions. Every number is from the lab's run.

Making It Scale: AI Feedback
Human labels are slow and cost money, so models now label too.
- RL from AI feedback (RLAIF). A model, not a person, picks the better answer. Lee and colleagues found in 2023 that "RLAIF achieves comparable performance to RLHF" on summarization and helpful and harmless dialogue, and estimated AI labels "over 10x cheaper than human annotation": about $0.06 against $0.67 for each pair of summaries, at that year's prices.
- Constitutional AI. Anthropic's 2022 method trains a harmless assistant "without any human labels identifying harmful outputs": "The only human oversight is provided through a list of rules or principles". The model critiques and revises its own answers against them, and a model picks the better of two answers to train the preference model.
An AI judge brings its own errors, the same Goodhart risk as any proxy.
Why This Matters for You
- It explains behaviour you will meet. Long answers and agreeing with the user are both measured effects of preference training.
- A reward model is a proxy. Anything you optimize against a learned judge, including an LLM grader in your own evaluations, can be gamed the same way.
- You can use preference data yourself. Pairs of a chosen and a rejected answer are the input of the method in DPO & Modern Preference Tuning, which learns from them without a separate reward model or a reinforcement learning loop.
Check Yourself
Eight questions on RLHF.
Check yourself: RLHF
1 / 8Multiple choice
Multiple choice
Multiple choice
Multiple choice
Multiple choice
Multiple choice
Multiple choice
Multiple choice
Key Takeaways
- RLHF learns from comparisons: which of two answers people prefer.
- Three steps: start from the SFT model, train a reward model on the comparisons, optimize the policy against it with PPO.
- A KL penalty keeps the policy close to the SFT model while it chases reward.
- The reward model is a proxy: optimized too hard, its score keeps rising while the true quality stalls or falls (reward hacking).
- AI feedback (RLAIF, Constitutional AI) makes the labels far cheaper, with the same proxy risk.
Next: DPO & Modern Preference Tuning. The same comparisons, without the reward model or the reinforcement learning.