An e-commerce team trains pricing agents in a simulator and keeps a large buffer of transitions collected by older versions of its policies. Which grouping of algorithms into on-policy and off-policy is correct, including what it means for reusing that buffer?
Show the answer and explanation
Correct answer: C, On-policy: SARSA, REINFORCE and PPO, which must learn from data of the current policy; off-policy: Q-learning, DQN and SAC, which can learn from an old replay buffer.
Explanation Reinforcement Learning
On-policy methods learn about the policy that generates the data. Off-policy methods learn about a target policy (often the greedy one) from data generated by a different behaviour policy, so they can reuse old or replayed experience.
| Algorithm | Type | Why |
|---|---|---|
| SARSA | on-policy | target uses Q(s′, a′) for the action the current policy takes |
| Q-learning | off-policy | target uses the max over a′, the greedy policy |
| DQN | off-policy | Q-learning with a replay buffer |
| REINFORCE | on-policy | gradient is an expectation over the current policy's episodes |
| PPO | on-policy | reuses a fresh batch for a few epochs, then discards it |
| SAC | off-policy | soft Q-functions trained from a replay buffer |
For this team: Q-learning, DQN and SAC can train on the old buffer (with the usual caveat that it must cover the relevant states and actions). REINFORCE and PPO need new rollouts. PPO's ratio π_new/π_old only corrects for the small gap between the policy that collected a batch and the one being updated during a few epochs, and clipping keeps that gap small, so it cannot use data from much older policies. SARSA trained on the old buffer would evaluate the old policies, not the current one.
Why the other groupings fail: SARSA and Q-learning are the textbook on-/off-policy pair, so swapping them is wrong. Being actor–critic does not make a method on-policy: A2C is on-policy, SAC is off-policy.
Interview tip: link the distinction to sample efficiency: off-policy methods reuse data and are usually more sample-efficient, while on-policy methods are often more stable.