Nathan Lambert
May 2026
Question-first templates from the issue tracker, Discord, and YouTube comments.
This course is approximately designed for early AI PhD/MS students. Traditional coursework path to this 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
In practice, yes but also not clear.
In practice, yes but also not clear.
To making a general model, very, but the solutions aren’t too surprising. Harder tasks get more tokens.
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.
Careful: two different meanings.
# 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:
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).
The PPO clipped objective on the cheatsheet:
No! But I don’t know of anyone using something else, or a raw value model. GAE works.
Source: issue #382 on GitHub
[B, T, V][B, T][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)
torch.max for both policy and value losses?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.
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.
Questions, comments, and future Q&A prompts: