Skip to content
AI & Machine Learning

RLHF (Reinforcement Learning from Human Feedback)

Definition

RLHF (reinforcement learning from human feedback) is a training method in which people rank a model's responses, a reward model learns from those rankings, and the main model is then trained with reinforcement learning to produce responses people prefer.

Diagram

  1. 1

    Pretraining

    predict the next word over a huge amount of text

    → a model that can write, but not helpfully

  2. 2

    Supervised fine-tuning

    learn from examples of good answers written by people

    → a model that follows instructions

  3. 3

    Human rankings

    people compare pairs of answers and pick the better one

    → thousands of preferences

  4. 4

    Reward model

    learns to predict which answer people would prefer

    → an automatic judge

  5. 5

    Reinforcement learning

    the model is tuned to produce answers the reward model scores highly

    → a more helpful assistant

Highlighted: the human feedback part, stages 3 to 5.

RLHF teaches a model what people prefer, not what is true. That is why it can make models more helpful and polite but also more eager to please, and why the choice of who ranks the answers, and how, matters so much.

Case study

Worked example