Back to Research Labs
modular-rl
Deadly Triad RL Divergence Demo

Baird's Counterexample: TD Divergence vs. GTD/TDC

Watch the "Deadly Triad" of RL in action. Off-policy sampling with function approximation causes standard semi-gradient TD(0) to exponentially diverge to ∞, while Gradient TD algorithms (GTD0 / TDC) remain stable and converge.

Algorithm Parameters & Controls

Adjust primary learning rate α, auxiliary step size β, and discount γ.

Learning Rate (α):0.010
Aux Step Size (β):0.050
Step Delay:40 ms

Semi-Gradient TD(0)

Off-Policy Standard Bootstrapping
||w||₂ = 2.83

Updating weights w ← w + α · ρ · δ · φ(s) without gradient correction. Watch weights explode!

Weight Vector w₁ … w₈:
1.0
1.0
1.0
1.0
1.0
1.0
1.0
1.0

TDC (Fast-GTD)

True Gradient Descent with Auxiliary Weights
||w||₂ = 2.83
Stable Convergence Guaranteed

Auxiliary weight vector corrects off-policy gradient projection, maintaining bounded stability and driving weights to 0.

Weight Vector w₁ … w₈:
1.00
1.00
1.00
1.00
1.00
1.00
1.00
1.00

Weight Norm ||w||₂ Divergence vs. Convergence Over Iterations

Comparing weight norm ||w||₂ trajectory over step transitions (TD(0) red vs GTD/TDC green).

TD(0)
TDC