Dynamic Prioritized Experience Replay in RL
- Dynamic Prioritized Experience Replay is a mechanism in reinforcement learning that dynamically adjusts sampling priorities based on TD errors to focus on informative transitions.
- It employs both proportional and rank-based prioritization schemes with online updates and importance-sampling corrections to mitigate bias from non-uniform replay.
- The approach has been shown to improve learning efficiency in various settings, from Atari games to distributed architectures, while inspiring several advanced variants.
Dynamic Prioritized Experience Replay denotes a family of replay mechanisms in off-policy reinforcement learning in which the replay distribution is allowed to evolve with the agent’s current learning state rather than remaining uniform over stored transitions. In its canonical form, Prioritized Experience Replay (PER) replaces uniform replay with sampling probabilities monotone in transition priority, typically derived from temporal-difference (TD) error magnitude, and pairs this with importance-sampling correction to control the bias introduced by non-uniform replay. The defining dynamic features are that priorities are updated online as new TD errors are computed, newly inserted transitions are typically given maximal priority so that they are replayed at least once, and the importance-sampling exponent is annealed during training to recover less biased updates near convergence (Schaul et al., 2015).
1. Canonical formulation
The original PER framework starts from standard experience replay: transitions are stored in a replay memory and later resampled in order to break temporal correlations, avoid forgetting rare but informative experience, and trade environment interaction for computation and memory. Uniform replay treats all stored transitions equally, whereas PER assumes that transitions with larger expected learning progress should be replayed more often. In the original formulation, the magnitude of the TD error is used as a proxy for that learning progress (Schaul et al., 2015).
For a transition , the TD error in DQN is
and in Double DQN it is
PER defines two stochastic prioritization schemes. In proportional prioritization,
where prevents starvation and controls prioritization strength. In rank-based prioritization, transitions are sorted by descending , assigned , and sampled from a power-law distribution . The rank-based variant is described as robust to outliers because it depends on ranks rather than magnitudes and retains heavy tails, promoting diversity (Schaul et al., 2015).
Because non-uniform replay changes the effective training distribution, PER uses per-sample importance sampling (IS) weights
with replay size 0 and correction exponent 1. The weighted squared TD error becomes
2
The dynamic character of PER lies in the update cycle: after each learning step, sampled transitions receive refreshed priorities based on their newly computed TD errors, while newly inserted transitions receive maximal priority to guarantee replay. In the Atari Double DQN configuration reported in the original study, proportional prioritization used 3 and linearly annealed 4 from 5 to 6, while rank-based prioritization used 7 and annealed 8 from 9 to 0 (Schaul et al., 2015).
2. Replay systems, data structures, and scaling
The canonical proportional implementation uses a sum-tree in which leaves store priorities and internal nodes store segment sums. Insert, update, and single-sample operations are 1, and minibatch sampling with stratified segments is 2. This makes PER practical for 3, whereas naive cumulative-sum recomputation would be 4 per sample. Rank-based PER can instead use an array-based binary heap to approximate sorted order, together with stratified sampling over equal-probability partitions of the rank-based cumulative distribution (Schaul et al., 2015).
In the Atari configuration of the original paper, the replay buffer size was 5, minibatch size 6, and replay period 7, corresponding to one gradient update per four new transitions and roughly eight replays per transition on average. The learning rate was reduced by 8 relative to the DQN baseline, from 9 to 0, to counter larger gradient magnitudes. Rewards and TD errors were clipped to 1 for stability (Schaul et al., 2015).
The distributed Ape-X architecture generalized dynamic PER to a many-actor setting by decoupling acting from learning. Hundreds of CPU actors interact with their own environments using a shared policy, compute initial priorities from local TD errors, and push prioritized transitions into a centralized replay store; a single GPU learner samples from that store, updates the network, recomputes TD errors under current parameters, and writes updated priorities back. In Atari, Ape-X used 360 CPU actors producing about 2K raw FPS and a single P100 GPU learner processing about 3K transitions per second, with replay capacity soft-limited to about 4M transitions, 5 multi-step returns, 6, 7, actor parameter refresh every 400 frames, and target-network updates every 2500 learner batches (Horgan et al., 2018). The actor-side computation of initial priorities was introduced specifically to avoid the strong recency bias of max-priority insertion in a setting where many actors continuously flood replay.
3. Empirical effects and performance regimes
In the original Atari study, DQN with prioritized replay outperformed DQN with uniform replay on 41 of 49 games. For the rank-based variant, the median normalized score increased from 8 to 9. For Double DQN, PER increased the median from 0 to 1 and the mean from 2 to 3, with the mean noted as dominated by Video Pinball. The median performance-equivalence point was reached in about 4 to 5 of training steps depending on the variant, indicating roughly 6 faster aggregate learning (Schaul et al., 2015).
Large-scale distributed replay amplified these gains. Ape-X DQN reported median human-normalized scores of 7 with no-op starts and 8 with human starts after 5 days and 22,800M frames, outperforming Rainbow, C51, Prioritized Dueling DQN, DQN, and Gorila under the reported evaluation setup (Horgan et al., 2018). The associated ablations attributed the performance gain not to recency alone, but to the combination of diverse exploration from many actors and prioritized concentration of learner updates on informative transitions.
The empirical picture is not uniformly positive across domains. In a later study focused on generalization, prediction tasks, and noisy settings, PER still improved value propagation in tabular settings, but behavior changed substantially with neural networks. Certain mitigations—delaying target-network updates and using estimates of expected TD errors—avoided large error spikes, yet prioritized variants generally did not outperform uniform replay in control tasks, and none consistently outperformed uniform replay in the reported neural control experiments (Panahi et al., 2024). This divergence established a persistent distinction between the original Atari success case and later evidence from noisy, bootstrapped, or heavily generalizing function approximators.
4. Bias, instability, and theoretical reinterpretations
The standard failure modes of dynamic PER are well characterized. Oversampling high-9 items can reduce diversity, increase sensitivity to noise or bootstrapping artifacts, and destabilize learning because both priorities and target values evolve as 0 and 1 change. The original PER paper mitigated these effects through stochastic prioritization with 2, importance sampling with annealed 3, max-normalized IS weights, stratified sampling, and a reduced learning rate (Schaul et al., 2015).
Later analyses made two criticisms sharper. First, raw TD errors can chase stochasticity: in neural settings, bootstrapping and generalization can create large transient TD errors that are then repeatedly replayed, producing error spikes. Second, importance-sampling correction is optimizer-dependent: with plain SGD, PER+ISR was observed to learn more slowly than iid replay in several settings, while with Adam or RMSprop the same correction could remain viable under noise (Panahi et al., 2024). This work proposed Expected Priorities (EPER), which replace instantaneous 4 with an online estimate 5 of expected absolute TD error, and also suggested lagged value functions for priority computation.
A separate theoretical line showed that non-uniform replay can be reinterpreted as a transformed uniformly sampled loss. For a base loss 6, PER with prioritization exponent 7 and IS exponent 8 has a uniformly sampled equivalent
9
under stop-gradient treatment of the priority term. This analysis explains why PER combined with MSE can bias learning toward outliers when the effective loss power exceeds 2, and it motivates corrected variants such as Loss-Adjusted Prioritized replay (LAP) and the uniformly sampled Prioritized Approximation Loss (PAL) (Fujimoto et al., 2020). In that sense, part of PER’s effect can be understood as loss shaping rather than merely sample selection.
5. Alternative priority signals and adaptation to non-stationarity
The most active post-Atari line of work modifies the prioritization signal itself rather than the replay architecture.
| Variant | Priority signal | Dynamic mechanism |
|---|---|---|
| EPER (Panahi et al., 2024) | Expected absolute TD error 0 | Online smoothing of priorities; mitigates transient spikes |
| RPE-PER (Yamani et al., 30 Jan 2025) | Reward prediction error 1 | Priorities change as the reward head improves |
| DEER (Duan et al., 18 Sep 2025) | Discrepancy of Environment Dynamics and TD error | Switches weighting after detected environment changes |
| LFIW replay (Sinha et al., 2020) | Density-ratio weight 2 | Continuously reweights critic loss toward the current policy’s stationary distribution |
RPE-PER replaces TD-error prioritization with reward prediction error produced by an Enhanced Model Critic Network that predicts Q-values, rewards, and next states. In the reported MuJoCo experiments, it used 3, 4, batch size 256, and 1M environment steps, and it outperformed TD-error PER on most tasks for both TD3 and SAC, with only minor exceptions such as Swimmer under TD3 and Hopper under SAC (Yamani et al., 30 Jan 2025). The rationale is that immediate reward prediction can be less distorted by bootstrapping bias than critic TD error in continuous control.
DEER targets explicitly non-stationary environments. It introduces the Discrepancy of Environment Dynamics,
5
estimated using critic snapshots at detected environment changes, and combines it with TD error through a change-dependent gate. In the reported MuJoCo benchmarks with non-stationary friction and damping offsets, DEER improved performance by 6 over the best state-of-the-art replay baseline on average, and by about 7 under 200% offsets (Duan et al., 18 Sep 2025). This directly addresses the classical PER problem that post-change high TD errors may reflect obsolete transitions rather than genuinely useful ones.
A different adaptation, “Experience Replay with Likelihood-free Importance Weights,” abandons TD-error prioritization altogether and instead reweights critic updates by an estimate of the current policy’s stationary state-action distribution relative to the replay distribution. The key argument is that the Bellman evaluation operator is a 8-contraction in the weighted 9 norm only when the weighting matches 0, and the practical implementation uses a fast/slow buffer density-ratio estimator with self-normalization temperature 1 (Sinha et al., 2020).
6. Structural and domain-specific generalizations
Dynamic prioritized replay has also been generalized structurally beyond individual transitions. Prioritized Sequence Experience Replay (PSER) propagates a fraction of a newly observed high priority backward along the preceding episode window using an exponential decay with coefficient 2 and window 3. In Atari experiments the tuned values were 4, 5, and 6, and the reported human-normalized median score rose from 7 under PER to 8 under PSER. In Blind Cliffwalk, the paper proved an exponential-vs-linear separation in expected convergence steps between PER and PSER under its assumptions (Brittain et al., 2019).
Sparse-reward goal-conditioned control motivated Hindsight Goal Ranking (HGR), which prioritizes both episodes and hindsight goals by TD error within DDPG+HER. Episode-level priorities are based on the average absolute TD error over all transition/future-goal pairs in an episode, and within a sampled episode, future goals are sampled with probability proportional to their goal-conditioned TD error. On Fetch tasks, HGR reported substantial sample-efficiency gains over vanilla HER, PER extensions, EBP, and MEP, with particularly strong improvements on Push and Slide (Luu et al., 2021).
State-aware replay has been explored in online recommendation through Locality-Sensitive Experience Replay (LSER), which hashes high-dimensional states into buckets using locality-sensitive hashing and then samples within similar-state buckets using reward-driven ranking rather than TD error. In VirtualTB, LSER reached good policies in about 30,000 episodes versus about 50,000 for AER, DER, PER, and SER, while also reducing runtime relative to PER and especially AER (Chen et al., 2021). Robotic manipulation has prompted yet another split design: D-SPEAR uses a shared buffer but decouples critic sampling toward high-TD transitions and actor sampling toward low-TD transitions, with a coefficient-of-variation-driven anchor that adaptively blends uniform and prioritized replay. On robosuite Lift and Door, it outperformed SAC, TD3, and DDPG in both final performance and stability (Zhang et al., 28 Mar 2026).
Taken together, these extensions indicate that “dynamic” in dynamic prioritized experience replay no longer refers only to refreshed TD-error magnitudes. It includes dynamic correction schedules, dynamic choice of prioritization signal, dynamic separation of actor and critic data requirements, dynamic conditioning on current state or current policy, and dynamic adaptation to distribution shift, noise, and environment change. The central design problem remains the same across variants: to focus computation on transitions that are informative under the agent’s present epistemic state without collapsing coverage, amplifying stochasticity, or hard-coding a replay distribution that quickly becomes obsolete.