TAKE THE LONGER ROUTE

Open the complete high-school lesson →

Worked explanations, full local narration, and connected Signal Room, Workbench and Field Notes.

← Connected lesson

RLHF + ReasoningA gentler route.

Compare two answers; distinguish a helpful rating from guaranteed truth.

More time for: Reward modeling, PPO clipping, reference policy KL and reward hacking.

Open high-school classroom and assessment ↗

What is RLHF and the Reasoning Turn?

Today, we’re diving into a fascinating topic: what RLHF is and how the reasoning turn changes language models from mere parrots into thinking assistants.

Let’s start with the base models. They only predict text—they don't actually understand whether their responses are helpful or not. Think of them like an auto-complete that doesn’t know if it’s making sense.

Now, RLHF stands for Reinforcement Learning from Human Feedback. This is a way to teach models by letting humans guide what good responses look like, kind of like a coach giving feedback after a game.

Then we have the reasoning turn. This step adds the model’s ability to actually think things through and assist, not just repeat patterns. Imagine a friend who stops to consider your question before answering.

Finally, let’s look at the post-training process overview. It lays out the stages we go through after training the base model to turn it into a helpful assistant.

We start with the base language model, then collect human feedback to guide improvements, and so on. This process helps the model learn not just to predict, but to be helpful and thoughtful.

So, to recap: base models just predict text without understanding, RLHF trains models using human feedback, and the reasoning turn brings in real thinking to make them true assistants. This transformation is what makes modern AI so powerful and useful.

What is RLHF and the Reasoning Turn?

Base models
predict text only

RLHF = Reinforcement
Learning from Human Feedback

Reasoning turn
adds thinking & assistance

Post-training Process Overview

• Start with base language model
• Collect human feedback on model output
• Use feedback to reward helpful answers
• Train model to think before answering
• Result: an assistant, not just a parrot

Why Do We Need RLHF?

Today, we're diving into an important question: why do we need RLHF, or Reinforcement Learning from Human Feedback? To get started, let's first understand what pretraining actually teaches our AI models.

Pretraining trains models to predict the next word in a sentence, like guessing what comes next in a story. But this doesn't mean the model actually knows what it’s saying. It's kind of like a parrot repeating words without really understanding them.

Because pretraining only focuses on word prediction, the model doesn't have a built-in sense of being helpful or avoiding harm. It doesn’t know what ‘good’ or ‘bad’ really means, which can lead to problems if we want AI to assist us safely.

That’s where alignment comes in. Alignment is the process that teaches models about human preferences, like being helpful and safe. Think of it as giving the AI a moral compass or a set of social rules it can follow.

So, even though models learn language patterns through pretraining, RLHF is key to making sure they behave in ways that match what we want — helpful, safe, and trustworthy. Let's keep this idea in mind as we explore further.

Why Do We Need RLHF?

• Pretraining teaches ‘next word prediction’ only

• No built-in idea of helpfulness or safety

• Models can repeat text without understanding

• Alignment teaches models to prefer human values

The Three Stages of RLHF Training

Today, we'll explore the three stages of RLHF training, which is a way to teach AI models step-by-step, just like training a puppy.

Stage one is Supervised Fine-Tuning, where the model learns from examples, similar to how a puppy learns by watching and copying.

Next is Stage two, the Reward Model, which predicts what humans prefer—think of it like rewarding a puppy when it does the right trick.

Finally, Stage three uses Reinforcement Learning techniques like PPO and GRPO to improve the model, similar to practicing and reinforcing new tricks with treats and praise.

So overall, think of RLHF as teaching an AI just like teaching a puppy—step-by-step, with examples, rewards, and lots of practice.

The Three Stages of RLHF Training

Training a model step-by-step, like teaching a puppy

Stage 1

Supervised Fine-Tuning

Learning from example answers

Stage 2

Reward Model

Predicts what humans prefer

Stage 3

Reinforcement Learning

Uses PPO & GRPO to improve

Think of it like teaching a puppy new tricks, step-by-step

How the Reward Model Works

Today we're diving into how the reward model works — basically, how AI learns what humans like by watching our choices.

First, humans are shown pairs of AI responses and asked to pick which one they like better. Think of it like voting for your favorite video clip.

Next, the model learns to predict which response a person would choose, kind of like guessing your friend's favorite song before they tell you.

Then, responses get scored with a points system — more points mean the answer is more likely to win a human’s thumbs up.

Finally, the reward model uses something called the Bradley-Terry probability model — it's a fancy math way to predict which answer will likely win based on those points.

In short, it predicts which AI answer is more likely to be chosen by a human, helping the AI improve what it says over time.

So, by learning from human preferences step by step, the AI gets better at giving answers we actually like. It’s like training a smart pet that learns your favorite tricks!

How the Reward Model Works

Step 1: Humans judge pairs
of AI responses

– Pick which response is better

Step 2: Model learns
to predict human choice

– Gets better over time

‘Points system’ scores AI responses

– More points = more likable

Think of it like a game leaderboard!

Using Bradley-Terry Probability Model - Explained Simply

It predicts which AI answer is more likely to win based on scores.

Simulate the Reward Model

Let's explore how AI learns from your preferences by simulating a reward model. You'll see two AI responses, pick which one you like better, and watch the model update its predictions based on your choice.

After selecting which response you prefer, notice how the scores for each response update, reflecting the model's learning from your feedback.

Try adjusting the scores using the sliders or selecting different presets to see how the initial preferences change the model’s predictions. This helps you understand how feedback guides AI learning.

