Token LabSearch

← Paper library
Reinforcement learning & reasoning / 2022

InstructGPT: change the training signal to change behavior

Connect demonstrations, preference labels, reward learning and policy optimization.

Training language models to follow instructions with human feedback · Ouyang et al. · arXiv:2203.02155

Original editorial analysis by Token Lab · Source checked 2026-10-25 · Paper claims and synthetic examples are separated.

01 · What the paper establishes

InstructGPT uses supervised demonstrations, human comparisons and reinforcement learning to improve instruction following. The paper reports human preferences on its prompt distribution and analyzes remaining limitations. The result is not that parameter count ceases to matter or that all human values have been aligned.

Primary source: paper abstract ↗
Study guide & lesson outlineLEARNING CONTRACT

Understand → implement → investigate

Goal: explain the mechanism in this lesson, reproduce one example and test a failure case. Reading alone does not mark mastery.

  • Understand: state assumptions, shapes/units and a counterexample.
  • Implement: reproduce a numerical example and inspect boundaries.
  • Investigate: compare one alternative under a matched budget.

02 · The mechanism

Text / 原始公式
Demonstrations → SFT policy
Ranked responses → learned reward rφ
Policy objective ≈ E[rφ]−β KL(πθ||πref)
Some variants additionally mix pretraining updates.

A next-token objective and a user-preference objective reward different behavior. A learned reward model supplies an imperfect proxy that the policy can optimize. The reference penalty discourages unrestricted drift, while independent evaluation checks whether proxy improvement corresponds to better user-facing outputs. Each stage has different data requirements and failure modes.

Notation and intuition are teaching explanations. Consult the original method for complete assumptions and implementation details.

Mechanism map & worked derivation

Human demonstrations → SFT → Preference pairs → reward model → Policy optimization + reference penalty → Independent behavior evaluation
Original schematic; read the steps from top to bottom. SVG ↓
Symbols and assumptions
SymbolMeaning
rφLearned reward proxy
πrefReference policy for the drift penalty
βTrade-off coefficient under the stated convention
  1. Distinguish three data products: demonstrations for SFT, comparisons for reward learning, and sampled trajectories for policy optimization. They are not interchangeable labels.
  2. For two policies on the same prompt distribution, (expected reward, expected KL)=(1,0.4) and (0.8,0.1), β gives regularized values 0.6 and 0.7. A lower raw reward can win after the drift penalty.
  3. Evaluate the selected policy with independent task labels and blinded human comparisons. Otherwise reward-model errors can become both the training target and the apparent success criterion.
Experiment checkpoint

Report who labeled the data and which prompt distribution was evaluated. A single reward score cannot represent every user objective.

LOCAL / SYNTHETIC / INTERACTIVE

Change one variable. Explain what moves.

Original teaching calculation, not a reproduction of the paper’s benchmark. Bars are relative within this panel; numeric values and units are authoritative.

04 · Work through an example

Original numerical example: hold raw reward at 1 and an illustrative KL value at 0.2. The regularized score is 1−0.2β. At β it is 0.9; at β it is 0.6. This static calculation explains the trade-off coefficient. It does not predict the trained policy’s KL or imply that a constant score is a full RLHF implementation.

05 · Design your experiment

Keep a blinded, held-out prompt set and compare base, SFT and preference-trained checkpoints at equal decoding budgets. Audit correctness separately from preference. For reward-model validation, measure pairwise agreement on new prompts and inspect disagreements. Include examples where verbosity, confidence or refusal style changes without factual improvement.

Research deliverable

State one hypothesis; save the configuration and raw results; identify a competing explanation; report the narrowest supported conclusion. Use the linked lab as a local starting point, not a full paper reproduction.

Open related lesson / lab →

06 · Limits & reviewer questions

Editorial caution: the evaluator population and prompt distribution delimit the claim. Reward hacking, distribution shift and capability regressions require dedicated tests. Local teaching diagrams do not execute model training, collect human feedback or establish an alignment result.

Why keep an evaluation separate from the reward model?

Optimizing a proxy can exploit its errors. Reusing the same proxy as the only evaluator cannot distinguish genuine task improvement from overfitting to the proxy.

07 · Read the original

Training pipeline, human evaluation and limitations; track the data source at each stage.

Year is the first arXiv submission year. Unversioned links follow revisions; record the exact version in your reproduction report. DeepSeek-R1 here is explicitly pinned to v1.

Continue this topic

MATHEMATICAL REVIEW · 2026-10-26

Assumptions, implementation & acceptance

KL is between response distributions, averaged over the same prompt distribution. Two example policies have expected reward/KL (1,0.4) and (0.8,0.1), so β gives 0.6 and 0.7. A sampled log ratio can be negative; its expectation is KL.

Displayed formula, bilingual explanation and declared slider range. This code reproduces the scalar teaching calculation, not the paper training system.

Before running: predict a boundary case

Keep a blinded, held-out prompt set and compare base, SFT and preference-trained checkpoints at equal decoding budgets. Audit correctness separately from preference. For reward-model validation, measure pairwise agreement on new prompts and inspect disagreements. Include examples where verbosity, confidence or refusal style changes without factual improvement.

Hint: isolate the assumption

Keep the baseline input fixed, change one parameter or boundary, and compare both the numerical result and the claimed units. A passing example verifies this fixture only.

Minimal executable example

Save the example and linked modules in one folder. Use Node.js 22 or newer, then run node rlhf.mjs. No third-party runtime dependencies.

import {paperCalc} from './paper-core.mjs';
const result=paperCalc("rlhf",1);
console.log(result);
Reference output — reveal after predicting
{
  "labels": [
    "Raw reward",
    "KL penalty",
    "Regularized objective"
  ],
  "values": [
    1,
    0.2,
    0.8
  ],
  "unit": "value"
}

Test and transfer

Keep a blinded, held-out prompt set and compare base, SFT and preference-trained checkpoints at equal decoding budgets. Audit correctness separately from preference. For reward-model validation, measure pairwise agreement on new prompts and inspect disagreements. Include examples where verbosity, confidence or refusal style changes without factual improvement.

Record input, code version, expected result and observed result in the notebook below. Then construct a counterexample that violates the assumption above and explain why the original conclusion no longer follows.

Download complete kit (.tar.gz) · Complete reference kit and regression checks

Predict, test and keep evidence

Before revealing an answer, predict one result. After the exercise, record the discrepancy and a transfer test. Saved locally across language editions.

Open notebook / export / clear →

The mathematical review scope is recorded per lesson. It does not establish empirical paper reproduction; report suspected errors in your notes. Review scope