Macalinao StudioLearnAll enriched lessons ↗
College path · 7 sectionsSwitch to high school ↗

College / LONGER LESSON 03

RLHF: preferences, incentives and their limits

Trace a preference model and a clipped policy objective without confusing reward with truth.

Preparation: Probabilities, averages and basic gradients.

Plan 20–35 minutes with the activities; this is a study estimate, not a timed requirement. Both paths have complete narration. Your notes and progress are kept separately for each level.

Section 01 / 07

Separate the stages

College path. Trace a preference model and a clipped policy objective without confusing reward with truth.

Preparation: Probabilities, averages and basic gradients. Work through one section at a time. Predict the experiment result before changing its controls, then explain what the example leaves out.

A common RLHF pipeline first trains useful responses, then learns from preferences, then optimizes a policy against a reward signal. Implementations differ, so name the stages actually present. Supervised fine-tuning, reward modeling and policy optimization have different data and losses. Preference optimization alternatives may omit an explicit reward model; not every alignment method is PPO.

Worked step 1. Collect a prompt and two answers.

Worked step 2. Record a preference.

Worked step 3. Keep reward-model training separate from policy updates.

Try it yourself. Is a preference label a verified factual truth label?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. It records a judgment under a collection protocol and may reflect style, omissions or mistakes.

Section 02 / 07

Fit a pairwise preference

A simple reward model turns the reward difference into a preference probability with a sigmoid. Only differences matter for this pairwise likelihood. The Bradley-Terry-style likelihood is sigmoid(r chosen minus r rejected). An additive reward offset cancels; absolute score calibration is not supplied by pairwise fitting alone.

Worked step 1. Rewards 3 and 1 give gap 2.

Worked step 2. Sigmoid of 2 is about 0.881.

Worked step 3. Rewards 13 and 11 produce the same probability.

Try it yourself. Does 0.881 mean the chosen answer is 88.1 percent factually true?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. It is a model probability for the observed preference event under this formulation.

Section 03 / 07

Use advantages, not raw praise alone

Policy updates often compare an outcome with a baseline to form an advantage. A positive advantage favors that sampled action; a negative advantage discourages it. The baseline and estimator affect variance and bias. PPO commonly uses value estimates and generalized advantage estimation; do not substitute an arbitrary reward difference without stating the simplification.

Worked step 1. Toy reward is 5 and baseline is 3.

Worked step 2. Toy advantage is 2.

Worked step 3. If baseline is 6, advantage becomes -1.

Try it yourself. Does subtracting a baseline change the raw reward?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. It changes the comparison used by this update estimator.

Section 04 / 07

Clip the surrogate incentive

PPO compares new and old action probabilities through a ratio. Its clipped surrogate limits part of the incentive for large ratio changes; it is not a hard bound on every parameter or policy change. The surrogate is the minimum of ratio times advantage and clipped ratio times advantage. Negative advantages reverse which branch is restrictive. The full objective includes other terms and repeated updates.

Lclip = min(rA, clip(r,1−ε,1+ε)A)

Worked step 1. Ratio 1.4, advantage 2, clip width 0.2.

Worked step 2. Unclipped term is 2.8; clipped term is 2.4.

Worked step 3. The minimum is 2.4.

Try it yourself. For advantage -2 and ratio 0.6, what is the minimum?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. Unclipped is -1.2 and clipped is -1.6. The minimum is -1.6, so sign matters.

Section 05 / 07

Keep a reference comparison explicit

A reference-policy penalty can discourage drifting too far from a starting behavior. The reference policy and the previous rollout policy play different roles and need not be the same object. Old-policy ratios support PPO updates; reference KL regularization constrains drift relative to a separate reference. Sampled log ratios estimate KL only under stated sampling distributions.

Worked step 1. Label policies current, rollout-old and reference.

Worked step 2. Write which pair appears in each term.

Worked step 3. Avoid calling all three the baseline.

Try it yourself. Does a small PPO clip guarantee small reference KL?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. They are different comparisons. Monitor the actual divergence and behavior.

Section 06 / 07

Look for reward exploitation

A policy can learn to satisfy the scoring system without satisfying the intended goal. Evaluate factual support, task success and failures separately from average reward. Use held-out prompts, adversarial examples, reward-model disagreement and human error analysis. Optimization pressure can exploit reward-model weaknesses; increasing measured reward is not sufficient evidence of alignment.

Worked step 1. Construct an answer that sounds polished but omits a critical fact.

Worked step 2. Compare reward and human task assessment.

Worked step 3. Record disagreements.

Try it yourself. What should happen when reward rises but task success falls?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. Treat it as a failure of the proxy or optimization setup, not as an unqualified improvement.

Section 07 / 07

Mastery and transfer

Bring the pieces together. First answer the checkpoint without the worked solutions. Then explain the mechanism in your own words, using one numerical example from this lesson.

A learned reward score represents… Option 1: Guaranteed truth. Option 2: A learned proxy shaped by its data and objective. Option 3: A universal human preference.

Pause here and choose an answer before continuing. The checkpoint explanation follows.

Reveal worked solution

The correct choice is option 2: A learned proxy shaped by its data and objective. A proxy must be evaluated against the intended task and may be exploited.

Transfer task. Change one assumption in the worked example. State your prediction, calculate or test it in Workbench, then explain whether the result supports your prediction.

Reveal worked solution

Self-check rubric. Name the changed assumption, keep the other inputs fixed, show at least one intermediate calculation, and distinguish what the toy example guarantees from what would require a trained model or a real measurement.

MODERN MODEL CASE STUDY

DeepSeek V4.1 Flash: where this idea goes next

Distinguish established algorithms from changes in data synthesis and environments. Follow the worked examples, then evaluate the reported gains and their limits.

Open the college case study →

Added October 21, 2026. This optional extension has its own complete local narration.

LONGER POST-TRAINING LESSONS

Follow demonstrations, rewards and preferences

Worked examples, local narration and connected experiments at your level.

LONGER REASONING LESSONS

Reason, verify and learn from attempts

Worked examples, local narration and connected experiments at your level.

Sources and scope

Original worked examples and teaching text, grounded in these primary references. Numerical fixtures explain mechanisms; model quality and hardware performance require separate measurements. Both levels share key examples, with different explanations and checkpoints.

Reset this college path?

This removes only this path’s notes, progress and experiments from this browser.