Abstract
In deep Q-learning, gradient descent (Residual Gradient, RG) is rarely used to solve the Bellman residual minimization problem despite being mathematically "exact." Instead, Temporal Difference (TD) learning—an incomplete gradient method—is the industry standard. This paper presents extensive empirical evidence showing that TD consistently outperforms RG. We demonstrate that while RG can achieve a smaller Bellman residual error, it often converges to "bad regimes" that result in poor policies. Our findings reveal that the "missing term" in the TD gradient is actually a key factor in avoiding these traps, highlighting a fundamental difference between reinforcement learning and supervised learning.
Introduction
In supervised learning, the path to optimization is clear: define a loss function and follow its exact gradient. One might expect Reinforcement Learning (RL) to follow suit. However, the RL community almost exclusively relies on Temporal Difference (TD) learning, which uses a "semi-gradient" by treating the target value as fixed. The mathematically exact alternative, Residual Gradient (RG), which performs true gradient descent on the squared Bellman error, is largely ignored due to poor practical performance.
Researchers at Shanghai Jiao Tong University investigated this discrepancy, providing empirical evidence for why the "mathematically correct" path of RG often leads to a dead end in Deep RL while TD thrives.
Problem Formulation: TD vs. RG
The goal of Q-learning is to satisfy the Bellman equation, where the value of a state-action pair equals the immediate reward plus the discounted value of the next state. Minimizing the Bellman residual error can be approached in two ways:
- Residual Gradient (RG): Exact gradient descent on the squared Bellman error.
- Temporal Difference (TD): A semi-gradient method that treats the "next state" value as a fixed target, ignoring its dependency on parameters during the update.
Experimental Setup
The authors compared TD and RG using Deep Q-Networks (DQN) with a four-layer fully connected neural network. To isolate the effects of the gradient rules and avoid the "double sampling" issue associated with RG, the study focused on deterministic environments and off-policy learning using fixed datasets.
Datasets and Environments
Four classic benchmarks were utilized:
- Grid World: A discrete state-space used for detailed visualization of state-value regimes.
- Cart Pole: A classic control task of balancing a pole on a cart.
- Mountain Car: An agent must build momentum to drive up a steep hill.
- Acrobot: A two-link pendulum task requiring the agent to swing an end-link above a target height.
Key Insights: Why RG Fails
Loss is Not Performance
In supervised learning, lower test loss indicates a better model. In RL, the authors found that RG can achieve a Bellman residual error several orders of magnitude smaller than TD ($10^{-9}$ vs $10^{-5}$), yet produce a policy that fails completely. This suggests that the Bellman residual is not a standard index of performance in the same way test loss is in supervised learning.
The "Missing Term" as a Saboteur
The difference between RG and TD is the "backward-semi gradient." The authors demonstrated that this specific term pulls the model toward "bad regimes" where the Bellman equation is satisfied mathematically, but the resulting values do not respect the necessary monotonicity for a successful policy. By training a network using only this missing term, they showed it actively pushes state values toward terminal traps.
Results and Discussion
Accumulated Reward
In all tested environments, TD achieved significantly higher rewards than RG. As shown in the training dynamics below, RG often flatlines at a minimum reward level despite its successful minimization of the Bellman error.
Policy Robustness and Recovery
Policies learned via TD were found to be significantly more robust to parameter perturbations than those from RG. Furthermore, the authors discovered that a "failed" model trained by RG could be rescued by switching to TD training. The model was able to "jump out" of the bad regime and eventually learn a successful policy, proving that TD possesses superior training dynamics for finding useful solutions.
Conclusion
This work demonstrates that the performance of a deep Q-learning solution is more closely related to training dynamics than to the absolute minimization of the Bellman residual. The "incomplete" nature of TD acts as a beneficial bias, preventing the model from falling into mathematically valid but practically useless solutions. Future work will explore how these dynamics interact with stochastic environments and reward function design.
Summary updated