Total Stochastic Gradient Algorithms and Applications in Reinforcement Learning
Introduction
Estimating the gradient of an expectation is a fundamental challenge in machine learning, critical for fields ranging from Variational Inference to Reinforcement Learning (RL). While existing frameworks like Stochastic Computation Graphs provide a basis for automation, they often lack the flexibility to integrate diverse estimation techniques—such as the reparameterization trick and the likelihood ratio (REINFORCE) method—within a single computational structure. This paper introduces Probabilistic Computation Graphs (PCGs), a unifying visual and mathematical framework based on the total derivative rule, designed to demystify and extend stochastic gradient estimation.
Probabilistic Computation Graphs and the Total Stochastic Gradient Theorem
The core contribution is the Total Stochastic Gradient Theorem, which leverages the total derivative rule to decompose a gradient into a sum of partial derivatives along distinct computational paths. Within this framework, gradient estimators are categorized into two primary types:
- Pathwise Derivative Estimators: These include techniques like the reparameterization trick, which compute local partial derivatives and propagate them step-by-step through the chain rule.
- Jump Gradient Estimators: These include Likelihood Ratio or REINFORCE methods. They estimate the total derivative by "jumping" over segments of the graph, bypassing the need to differentiate intermediate nodes directly.
Unifying Policy Gradient Theorems
A key insight of PCGs is that standard Policy Gradient Theorems are not distinct entities but rather different choices of estimators applied to the same underlying graph. For instance, the standard Policy Gradient Theorem and the Deterministic Policy Gradient (DPG) Theorem share the same PCG structure. The distinction lies solely in the "jump" estimator used after intermediate action nodes.
Gaussian Shaping and the Success of PILCO
The author introduces the Gaussian Shaping (GS) gradient, which fits a Gaussian distribution to particles at intermediate nodes. By "jumping" from these intermediate nodes to the final objective while using pathwise derivatives for the preceding parameters, GS achieves a balance of low variance and flexibility.
This framework helps explain the legendary data efficiency of the PILCO algorithm. While PILCO's success is often attributed to "smoothing" the reward signal via Gaussian approximations, this paper proves a second factor: the approximation forces the trajectory distribution to remain unimodal. This prevents particles from splitting across disjoint reward regions, significantly simplifying the optimization landscape.
Experimental Results
The proposed Gaussian Shaping with Total Propagation (GTP) algorithm was evaluated on continuous control tasks like cart-pole swing-up. On the challenging "Tip Cost" variant, where traditional particle-based methods often fail (0.54 success rate), GTP with injected noise achieved an 0.80 success rate, approaching PILCO’s 0.92. Furthermore, the experiments confirmed that mixing Likelihood Ratio and Reparameterization gradients within the PCG framework (specifically the TP and GTP variants) leads to more stable convergence and reduced variance compared to using standard Likelihood Ratio estimators in isolation.
Conclusion and Future Directions
While some estimators like Density Estimation LR (DEL) remain biased and sensitive to high-dimensional density estimation, the PCG framework provides a robust theoretical foundation for future developments. The author envisions a new generation of automatic differentiation libraries that do not just optimize for speed, but automatically select the best combination of pathwise and jump estimators to minimize variance and maximize gradient accuracy.
Summary updated