# Training language models to follow instructions with human feedback

> Fine-tunes GPT-3 on demonstrations, then with RLHF from human rankings. Labelers prefer the 1.3B InstructGPT over 175B GPT-3, and it makes up facts about half as often, at a small cost on public benchmarks.

- arXiv: https://arxiv.org/abs/2203.02155
- 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
- Published: 2022-03-04
- Topic: Alignment
- Visual carousel: https://instaxiv.com/p/2203.02155
- Explanation by InstaXiv, a secondary educational summary. Cite the original paper for exact results. InstaXiv is not affiliated with or endorsed by arXiv or Cornell University.

## A 1.3B model tuned on human feedback beats 175B GPT-3

**100×** fewer parameters, yet preferred by labelers

## The three-step RLHF recipe

![Figure 2](https://cdn.instaxiv.com/figures/2203.02155/figure2.webp)

Collect demonstrations and fine-tune; collect rankings of model outputs and train a reward model; then optimize the policy against that reward with PPO. (Figure 2)

## Next-token prediction is not following instructions

**GPT-3:** Trained to continue internet text, it often ignores the request, invents facts or produces toxic output when asked to help.

**InstructGPT:** Fine-tuned to do what labelers prefer: follow the instruction, stay truthful, avoid harm. The target is the user's intent, not plausible text.

Alignment is a training target, not a side effect of scale.

## What each stage contributes

1. **Supervised fine-tuning**: About 13k prompts with labeler-written demonstrations teach the desired behavior directly.
2. **Reward model**: Labelers rank 4 to 9 outputs per prompt; a 6B model learns to predict which they prefer.
3. **PPO with a KL penalty**: Optimize against the reward while a KL term keeps the policy near SFT, with pretraining gradients mixed in.

## Preferred at every size, by a wide margin

![Figure 1](https://cdn.instaxiv.com/figures/2203.02155/figure1.webp)

Win rate against the 175B SFT model. PPO-ptx at 1.3B beats both prompted and plain GPT-3 at 175B, and the gap holds as models grow. (Figure 1)

## Half the made-up facts

| Method | Hallucination rate |
| --- | --- |
| GPT-3 175B | 41% |
| **InstructGPT (−20 pts)** | **21%** |

_Closed-domain tasks: information not present in the input. Labelers preferred 175B InstructGPT 85 ± 3% of the time._

## Aligned to whom, and how well?

- **A narrow group of labelers**: Behavior reflects about 40 contractors, the researchers and API customers, not people broadly.
- **Still makes simple mistakes**: It can accept false premises, hedge excessively and miss instructions with several constraints.
- **Follows harmful instructions**: Trained to be helpful, it complies with many harmful requests when explicitly asked.

Best used when: Turning a pretrained model into a helpful assistant with a modest labeling budget.

## Key takeaways

- Human preference fine-tuning made a 1.3B model more useful than 175B GPT-3.
- Mixing pretraining gradients into PPO limited the alignment tax on public NLP benchmarks.
- Its recipe of SFT, then a reward model, then PPO became the blueprint for ChatGPT.

## Links

- arXiv: https://arxiv.org/abs/2203.02155
- PDF: https://arxiv.org/pdf/2203.02155

## Citation

```bibtex
@article{ouyang2022training,
  title   = {Training language models to follow instructions with human feedback},
  author  = {Ouyang, Long and Wu, Jeff and Jiang, Xu and Almeida, Diogo and Wainwright, Carroll L. and Mishkin, Pamela and Zhang, Chong and Agarwal, Sandhini and Slama, Katarina and Ray, Alex and Schulman, John and Hilton, Jacob and others},
  journal = {arXiv preprint arXiv:2203.02155},
  year    = {2022},
  url     = {https://arxiv.org/abs/2203.02155}
}
```
