Module 1 · Reinforcement Learning · Lesson 4 of 34
How chat models learn to be helpful: RLHF
Pre-training, instruction tuning and learning from human preferences. Reward models, and why labelling matters.
In this lesson · about 18 minutes
- Describe the three training stages behind a chat model
- Explain how a reward model is learned from pairwise preferences
- Name the main risks of RLHF and the alternatives used today
A chat model you talk to was trained in roughly three stages:
- Pre-training. The model reads a vast amount of text and learns to predict the next token. It learns grammar, facts, styles and reasoning patterns, but it is not yet a helpful assistant: ask it a question and it might continue with three more questions.
- Supervised fine-tuning (SFT), or instruction tuning. It is trained on thousands of example conversations written by people: a request and a good answer. Now it follows instructions.
- Learning from preferences. People compare two or more of the model's answers and pick the better one. These choices teach the model the fine points: be correct, be clear, admit uncertainty, refuse harmful requests politely, do not ramble.
Stage 3 is where reinforcement learning comes in, as RLHF: reinforcement learning from human feedback.
Whiteboard · watch and try
RLHF in three moves
Press Play to see how a pile of “A is better than B” choices becomes a better model.
Tip: press Pause, then use the pen to work along on the board. Space plays and pauses; Ctrl+Z undoes your last mark.
Try it · simulator
Teach a reward model your preferences
This is the heart of RLHF. Pick the better of two answers. A tiny reward model learns which qualities you value, then scores answers it has never seen.
Comparison 1 · prompt
How many legs does a spider have?
What the reward model has learned to value
How it now ranks new answers to “What is photosynthesis?”
- 0.00 Plants use sunlight, water and carbon dioxide to make sugar, and give off oxygen.
- 0.00 Photosynthesis is a deeply important and wonderful process that has fascinated scientists …
- 0.00 Google it.
- 0.00 Plants eat soil to grow; that is photosynthesis.
Sorting drill
Which training stage?
Put each activity in the stage it belongs to.
- Predicting the next word across billions of web pages
- Training on 20,000 example conversations written by experts
- Raters choose which of two answers is more helpful
- A reward model scores answers during training
- The model learns grammar, facts and coding patterns
- Teaching the model to follow a requested output format
0 of 6 sorted
Check your understanding0 of 4 correct
Think about “good” for your own project.
Consider these questions and write down your thoughts. What you write stays on this device.
Quiz score: 0 of 4
Written by Noviq Academy in its own words. The simulators are small teaching models that keep the real idea and leave out the scale; their numbers (prices, speeds, scores) are illustrative. Model names, prices and features change quickly, so check your provider's current documentation before you build. Read-aloud uses your device's built-in voices.