5.1.11 · D5Reinforcement Learning Foundations

Question bank — Temporal Difference learning

1,517 words7 min readBack to topic

Before we start, a tiny glossary so every symbol below is earned:


True or false — justify

TD(0) needs the environment's transition probabilities to compute its target
False. It never computes the next state — it observes by acting. The target uses the observed , so no model is required; this is what makes TD model-free.
If our value estimates are already perfectly correct, every individual TD error becomes exactly
False. With stochastic rewards/transitions, single-step still swings above and below zero; only its expectation is zero at the true values. See variance.
TD is unbiased once it converges but has high variance
Half-true and mislabelled. TD reduces variance (it samples only one step of randomness) but is biased while is still wrong. That biased-but-low-variance tradeoff is TD's signature, opposite to Monte Carlo.
Setting turns TD into a method that only ever cares about the immediate reward
True. With the target collapses to , so learns the expected next reward and ignores the future entirely — a myopic estimator.
Setting is always safe
False. is fine for guaranteed-terminating (episodic) tasks but makes the return infinite/divergent for continuing tasks, so may not converge.
TD(0) can update a state's value before the episode ends
True. That is its whole point — it updates online after each transition, unlike Monte Carlo which waits for the final return .
Terminal states must be initialized to
True by definition. A terminal state has no future rewards, so its true value is ; using anything else corrupts every TD target that bootstraps off it.
The TD update always moves closer to the true value
False. A single noisy sample can push it the wrong way; correctness is only guaranteed in expectation / over many updates with a decaying .
Bootstrapping means "learning from the final outcome of the whole episode"
False. That is Monte Carlo. Bootstrapping means updating one guess () toward another guess () — see Bootstrapping and DP, which also bootstraps.
The Bellman equation and the TD target are unrelated ideas
False. The TD target is a one-sample estimate of the Bellman right-hand side ; TD replaces the expectation with an observed sample.

Spot the error

"TD error should shrink to exactly zero as training finishes, otherwise learning failed."
Wrong: individual errors never vanish under stochasticity. The right diagnostic is whether the average error and the change in shrink, not each .
"Use so we learn as fast as possible."
Wrong: throws away the old estimate and replaces it with one noisy sample, causing wild oscillation. Small (often decaying) trades speed for stability.
" in the target is the true value of the next state."
Wrong: it is our current estimate, which is itself imperfect. That is exactly the source of TD's bias.
"Because TD bootstraps from DP, it also needs the full model like DP does."
Wrong: TD inherits DP's bootstrapping idea but not DP's model requirement. It samples transitions instead of sweeping over known dynamics.
"A positive TD error means the agent did something bad and must go down."
Wrong: positive means the outcome was better than predicted, so is nudged up. Positive = pleasant surprise.
"Since MC and TD both estimate , after one episode they give the same estimates."
Wrong: MC updates only states actually visited using the real return; TD updates each state toward a bootstrapped one-step target. Their intermediate estimates differ sharply, especially early.
"If a reward is stochastic, TD is broken because keeps flipping sign."
Wrong: sign-flipping is expected and healthy — the flips average out. TD converges in expectation despite noisy per-step errors.

Why questions

Why does TD have lower variance than Monte Carlo?
MC's target is a sum of many random rewards , accumulating randomness at every step; TD replaces that whole tail with , so only one step of randomness enters the target.
Why does TD have bias that MC does not?
TD's target leans on , an estimate that starts wrong, so early targets are systematically off. MC uses the actual return, which is an unbiased sample of .
Why does value "propagate backward" faster in TD than MC?
Once a state near the goal learns a good value, its predecessor immediately bootstraps off it next visit. MC must wait for whole episodes to feed the real return back, so a 100-step chain needs roughly 100 episodes to fill in.
Why do we still use a learning rate instead of jumping straight to the TD target?
Because a single target is noisy; makes the update a running average, blending old estimate with new evidence so noise cancels over time.
Why is TD called "model-free" even though it uses ?
Because it never asks "which states could follow?"; it uses the one the environment actually handed it. No transition probabilities are ever queried.
Why is the TD target considered "more informed" than the old estimate ?
Because it contains a piece of real experienced data — the actual reward — that the old estimate was made without.
Why must terminal states be pinned at rather than learned?
Because their true value is defined as zero (no future); learning them would let noise leak in and bias every target that bootstraps through the episode's end.

Edge cases

What is the TD target when is terminal?
It becomes simply , since terminal states carry value . The bootstrap term vanishes at the boundary.
What happens to learning if ?
Updates become vanishingly small, so barely moves and effectively stops learning — stable but stuck. There is a sweet spot, not a "smaller is always safer" rule.
What does look like for a fair coin-flip reward of once is correct?
On a draw , on a draw ; the errors are large and permanent per step but average to . Convergence lives in the expectation, not the individual .
If two different states happen to share the same true value, will TD treat them identically?
Not necessarily during learning — each has its own estimate updated only when visited, so visitation frequency and neighbours make their learning trajectories differ even if they converge to the same number.
What if the initial values are wildly wrong (say all )?
TD still converges; the surprising values simply drive large early corrections. Bad initialization slows the start but does not break the method — that is why "initialize arbitrarily" is allowed.
In a continuing (never-ending) task with , what breaks?
The return has no finite value to converge to, so targets can grow unboundedly and diverges. Discounting with (or an average-reward formulation) is needed to keep values finite.
Recall Quick self-test

One TD idea that is shared with DP but not with MC ::: Bootstrapping (updating a guess from another guess). One TD idea that is shared with MC but not with DP ::: Learning from sampled experience, model-free. The single quantity that carries all the "surprise" in a TD update ::: The TD error .