Skip to content

Reinforcement learning from human feedback

Also called: RLHF, reinforcement learning with human feedback

Published:

How does RLHF work?

The method starts from tasks where writing a reward function by hand is hard. In 2017 Christiano and colleagues defined the goal through non-expert human preferences between pairs of short trajectory segments. With feedback on less than one percent of the agent's interactions, they solved Atari games and simulated robot locomotion tasks, and taught new behaviours with about an hour of human time [2].

The version used for language models is laid out in the InstructGPT paper. A team of 40 labelers first writes demonstrations of good answers, and the model is fine-tuned on them with supervised learning. Labelers then compare several outputs for the same prompt, and those comparisons train a reward model that predicts which output a labeler would prefer. Finally, the model is fine-tuned with the PPO algorithm to maximise that reward [1].

What did the results show?

Here is a concrete case: outputs from the 1.3 billion parameter InstructGPT trained this way were preferred to those of the 175 billion parameter GPT-3 [1]. The authors also report gains in truthfulness and less toxic output, while noting that the models still make simple mistakes [1].

What are its limits?

RLHF pulls a model towards the preferences of whoever gives the feedback, not towards everyone's values. The InstructGPT team describes that group as mostly its own labelers and researchers [1]. NIST's Generative AI Profile asks organisations to document how far human domain knowledge is used to improve system performance, naming RLHF alongside fine-tuning and retrieval-augmented generation [3].

Frequently asked questions

How is RLHF different from fine-tuning?

RLHF is a kind of fine-tuning. The difference is that the model is tuned against a reward learned from human preferences rather than against example answers.

What does the reward model do?

It predicts which output people would prefer, so a human does not have to judge every training step.

Sources

  1. Training language models to follow instructions with human feedback (Ouyang et al., 2022) — arXiv
  2. Deep reinforcement learning from human preferences (Christiano et al., 2017) — arXiv
  3. Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile (NIST AI 600-1) — NIST