Pro
Pro lesson

Instruction tuning and RLHF

How a text predictor is trained into an assistant, with demonstrations, preferences and rewards.

This one’s part of How Models Learn Pro — every lesson, every interactive, and new ones as they land. About 12 minutes.

Already Pro? Sign in and you’ll go straight in.

Inside “Instruction tuning and RLHF”

What you’ll learn

  1. Same model, different training
  2. Step 1: learn from demonstrations
  3. Step 2: collect preferences
  4. Turning preferences into a score
  5. Step 3: reinforcement learning from human feedback
  6. Newer recipes, same limits

Key terms

Post-training
Training that comes after pre-training, to turn a base model into one that follows instructions and behaves as intended.
Supervised fine-tuning (SFT)
Further training of a pre-trained model on example prompts paired with the replies people want.
Demonstration
An example reply, written or chosen by a person, used to show a model the behaviour wanted.
Chat template
The fixed text format, with special tokens, that lays out a conversation for an assistant model.
Preference data
Records of which of two or more model responses people judged better.
Reward model
A model trained on preference data to give a response a single score predicting how much people would like it.
RLHF
Reinforcement learning from human feedback: fine-tuning a model to earn higher scores from a reward model trained on human preferences.
DPO
Direct preference optimisation: training a model directly on preference pairs with a classification-style loss, without a separate reward model.

Sources