[Paper Review] Automatic structured variational inference
This paper introduces Automatic Structured Variational Inference (ASVI), a fully automated method that constructs structured variational families by mimicking conjugate exponential family updates, enabling efficient and accurate posterior approximation in probabilistic programs. ASVI achieves state-of-the-art performance on low- and high-dimensional models, outperforming mean-field and inverse autoregressive flows while maintaining the same computational complexity as the original model.
Stochastic variational inference offers an attractive option as a default method for differentiable probabilistic programming. However, the performance of the variational approach depends on the choice of an appropriate variational family. Here, we introduce automatic structured variational inference (ASVI), a fully automated method for constructing structured variational families, inspired by the closed-form update in conjugate Bayesian models. These convex-update families incorporate the forward pass of the input probabilistic program and can therefore capture complex statistical dependencies. Convex-update families have the same space and time complexity as the input probabilistic program and are therefore tractable for a very large family of models including both continuous and discrete variables. We validate our automatic variational method on a wide range of low- and high-dimensional inference problems. We find that ASVI provides a clear improvement in performance when compared with other popular approaches such as the mean-field approach and inverse autoregressive flows. We provide an open source implementation of ASVI in TensorFlow Probability.
Motivation & Objective
- To automate the construction of structured variational families that capture complex dependencies in probabilistic programs.
- To overcome the limitations of mean-field and ad-hoc structured VI methods that require manual design or strong assumptions.
- To develop a method that preserves the forward-pass structure of the input model while enabling scalable, differentiable inference.
- To provide a drop-in replacement for mean-field VI in automatic differentiation frameworks like TensorFlow Probability.
- To achieve high-performance posterior approximation without increasing computational complexity beyond the original model.
Proposed method
- ASVI constructs a convex-update variational family where each latent variable's posterior parameters are a convex combination of parent-induced parameters and data-informed terms, emulating conjugate exponential family updates.
- The method uses a parameterization that combines the deterministic forward pass of the probabilistic program with data-dependent updates, ensuring the same time and space complexity as the original model.
- The variational family is defined such that the mean of each latent variable is a weighted average of the parent network outputs and a data-driven component, with learnable mixing weights.
- The approach supports both continuous and discrete variables and is compatible with standard stochastic gradient optimization and automatic differentiation.
- The method is implemented as a reusable component in TensorFlow Probability via `tfp.experimental.build_asvi_surrogate_posterior`.
- Amortized inference is applied by using an inference network to predict the data-dependent components of the variational parameters.
Experimental results
Research questions
- RQ1Can a fully automatic method construct structured variational families that capture complex dependencies in probabilistic programs without model-specific derivations?
- RQ2How does the performance of ASVI compare to mean-field and inverse autoregressive flow baselines on structured probabilistic models?
- RQ3Can the convex-update family maintain the same computational complexity as the original model while improving posterior approximation?
- RQ4To what extent can ASVI capture posterior dependencies when the graphical model contains colliding arrows (e.g., in Bayesian neural networks)?
- RQ5Does ASVI generalize well across low- and high-dimensional inference problems, including deep generative models?
Key findings
- ASVI significantly outperforms mean-field VI on all tested low-dimensional models, with improvements in ELBO ranging from 1.5 to 10.5 points across different datasets.
- On the Bayesian logistic regression model, ASVI achieved an ELBO of -158.2 ± 1.3, compared to -166.7 ± 0.2 for mean-field, demonstrating a clear performance gain.
- In the deep variational autoencoder experiment, ASVI achieved higher test set ELBO than the mean-field baseline across all three datasets: MNIST, FashionMNIST, and KMNIST.
- The performance gain in the deep model was consistent across both joint image-and-label generation and image-only generation tasks.
- ASVI achieved competitive performance with inverse autoregressive flows (IAFs), a high-capacity normalizing flow method, while maintaining lower computational complexity.
- The method successfully captures posterior structure through the forward pass of the model, even in cases where the prior graph contains colliding arrows, though it cannot model dependencies induced by such structures directly.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.