flâneur

High variance in RL (and how to measure it)

suzyahyah.github.io · 1,233 words · saved by 1 readers

Summary

Summary Policy Gradient algorithms in RL are known to have ‘high variance’, leading to a family of algorithms and 1000 of papers across more than 10 years (Actor-Critics, PPO, DPO, GRPO), clipping tricks, normalisation tricks, learning rate warm up tricks, which all attempt to reduce this variance. To examine this variance, we’ll implement Policy Gradient from scratch and collect the gradients by pytorch hackery. Implementing Policy Gradient From Scratch The derivation of the objective function for Policy Gradient, is the following: \[J(\theta) = E_{s,a} [ \log \pi_{\theta} (a \mid s)…

saved by

related reading