Effective Multi-step Temporal-Difference Learning for Non-Linear Function Approximation

Harm van SeijenarXiv 2016

Abstract: Multi-step temporal-difference (TD) learning, where the update targets contain information from multiple time steps ahead, is one of the most popular forms of TD learning for linear function approximation. The reason is that multi-step methods often yield substantially better performance than their single-step counterparts, due to a lower bias of the update targets. For non-linear function approximation, however, single-step methods appear to be the norm. Part of the reason could be that on many domains the popular multi-step methods TD($\lambda$) and Sarsa($\lambda$) do not perform well when combined with non-linear function approximation. In particular, they are very susceptible to divergence of value estimates. In this paper, we identify the reason behind this. Furthermore, based on our analysis, we propose a new multi-step TD method for non-linear function approximation that addresses this issue. We confirm the effectiveness of our method using two benchmark tasks with neural networks as function approximation.

Introduction

Temporal-Difference (TD) learning is a fundamental technique in reinforcement learning, allowing agents to learn value functions through bootstrapping. While single-step TD is common, multi-step variants—controlled by the parameter $\lambda$—typically offer superior performance in linear settings by reducing update bias. However, in deep reinforcement learning, multi-step methods like TD($\lambda$) and Sarsa($\lambda$) are often avoided due to their tendency to diverge when paired with non-linear function approximators like neural networks. This paper identifies the mathematical root of this instability and proposes Forward TD($\lambda$), a stable and computationally efficient alternative.

The Root of Instability: Divergence in Non-Linear TD($\lambda$)

The instability of traditional TD($\lambda$) with non-linear function approximation is not a mere implementation detail but a fundamental mismatch. Traditional eligibility traces (the "backward view") assume the gradient of the value function is independent of the weights. This assumption holds for linear models but is false for neural networks. Consequently, the updates deviate from true gradient descent, leading to "value blow-ups."

RMS error vs. learning rate $\alpha$ for TD($\lambda$) and the $\lambda$-return algorithm.

As demonstrated in the figure above, TD($\lambda$) quickly diverges as the learning rate $\alpha$ increases in a simplified MDP, while the $\lambda$-return algorithm remains stable.

The Forward TD($\lambda$) Algorithm

To resolve this, the paper introduces a "forward view" approach that strictly follows gradient descent principles. While forward views are typically computationally expensive, Forward TD($\lambda$) achieves $O(1)$ complexity per step through two key mechanisms:

  1. The $K$-bounded Trick: The algorithm utilizes a "K-bounded $\lambda$-return," waiting for $K$ steps to gather data before updating. This delay surprisingly enhances stability by reducing correlation between estimates and targets, similar to the role of target networks in DQN.
  2. Recursive Formulation: A clever mathematical derivation allows for the efficient computation of multi-step returns without needing to wait for the end of an episode.

Experimental Results

The algorithm was evaluated on classic benchmarks using neural networks. In control tasks like Cart-Pole, the "Sarsa" version of the algorithm demonstrated significant performance gains over traditional methods.

Performance comparison between forward Sarsa($\lambda$) and standard Sarsa($\lambda$) on the Cart-Pole task.

As shown in the Cart-Pole results, Forward Sarsa($\lambda$) significantly outperforms standard Sarsa($\lambda$). Notably, traditional Sarsa($\lambda$) actually performs worse than the one-step version (Sarsa(0)) as $\lambda$ increases, highlighting the failure of the standard approach in non-linear settings.

Conclusion

Forward TD($\lambda$) bridges the gap between the theoretical advantages of multi-step learning and the practical requirements of deep reinforcement learning. By ensuring stability through gradient descent principles and maintaining computational efficiency, it provides a robust alternative to standard TD methods. Future research may further investigate the synergy between the update delays in this method and the success of target networks in modern deep RL architectures.

Summary updated

BibTeX
@misc{seijen2016effective,
  author = {Harm van Seijen},
  title = {{Effective Multi-step Temporal-Difference Learning for Non-Linear Function Approximation}},
  year = {2016},
  eprint = {1608.05151},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1608.05151},
}
Figure