TL;DR
GPT-3 was trained to predict internet text, and that is not the same as doing what a user asks. It makes things up, rambles, and sometimes produces toxic text. InstructGPT fixes this with three stages: supervised fine-tuning on human-written demonstrations, a reward model trained on human rankings of model outputs, and PPO reinforcement learning against that reward model. A 1.3B InstructGPT model was preferred by labelers over the 175B GPT-3, despite having over 100 times fewer parameters.
Where you'll see it: the recipe behind most chat assistants, the step that turns a raw language model into one that follows instructions.
The problem
A language model trained only to predict the next token learns to continue text, not to serve a person. Ask it to summarize an article and it may write another article, invent a citation, or give a long hedge where a short answer was wanted. The paper states the core claim plainly: making language models bigger does not inherently make them better at following a user's intent. Their word for this gap is misalignment.
Scaling was the usual fix, and it was not enough. The authors measured GPT-3 at 175B parameters on prompts drawn from the OpenAI API and found that its outputs were often untruthful, toxic, or simply unhelpful. Even a well-crafted few-shot prompt, which shows the model a few examples inside the prompt itself (see In-Context Learning), left a clear preference gap.
Human preference was not a new signal. Earlier work had used it to fine-tune language models for stylistic continuation and for summarization. What was missing was evidence that the same recipe could work across a broad, messy distribution of instructions that real users send. The paper's bet is that a fairly small amount of human judgement, applied to a large model, is enough to close that gap.
Key idea
Humans can supply their signal in two cheap forms. A demonstration is a person writing the ideal answer to a prompt; the model copies it. A comparison is a person looking at several answers and picking the best. Picking is faster and more consistent than writing, and it is easier to get reliable labels for "which of these is better" than for "write the perfect answer."
So the method learns a score from comparisons, the reward model, and then uses that score as the training signal for the language model. The picture is a teacher who grades essays rather than writing them. The grades are not the essay, but a student who learns to predict the grades ends up writing better essays.
flowchart LR
A[Pretrained GPT-3] --> B[Step 1: supervised fine-tuning on demonstrations]
B --> C[SFT model]
C --> D[Step 2: labelers rank sampled outputs]
D --> E[Reward model]
C --> F[Step 3: PPO against reward model with KL penalty]
E --> F
F --> G[InstructGPT]
The three steps are not a one-off. The paper notes that comparison data can be collected again from the current best policy, which is then used to train a new reward model and a new policy. In practice most comparison data came from supervised policies, with some coming from PPO policies.
The method
Step 1: supervised fine-tuning
Labelers write a demonstration for each prompt . GPT-3 is then fine-tuned on these pairs with the ordinary next-token cross-entropy loss, which is standard Fine-Tuning on a small, curated dataset. The result is the supervised policy . This model is both the baseline and the starting point for step 3. The paper trains the SFT baseline for 16 epochs and picks a checkpoint by reward model score. Validation loss starts to overfit after 1 epoch, but the authors found that more epochs still improved the reward model score and human ratings. The models that start RL get 2 epochs (with the 10% pretraining mix, below).
About 13k prompts were used for the SFT dataset, drawn from the API and from labeler-written prompts.
Step 2: the reward model
The reward model takes a prompt and a response and returns one real number. The main text says it starts from the SFT model with the final unembedding layer removed, so the output is a scalar instead of a distribution over tokens. The appendix says something slightly different: the final reward model was initialized from a 6B GPT-3 model fine-tuned on a mix of public NLP datasets (ARC, BoolQ, CoQA, DROP and others), "mostly for historical reasons", and that initializing from plain GPT-3 or from the SFT model gave similar results. Treat the main-text description as the idea and the appendix as what was actually run. The paper uses one 6B reward model for every policy size, because 175B reward models trained less stably and cost much more compute to use inside PPO.
For each prompt, labelers rank between and responses. A ranking of responses contains pairwise comparisons. The obvious approach is to shuffle all pairs into one dataset, but the pairs from one prompt are strongly correlated, and a single pass over shuffled pairs made the model overfit. The authors instead treat all pairs from one prompt as a single batch element. Each response then needs only one forward pass.
The loss for a prompt with preferred response and less-preferred response is
Here is the sigmoid, which turns a score difference into a probability that beats . Minimizing this is the same as maximizing the log of that probability, so it is a cross-entropy loss on the human choices. The only thing the model learns is differences: adding a constant to every score leaves the loss unchanged. The paper uses this to normalize the reward so that the labeler demonstrations average to zero before RL starts.
Worked numbers. Take . That gives comparisons per prompt. Suppose the reward model gives the preferred response a score 2 higher than the other. Then , and the term inside the expectation is . If the scores were tied, the same term would be , which is the loss of a coin flip. If the model ranked the pair backwards by 1, the term would be , a much larger penalty.
About 33k prompts were used for the reward model dataset, from the API and from labeler-written prompts.
Step 3: PPO against the reward model
Once the reward model exists, the SFT model is tuned with reinforcement learning. The environment is a bandit: a random prompt arrives, the policy writes one response, the reward model scores it, and the episode ends. The policy is updated with PPO, which limits how far each update can change the policy in one step.
The full objective is
The first term is the reward the policy should maximize. The second term subtracts times the log-ratio between the policy and the frozen SFT model, which is a sample-based estimate of the KL divergence between the RL policy and the frozen SFT model. Without it the policy finds ways to exploit the reward model, producing text that scores highly but reads badly. In the paper's description of the environment the penalty is applied per token; Equation 2 writes it at the whole-response level. The paper sets ; its sweep found both 0 and 2 perform poorly, with the best values around 0.01 to 0.02. The third term is the pretraining mix. Setting gives the plain PPO model. Keeping nonzero gives PPO-ptx, which the paper calls InstructGPT by default.
The pretraining term matters for the alignment tax, discussed below. On each update, the gradient mixes RL updates with the ordinary next-token likelihood on a pretraining distribution. Roughly 10% pretraining data was used during the supervised stage that initializes RL, which the authors found helpful for PPO training.
The value function used by PPO is initialized from the reward model. Training ran for 256k episodes over about 31k unique API prompts, after filtering out prompts containing personally identifiable information and deduplicating.
The data and the labelers
The authors hired 40 contractors and screened them with a test. Most prompts were submitted to the OpenAI API, filtered for personal information, with some labeler-written prompts added. The API prompts were grouped by use case. The largest groups were generation at 45.6%, open question answering at 12.4%, brainstorming at 11.2%, and chat at 8.4%. The rest were rewriting, summarization, classification, extraction and other tasks.
The three dataset sizes were about 13k prompts for SFT, 33k for the reward model, and 31k for PPO. The PPO prompts carry no human labels; they are only inputs to the policy.
Results
The main evaluation is human. Labelers rate outputs on a held-out test set built from prompts sent by customers whose prompts were not in the training data. Automatic evaluation covers public NLP benchmarks.
Preference. Outputs of the 175B InstructGPT are preferred to outputs of 175B GPT-3 of the time, and preferred of the time to few-shot 175B GPT-3. The 1.3B InstructGPT is preferred to the 175B GPT-3 even though it has over 100 times fewer parameters. The two models share an architecture and differ only in the fine-tuning on human data. The effect also appears for held-out labelers who wrote no training data, who preferred InstructGPT at about the same rate as the training labelers (a preliminary experiment, in the paper's words). Reward models trained on four of five labeler groups predicted the held-out group's preferences with 69.6% accuracy, against 72.4% on the groups they trained on.
Truthfulness and hallucination. On TruthfulQA, InstructGPT produces truthful and informative answers about twice as often as GPT-3. On closed-domain tasks such as summarization, where the output should not add information absent from the input, the hallucination rate fell from 41% for GPT-3 to 21% for InstructGPT.
Toxicity and bias. When prompted to be respectful, InstructGPT generates about 25% fewer toxic outputs. It did not significantly improve on the bias benchmarks Winogender and CrowS-Pairs.
Public NLP datasets and the alignment tax. RLHF caused regressions on some public benchmarks, including SQuAD, DROP, HellaSwag and French to English translation. The paper calls this an alignment tax. Mixing pretraining updates into PPO, the PPO-ptx variant, mitigated these regressions on all the datasets (and even beat GPT-3 on HellaSwag) without large changes in labeler preference. It did not remove them entirely: PPO-ptx still lagged GPT-3 on DROP, SQuADv2 and translation.
Versus other instruction datasets. The authors also fine-tuned GPT-3 on the FLAN and T0 collections of public NLP tasks. Labelers preferred InstructGPT over the SFT baseline 73.4% of the time, while the T0 and FLAN models were preferred only 26.8% and 29.8% of the time. Public NLP tasks, in other words, do not look like real API traffic.
Limits. The paper is explicit that InstructGPT still makes simple mistakes. It can fail to follow instructions, make up facts, hedge on simple questions, or miss false premises.
Why it mattered
The paper turned a research recipe into evidence that a practical product could be built on it. A model over 100 times smaller than GPT-3 became the one people preferred, and the lesson was that alignment is a cheap addition to a large model rather than a property that requires a bigger one. OpenAI later described ChatGPT as trained with a method closely related to this one, and the recipe of supervised demonstrations, a learned reward model, and RL fine-tuning became the common template for instruction-following assistants.
The paper also made several problems visible that later work has tried to address. The reward model is a proxy for human judgement, and optimizing it too hard produces over-optimization, which is why the KL penalty matters. The alignment tax is real and needs fixes like pretraining mixing. And the people whose preferences were learned were a small group of contractors and researchers, which the authors discuss directly as a question of whom the model is aligned to.
Reading guide
Read the paper in this order and use the linked lessons as you go.
- Section 1, Introduction. Needs RLHF at the level of its big picture, and Fine-Tuning for the first step.
- Section 3.1, High-level methodology. Needs Fine-Tuning, Reward Model and PPO. This section is the three-step recipe in the Key idea above.
- Section 3.4 to 3.5, Human data collection and Models. Needs Cross-Entropy Loss for the SFT loss and Sigmoid Function for the reward model loss. The reward model loss is the formula in the method section here.
- Section 3.5, PPO objective (Equation 2). Needs Kullback–Leibler Divergence for the penalty and PPO for the update. The pretraining term needs only the idea of next-token likelihood.
- Section 3.6 and 4.1, Evaluation and API results. Needs GPT-3 for the baseline models and In-Context Learning for the few-shot prompting baseline.
- Section 4.2, Public NLP datasets. Uses the same ideas; the alignment tax is the point to watch for here.
- Section 5, Discussion. Read after the results. It needs no new prerequisites.
Check yourself
QuestionName the three steps of the InstructGPT method, in order.Show answer
QuestionA labeler ranks K = 4 responses to one prompt. How many pairwise comparisons does this produce, and if the reward model scores the preferred response 2 higher than the other, what is the value of the loss term ?Show answer
QuestionWhy does the paper treat all pairs from one prompt as a single batch element instead of shuffling them into one dataset?Show answer
QuestionA team has a base model that writes fluent but unhelpful answers and a limited labeling budget. Should they spend it mostly on demonstrations or on comparisons, and why?Show answer
Sources
- Ouyang et al., Training language models to follow instructions with human feedback, arXiv:2203.02155. https://arxiv.org/abs/2203.02155
- Stiennon et al., Learning to summarize from human feedback, arXiv:2009.01325. https://arxiv.org/abs/2009.01325
- Schulman et al., Proximal policy optimization algorithms, arXiv:1707.06347. https://arxiv.org/abs/1707.06347