Q&A 1: RLHF course student questions

rlhfbook.com/course

Nathan Lambert

May 2026

Question-first templates from the issue tracker, Discord, and YouTube comments.

Course orientation

What prerequisites should a learner cover before this course?

What prerequisites should a learner cover before this course?

This course is approximately designed for early AI PhD/MS students. Traditional coursework path to this course:

  • Basics of language modeling / NLP
  • Basic ML (e.g. intro to AI course and intro to ML course)

With AI agents, all the material is very accessible. I encourage people to track down rabbit holes, skip videos, go out of order, and chases what excites them.

Related courses: David Silver’s RL Course (2015), UC Berkeley Deep RL (2023), Sutton & Barto RL Book

Data & instruction tuning

For synthetic SFT data, is one teacher model better than many?

For synthetic SFT data, is one teacher model better than many?

For synthetic SFT data, is one teacher model better than many?

Should the teacher model’s distribution match the base model?

In practice, yes but also not clear.

For synthetic SFT data, is one teacher model better than many?

Should the teacher model’s distribution match the base model?

In practice, yes but also not clear.

How important is balancing domains in an SFT mix?

To making a general model, very, but the solutions aren’t too surprising. Harder tasks get more tokens.

Reward models & reward design

Is there a unified benchmark across pairwise RMs, ORMs, PRMs, and generative RMs?

Is there a unified benchmark across pairwise RMs, ORMs, PRMs, and generative RMs?

Context: the question asks whether one labeled dataset could support comparison data, per-token labels, and outcome labels for apples-to-apples RM evaluation.

Answer: No. Fragmentation of the community makes progress more diffuse. This is okay, and a normal evolution.

Why choose token-level rewards over sequence-level rewards?

Why choose token-level rewards over sequence-level rewards?

Careful: two different meanings.

  • Reward granularity: final-answer reward vs step/token rewards (PRM, KL, format rewards) (Lightman et al., 2024).
  • Loss granularity: average by sequence vs average by active tokens; DAPO uses token-level policy-gradient loss (Yu & others, 2025).
# Sequence-normalized: each completion has equal weight
loss = ((pg_loss * mask).sum(dim=1) / mask.sum(dim=1)).mean()

# Token-normalized: each generated token has equal weight
loss = (pg_loss * mask).sum() / mask.sum()

Why token-level can help:

  • local signals: KL, format rewards, PRMs, partial credit
  • long-CoT RL: more gradient on the tokens actually sampled
  • batching: normalize by active tokens, not examples
  • DAPO: token-level loss + Clip-Higher + dynamic sampling for reasoning RL (Yu & others, 2025)

Counterpoint: if the reward is only final-answer correctness, sequence-level advantage is still natural; GSPO pushes the ratio back to sequence level (Zheng et al., 2025).

RL math & notation

Is GAE the only way to compute the advantage in PPO?

Is GAE the only way to compute the advantage in PPO?

The PPO clipped objective on the cheatsheet:

J(\theta) = \mathbb{E}_t\!\left[\min\!\left(\rho_t(\theta)\hat{A}_t,\; \text{clip}(\rho_t(\theta),\, 1-\varepsilon,\, 1+\varepsilon)\hat{A}_t\right)\right]

No! But I don’t know of anyone using something else, or a raw value model. GAE works.

What is the shape of \rho?

\rho_t(\theta) = \frac{\pi_\theta(a_t \mid s_t)}{\pi_{\theta_\text{old}}(a_t \mid s_t)}

What is the shape of \rho?

\rho_t(\theta) = \frac{\pi_\theta(a_t \mid s_t)}{\pi_{\theta_\text{old}}(a_t \mid s_t)}
  • \pi(\cdot \mid s_t) is vocab-shaped: [B, T, V]
  • \pi(a_t \mid s_t) is gathered at sampled tokens: [B, T]
  • \rho_t is scalar per token; rollout tensor is [B, T]
# logits/logprobs over vocab: [B, T, V]
old_logps_all = old_policy.log_softmax(logits_old, dim=-1)
new_logps_all = policy.log_softmax(logits_new, dim=-1)

# sampled token ids: [B, T]
actions = input_ids[:, 1:]

# gather only the probabilities of the sampled tokens: [B, T]
old_logps = old_logps_all.gather(-1, actions.unsqueeze(-1)).squeeze(-1)
new_logps = new_logps_all.gather(-1, actions.unsqueeze(-1)).squeeze(-1)

# importance ratio per sampled token: [B, T]
rho = torch.exp(new_logps - old_logps)

PPO implementation & debugging

Why does PPO use torch.max for both policy and value losses?

Why does PPO use torch.max for both policy and value losses?

# PPO minimizes a negative policy loss
pg_loss_unclipped = -advantages * ratio
pg_loss_clipped = -advantages * torch.clamp(
    ratio, 1.0 - eps, 1.0 + eps
)

# choose the more conservative / worse loss
pg_loss = torch.max(pg_loss_unclipped, pg_loss_clipped)

torch.max matters because PPO is written as a loss to minimize.

It selects the update that gives less improvement after clipping.

# value clipping: do not let critic jump too far
v_clip = old_values + torch.clamp(
    v_pred - old_values, -vf_eps, vf_eps
)

vf_unclipped = 0.5 * (v_pred - targets) ** 2
vf_clipped = 0.5 * (v_clip - targets) ** 2

# optimize the worse value error
vf_loss = torch.max(vf_unclipped, vf_clipped)

Policy clipping limits policy drift.

Value clipping limits critic drift.

Same pattern: compare unclipped vs clipped, train on the worse one.

Human feedback operations

How should data-annotation companies stay valuable as synthetic data gets simpler?

How should data-annotation companies stay valuable as synthetic data gets simpler?

A big shift underway from “grunt” low-skill work to expert domains like law, finance, healthcare, consulting, which solves a lot of the data company problems.

Context from the reader: this asks about the aside in Chapter 11 on companies that vet data annotators.

What comes next?

Upcoming lectures
  • Lecture 5: Reasoning training & inference-time scaling
  • Lecture 6: Direct alignment algorithms
  • Later: Preferences, preference data, synthetic data, tools, evaluation, product, and style

Thanks for watching

Questions, comments, and future Q&A prompts:

References

Guha, E., Marten, R., Keh, S., and others. “OpenThoughts: Data Recipes for Reasoning Models.” arXiv preprint arXiv:2506.04178, 2025.
Lightman, H., Kosaraju, V., Burda, Y., Edwards, H., Baker, B., et al.. “Let's verify step by step.” International Conference on Learning Representations, 2024.
Olmo, T., Ettinger, A., Bertsch, A., Kuehl, B., Graham, D., et al.. “Olmo 3.” 2025. [link]
Yu, Q., and others. “DAPO: An Open-Source LLM Reinforcement Learning System.” arXiv preprint arXiv:2503.14476, 2025.
Zheng, Z., Guo, D., and others. “Group Sequence Policy Optimization.” arXiv preprint, 2025.