Preprint
Reinforcement Learning

Training a helpful and harmless assistant with reinforcement learning from human feedback

Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova Dassarma, Dawn Drain, Stanislav Fort, Deep Ganguli, T. Henighan, Nicholas Joseph, Saurav Kadavath, John Kernion, Tom Conerly, S. El-Showk, Nelson Elhage, Zac Hatfield-Dodds, Danny Hernandez, Tristan Hume, Scott Johnston, S. Kravec, Liane Lovitt, Neel Nanda, Catherine Olsson, Dario Amodei, Tom B. Brown, Jack Clark, Sam McCandlish, Chris Olah, Benjamin Mann, Jared Kaplan
April 1, 2022arXiv.org4,292 citations

4.3k

Citations

512

Influential Citations

arXiv.org

Venue

2022

Year

Abstract

… We apply preference modeling and reinforcement learning from human feedback (RLHF) to finetune language models to act as helpful and harmless assistants. We find this alignment …

Analysis

Why This Paper Matters

This paper is a landmark in the field of AI alignment, demonstrating that reinforcement learning from human feedback (RLHF) can effectively fine-tune large language models to be both helpful and harmless. Prior to this work, language models were typically trained to maximize likelihood on text corpora, which often resulted in outputs that were unhelpful, toxic, or biased. This paper provided a practical recipe for steering model behavior toward desired attributes using human preferences, which has become the standard approach for aligning models like ChatGPT and Claude.

The significance lies not only in the results but also in the methodology. The authors show that by collecting a relatively small amount of human preference data and training a reward model, they can significantly improve the alignment of a large model. This opened the door for scaling alignment efforts and made it feasible for organizations to fine-tune models with human feedback. The paper also highlights the importance of balancing multiple objectives, such as helpfulness and harmlessness, which are often in tension.

Technical Contributions

The paper makes several key technical contributions:

  • Preference modeling: They train a model to predict human preferences between pairs of responses, using a dataset of comparisons. This model serves as a reward signal for RL.
  • RLHF with PPO: They apply Proximal Policy Optimization (PPO) to fine-tune the language model, using the preference model as a reward function, with a KL penalty to keep the model close to the original.
  • Iterative data collection: They use the model itself to generate responses for further human evaluation, creating a feedback loop that improves the preference model.
  • Helpfulness and harmlessness metrics: They define and measure these attributes using human evaluations, providing a framework for assessing alignment.
  • Trade-off analysis: They systematically study how different training configurations (e.g., mixing helpfulness and harmlessness data) affect the final model's behavior.

Results

The paper reports that the RLHF-tuned models are significantly more helpful and harmless than the base models. For instance, human evaluators preferred the RLHF model's responses over the base model's in the majority of cases. The models also show a large reduction in harmful outputs, such as toxic or biased language. The authors find that training with a mix of helpfulness and harmlessness data yields the best balance, though there is a slight trade-off: models optimized purely for helpfulness may be less harmless, and vice versa. The results are robust across different model sizes and evaluation settings.

Significance

This paper has had a profound impact on the AI field, establishing RLHF as the de facto method for aligning large language models. It has influenced subsequent research on alignment, safety, and preference learning, and has been widely adopted in industry. The work also raised awareness of the importance of human feedback in model development, leading to more user-centric AI systems. Its legacy is evident in the development of models like ChatGPT and Claude, which rely on RLHF to be helpful and harmless assistants.