Your favorite route runs beside a cliff, and while you're still exploring, one random move can make you fall. Should the route's value include those random moves? If it does, you're learning on-policy: the value describes the moves you actually make. If it doesn't, you're learning off-policy: the value describes a different policy, here a greedy one that never slips. You can see the difference by holding one next-state row fixed and calculating three targets (Sutton and Barto, §§5.5 and 6.4–6.6).
Part 4. A value estimate credits earlier actions with rewards that arrive later, so it has to assume which actions come next. The task, the rewards and the table stay the same.
Two policies, one task
The rule that collects your moves is the behavior policy, written . The rule whose future you want to value is the target policy, written . Both give the probability of action in state : and .
| At one illustrative state | Right | Down |
|---|---|---|
| Behavior : collects moves | 0.9 | 0.1 |
| Target : greedy continuation | 1 | 0 |
So a down move can show up in the data even though you're valuing a future that always goes right. Learning is on-policy when the two rules match and off-policy when they differ. Q-learning is off-policy even when it learns from each move as it happens: the exploratory rule picks the move, but the target assumes greedy actions afterwards. Off-policy is about whose future the target describes, not about how old the data is.
One row, three targets
Hold the next-state row fixed: right is worth , down is worth , the behavior picks them with probabilities and , the reward is and . Every method moves toward a target . They only differ in how the next action enters that target:
Q-learning takes the best next action: . Sarsa uses the next action it actually sampled, so its target is after right or after down. Expected Sarsa with averages over the next action: . That removes the noise from sampling the next action. With a greedy , Expected Sarsa becomes Q-learning. §§6.4–6.6.
Notation and the update rule
At step you take action in state , receive reward and arrive at . estimates the discounted return after action in state , is the discount, a positive learning rate, and a candidate next action. For Sarsa, is the action actually sampled from the same behavior. The superscripts Q, Sarsa and Expected name the method; they aren't powers. Every method uses the same update:
Expected Sarsa removes next-action sampling noise, but transition and reward randomness can remain. It is off-policy whenever its chosen differs from .
Exploration has a cost
Q-learning's target values a future without exploratory slips, so it learns the route right along the cliff edge. Sarsa includes the slips in the behavior it evaluates, so it can prefer a longer route that leaves room to recover. That's the book's cliff example, with exploration that never stops (Example 6.6). Neither target is a safety guarantee: Sarsa's value is an expected return for its own policy, and that policy can still choose dangerous actions.
What a single run depends on
A particular finite run also depends on initialization, visits and the learning rate. Changing the exploration rule changes the return Sarsa learns. Gradually removing exploration changes the comparison again: the book's asymptotic optimality discussion assumes the required exploration and learning-rate conditions.
Data must cover the question
Suppose a stored dataset never takes a bridge that the target policy would use. Replaying the other transitions more often won't tell you where the bridge leads. For action correction, the coverage requirement is
every action the target might take must also be possible under the behavior. The states have to show up in the updates too, and a buffer can skip them or sample them very unevenly. That freedom to learn about another policy is what off-policy methods are for, and its price is that coverage becomes part of the learning problem (§5.5). Part 7 takes this to a fixed robot log, where a missing action becomes a target nothing corrects.
Correcting action probabilities
Say the data choose right and down equally, but the target chooses right four times as often. A plain average then answers the wrong policy's question. The importance ratio fixes each action's share, because behavior probability times the ratio leaves target probability. For any fixed quantity attached to an action:
With behavior , target and quantities , the ratios are and , and , the same as . That's a one-step identity. Correcting a whole return needs a product of ratios, and a rare behavior action can get a huge weight. §5.5.
The weighted contributions, row by row
| Action | Behavior | Target | Ratio | Quantity | Weighted contribution |
|---|---|---|---|---|---|
| Right | 0.5 | 0.8 | 1.6 | 10 | 8 |
| Down | 0.5 | 0.2 | 0.4 | −10 | −2 |
Add the last column to recover 6. Each contribution is behavior probability × ratio × quantity; it isn't a new transition or reward. The arithmetic doesn't repair an omitted state, and it doesn't establish convergence for a nonlinear bootstrapping learner. Here is the expectation and means the action is sampled from the behavior at this fixed state; the denominator must be positive for every target action.
Which guarantees survive?
On-policy sampling fixes one mismatch, not every problem. The familiar convergence result covers fixed-policy prediction with fixed linear features, enough visits and shrinking step sizes (Tsitsiklis and Van Roy, 1997). Sample the states off-policy and the same linear TD can diverge, because one shared weight vector moves a prediction and its own target together. Part 5 shows how. For a changing control policy or a neural network there's no general guarantee, so each method needs its own analysis.
Three targets and an Expected Sarsa loop
| Method | Continuation in the target | Primary source |
|---|---|---|
| Q-learning | Largest next-action estimate | §6.5 |
| Sarsa | One action sampled from its policy | §6.4 |
| Expected Sarsa | Average under the chosen target policy | §6.6 |
A short Expected Sarsa loop makes the policy choice explicit. collects actions and weights their continuation; in the code, gamma, alpha and pi spell those symbols, and terminal means the episode ended, so there's no remaining value to bootstrap:
choose A_t using behavior b at S_t
observe R_(t+1), S_(t+1), terminal
if terminal: Y_t = R_(t+1)
else: Y_t = R_(t+1) + gamma * sum_a pi(a|S_(t+1)) Q(S_(t+1),a)
move Q(S_t,A_t) a fraction alpha toward Y_t
- On-policy benefit: the target includes the behavior's exploratory costs.
- Off-policy benefit: collection and the policy being learned about can differ.
- Coverage cost: missing actions or states leave parts of the question unsupported.
- Approximation limit: shared predictions can feed changes back into their own targets.
Is off-policy a must at scale?
A growing dataset fills up with old runs, other controllers and failed attempts, and using all of it means learning off-policy. Whether you need that depends on the domain.
Robots. Real robot time is expensive, so real-robot RL stores old attempts in a replay buffer or a dataset and trains on them again. QT-Opt pooled over 580,000 grasps from 7 robots (2018), and RECAP in π*0.6 learns from good and bad runs together (2025), with a Monte Carlo value instead of Q-learning. In simulation, parallel environments make fresh data cheap, and Proximal Policy Optimization (PPO) is still the usual choice (FastTD3). In the table of real-world successes in a 2025 survey, locomotion has 37 on-policy, 6 off-policy and 0 offline entries, and manipulation has 9, 24 and 6 (my count).
LLMs. The main algorithms, PPO and Group Relative Policy Optimization (GRPO), learn from fresh samples of a recent version of the model. InstructGPT used PPO, and DeepSeekMath, which introduced GRPO, took a single update on each fresh batch. Large systems drift a little from fresh data. DeepSeek-R1 made one pass over each batch of 8,192 outputs in 16 minibatch steps, so its later steps used slightly older samples. Others reuse a batch for several updates or let rollouts lag a few steps, then correct with clipped or truncated probability ratios. In a controlled study, results generally got worse as the data grew more off-policy, while an asynchronous setup with a one-step lag matched the synchronous results and trained faster (Noukhovitch et al.).
There's no defensible count of the off-policy share of RL methods. A rough proxy points the other way: among arXiv abstracts that name PPO, TRPO, A2C or A3C versus DQN, DDPG, TD3 or SAC, the off-policy-only share fell from 61% in 2022 to 35% in 2025. Off-policy mentions still grew, from 244 to 416 abstracts, while on-policy mentions grew faster. The proxy counts mentions, not use, but its share shows no rise.
Source note: definitions, counts and dated examples
Definition used. On-policy methods "attempt to evaluate or improve the policy that is used to make decisions, whereas off-policy methods evaluate or improve a policy different from that used to generate the data" (Sutton and Barto, 2020, §5.4). The same book warns that off-policy methods "are often of greater variance and are slower to converge" (§5.5).
Five ideas that get called off-policy. They aren't the same thing, and only some of them need an off-policy learner.
| Idea | Needs an off-policy learner? |
|---|---|
| Off-policy RL (Q-learning, DQN, SAC) | Yes, by definition. |
| Offline RL on a fixed dataset | Yes, if the goal is to beat the policy that collected the data. With sparse rewards or noisy data, offline RL "can significantly outperform" behavior cloning (Kumar et al., 2022). |
| Learning from good and bad demonstrations | It needs off-policy improvement, but not an off-policy value learner. Filtering, weighting or conditioning on the data needs a quality score. RECAP scores the data with a Monte Carlo value of the policy that collected it, conditions the policy on an advantage label, and trains a policy that does better. Plain behavior cloning copies the bad demonstrations too. |
| Replay buffer | Reusing old transitions to improve the current policy needs an off-policy learner or a correction: "when learning by experience replay, it is necessary to learn off-policy (because our current parameters are different to those used to generate the sample)" (DQN, 2015, Methods). |
| Rollout reuse in PPO and GRPO | Slightly. After the first gradient step the batch is a little stale, and the ratio with clipping or truncation corrects for it. |
What a percentage would need. A share of "off-policy methods" needs a population, a date range and a counting rule. The measure that would answer the question is the share of RL papers in each year that use each algorithm, from full-text reading of a random sample. No study of that kind turned up. Classification also moves any percentage: GRPO is nominally on-policy but runs slightly off-policy at scale, DPO is often trained offline on a fixed preference set but also runs in rounds (Llama 3) or online (Online DPO), and behavior cloning isn't RL at all.
A mention proxy. For each year, take the abstracts that name at least one on-policy algorithm (PPO, TRPO, A2C or A3C) or off-policy algorithm (DQN, DDPG, TD3 or SAC), and count the share that names only off-policy ones. GRPO is left out so that the LLM wave doesn't decide the answer. PPO stays in, so to check the LLM effect, the same count without abstracts about language models fell from 61.5% (2022) to 42.7% (2025). SAC counts only by its full name. From 2018 to 2022 the arXiv share sat between 58% and 68%, so any start year in that range shows a fall.
| Population | 2022 | 2025 |
|---|---|---|
| arXiv cs.LG, cs.AI, cs.RO or cs.CL, by first submission date | 61.0% of 364 | 35.2% of 960 |
| arXiv cs.RO only | 62.6% of 91 | 37.4% of 203 |
| OpenAlex works in computer science or engineering, full algorithm names only | 76.0% of 2,809 | 63.7% of 9,211 |
The OpenAlex share sat between 76% and 78% from 2018 to 2022 before it fell. Off-policy mentions still grow in absolute numbers (arXiv: 244 abstracts in 2022, 416 in 2025); on-policy mentions grow faster (142 to 622). The proxy has hard limits: an abstract that names an algorithm isn't a paper that trains with it, the lists miss methods such as CQL, IQL and REINFORCE-style LLM methods, and with a few hundred arXiv abstracts a year, moves of a few points are noise. Counts come from the arXiv and OpenAlex APIs, queried on 22 October 2026.
Two curated counts. Each covers one period and the authors' own selection, so neither shows a trend.
- Tang et al., 2025, Table 5 (real-world robot RL successes chosen by the authors): locomotion lists 37 on-policy, 6 off-policy and 0 offline entries; manipulation lists 9, 24 and 6. Two locomotion references appear in both the on-policy and off-policy columns. The survey gives lists of references, and I counted them. It links the lean in locomotion and navigation to dense, shaped rewards and easy simulation: "the predominant use of stable and robust model-free, on-policy algorithms in these domains."
- Survey of RL for large reasoning models, v3, October 2025, Table 1 (33 "representative open-source models trained with RL", January to September 2025): GRPO alone 16, GSPO 2, PPO 1, CISPO 1, OPMD 1, MPO 1, MPO with GRPO 1, MPO with GSPO 1, not stated 9. None names a replay-buffer Q-learning method.
Dated examples. These are prominent systems, picked by hand, so they show what's done, not how often.
| System | Domain | How it uses data |
|---|---|---|
| DQN, Feb 2015 | Atari | Replay forces off-policy learning, "which motivates the choice of Q-learning". |
| PPO, Jul 2017 | General | "enables multiple epochs of minibatch updates" on each batch. |
| QT-Opt, Jun 2018 | Real-robot grasping | "over 580k grasps over the course of several weeks across 7 robots"; "Collecting such data in a single on-policy training run would be impractical." |
| InstructGPT, Mar 2022 | LLM | "we fine-tuned the SFT model on our environment using PPO" (§3.5). |
| DeepSeekMath, Feb 2024 | LLM | Introduces GRPO; "The policy model only has a single update following each exploration stage." |
| Tajwar et al., Apr 2024 | LLM fine-tuning study | "approaches that use on-policy sampling or attempt to push down the likelihood on certain responses ... outperform offline and maximum likelihood objectives" (the paper puts offline DPO, which pushes down the likelihood of rejected responses, in the winning group). |
| Llama 3, Jul 2024 | LLM | DPO in rounds, on preference data from recent models; "We also explored on-policy algorithms such as PPO ..., but found that DPO required less compute for large-scale models and performed better". |
| SERL, HIL-SERL, Jan and Oct 2024 | Real-robot manipulation | Off-policy RL based on RLPD, with demonstrations in the replay buffer. HIL-SERL "also incorporates human demonstrations and corrections". |
| DeepSeek-R1, Jan 2025 (batch details from the Nature version, Sep 2025, and arXiv v2) | LLM | "we adopt Group Relative Policy Optimization (GRPO)"; "each rollout generates 8,192 outputs, which are randomly split into 16 minibatches and trained for only a single inner epoch". |
| Asynchronous RLHF, ICLR 2025 | LLM | "RLHF performance generally degrades with more off-policyness"; the asynchronous setup trains faster, and Online DPO is "most robust to off-policy data". |
| FastTD3, May 2025 (second quote from v2 and later) | Humanoid, sim to real | "practitioners have mostly used Proximal Policy Optimization (PPO ...) for training deployable policies in simulation"; calls its humanoid result, "to the best of our knowledge, the first documented instance of a successful deployment of an off-policy RL policy on a full-size humanoid robot in the real world". |
| MiniMax-M1, Jun 2025 | LLM | "16 rounds of off-policy updates per generation batch"; its CISPO loss "clips the importance sampling weights". |
| ScaleRL, Oct 2025 | LLM | "8 steps off-policyness" (a maximum lag) with a truncated importance-sampling loss. The abstract says the off-policy algorithm mainly changes compute efficiency; Appendix A.11 says it also shifts the asymptote, "one of the most consequential design decisions in RL post-training". |
| RECAP in π*0.6, Nov 2025 | Real-robot VLA | "an iterated offline RL framework"; it must "effectively utilize both good (near-optimal) and bad (suboptimal) data" and avoids "the need for on-policy PPO or REINFORCE". |
Limits. Hand-picked examples can't support a share or a trend, both surveys are curated, and the mention proxy measures attention, not use. Robot foundation models trained by imitation, such as RT-1 ("it is an imitation learning method", 130k demonstrations), aren't counted here. All sources were accessed on 22 October 2026.
Part 5: the deadly triad follows the shared-weight feedback all the way to a growing number. Later, Part 6 turns action credit into the policy updates that PPO and GRPO make.