Evaluation lab · San Francisco · London · Zürich
Reinforced Labs Request a briefing
Glossary

Temporal-difference learning

Also called: TD learning, TD(0), TD(λ), TD lambda, bootstrapping

TD learning updates a value estimate toward the next reward plus the estimated value of the next state, so it learns without waiting for episodes to end.

Temporal-difference (TD) learning is a family of methods that learn value estimates from incomplete episodes by updating each estimate toward the observed reward plus the current estimate of the next state's value. It combines the sampling of Monte Carlo methods with the bootstrapping of dynamic programming.

The TD(0) update

After observing a transition , TD(0) moves the value estimate a step of size toward a one-step target:

The bracketed term is the TD error. The target uses the agent's own estimate of the future, which is what "bootstrapping" means. Learning can happen after every step, in continuing tasks with no episodes at all.

TD vs Monte Carlo

A Monte Carlo target is the full sampled return: unbiased, but noisy because it sums many random rewards. A TD target depends on one random reward and one estimate, so it has much lower variance but is biased while the estimate is wrong. In a seeded simulation of the classic five-state random walk (200 runs, 100 episodes each, values initialised to 0.5), TD(0) with reached a root-mean-square value error of 0.034, while the best constant-step Monte Carlo setting we tried () reached 0.082. That pattern, TD learning faster on Markov problems, is typical, though not guaranteed.

The TD family

  • n-step TD uses real rewards before bootstrapping, trading bias for variance.
  • TD() averages all n-step targets with weights ; is TD(0) and recovers Monte Carlo. Eligibility traces implement it online.
  • Control methods: SARSA (on-policy) and Q-learning (off-policy) apply the same idea to action values.

Why it matters

TD learning is the engine inside most practical RL: critics in actor-critic methods, deep Q-networks and value heads in language-model RL are all trained on TD-style targets. Its weakness is the flip side of its strength. Bootstrapping propagates errors, and TD with function approximation and off-policy data can diverge, which is why target networks, replay ratios and careful step sizes matter in deep RL.

Sources

  1. Richard S. Sutton, Andrew G. Barto. Reinforcement Learning: An Introduction (2nd edition), 2018. incompleteideas.net
  2. Richard S. Sutton. Learning to predict by the methods of temporal differences, 1988. doi.org

Know the number before you ship.

A 45-minute working session with an evaluation engineer. Bring one use case; leave with a threat model, a draft eval plan with sample sizes, and an honest read on where you stand.