True Online Temporal-Difference Learning

Harm van Seijen, Ashique Rupam Mahmood, Patrick M. Pilarski, Marlos C. Machado, Richard S. Sutton

TL;DR

Standard TD($\lambda$) only approximates its theoretical ideal—the forward-view $\lambda$-return—when using vanishingly small step sizes, often forcing practitioners to compromise between unstable accumulating traces and restrictive replacing traces. This paper introduces an exact online forward view and its efficient backward-view counterpart, True Online TD($\lambda$), which maintains exact equivalence to the forward view at every step for arbitrary step sizes. Across benchmark tasks ranging from synthetic Markov processes to robotic prosthetic control, true online methods equal or outperform standard TD methods while eliminating the dilemma of choosing between trace types.

What Problem Does This Paper Address?

Temporal-Difference learning algorithms like TD($\lambda$) and Sarsa($\lambda$) combine bootstrapping with eligibility traces to trade off bias and variance. Conceptually, their behavior is motivated by a forward view: each state's value should be updated toward an ideal multi-step target called the $\lambda$-return.

However, a fundamental disconnect existed between theory and practice:

  1. The forward view was offline: The classical $\lambda$-return requires data up to the end of an episode, leaving the actual step-by-step behavior of online TD($\lambda$) theoretically unresolved.
  2. Equivalence was only an approximation: Backward-view TD($\lambda$) only matches the forward view when the step-size parameter approaches zero ($\alpha \to 0$). At practical learning rates, accumulating traces can easily diverge or suffer extreme variance.
  3. Replacing traces were a brittle workaround: Replacing traces were invented to prevent accumulating traces from exploding, but they only work with binary features and inadvertently degrade multi-step bootstrapping.

The authors address this gap by establishing an exact online forward view and demonstrating an efficient algorithm that satisfies it on every time step.

Methods

  • The Online Forward View: The authors define an interim $\lambda$-return ($G_k^{\lambda|t}$) with a truncated horizon $t$. At step $t$, the forward view conceptualizes re-updating all visited states up to the current time horizon using this growing target.
  • Dutch Traces: Rather than re-running updates from scratch (which would take $O(t)$ per step), the authors analytically collapse the sequence into a constant-time $O(n)$ update. This introduces Dutch traces: $$e_t = \gamma \lambda e_{t-1} + \phi_t - \alpha \gamma \lambda (e_{t-1}^\top \phi_t) \phi_t$$ In tabular representations, a Dutch trace is a weighted average between an accumulating trace (weight $1 - \alpha$) and a replacing trace (weight $\alpha$).

  • TD-Error Time-Step Correction ($\delta$-correction): The weight update incorporates an adjustment term, $\alpha(\theta_t^\top \phi_t - \theta_{t-1}^\top \phi_t)(e_t - \phi_t)$, ensuring that past predictions correctly align with the most recent weight vector.

  • Control and Off-Policy Extensions: The paper extends this principle beyond on-policy evaluation to True Online Sarsa($\lambda$) and a true online formulation of Watkins's $Q(\lambda)$.

Datasets

The authors evaluated true online methods against accumulating and replacing traces across three environments using tabular, binary, and non-binary feature representations:

  1. Random Markov Reward Processes (MRPs): Synthetic MRPs varying in state space size ($k \in \{10, 100\}$), branching factor ($b \in \{3, 10\}$), and reward noise ($\sigma \in \{0, 0.1\}$).
  2. Myoelectric Robotic Arm: Real-world sensorimotor streams (58,000 time steps sampled at 40 Hz) collected from an amputee participant performing grasping tasks. Predictions targeted grip force and hand motor angle using tile coding (800,001 features hashed down to 200,000).
  3. Arcade Learning Environment (ALE) – Asterix: Control evaluation on Atari 2600 Asterix using raw screen-color tile features (28,672 binary features).

Key Insights and Ideas

  • Exact Forward–Backward Equivalence: True Online TD($\lambda$) matches the online forward view identically for any learning rate $\alpha$, not just as $\alpha \to 0$.
  • Robustness Without Trade-offs: Unlike accumulating traces (which can blow up pseudo-step sizes beyond 1) or replacing traces (which collapse to 1-step TD on frequently visited states), Dutch traces bound effective updates naturally.
  • Enabling Non-Binary Multi-Step Learning: Replacing traces cannot be applied to continuous or normalized non-binary features. True Online TD($\lambda$) brings the stability of replacing traces to general, real-valued feature spaces without heuristic clipping.
  • When Advantages Emerge: Performance gains are largest when $\alpha$ and $\lambda$ are high, return variance is low, and the same features recur frequently within a short temporal window (i.e., non-sparse representations).

Key Results

  • Empirical Dominance: Across all domains and representations, true online algorithms matched or significantly outperformed accumulating and replacing traces; they were never worse.
  • Parameter Robustness: True online methods exhibited substantially wider "basins" of stable step sizes, whereas standard accumulating traces rapidly diverged under higher $\alpha$ and $\lambda$ values.
  • Real-World Prosthetic Control: In predicting motor angle and grip force, True Online TD($\lambda$) systematically achieved lower normalized mean absolute return errors across all tested $\lambda > 0$.
  • Arcade Environment (Asterix): True Online Sarsa($\lambda$) achieved a peak score (~1000 points/episode) comparable to the best accumulating and replacing settings, confirming that even in worst-case sparse regimes, performance remains competitive.

Limitations and Future Work

  • Computational Overhead: While memory complexity remains $O(n)$, computing the Dutch trace and $\delta$-correction requires extra vector operations. In dense-feature settings, per-step runtime can be up to $2\times$ that of basic TD($\lambda$) (though it is negligible when features are sparse).
  • Linear Function Approximation Restriction: The exact derivation relies on the value function gradient being independent of the parameter vector $\theta$. Consequently, exact true-online equivalence cannot directly transfer to non-linear models like deep neural networks without introducing update delays or approximations.
  • Evaluation Cost in Complex Environments: Rigorous parameter sweeps (e.g., 16,800 runs across 400 seeds for Asterix) prohibited benchmarking across the complete Atari game suite.

Summary updated

BibTeX
@article{seijen2016true,
  author = {Harm van Seijen and Ashique Rupam Mahmood and Patrick M. Pilarski and Marlos C. Machado and Richard S. Sutton},
  title = {{True Online Temporal-Difference Learning}},
  journal = {J. Mach. Learn. Res.},
  year = {2016},
  url = {https://openreview.net/forum?id=M0tMUAc2pvj},
}
Figure