FlashPapers / InstructGPT
NeurIPS 2022 (Oral)

Training language models to follow instructions with human feedback

Long Ouyang*, Jeff Wu*, Xu Jiang*, Diogo Almeida*, Carroll L. Wainwright*, Pamela Mishkin* and the OpenAI Alignment Team

"Making language models bigger does not inherently make them better at following a user's intent. By fine-tuning GPT-3 with human feedback (RLHF), we create InstructGPT—a model that is 100x smaller (1.3B) yet consistently preferred over the 175B base model."

RLHF Alignment 100x Parameter Efficiency Mitigates Toxicity & Lies

Why This Matters

Large language models (LLMs) like GPT-3 are trained on a simple objective: predict the next token on a massive scrape of the internet. While this objective produces models capable of zero-shot reasoning and creative generation, it introduces a fundamental misalignment.

The internet is full of helpful tutorials, but it also contains toxicity, bias, and outright lies. A model that simply mimics the internet does not know how to be a helpful assistant. Instead, it might generate toxic text, fabricate facts (hallucinations), or completely ignore user instructions.

To deploy these systems safely in real-world applications, we need them to act in accordance with the user's *true intention*. This paper formalizes the methodology to bridge that gap.

The Big Idea

The core contribution of this paper is the successful scaling of Reinforcement Learning from Human Feedback (RLHF) to align large language models. Rather than relying solely on raw scale (which does not improve instruction following), the authors train a series of models called InstructGPT.

By integrating a small team of 40 human labelers into the training loop, they show that a 1.3 billion parameter model fine-tuned with RLHF produces outputs preferred over the massive 175 billion parameter base GPT-3. This represents a monumental leap in parameter efficiency and safety, demonstrating that alignment is a highly cost-effective alternative to pure scaling.

How It Works: The 3-Step Pipeline

The RLHF pipeline consists of three distinct phases. Click through the interactive explorer below to see how raw GPT-3 is transformed into InstructGPT.

Supervised Fine-Tuning

Bootstrap with Demonstrations

We collect human-written demonstrations of desired behaviors on prompts. We then fine-tune the base GPT-3 model using standard supervised learning.

Training Data Flow Example

Input Prompt:

"Explain gravity to a 6-year-old."

Human Demonstration:

"Gravity is like an invisible glue that holds us to the ground so we don't float away into space!"

1. Supervised Fine-Tuning (SFT)

To bootstrap the process, human contractors write high-quality demonstrations for thousands of prompts. The base model is fine-tuned on this dataset. Although SFT models are significantly better than base models at instruction following, they still suffer from overfitting and struggle to generalize to more complex task distributions.

2. The Reward Model (RM)

Next, we remove the final unembedding layer of the SFT model and replace it with a projection layer to output a scalar reward. The reward model takes a prompt $x$ and candidate completion $y$, outputting a scalar score $r_\theta(x, y)$.

To train the RM, human labelers rank multiple completions (from $K=4$ to $K=9$) generated by the SFT model. The model is trained using a pairwise ranking loss:

$$\text{loss}(\theta) = -\frac{1}{\binom{K}{2}} 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 $y_w$ is the preferred completion, $y_l$ is the less-preferred completion, and $D$ is the dataset of human comparisons.

3. Proximal Policy Optimization (PPO)

Finally, we fine-tune the SFT model using reinforcement learning. The environment is a bandit setting where the model receives a prompt, generates a response, and is evaluated by the frozen Reward Model.

To prevent the policy from diverging too far from the original SFT model (which would cause output collapse or "gaming" the reward model), a token-level Kullback-Leibler (KL) penalty is added to the objective.

Interactive Output Playground

Compare actual completions from the paper's models. Select a prompt type below to see how base GPT-3 (unaligned) compares to the human-aligned InstructGPT.

Prompt:

"Why is it important to eat socks after meditating?"

GPT-3 (175B Base) Unaligned

"What can you learn from socks? A: When you eat socks, you are tasting the essence of enlightenment..."

