Abstract
Reparameterization (RP) and likelihood ratio (LR) gradient estimators are used to estimate gradients of expectations throughout machine learning and reinforcement learning; however, they are usually explained as simple mathematical tricks, with no insight into their nature. We use a first principles approach to explain that LR and RP are alternative methods of keeping track of the movement of probability mass, and the two are connected via the divergence theorem. Moreover, we show that the space of all possible estimators combining LR and RP can be completely parameterized by a flow field $u(x)$ and importance sampling distribution $q(x)$. We prove that there cannot exist a single-sample estimator of this type outside our characterized space, thus, clarifying where we should be searching for better Monte Carlo gradient estimators.
The Core Challenge: Estimating Gradients of Expectations
In modern machine learning, many problems boil down to optimizing an expectation: $\frac{d}{d\theta} \mathbb{E}_{p(x;\theta)} [\phi(x)]$. This is the fundamental operation in Reinforcement Learning (where $\phi$ represents a reward) and Variational Inference (where $\phi$ is an evidence lower bound). Historically, researchers have relied on two distinct "tricks" to estimate these gradients:
- Likelihood Ratio (LR) / Score Function: This method uses the values of $\phi(x)$ and the gradient of the log-density. While general, it often suffers from high variance.
- Reparameterization (RP) / Pathwise Gradients: This method uses the gradient of $\phi(x)$ by shifting the randomness into a base distribution. It typically offers lower variance but requires $\phi(x)$ to be differentiable.
Until now, these were viewed as separate mathematical maneuvers. This research provides a unified physical explanation, treating probability mass as a flowing fluid.
A Physical Perspective: Probability Flow
By imagining the probability density $p(x;\theta)$ as a fluid, we can see that when parameters $\theta$ change, the "fluid" moves. The key mathematical bridge is the Divergence Theorem, which in physics relates the flow inside a volume to the flow across its surface.
The authors demonstrate that RP gradients are essentially a volume integral of this flow, while LR gradients are a surface integral. This duality means they are two sides of the same coin, measuring the same change in total expectation from different perspectives.
The "Boxes" Intuition
To make this abstract concept concrete, consider probability mass distributed into "boxes."
- LR Perspective: Keeps the boxes at fixed locations but changes the amount of weight (probability mass) inside each box.
- RP Perspective: Keeps the weights fixed but physically moves the boxes to new locations.
Both methods measure the same total change in expectation, but the "movement" is tracked differently. This visualization clarifies why LR is the only option when $\phi(x)$ is non-differentiable: if you cannot look inside the boxes to see how $\phi$ changes with position, you can only track the change in the weights themselves.
The Master Equation and the Search Space
The paper introduces a "Master Equation" (Theorem 3) that characterizes the entire space of possible unbiased gradient estimators. This space is defined by two "knobs": a vector field $u(x)$ (representing the flow) and an importance sampling distribution $q(x)$.
By adjusting these parameters, one can recover standard LR, standard RP, or any hybrid estimator in between. Crucially, the authors prove that any unbiased single-sample estimator of this common form must fall within this space. This provides a definitive map for researchers, showing exactly where to look for the next generation of low-variance Monte Carlo gradient estimators.
Conclusion
This work moves the field away from disparate mathematical tricks toward a unified physical principle. By characterizing the complete space of gradient estimators, it sets the stage for more systematic optimization in reinforcement learning and variational inference, allowing researchers to move beyond standard LR and RP to find more efficient, problem-specific solutions.
Summary updated