How to Learn a Useful Critic? Model-based Action-Gradient-Estimator Policy Optimization

Pierluca D'Oro, Wojciech Jaskowski

In the world of Reinforcement Learning (RL), we often talk about "actors" (the policies that decide what to do) and "critics" (the functions that estimate how good those actions are). For years, the standard way to train a critic has been to make it a good bookkeeper—teaching it to accurately predict the total reward an agent will get. But what if being a good bookkeeper isn't what the actor actually needs?

A paper from NeurIPS 2020, "How to Learn a Useful Critic? Model-based Action-Gradient-Estimator Policy Optimization" (MAGE), argues that for continuous control, we’ve been training our critics the wrong way.

The Problem with Standard Critics

In continuous control tasks (like moving a robotic arm), popular algorithms like DDPG or TD3 use a "Deterministic Policy Gradient." To improve, the actor asks the critic: "If I change my action slightly in this direction, will the reward go up?" Mathematically, the actor needs the action-gradient of the critic’s value function ($Q$).

The problem is that critics are typically trained using Temporal Difference (TD) learning, which minimizes the error in predicted returns (the value). Standard RL assumes that if you get the values right, the gradients (the "slope" of the value function) will naturally be right too.

The authors point out this is a hazy assumption. A critic can be great at predicting that an action is "good" (high value) but terrible at telling the actor which way to move to make it "better" (wrong gradient). If the critic's "map" of the world has the right heights but the wrong slopes, the actor will get lost.

The MAGE Approach

The authors introduce MAGE (Model-based Action-Gradient-Estimator), which fundamentally changes the critic's objective.

  1. Learning the Gradient Directly: Instead of just minimizing the TD-error, MAGE minimizes the norm of the action-gradient of the TD-error. This explicitly forces the critic to have a shape that matches the true underlying reward structure.
  2. Differentiable Dynamics: To compute the gradient of the TD-error, you need to know how the next state changes based on the current action. Since the real world isn't a differentiable computer program, MAGE learns a probabilistic dynamics model (an ensemble of neural networks) to act as a proxy.
  3. The Sobolev Connection: This approach is related to "Sobolev training," where a model is trained to match both the values and the derivatives of a target function.
  4. The Constraint: Training only on gradients is numerically unstable and can lead to degenerate solutions. To fix this, the authors add a constraint (via a penalty term) that keeps the standard TD-error small, ensuring the critic doesn't drift too far from reality.

Key Insights and Ideas

  • The "Useless" Critic: The most striking insight is that standard critics often fail to learn useful gradients. As shown below, while a standard "Dyna" critic might learn values, its gradient error stays massive. It is essentially giving the actor random directions.
Action-gradient error comparison between MAGE-TD3 and Dyna-TD3.
  • Gradients are the Bottleneck: The paper theoretically proves that the error in the policy update is directly bounded by the error in the critic's action-gradient. This provides a solid foundation for why we should care about gradients more than values.
  • Model-Based for a Different Reason: Usually, "model-based" RL means using a model to generate more fake data. In MAGE, the model is used to unlock the gradient path. It allows the algorithm to "see through" the environment's transitions to understand how actions influence future rewards.

Key Results

The researchers evaluated MAGE on the MuJoCo suite, the gold standard for continuous control benchmarks.

Performance of MAGE-TD3 compared to baselines across MuJoCo environments.
  • Sample Efficiency: As seen in the learning curves above, MAGE significantly outperformed state-of-the-art baselines like TD3 (model-free) and Dyna-TD3 (model-based). It reached high performance levels in much fewer environment interactions (often within the first 100,000 steps).
  • Robustness: Even when the reward function itself had to be learned from data (rather than being provided by the simulator), MAGE remained effective, showing it isn't overly reliant on perfect ground-truth information.
  • Superior Gradients: MAGE's critic progressively learned an accurate estimate of the true action-gradient, whereas the baseline critics completely failed to do so.

Limitations and Future Work

  • Computational Overhead: MAGE requires computing second-order gradients (the gradient of a gradient). This makes the training step roughly twice as slow in terms of wall-clock time compared to simpler Dyna-style methods.
  • Model Bias: Like all model-based methods, if the learned dynamics model is very wrong, the gradients it provides will also be wrong. MAGE uses an ensemble of models to mitigate this, but it remains a challenge.
  • Future Directions: The authors suggest exploring more efficient automatic differentiation tools to speed up training and investigating why the unconstrained gradient-only optimization is so prone to local minima.

Summary updated

BibTeX
@inproceedings{doro2020how,
  author = {Pierluca D'Oro and Wojciech Jaskowski},
  title = {{How to Learn a Useful Critic? Model-based Action-Gradient-Estimator Policy Optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=Q4FjpkuGdIn},
}
Figure