← back to the archiveCover illustration for “RLHF: training AI with human feedback on its answers”
TERMday 177·yesterday·Published ·by Andy Padia

RLHF: training AI with human feedback on its answers

In short: RLHF, reinforcement learning from human feedback, trains a language model on human preferences between its answers using a learned reward model.

Reinforcement learning from human feedback (RLHF) is a way of training AI with human feedback on its answers: people compare or rank a model's outputs, a reward model learns to predict those preferences, and the language model is then optimised to score highly on it. The InstructGPT paper, submitted on 4 March 2022, used RLHF to turn GPT-3 into a model that follows instructions.

RLHF in plain words

A trainee writes two drafts; a manager says which is better. After thousands of such choices, the trainee learns what "better" means here, without anyone writing a rulebook.

How it works

The InstructGPT paper describes the recipe:

  1. Supervised fine-tuning on demonstrations written by human labellers.
  2. Preference collection: labellers rank several model outputs for the same prompt.
  3. Reward model training on those rankings.
  4. Reinforcement learning with PPO to push the model towards high-reward outputs, with a penalty for drifting too far from the supervised model.

In that paper, human evaluators preferred outputs from a 1.3 billion parameter InstructGPT model to those of the 175 billion parameter GPT-3.

The idea predates language models. Christiano and co-authors showed in June 2017 that agents could learn Atari games and simulated robot movement from human preferences between pairs of clips, with feedback on less than one percent of interactions. A later variant, Constitutional AI from December 2022, replaces human labels with AI feedback guided by a list of written principles.

Example

As an illustration, raters see two answers to "my code throws a null pointer error": one lectures about best practices, one asks for the stack trace and suggests the likely line. Raters prefer the second; across many examples the model learns to diagnose before lecturing.

Where you'll meet it

  • Model cards and training reports from AI labs
  • Discussions of model tone, helpfulness and refusals
  • Alignment and safety research
  • Comparisons with DPO and other preference-tuning methods

What it changes for you

For users of APIs, RLHF-style training is one reason assistant models follow instructions; my view is that it also contributes to over-refusal and flattery. For teams fine-tuning their own models, preference data can be worth more than extra examples. For governance, the InstructGPT authors say plainly that model behaviour is determined in part by the feedback of the people hired to give it.

RLHF vs DPO

RLHF trains a separate reward model and then uses reinforcement learning. DPO, proposed in May 2023, solves the same problem with a simple classification loss on preference data, which removes the reinforcement learning loop.

Common mistake

My view: assuming RLHF-trained models tell the truth. Rewarding answers people like can reward confident, agreeable answers over accurate ones. That is one reason models can be sycophantic.

Fine-tuning · Large language model · Hallucination

From the archive: Preference data governance outlives training methods

RLHF rewards the answers people prefer, so check truth separately.

#field-guide#models#training#alignment

Sources

  1. arxiv.org/abs/2203.02155
  2. arxiv.org/abs/1706.03741
  3. arxiv.org/abs/2305.18290
  4. arxiv.org/abs/2212.08073
← older drop
Natural-language approval policies need regression fixtures

related drops

explore all 563 drops →
← back to the archiveday 178