Abstract
Variational Inference (VI) is a cornerstone of modern Bayesian machine learning, yet its scalability is often limited by the computational cost of evaluating gradients of the model's log-likelihood. This paper introduces a novel framework for accelerating VI by reusing expensive gradient computations across multiple optimization steps. By leveraging importance sampling (IS) to re-weight previous gradient estimates, the authors propose two new algorithms: Importance Sampled SGD (I-SGD) and Importance Sampled SAG (I-SAG). Experimental results across various probabilistic benchmarks demonstrate that these methods can achieve up to a 10x speedup over standard stochastic gradient descent while maintaining convergence stability and accuracy.
Introduction
In "Black-Box" Variational Inference, we approximate complex posterior distributions using differentiable models. The standard optimization tool is Stochastic Gradient Descent (SGD). However, every iteration of SGD requires a full evaluation of the gradient of the model's log-joint distribution—a process that is often the primary computational bottleneck, especially for complex models or large-scale datasets. While previous research has largely focused on reducing the variance of these gradient estimates, this work addresses the efficiency of the optimizer itself. The central question is: can we perform more optimization steps without re-calculating the most expensive components of the gradient every time?
Methodology: Reusing Gradients via Importance Sampling
The authors observe that when using the "reparameterization trick," the gradient of the Evidence Lower Bound (ELBO) factorizes into two distinct components:
- The Model Part: The gradient of the log-joint distribution with respect to the latent variables. This is computationally "heavy."
- The Transformation Part: The gradient of the mapping from a base noise distribution to the variational parameters. This is computationally "light."
The Innovation: I-SGD and I-SAG
Instead of discarding the expensive "Model Part" after a single update, the proposed algorithms use Importance Sampling (IS) to reuse it. When variational parameters $\lambda$ are updated to $\lambda'$, the previous model gradients are re-weighted using the ratio of the new and old distributions.
- I-SGD (Importance Sampled SGD): For each mini-batch, the algorithm performs one full gradient update followed by several "cheap" steps using importance-sampled estimates.
- I-SAG (Importance Sampled SAG): This variant of Stochastic Average Gradient uses IS to "freshen up" stale gradients stored in memory, ensuring the aggregate gradient estimate remains accurate as the variational distribution shifts.
Key Insights
Non-linear Optimization Trajectories
A surprising finding is that I-SGD does not simply interpolate linearly between full updates. Because the "light" transformation part of the gradient is updated exactly at every step, the optimizer follows a sophisticated, non-linear path even while the "heavy" model gradient remains fixed.
Graceful Degradation in High Dimensions
While importance sampling typically struggles in high dimensions due to weight collapse, the authors mitigate this by exploiting the "factorized" nature of common variational approximations. By applying IS to small groups of variables (e.g., 5-10 dimensions) independently, the method remains effective even in high-dimensional models.
Experimental Results
The authors evaluated I-SGD and I-SAG on benchmarks including Bayesian Linear Regression, Gaussian Mixture Models, and Poisson Likelihood models.
- Significant Speedups: In tasks like Bayesian Linear Regression, I-SGD reached the optimal ELBO approximately ten times faster than standard SGD.
- Enhanced Stability: Standard SAG often performs poorly in VI because stored gradients become "stale." I-SAG effectively corrects these stale gradients, outperforming both standard SAG and simple running averages.
Conclusion and Future Work
The proposed importance-sampled optimizers offer a practical way to accelerate Variational Inference by making gradients "cheaper" rather than just "cleaner." While the method is limited by the dimensionality of independent factors and requires invertible reparameterization transformations, it provides a robust 10x performance gain in standard settings. Future research may explore more principled thresholds for re-computing full gradients, potentially by monitoring the variance of the importance weights.
Summary updated