n-Step Temporal Difference Learning with Optimal n
Lakshmi Mandal, Shalabh Bhatnagar
TL;DR
This work tackles the problem of selecting the optimal number of steps $n$ in $n$-step TD to minimize the long-run RMSE, denoting this objective by $J(n)$. It introduces SDPSA, a one-simulation, deterministic perturbation SPSA-like algorithm operating on a two-timescale stochastic approximation: a fast TD($n$) estimator for fixed $n$, and a slow SDPSA-driven update of the discrete $n \\in D=\{1,...,L\}$. Theoretical guarantees are provided by formulating a differential inclusion (DI) with a Marchaud set-valued map $H(n)$ to handle discontinuities in $\dot{J}(n)$; the slower update converges almost surely to the limit points of this DI, identifying the optimal $n$ that minimizes the long-run variance of the TD estimator. Empirically, SDPSA converges from arbitrary initial $n$ on Random Walk and Grid World tasks and outperforms the state-of-the-art OCBA in RMSE and computation time. The approach offers a principled, model-free means to optimize discrete RL parameters and demonstrates the practicality of DI-based analysis for stochastic approximation in reinforcement learning.
Abstract
We consider the problem of finding the optimal value of n in the n-step temporal difference (TD) learning algorithm. Our objective function for the optimization problem is the average root mean squared error (RMSE). We find the optimal n by resorting to a model-free optimization technique involving a one-simulation simultaneous perturbation stochastic approximation (SPSA) based procedure. Whereas SPSA is a zeroth-order continuous optimization procedure, we adapt it to the discrete optimization setting by using a random projection operator. We prove the asymptotic convergence of the recursion by showing that the sequence of n-updates obtained using zeroth-order stochastic gradient search converges almost surely to an internally chain transitive invariant set of an associated differential inclusion. This results in convergence of the discrete parameter sequence to the optimal n in n-step TD. Through experiments, we show that the optimal value of n is achieved with our SDPSA algorithm for arbitrary initial values. We further show using numerical evaluations that SDPSA outperforms the state-of-the-art discrete parameter stochastic optimization algorithm Optimal Computing Budget Allocation (OCBA) on benchmark RL tasks.
