Abstract
Estimating the gradient of an expectation with respect to distribution parameters is a cornerstone of modern machine learning, particularly in variational inference and reinforcement learning. Traditionally, the Likelihood Ratio (LR) and Reparameterization (RP) estimators have been treated as distinct "tricks." This paper provides a theoretical bridge between them using the divergence theorem from fluid dynamics. We show that LR and RP are duals of each other, representing the same probability flow viewed as either a surface or volume integral. This unified framework allows for the characterization of a broad class of unbiased estimators.
The Gradient Estimation Problem
In many machine learning contexts, we need to compute the gradient of an expectation:
$$\frac{d}{d\theta} \mathbb{E}_{p(x;\theta)}[\phi(x)]$$
This operation is central to policy gradients in RL and training Variational Autoencoders (VAEs). Historically, two primary methods have dominated:
- Likelihood Ratio (LR) / REINFORCE: Evaluates the function $\phi(x)$ directly. It is versatile but often high-variance.
- Reparameterization (RP) / Pathwise Gradients: Uses the gradient $\nabla \phi(x)$. It typically offers lower variance but requires differentiability and reparameterizability.
Methods: Unified Probability Flow
The authors propose treating the change in probability density as parameters $\theta$ vary like the flow of an incompressible fluid. By extending the sampling space with a "height" dimension representing density and applying the divergence theorem, they link the two estimators. The divergence theorem states that the total flux out of a volume (surface integral) equals the total divergence within it (volume integral).
In this physical view:
- The LR gradient corresponds to the surface integral, measuring flow across the boundaries of probability "boxes."
- The RP gradient corresponds to the volume integral, measuring how function values change as points move within the flow.
The "Boxes" Analogy
A key conceptual contribution is the "boxes" intuition for understanding how these estimators capture changes in expectation.
As shown in the figure above:
- LR (Likelihood Ratio) treats the domain as a set of fixed "boxes" and measures how much probability mass flows into or out of them as $\theta$ changes (vertical shift $\delta p$).
- RP (Reparameterization) defines "boxes" of constant probability mass and tracks their physical displacement $\delta x$ in the sample space.
Characterizing the Estimator Space
The paper's main result, Theorem 3, formalizes the "Probability Flow Gradient Estimator." This master equation describes a vast space of unbiased estimators parameterized by a flow field $u(x)$ and an importance sampling distribution $q(x)$.
This visualization demonstrates how different parameter changes result in distinct flow fields. The authors prove that any unbiased estimator of a specific product form (weighted sums of $\phi(x)$ and $\nabla \phi(x)$) must exist within this framework. Notably, they show that the standard LR estimator is the unique unbiased estimator relying solely on function values when sampling from the model distribution.
Key Insights and Implications
- Duality: LR and RP are not just different tricks; they are mathematically dual representations of the same underlying physical process.
- Reparameterization as Implementation: The authors argue that "reparameterizability" is not a fundamental requirement for the existence of these gradients, but rather a convenient implementation detail for a specific flow field using automatic differentiation.
- Robustness: The framework naturally extends to discontinuous models, showing that edge cases like the "GO gradient" are simply flows encountering a "jump" at a boundary.
Limitations and Future Work
While the paper maps the entire space of possible estimators, it does not provide a definitive algorithm for selecting the optimal flow field $u(x)$ to minimize variance for a given high-dimensional problem. Future work may involve automated searches for low-variance "knobs" within this unified space. Additionally, the current characterization focuses on single-sample estimators and does not yet cover multi-sample or higher-order derivative methods (like $\nabla^2 \phi(x)$).
Summary updated