Bookmarks

RLHF — reinforcement learning from human feedback

A way to fine-tune a language model so that its answers appeal to people: human ratings are turned into a reward, and the model is trained to maximise it.

Also: reinforcement learning from human preferences, RL from human feedback

checked 18 Nov

All terms

People find it hard to write down a formula for a “good answer”, but easy to pick the better of two. RLHF uses these comparisons: they train a separate reward model, and the language model is then fine-tuned with reinforcement learning to earn a high score from it.

Three steps

StepWhat happens
1. SFTthe pretrained model is fine-tuned on example answers written by people
2. Reward modelthe model generates several answers to one prompt and people rank them; these comparisons train a model that predicts which answer people would choose
3. Reinforcement learningthe language model is fine-tuned with the PPO algorithm to maximise the reward model’s score

InstructGPT was trained this way at three sizes: 1.3 billion, 6 billion and 175 billion parameters. According to labellers’ ratings, answers from the 1.3-billion-parameter InstructGPT were preferred to those of the 175-billion-parameter GPT-3, even though it has over a hundred times fewer parameters.

What to keep in mind

The reward model is only an approximation of the tastes of a particular group of labellers, not of “human values” in general. If the model chases its score for too long, the language model starts to find loopholes in it, so a penalty for drifting away from the original model is usually added. The method needs a separate reward model, generation of answers during training and careful tuning, which is why the simpler DPO method was proposed later.

Where the term comes from

The method was developed by Paul Christiano and co-authors in 2017 for Atari games and a simulated robot (learning from human preferences had been studied before); it was first applied to language models for text continuation and summarisation (Ziegler et al., 2019; Stiennon et al., 2020), and to a broad range of instructions in InstructGPT (Ouyang et al., 2022).

Sources

the term is written from these pages

Verified 18 Nov

Not to be confused with

what it is mixed up with and how it differs

  • DPOdirect preference optimisation

    DPO trains the model directly on the same preference pairs, without a separate reward model or a reinforcement learning loop.

  • SFTsupervised fine-tuning

    SFT teaches the model to repeat ready-made answers, while RLHF teaches it to write ones that people would rate higher.

In depth in the references

where the topic is covered in detail