Abstract
Bayesian posterior inference is prevalent in various machine learning problems. Variational inference provides one way to approximate the posterior distribution, however its expressive power is limited and so is the accuracy of resulting approximation. Recently, there has a trend of using neural networks to approximate the variational posterior distribution due to the flexibility of neural network architecture. One way to construct flexible variational distribution is to warp a simple density into a complex by normalizing flows, where the resulting density can be analytically evaluated. However, there is a trade-off between the flexibility of normalizing flow and computation cost for efficient transformation. In this paper, we propose a simple yet effective architecture of normalizing flows, ConvFlow, based on convolution over the dimensions of random input vector. Experiments on synthetic and real world posterior inference problems demonstrate the effectiveness and efficiency of the proposed method.
Introduction
In Bayesian machine learning, approximating the posterior distribution—the update of beliefs about model parameters after observing data—is a fundamental challenge. Variational Inference (VI) typically addresses this by approximating the true posterior with a simpler, tractable distribution. However, standard choices like Gaussians often fail to capture the multi-modal or complex structures of real-world posteriors.
Normalizing flows offer a solution by transforming a simple base distribution through a series of invertible mappings. The primary bottleneck in these methods is the computation of the Jacobian determinant, which ensures the validity of the transformed probability density. For general neural networks, this operation scales at $O(d^3)$, where $d$ is the dimensionality. Previous architectures like Inverse Autoregressive Flows (IAF) or Planar Flows have attempted to simplify this, but often at the cost of parameter efficiency or expressive power. This paper introduces ConvFlow, a novel architecture that leverages 1D convolutions to achieve high flexibility with linear computational complexity.
The ConvFlow Architecture
ConvFlow applies a 1D convolution to an input random vector $z$ to define the transformation: $$f(z) = z + u \odot h(\text{conv}(z, w))$$ where $w$ is the convolution kernel, $h(\cdot)$ is a monotonic non-linearity, and $u$ is a scaling vector.
Efficient Jacobian Computation
The core innovation lies in the use of causal padding. By ensuring that the $i$-th element of the output only depends on elements $j \le i$ of the input, the resulting Jacobian matrix becomes lower triangular. The determinant of a triangular matrix is simply the product of its diagonal elements, reducing the computational cost of the Jacobian from $O(d^3)$ to $O(d)$.
Capturing Global Dependencies
While standard convolutions have a limited local receptive field, ConvFlow incorporates dilated convolutions to capture long-range dependencies across dimensions without increasing the parameter count. Additionally, the authors introduce a "Revert Layer" that flips the vector between blocks. This ensures that information can flow in both directions across the latent space, allowing the model to learn global correlations after several layers.
Experimental Evaluation
The effectiveness of ConvFlow was evaluated across synthetic and real-world benchmarks.
Synthetic 2D Densities
On complex 2D energy functions, ConvFlow demonstrated superior expressivity compared to IAF. While IAF often struggled with multi-modal distributions—sometimes collapsing the density into a single mode or line—ConvFlow accurately captured intricate shapes like rings and waves.
Generative Modeling on MNIST and OMNIGLOT
In high-dimensional tasks, a Variational Autoencoder (VAE) using ConvFlow outperformed standard VAEs and IAF-based models. On the MNIST dataset, ConvFlow achieved a Negative Log-Likelihood (NLL) of 79.11, significantly better than the standard VAE (85.66) and IAF (84.26). Furthermore, t-SNE visualizations of the latent space revealed that ConvFlow produces more distinct and separable clusters for different digit classes, indicating a more informative latent representation.
Conclusion
ConvFlow presents a highly efficient and expressive framework for normalizing flows. By utilizing causal and dilated 1D convolutions, it achieves $O(d)$ Jacobian computation while maintaining the ability to model complex, global dependencies. The model is significantly more parameter-efficient than previous autoregressive methods, requiring only $k + d$ parameters per layer, making it a powerful tool for flexible variational inference in high-dimensional spaces.
Summary updated