Policy gradients and actor-critic
The policy gradient theorem, baselines and advantages, GAE, PPO, and the link to RLHF.
Why not argmax over Q
DQN acts by . Continuous torques make that an inner optimization; tiny Q-changes flip the greedy action; when states are aliased the best policy may be stochastic. In the short corridor (three lookalike states, swapped actions in the middle) the optimum is worth about ; -greedy with reaches only or , and deterministic never finishes.
The policy gradient theorem
Key idea. Raise the probability of actions that led to high return. The log-derivative trick turns into an expectation you can sample; unknown dynamics drop out of :
Causality replaces the full return by the reward-to-go . REINFORCE samples this sum; it is on-policy and noisy.
Baselines and advantages
Any action-independent baseline leaves the gradient unbiased because . A baseline near cuts variance: says whether the action beat the average. The advantage is the right weight; the TD error of a critic estimates it. Actor–critic: the actor steps along ; the critic learns by TD.
GAE
GAE averages -step advantages with weights :
computed backwards . is one-step TD; is . With rewards , values , , : advantages , , .
PPO
Large policy steps change the data and can collapse learning. PPO maximizes a clipped surrogate
with and typically , plus a value loss and an entropy bonus. Clipping stops improving a sample once a good action grew (or a bad one shrank) by about , so several epochs per batch stay safe. An entropy bonus delays premature collapse.
LMs and next
A language model is already a policy over tokens; RLHF runs PPO (or a critic-free cousin) with a KL tether to the starting model. Model-free methods never ask what an untaken action would do — expensive. Next (extension): learn a world model and plan or imagine inside it — Dyna, MPC, Dreamer, MuZero.
Check your understanding
The same questions as in Pulse. Answers are shared between modes.
Answers are saved on the server and tied to this browser until you sign in.