Abstract: Policy gradient methods are a vital ingredient behind the success of modern reinforcement learning. Modern policy gradient methods, although successful, introduce a residual error in gradient estimation. In this work, we argue that this residual term is significant and correcting for it could potentially improve sample-complexity of reinforcement learning methods. To that end, we propose log density gradient to estimate the policy gradient, which corrects for this residual error term. Log density gradient method computes policy gradient by utilising the state-action discounted distributional formulation. We first present the equations needed to exactly find the log density gradient for a tabular Markov Decision Processes (MDPs). For more complex environments, we propose a temporal difference (TD) method that approximates log density gradient by utilizing backward on-policy samples. Since backward sampling from a Markov chain is highly restrictive we also propose a min-max optimization that can approximate log density gradient using just on-policy samples. We also prove uniqueness, and convergence under linear function approximation, for this min-max optimization. Finally, we show that the sample complexity of our min-max optimization to be of the order of $m^{-1/2}$, where $m$ is the number of on-policy samples. We also demonstrate a proof-of-concept for our log density gradient method on gridworld environment, and observe that our method is able to improve upon the classical policy gradient method by a clear margin, thus indicating a promising novel direction to develop reinforcement learning algorithms that require fewer samples.
Introduction
In Reinforcement Learning (RL), the primary objective is often to maximize the long-term average reward. However, the mathematical formulation for average reward is challenging because the Bellman operator is not a contraction when the discount factor ($\gamma$) is 1. To circumvent this, practitioners typically use a discount factor slightly less than 1 (e.g., $\gamma = 0.99$) as a proxy.
This substitution introduces a significant residual error in gradient estimation. This error compounds during training, leading to sub-optimal policies and requiring extensive hyperparameter tuning. This paper introduces Log Density Gradient, a novel framework that corrects this error by estimating the gradient of the state-action stationary distribution directly.
Methodology
The core innovation is shifting from the standard Policy Gradient Theorem—which weights the score function by the Q-value—to a formulation based on the log density gradient.
The Log Density Gradient Theorem
The authors demonstrate that the policy gradient can be rewritten as the expectation of the reward multiplied by the gradient of the log of the state-action occupancy distribution ($d_\gamma^{\pi_\theta}$). This separation of the reward function from the policy's influence on the state distribution appears to result in lower variance during training.
Min-Max Optimization
Estimating this gradient typically requires "backward" samples (sampling the previous state given the current one), which is impossible in most environments. To solve this, the authors utilize Fenchel duality to transform the objective into a minimax problem. This allows for the estimation of the log density gradient using only standard, on-policy samples.
Theoretical Guarantees
For cases where the density is represented by linear features, the authors provide a concrete update rule and prove that it converges to a unique solution. They establish a sample complexity of $O(m^{-1/2})$, making the method competitive with vanilla policy gradient methods while maintaining theoretical rigor.
Experimental Results
The approach was evaluated on Gridworld environments ($5 \times 5$ and $10 \times 10$) as a proof-of-concept. These settings allow for a direct comparison between the empirical algorithm and theoretical ground-truth solutions.
As illustrated in the figure above, the Log Density Gradient method (green lines) consistently converges to better policies than the Classical Policy Gradient (blue lines) across different grid sizes. Furthermore, the proposed method exhibits significantly tighter confidence intervals and less "jitter," suggesting improved stability and reduced variance during the learning process.
Discussion and Future Work
By mathematically characterizing the "Residual Error" ignored by standard methods, this work provides a new lens for understanding why popular algorithms like PPO or TRPO may struggle in long-horizon tasks. The use of Fenchel duality effectively bypasses the need for transition models or backward sampling, making a theoretically pure idea practically applicable.
While the current results rely on linear function approximation, the next major challenge is scaling this framework to high-dimensional tasks using deep neural networks. Future research will investigate whether the observed sample efficiency gains hold up in more complex, non-linear environments.
Summary updated