Paper commentary
Training language models to follow instructions with human feedback
- Problem Pretrained language models predict the next token of web text, so they often make up facts, produce biased or toxic text, or ignore what the user asked for.
- Method Fine-tune GPT-3 on labeler demonstrations with supervised learning, train a reward model on labeler rankings of sampled outputs, then optimize the policy against that reward model with PPO.
- Results In human evaluations on the API prompt distribution, outputs from the 1.3B InstructGPT model were preferred to outputs from the 175B GPT-3 model.
Why next-token training is misaligned with instructions
Pretrained language models learn to predict the next token of text taken from the web, and that objective differs from following a user's instruction helpfully and safely. The consequences show up as invented facts, biased or toxic text, and outputs that skip the request, and they matter more because one model serves hundreds of applications.
The authors therefore call the language modeling objective misaligned and aim to train models toward the user's intention, covering explicit instructions and implicit goals such as truthfulness and avoiding harm. They describe the target as helpful, honest and harmless, and they evaluate those criteria later in the paper.
Three steps from demonstrations to a PPO policy
The pipeline starts from a pretrained GPT-3 model, a distribution of prompts, and a team of trained labelers, and it changes only the post-training of that model. In the first step, labelers write demonstrations of the desired behavior and GPT-3 is fine-tuned on them with supervised learning, which gives the SFT policy. In the second step, labelers rank the outputs for each prompt and a reward model is trained to predict the preferred output as a scalar reward.
In the third step, the SFT policy is optimized with PPO so that the reward model's score rises.
The reward model starts from the SFT model with its final unembedding layer removed, and only 6B reward models are used, because the authors found 175B reward model training could be unstable as a value function during RL. SFT training runs for 16 epochs with a cosine learning rate decay and residual dropout of 0.2, and the final SFT checkpoint is chosen by reward model score on the validation set.
Although the SFT models overfit validation loss after one epoch, more epochs still improved the reward model score and human preference ratings. Steps 2 and 3 can be repeated on the current best policy, though in practice most comparisons come from supervised policies and some from PPO policies.
How the reward loss and the PPO objective are written
Rather than shuffling every pair into one dataset, all pairs from one prompt are kept together as a single batch element, drawn from rankings of between 4 and 9 responses per prompt. The authors give the reward model loss as \[\text{loss}(\theta)=-\frac{1}{\binom{K}{2}}\,\mathbb{E}_{(x,y_w,y_l)\sim D}\left[\log\sigma\left(r_\theta(x,y_w)-r_\theta(x,y_l)\right)\right]\] where r_θ(x,y) is the scalar reward for prompt x and completion y, y_w is the preferred completion, y_l the rejected one, and D the human comparison dataset.
The minus sign means the loss falls as the reward of the preferred completion rises above the reward of the rejected one, and the factor 1/binom(K,2) normalizes by the number of pairs drawn for each prompt. Because this loss does not change when a constant is added to all rewards, the reward model is shifted with a bias so that labeler demonstrations average 0 before RL starts.
During RL the policy is trained to maximize the following objective: \[\text{objective}(\phi)=\mathbb{E}_{(x,y)\sim D_{\pi^{RL}_\phi}}\left[r_\theta(x,y)-\beta\log\left(\frac{\pi^{RL}_\phi(y\mid x)}{\pi^{SFT}(y\mid x)}\right)\right]+\gamma\,\mathbb{E}_{x\sim D_{\text{pretrain}}}\left[\log\left(\pi^{RL}_\phi(x)\right)\right]\] The first term is the expected reward minus β times the log ratio between the RL policy and the SFT policy, which acts as a per-token KL penalty that limits over-optimization of the reward model.
The second term adds γ times the log likelihood of pretraining samples; this is the mixing that defines PPO-ptx, while for PPO models γ is set to 0 and InstructGPT refers to PPO-ptx unless stated otherwise.
Prompts, labelers and data splits
Most prompts were submitted to the OpenAI API through an earlier InstructGPT version on the Playground, and the labelers wrote some prompts to start the process. The labeler-written prompts come in three forms: plain tasks, few-shot instructions with several query and response pairs, and user-based prompts drawn from waitlist use cases. Prompts are deduplicated by shared long prefixes and capped at 200 per user ID, and the train, validation and test splits are made by user ID, with personally identifiable information filtered from the training split.
Three datasets follow from these prompts: about 13k SFT prompts, 33k RM prompts, and 31k PPO prompts that carry no human labels and come only from the API. More than 96% of the prompts are English, and generation is the largest use-case category at 45.6%.
About 40 contractors were hired through Upwork and ScaleAI and selected with a screening test for sensitivity to demographic preferences and for spotting harmful outputs. Held-out labelers come from the same vendors but skipped the screening test. Training labelers agreed with one another 72.6±1.5% of the time, and held-out labelers agreed 77.3±1.3% of the time.
What counts as aligned in the evaluations
Alignment is judged mainly through labeler preference ratings, because labelers are not the people who wrote the prompts, so their reading of intent may differ from the user's. Honesty cannot be measured directly for a black-box generative model, so truthfulness is checked through hallucinations on closed-domain tasks and through the TruthfulQA benchmark.
Because harm depends on how outputs are used, the authors use proxy criteria such as inappropriateness for a customer assistant, denigration of a protected class, and sexual or violent content.
The main metric is the win rate against the 175B SFT model on held-out API prompts, chosen as baseline because its performance sits near the middle of the models compared. Labelers also give each response a 1-7 Likert quality rating and tag it with the metadata categories in Table 3. Error bars in the paper are 95% confidence intervals.
Preference results on the API distribution
Labelers preferred InstructGPT outputs over GPT-3 outputs across model sizes, and the 1.3B InstructGPT model was preferred to the 175B GPT-3 model despite having over 100x fewer parameters. The 175B InstructGPT model was preferred to 175B GPT-3 outputs 85±3% of the time and to few-shot GPT-3 outputs 71±4% of the time. Ordering the methods by win rate, GPT-3 performs worst, then a few-shot prompted GPT-3, then SFT, then PPO, with each step adding preference, while adding pretraining updates during PPO changes labeler preference only little.
The ranking holds on prompts that were submitted to GPT-3 models, although PPO-ptx does slightly worse at larger sizes on those prompts. GPT (prompted) is left out of that comparison because its prompts were already designed for GPT-3.
On the metadata labels, labelers rated InstructGPT outputs as more appropriate for a customer assistant, more often following explicit constraints, less often failing the correct instruction, and less often hallucinating on closed-domain tasks. Held-out labelers ranked outputs much like the training labelers, and InstructGPT still clearly outperformed the GPT-3 baselines for them.
Five labeler groups were split into 5-fold cross validation with 3 seeds, and the resulting reward models reached 69.6±0.9% accuracy on the held-out group against 72.4±0.4% on the labelers they were trained on.
Truthfulness and hallucination
On TruthfulQA, human raters judged InstructGPT answers as both truthful and informative roughly twice as often as GPT-3 answers. With the Instruction+QA prompt, which asks the model to say it has no comment when unsure, the PPO models choose to be truthful but uninformative rather than confidently wrong.
On closed-domain tasks such as summarization and closed-domain QA, the hallucination rate was 21% for InstructGPT and 41% for GPT-3. The PPO models hallucinate less often on these closed-domain tasks, which the metadata labels in the API evaluation also show.
Toxicity and bias results
The bias measurements show no clear change: on Winogender and CrowS-Pairs the difference from GPT-3 is not significant. When prompted to be maximally biased, InstructGPT produces more toxic output than same-size GPT-3 models.
Regressions on public NLP datasets
During RLHF fine-tuning, performance drops relative to GPT-3 on SQuAD, DROP, HellaSwag and WMT 2015 French to English translation, which the authors call an alignment tax. Mixing PPO updates with updates that raise the log likelihood of the pretraining distribution substantially reduces these regressions without compromising labeler preference scores.
The regressions are not fully eliminated, and the authors note that this mixing may make some undesirable behaviors more likely where they appear in the pretraining data.
Comparison with FLAN and T0 fine-tuned GPT-3
Likert ratings put FLAN and T0 above default GPT-3 and roughly level with a few-shot prompted GPT-3, but below the SFT baseline.
InstructGPT reached a 73.4±2% win rate against the SFT baseline, against 26.8±2% for T0 and 29.8±2% for FLAN. In direct comparisons, 175B InstructGPT outputs were preferred over FLAN outputs 78±4% of the time and over T0 outputs 79±4% of the time.
The authors attribute the gap to public NLP datasets focusing on tasks that automatic metrics can score, such as classification and question answering, which cover about 18% of API use, while open-ended generation and brainstorming cover about 57%. They add that public datasets rarely reach the diversity of inputs that real users send.
Limitations
The labeler group is about 40 contractors, primarily English-speaking, and most comparisons were labeled by only one contractor.
They mostly follow the user's instruction even when that could cause real-world harm, and they still make simple mistakes such as failing to follow instructions, giving long hedging answers, and missing false premises.
The held-out labeler result is a preliminary experiment, and more work is needed on broader groups of users and on inputs where humans disagree.
What the cost figures and generalization suggest
Training the 175B SFT model used 4.9 petaflops/s-days and the 175B PPO-ptx model used 60 petaflops/s-days, compared with 3,640 petaflops/s-days for GPT-3.
The authors also see instruction following carry over to settings with little supervision, such as non-English language tasks and code-related tasks. The authors note that this matters because supervising models on every task is prohibitively expensive, and that how well the generalization scales with capability remains to be studied.
Paper info
- Authors
- Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Christiano, Jan Leike, Ryan Lowe
- Venue
- arXiv · Preprint
- First published
- 2022-3-4
- Added
- 2026-10-20
- Updated
- 2022-3-4
- Version
- v1
- arXiv
- 2203.02155
- Category
- cs.CL · cs.AI · cs.LG
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Christiano, Jan Leike, Ryan Lowe (2022). Training language models to follow instructions with human feedback. arXiv:2203.02155v1. https://arxiv.org/abs/2203.02155v1
BibTeX
@misc{ouyang2022training,
title = {{Training language models to follow instructions with human feedback}},
author = {Long Ouyang and Jeff Wu and Xu Jiang and Diogo Almeida and Carroll L. Wainwright and Pamela Mishkin and Chong Zhang and Sandhini Agarwal and Katarina Slama and Alex Ray and John Schulman and Jacob Hilton and Fraser Kelton and Luke Miller and Maddie Simens and Amanda Askell and Peter Welinder and Paul Christiano and Jan Leike and Ryan Lowe},
year = {2022},
eprint = {2203.02155},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2203.02155v1}
}