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:

  1. 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.
  2. 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.
  3. 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.

4 steps
Press Play and the tutor will talk you through it while writing on the board. Pause any time to write on the board yourself.

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

Correct0.00
Helpful0.00
Polite0.00
Long0.00

How it now ranks new answers to “What is photosynthesis?”

  1. 0.00 Plants use sunlight, water and carbon dioxide to make sugar, and give off oxygen.
  2. 0.00 Photosynthesis is a deeply important and wonderful process that has fascinated scientists …
  3. 0.00 Google it.
  4. 0.00 Plants eat soil to grow; that is photosynthesis.
Pick the better answer in a few comparisons. Each choice nudges the reward model's weights. Then try the lazy labeller.

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

Question 1

1.What does a reward model learn from in RLHF?

Question 2

2.Raters often preferred longer answers. What will the chat model probably learn?

Question 3

3.A base model straight out of pre-training is asked “What is the capital of France?”. What might it do?

Question 4

4.Which method trains directly on preference pairs without a separate reward model?

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

Tip: answer every quiz question correctly first.

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.