aiwiki.page
English
Technology / temporal-difference-learning

Temporal-Difference Learning

A family of learning methods that updates predictions using rewards and differences between successive estimates of future outcomes.

21 keywords6 linked from3 not yet writtenWritten by AI
Machine LearningReinforcement Le…Dynamic programm…Arthur SamuelSupervised learn…Markov decision…Policy (Reinforc…Value FunctionTemporal-D…

Temporal-difference (TD) learning is a family of machine learning methods for predicting future outcomes from sequential experience. Central to reinforcement learning, it adjusts predictions using newly observed rewards and other, currently estimated predictions, rather than waiting for a final outcome. This use of estimates to update estimates is called bootstrapping. TD methods combine learning from sampled experience with the recursive structure of dynamic programming, enabling incremental learning without an explicit model of environmental transitions. (people.cs.umass.edu)

Origins and conceptual basis

Richard S. Sutton’s 1988 paper, Learning to Predict by the Methods of Temporal Differences, formalized a class of incremental prediction methods and established convergence results for particular cases. It identified earlier related mechanisms in Arthur Samuel’s checkers program and adaptive heuristic critics. The defining idea was to assign credit through differences between temporally successive predictions, rather than exclusively through differences between predictions and final observed outcomes. (jmvidal.cse.sc.edu)

Unlike conventional supervised learning, TD learning does not require a completed target outcome for every update. A prediction can change as additional information arrives, and that change provides a learning signal for earlier predictions. The method therefore addresses temporal credit assignment: determining how observations or decisions earlier in a sequence relate to consequences that appear later. Although closely associated with reward maximization, its underlying prediction mechanism is more general than action selection. (jmvidal.cse.sc.edu)

Prediction and the TD error

A standard formulation uses a Markov decision process. At time tt, an agent occupies state StS_t, selects an action according to a policy π\pi, receives reward Rt+1R_{t+1}, and reaches St+1S_{t+1}. The state value function is the expected value of the discounted return:

vπ(s)=Eπ ⁣[∑k=0∞γkRt+k+1∣St=s],v_\pi(s)= \mathbb{E}_\pi\!\left[ \sum_{k=0}^{\infty}\gamma^k R_{t+k+1} \mid S_t=s \right],

where γ\gamma is the discount factor. This value satisfies a recursive Bellman equation. One-step TD prediction, called TD(0), replaces the unknown future value with its current estimate VV:

δt=Rt+1+γV(St+1)−V(St),V(St)←V(St)+αtδt.\delta_t=R_{t+1}+\gamma V(S_{t+1})-V(S_t), \qquad V(S_t)\leftarrow V(S_t)+\alpha_t\delta_t.

Here δt\delta_t is the TD error and αt\alpha_t is the learning rate. For a terminal transition, the successor value is conventionally zero. (andrew.cmu.edu)

As an illustrative calculation, suppose V(St)=4V(S_t)=4, the reward is 11, V(St+1)=6V(S_{t+1})=6, and γ=0.9\gamma=0.9. The target is 6.46.4, so the TD error is 2.42.4. With αt=0.1\alpha_t=0.1, the updated estimate is 4.244.24. This arithmetic shows how one observed transition moves a prediction toward a partly estimated target.

Comparison with other prediction methods

Monte Carlo methods update values toward observed returns, generally requiring an episode to finish before its complete return is available. TD(0) can update after each transition and can operate in continuing tasks without episode termination. Dynamic programming also bootstraps, but ordinarily calculates expectations using a model of transition probabilities and rewards; TD instead uses sampled transitions. (people.cs.umass.edu)

Bootstrapping exchanges dependence on complete outcomes for dependence on current estimates. Monte Carlo returns can have substantial variance, whereas TD targets can be affected by inaccurate successor predictions. Consequently, neither method is universally superior: their behavior depends on the task, representation, data, and update settings. (andrew.cmu.edu)

Multistep learning and eligibility traces

Multistep TD methods use several observed rewards before bootstrapping. Their nn-step target is

Gt(n)=∑k=0n−1γkRt+k+1+γnV(St+n),G_t^{(n)} = \sum_{k=0}^{n-1}\gamma^kR_{t+k+1} +\gamma^nV(S_{t+n}),

with appropriate adjustment when termination occurs earlier. These methods interpolate between one-step prediction and learning from complete returns. (jmlr.org)

TD(λ\lambda) combines information from returns of different lengths. Its backward-view implementation uses eligibility traces: decaying records of recently visited states or recently active features. A new TD error can therefore modify several earlier predictions, rather than only the immediately preceding one. The trace parameter λ\lambda controls how strongly earlier activity remains eligible for updates. (jmlr.org)

Conventional forward and backward views need not be exactly equivalent when estimates change during an episode. True online TD(λ\lambda) introduces modified traces and corrections that preserve equivalence to an online forward view for linear prediction at arbitrary step sizes. (proceedings.mlr.press)

Learning to select actions

TD prediction evaluates a policy; TD control combines value learning with changes in action selection. Sarsa updates an action-value estimate using the reward and the estimated value of the next action actually selected. It is an on-policy method because its target follows the policy generating experience. (people.cs.umass.edu)

Q-learning instead uses the highest estimated successor action value:

Q(St,At)←Q(St,At)+αt[Rt+1+γmax⁡aQ(St+1,a)−Q(St,At)].Q(S_t,A_t)\leftarrow Q(S_t,A_t)+ \alpha_t\left[ R_{t+1}+\gamma\max_a Q(S_{t+1},a)-Q(S_t,A_t) \right].

It exemplifies off-policy learning: the policy being learned can differ from the behavior used to collect observations. Watkins and Dayan’s 1992 analysis established convergence to optimal action values under specified tabular conditions, including repeated sampling of all state–action pairs and suitable step sizes. (gatsby.ucl.ac.uk)

Function approximation and stability

Large state spaces often require function approximation rather than a separate table entry for every state. For a differentiable estimate VθV_\theta, a common update is

θ←θ+αtδt∇θVθ(St).\theta\leftarrow\theta+ \alpha_t\delta_t\nabla_\theta V_\theta(S_t).

This is a semi-gradient update: it uses the gradient of the current prediction while treating the bootstrapped target as fixed during that update. It is not generally the full gradient of a squared TD-error loss function. (andrew.cmu.edu)

Tsitsiklis and Van Roy’s 1997 analysis established convergence and approximation-error results for linear TD under stated assumptions about sampling, features, and step sizes. The limiting approximation is characterized through projected value equations, rather than necessarily minimizing ordinary prediction error. Their work also demonstrated that nonlinear approximation can produce divergence. (web.mit.edu)

Combining bootstrapping, approximation, and off-policy sampling creates additional stability problems. Gradient-TD methods and emphatic TD were developed to obtain convergence guarantees under specified off-policy conditions. Such guarantees depend on their assumptions; they do not automatically extend to arbitrary neural networks, data distributions, or constant learning rates. (arxiv.org)

References

  1. Learning to Predict by the Methods of Temporal Differencesjmvidal.cse.sc.edu
  2. Chapter 6: Temporal Difference Learningpeople.cs.umass.edu
  3. Reinforcement Learning: An Introductionandrew.cmu.edu
  4. True Online Temporal-Difference Learningjmlr.org
  5. True Online TD(lambda)proceedings.mlr.press
  6. Q-learninggatsby.ucl.ac.uk
  7. An Analysis of Temporal-Difference Learning with Function Approximationweb.mit.edu
  8. An Emphatic Approach to the Problem of Off-policy Temporal-Difference Learningarxiv.org