Hallucinates & accepts false premise
InstructGPT (175B PPO-ptx) Aligned

"There is no clear answer to this question, but there are many theories... However, there is currently no hard scientific evidence to support eating socks."

Exhibits epistemic humility & refutes false premise

The Alignment Tax

A key discovery in alignment research is the "Alignment Tax". When we optimize a model strictly for human preference (using PPO on the reward model), its performance on traditional, public academic benchmarks (like SQuAD, DROP, and translation tasks) actually decreases.

To solve this, the authors modified the RL training objective by mixing in a fraction of the pretraining gradients. This hybrid approach, called PPO-ptx, optimizes the following combined objective function:

$$\text{obj}(\phi) = E_{(x, y) \sim D_{\pi_\phi^{\text{RL}}}} \left[ r_\theta(x, y) - \beta \log \left( \frac{\pi_\phi^{\text{RL}}(y|x)}{\pi^{\text{SFT}}(y|x)} \right) \right] + \gamma E_{x \sim D_{\text{pretrain}}} \left[ \log \pi_\phi^{\text{RL}}(x) \right]$$

Where $\beta$ controls the KL penalty strength, and $\gamma$ controls the pretraining gradient mix.

Alignment Tax Simulator

Adjust the pretraining mix coefficient ($\gamma$) to see how it balances alignment vs academic capability.

Pretraining Mix Coefficient ($\gamma$) 27.8
Human Preference Score 85%

How much human labelers prefer this model over base GPT-3.

Academic Benchmarks (F1) 59%

Average performance on SQuADv2, DROP, and translation.

Insight: Setting $\gamma \approx 27.8$ (the paper's optimal value) minimizes the alignment tax on public NLP datasets without compromising human preference scores.

Headline Results

The paper's evaluations yielded several striking results, proving that alignment is not only a safety mechanism but also a performance multiplier:

100x
Parameter Efficiency

Outputs from the 1.3B parameter InstructGPT are preferred to the 175B base GPT-3, despite having 100x fewer parameters.

2x
Truthfulness Improvement

On the TruthfulQA benchmark, InstructGPT generates truthful and informative answers twice as often as GPT-3.

25%
Toxicity Reduction

InstructGPT generates about 25% fewer toxic outputs than GPT-3 when explicitly prompted to be respectful.

50%
Hallucination Drop

On closed-domain tasks, InstructGPT makes up information about half as often as GPT-3 (21% vs 41% hallucination rate).

Limitations & Open Questions

Despite the success of InstructGPT, the authors identify several critical limitations:

  • Whose values are we aligning to? The models are aligned to the preferences of a small group of English-speaking labelers (mostly in the US and Southeast Asia). This is not representative of all global users.
  • Susceptibility to bad prompts: If explicitly instructed to generate toxic or biased text, InstructGPT will still comply—sometimes even more effectively than the base model.
  • Over-hedging: Because labelers reward "epistemic humility", the model occasionally over-hedges, refusing to answer simple questions or giving long, overly cautious responses.

Glossary

RLHF (Reinforcement Learning from Human Feedback)
A technique that uses human preferences as a reward signal to fine-tune AI systems, aligning their behavior with human intent rather than raw next-token prediction.
PPO (Proximal Policy Optimization)
An on-policy reinforcement learning algorithm used to update the model's parameters to maximize the scalar reward while keeping updates stable.
Alignment Tax
The performance cost (e.g., lower accuracy on public academic benchmarks) that arises when fine-tuning a model to follow instructions or act safely.

Citation

@article{ouyang2022training,
  title={Training language models to follow instructions with human feedback},
  author={Ouyang, Long and Wu, Jeffrey and Jiang, Xu and Almeida, Diogo and Wainwright, Carroll and Mishkin, Pamela and Zhang, Chong and Agarwal, Sandhini and Slama, Katarina and Ray, Alex and others},
  journal={Advances in Neural Information Processing Systems},
  volume={35},
  pages={27730--27744},
  year={2022}
}
Made with Flash Papers — make your own