On-Policy vs Off-Policy Alignment

Today we're diving into On-Policy versus Off-Policy alignment. These terms might sound technical, but they're really about how a model learns from human preferences during training.

Let's start with On-Policy learning. Imagine the model is playing practice rounds in a video game and learning directly from the new answers it creates.

In other words, the model explores and adjusts based on its own fresh experiences, making it slower but more flexible in learning.

On the other hand, Off-Policy learning means the model learns only from past examples, like watching game replays without trying anything new.

This approach is faster and more stable since it relies on existing data and doesn't experiment during learning.

To recap, On-Policy is like practicing live matches to learn, while Off-Policy is like studying past matches to improve. Both have their strengths depending on what you need.

Keep these examples in mind as we continue exploring how models align with human preferences through different learning methods.

On-Policy vs Off-Policy Alignment

On-Policy

Off-Policy

• Model "plays" and learns from new answers
• Like practice games for learning
• Slower but more flexible

• Learns only from past examples
• No exploring new answers
• Faster and more stable

Example: Practice rounds in video games

Example: Learning from game replays

Proximal Policy Optimization (PPO) Explained

Today we'll dive into Proximal Policy Optimization, or PPO. This is a key method used to safely update AI models without letting them make big, risky jumps.

Why does PPO matter? Well, it helps the AI learn in small, careful steps, kind of like how you might level up in a game without losing progress or crashing.

Think about the AI like a player choosing words as moves in a game. PPO treats the language model this way, helping it pick the best moves carefully.

The AI gets rewards based on how well it scores the full answer. This reward guides it toward better choices over time.

PPO helps the AI take small, steady steps rather than big leaps. This keeps updates safe and stable, preventing it from changing too fast and making mistakes.

To sum up, PPO is like a coach that makes sure the AI learns gently, avoiding big errors while still getting better and better.

Proximal Policy Optimization (PPO) Explained

Why PPO matters in safe AI updates

PPO updates AI in small, safe steps to avoid big mistakes

Think of AI as a player picking words like moves in a game

Rewards come from scoring the full answer, guiding better choices

PPO helps the AI take small, steady steps — like walking carefully instead of running — so it learns safely and doesn't forget what works.

Model Components During PPO Training

Let's dive into the model components during PPO training. Think of this as the different players working together in a video game team to win.

First, we have the Policy. This is the AI we're training, like the gamer or player controlling the game. Its job is to learn and improve strategies.

Next is the Reference. Think of it as the frozen baseline AI, like a coach watching the player and providing a steady standard to compare performance against.

Now, let's meet the Reward Model. This acts like a judge who scores the player's moves, deciding how well they're doing based on set criteria.

Finally, we have the Critic. This part estimates the value of different actions to guide the training, like a helpful mentor suggesting which moves will likely lead to success.

Together, these four components collaborate to train the AI effectively, just like a team of gamers, coaches, judges, and mentors working toward winning the game.

Model Components During PPO Training

Policy

The AI being trained — like a gamer/player

Reference

Frozen baseline AI — like a coach

Reward Model

Judges performance — like a game judge or referee

Critic

Estimates value to guide training — like a helpful assistant

Quick Quiz: Test Your Understanding

Now let's check how well the ideas about Reinforcement Learning from Human Feedback have stuck. Take your time and answer each question on your own.

After you finish and submit, I'll be here to review your answers and help clarify anything that was tricky.

Why Alignment Matters

Hello everyone! Today we're diving into an important topic: why alignment matters when it comes to AI. Let's see why getting this right is so crucial.

First off, if an AI isn't aligned with what we expect, it might give us silly or even harmful answers. Imagine asking your virtual assistant for homework help and getting nonsense or advice that could get you in trouble!

Alignment makes sure the AI acts like a helpful assistant—one that listens carefully and supports you in a friendly, useful way, rather than causing confusion.

Think of it like training your virtual helper, teaching it what's safe and okay to say. Just like you'd teach a pet or a robot how to behave, AI needs clear guidance.

In the end, proper alignment keeps conversations with AI useful, friendly, and safe—so you get answers that help rather than confuse or upset you.

So, as we explore AI further, keep in mind how important it is to train and align these tools carefully, just like you'd want a helpful, reliable friend by your side.

Why Alignment Matters

• Unaligned AI may give silly or harmful answers

• Alignment ensures AI acts as a helpful assistant

• Think of training your virtual helper for safe use

• Keeps conversations useful, friendly, and safe

Summary: From Parrot to Assistant

Let's wrap up with a summary titled 'From Parrot to Assistant'. This helps us see the whole picture of how models evolve.

First, base models start off just parroting text—they don’t actually understand what they’re saying. It's like memorizing lines without knowing the story.

Then, with Reinforcement Learning from Human Feedback, or RLHF, the models learn what humans prefer. They become more helpful and polite, not just repeating stuff blindly.

Adding reasoning layers lets these models handle complex tasks, like solving problems or making plans, almost like a teammate rather than just a parrot.

Finally, a special post-training step, the 'pass,' truly transforms these parrots into helpful assistants. Together, all these parts make AI that works with us instead of just repeating.

So, this summary shows how RLHF and reasoning combine to create models that don’t just mimic but genuinely assist humans. Great job following along!

Summary: From Parrot to Assistant

• Base models mimic text but don’t truly understand

• RLHF (Reinforcement Learning from Human Feedback) teaches helpfulness and preferences

• Reasoning layers enable deeper, complex assistance

• The post-training "pass" transforms parrots into true teammates