Learning Expected Emphatic Traces for Deep RL

Ray Jiang, Shangtong Zhang, Veronica Chelu, Adam White, Hado van Hasselt

Abstract

Off-policy sampling and experience replay are key for improving sample efficiency and scaling model-free temporal difference learning methods. When combined with function approximation, such as neural networks, this combination is known as the deadly triad and is potentially unstable. Recently, it has been shown that stability and good performance at scale can be achieved by combining emphatic weightings and multi-step updates. This approach, however, is generally limited to sampling complete trajectories in order, to compute the required emphatic weighting. In this paper we investigate how to combine emphatic weightings with non-sequential, off-line data sampled from a replay buffer. We develop a multi-step emphatic weighting that can be combined with replay, and a time-reversed $n$-step TD learning algorithm to learn the required emphatic weighting. We show that these state weightings reduce variance compared with prior approaches, while providing convergence guarantees. We tested the approach at scale on Atari 2600 video games, and observed that the new X-ETD($n$) agent improved over baseline agents, highlighting both the scalability and broad applicability of our approach.

Introduction: Taming the Deadly Triad

In Reinforcement Learning (RL), researchers often pursue three "holy grails" simultaneously: off-policy learning (learning from data generated by older versions of the agent), function approximation (using neural networks to handle complex environments), and bootstrapping (updating estimates based on other estimates). When combined, these three elements form the "deadly triad," a combination that is notoriously unstable and can cause value estimates to diverge.

While Emphatic TD (ETD) was introduced to mitigate this instability by re-weighting updates, it traditionally requires sequential trajectories to calculate the necessary emphatic traces. This requirement makes it incompatible with Experience Replay, the standard practice in Deep RL of sampling random, non-sequential mini-batches. This paper introduces X-ETD(n), an algorithm that bridges this gap by learning to predict the expected emphatic trace, enabling stable off-policy learning from replay buffers.

Methodology: Learning the Expected Trace

The core innovation of X-ETD(n) is the realization that the exact, noisy trace from a specific trajectory is not required; an estimate of the expected trace for a given state is sufficient.

Time-Reversed TD Learning

Because emphatic traces are defined recursively based on past states, learning them as a function of the current state requires a novel approach. The authors developed a time-reversed TD learning algorithm that effectively "bootstraps backwards" in time. This allows a neural network to map observations directly to their expected emphasis, making the method compatible with random sampling from a replay buffer.

Architecture and Stabilization

The authors integrated this approach into a deep RL framework by adding auxiliary heads to the neural network architecture. These heads learn the policy, value function, and the emphatic trace simultaneously.

Neural network architecture featuring auxiliary heads for learning emphatic traces alongside policy and value functions.

To ensure stability during training, two key techniques were employed:

  1. Importance Sampling (IS) Clipping: Prevents learned weights from exploding due to high-variance ratios.
  2. Auxiliary Monte-Carlo Loss: Uses sequential data, when available, as a ground-truth signal to regularize the learned trace.

Experimental Evaluation

The approach was evaluated on two main fronts:

  • Baird’s Counterexample: A classic MDP designed to cause standard off-policy TD to diverge, serving as a proof-of-concept for stability.
  • Atari 2600 (Arcade Learning Environment): A suite of 57 diverse video games used to test the algorithm's ability to scale to high-dimensional image inputs and complex architectures.

Results and Discussion

X-ETD(n) demonstrated significant improvements in both stability and performance. On Baird's Counterexample, it converged faster and with lower variance than standard ETD.

Comparison of value function error for n=4. X-ETD(n) (blue) shows significantly faster convergence and lower variance compared to standard ETD(n) (red).

In the Atari 2600 suite, the X-ETD(n) agent outperformed the strong Surreal baseline, showing improvement in 97 out of 171 game/seed combinations. A one-sided Sign Test confirmed the statistical significance of these gains ($p = 0.046$), proving that emphatic weighting provides a tangible benefit even in complex, modern Deep RL setups.

Key Insights

  • Variance Reduction: Using a learned expected trace smooths out the noise inherent in individual trajectories, leading to a cleaner learning signal.
  • Symmetry of Learning: There is a theoretical elegance in using TD learning—traditionally used for future prediction—in reverse to capture the influence of the past.

Conclusion

X-ETD(n) successfully scales emphatic weighting to deep RL by leveraging expected traces and experience replay. While highly effective, the authors noted that in rare cases, the predicted emphasis can "run wild" or collapse, suggesting that further research into robust stabilization is needed. Future work will explore more diverse data sources and investigate the specific environmental factors that lead to emphasis instability.

Summary updated

BibTeX
@inproceedings{jiang2022learning,
  author = {Ray Jiang and Shangtong Zhang and Veronica Chelu and Adam White and Hado van Hasselt},
  title = {{Learning Expected Emphatic Traces for Deep RL}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i6.20660},
}
Figure