A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Temporal Difference Learning

Research Depth 101 in the knowledge graph ☐ I know this ☆ Set as goal
19topics build on this
765prerequisites beneath it
See this on the map →
Introduction to Reinforcement LearningMarkov Chains+4 more→→Q-Learning Algorithm
reinforcement-learning value-based temporal-difference bootstrapping

Core Idea

Temporal difference learning updates value estimates using the difference between successive value predictions (TD error), enabling online learning without full episode returns. TD combines sample-based learning (Monte Carlo) and bootstrapping (dynamic programming); the TD(λ) framework generalizes TD(0) and Monte Carlo through an eligibility trace parameter λ.

How It's Best Learned

Implement TD(0) and TD(1) on a simple domain and observe convergence differences; then implement TD(λ) with eligibility traces to understand the spectrum between TD(0) and Monte Carlo.

Explainer

From reinforcement learning, you know the central problem: an agent in a Markov decision process must estimate how valuable each state is (the value function) in order to act well. Two classic approaches exist. Monte Carlo methods wait until an episode finishes, then use the actual total return to update value estimates — accurate but slow, since you learn nothing until the end. Dynamic programming uses the Bellman equation to update values based on the estimated values of successor states — fast but requires a complete model of the environment's transition probabilities. Temporal difference learning combines the best of both: it learns from raw experience (no model needed, like Monte Carlo) but updates after every single step (no waiting for episode end, like dynamic programming).

The core mechanism is the TD error, defined as δ = r + γV(s') − V(s), where r is the reward received, γ is the discount factor, s' is the next state, and V(s) is the current estimate. Think of it as a prediction error: V(s) is what you expected to get from state s, and r + γV(s') is a better estimate now that you have actually observed the immediate reward and the next state. The update rule V(s) ← V(s) + α·δ simply nudges your old estimate toward this new, partially-observed reality. This is called bootstrapping because you are updating one estimate using another estimate — V(s') is itself just a guess — rather than waiting for the true outcome.

The simplest version, TD(0), updates the value of each state using only the immediate next state's estimated value. At the other extreme, TD(1) is equivalent to Monte Carlo — it effectively waits for the full return before updating. The framework TD(λ) interpolates between these extremes using a parameter λ ∈ [0,1]. When λ = 0, you get TD(0); when λ = 1, you get Monte Carlo. Intermediate values of λ use eligibility traces, which keep a decaying memory of recently visited states. When a TD error occurs, it propagates backward to update not just the current state but all recently visited states, with the update strength decaying by λ at each step backward. States visited many steps ago get small updates; states visited just before the error get large ones.

Why does this matter in practice? TD methods converge faster than Monte Carlo on many problems because they do not waste information — each transition teaches the agent something immediately, rather than requiring a complete trajectory. The bootstrapping also reduces variance at the cost of some bias (since V(s') may be wrong). This bias-variance tradeoff, controlled by λ, is the central design choice. TD(0) has the lowest variance but highest bias; Monte Carlo has zero bias but high variance. Most practical algorithms — including Q-learning, SARSA, and the deep Q-networks you will study next — are built on the TD framework, making temporal difference learning the backbone of modern reinforcement learning.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Probability Density Functions and Continuous Distributions → Cumulative Distribution Functions → Continuous Random Variables → Probability Density Functions → Expected Value → Weak Law of Large Numbers → Probability Axioms and Rules → Conditional Probability → Conditional Distributions → Conditional Expectation → Markov Chains → Markov Decision Processes → Introduction to Reinforcement Learning → Policy Gradient Methods → Policy Networks and Policy Gradients → Actor-Critic Methods → Temporal Difference Learning

Longest path: 102 steps · 765 total prerequisite topics

Prerequisites (6)

Leads To (1)