A ai coolAId

On-Policy vs. Off-Policy

In One Sentence
On-policy algorithms (PPO, GRPO) learn only from fresh data generated by the current policy; off-policy algorithms (Q-learning, SAC) reuse past data from a replay buffer.
ELI5 (Intuition)
On-policy is learning only from games you played today; off-policy is studying game film from last week—even when someone else was playing—to improve.
ELI18 (Technical)
On-policy methods sample trajectories from \(\pi_\theta\) (stable, simple, lower sample efficiency); off-policy methods learn from a behavioral distribution \(\mu \ne \pi_\theta\) stored in a replay buffer, trading stability for 10x better sample efficiency.
In Practice
Use on-policy (PPO/GRPO) when simulation or rollouts are cheap and parallelizable; use off-policy (SAC, TD3, offline RL) when every real-world trial is expensive, such as physical robots or live user traffic.