An Empirical Analysis of Measure-Valued Derivatives for Policy Gradients

João Carvalho, Davide Tateo, Fabio Muratore, Jan Peters

TL;DR

This paper investigates Measure-Valued Derivatives (MVD) as a robust alternative for estimating policy gradients in reinforcement learning. Unlike the popular reparameterization trick, MVD does not require a differentiable value function, and unlike the score-function (REINFORCE) approach, it maintains low variance without needing complex baselines.

What Problem Does This Paper Address?

In policy gradient methods, we aim to optimize an agent's behavior by calculating the gradient of an expected return. Currently, researchers primarily rely on two "tricks":

  1. The Score-Function (SF) / Likelihood-Ratio Trick: Works for almost any distribution but suffers from notoriously high variance, often requiring carefully tuned baselines to be usable.
  2. The Reparameterization Trick (Rep-trick): Used in algorithms like Soft Actor-Critic (SAC), it offers low variance but requires the critic (value function) to be differentiable.

This creates a dilemma: what if your critic is a non-differentiable model, like a random forest or a regression tree? Or what if your critic is "rough" (has a high Lipschitz constant), causing the Rep-trick's variance to explode? The authors propose MVD as a "third way" that bridges this gap, offering an unbiased, low-variance estimator that works even with non-smooth function approximators.

Methods

The core idea of Measure-Valued Derivatives is to decompose the derivative of a probability distribution into a difference between two other probability distributions (a positive and a negative component) scaled by a constant.

To estimate a gradient using MVD, you sample actions from both the positive and negative component distributions, evaluate the Q-function at these points, and take the difference.

  • Standard MVD: The paper adapts MVD for actor-critic settings, ensuring it can be used in standard RL scenarios without needing to "reset" the environment to specific states.
  • Tree-MVD: The authors introduce a novel on-policy procedure that uses Extra-Trees (a non-differentiable regression tree model) as the critic. Since trees aren't differentiable, the Rep-trick is off the table, making MVD the ideal candidate for the gradient update.

Datasets

The authors evaluated their approach across a spectrum of complexity:

  • Optimization Benchmarks: Quadratic, Himmelblau, and Styblinski functions to visualize estimator behavior.
  • Control Theory Baselines: Linear-Quadratic Regulator (LQR) problems, where the true gradient is known, allowing for precise error analysis.
  • Continuous Control (PyBullet): High-dimensional tasks including Ant, HalfCheetah, Hopper, and Walker2D.
  • Classic RL & Custom Tasks: Pendulum-v0, LunarLander, and two custom environments—Corridor and Room—designed to test how non-smooth approximators handle structured rewards.

Key Insights and Ideas

  • Robustness to "Rough" Critics: A major "aha" moment comes from the analysis of approximation errors. If a critic has high-frequency noise (common when overfitting), the Rep-trick fails because it relies on the critic's derivative. MVD and SF, which only query the critic's values, remain stable.
Fig. 3: Gradient errors in magnitude and direction in different LQRs, with increasing error noise and frequency. The different linestyles correspond to different error amplitudes α. The results are estimated using 10 trajectories and 20|A| actions per state for each LQR. For MVD and SF the amplitudes 0.0001 and 0.001 show identical results and thus the lines are superposed. Depicted is the mean over 25 random seeds.
  • The "Third Way" is Viable: The paper demonstrates that the Rep-trick isn't strictly necessary for high-performance deep RL. By swapping the Rep-trick for MVD in Soft Actor-Critic (SAC-MVD), the authors achieved nearly identical performance on complex PyBullet tasks.
  • Tree-based RL: Using MVD allows RL to move beyond neural networks. In environments with sharp transitions (like the Corridor task), regression trees can approximate the value function more accurately than smooth neural networks, leading to faster convergence.

Key Results

  • LQR Accuracy: In controlled LQR environments, MVD consistently produced lower magnitude and direction errors than the Score-Function, though it remained slightly behind the Rep-trick when the critic was perfect.
  • Deep RL Parity: On the Ant and HalfCheetah benchmarks, SAC-MVD performed comparably to the standard SAC, proving that MVD scales to high-dimensional action spaces.
  • Non-Differentiable Success: The Tree-MVD algorithm outperformed or matched PPO and TRPO in the Corridor and Room environments. The value functions learned by the trees better captured the environment's structure compared to the smooth approximations of neural networks.
Fig. 2: Gradient errors in magnitude and direction in different LQRs, per number of trajectories and sampled actions. Depicted are the mean and the 95% confidence interval of 25 random seeds.

Limitations and Future Work

The primary drawback of MVD is computational complexity. While SF and the Rep-trick have $O(1)$ complexity relative to the action dimension, MVD requires $O(2|A|)$ queries to the critic (where $|A|$ is the number of action dimensions). This makes it more expensive for robots with many degrees of freedom.

The authors suggest several promising directions for future research:

  • Complexity Reduction: Investigating ways to compute derivatives only along the most impactful parameter dimensions.
  • Hybrid Estimators: Combining MVD with other tricks to balance variance and computational cost.
  • Theoretical Depth: Further analysis is needed to define exactly which task types favor MVD over traditional methods.

Summary updated

BibTeX
@inproceedings{carvalho2021empirical,
  author = {João Carvalho and Davide Tateo and Fabio Muratore and Jan Peters},
  title = {{An Empirical Analysis of Measure-Valued Derivatives for Policy Gradients}},
  booktitle = {IJCNN},
  year = {2021},
  doi = {10.1109/ijcnn52387.2021.9533642},
}
Figure