Abstract
Normalizing flows and autoregressive models have been successfully combined to produce state-of-the-art results in density estimation, via Masked Autoregressive Flows (MAF), and to accelerate state-of-the-art WaveNet-based speech synthesis to 20x faster than real-time, via Inverse Autoregressive Flows (IAF). We unify and generalize these approaches, replacing the (conditionally) affine univariate transformations of MAF/IAF with a more general class of invertible univariate transformations expressed as monotonic neural networks. We demonstrate that the proposed neural autoregressive flows (NAF) are universal approximators for continuous probability distributions, and their greater expressivity allows them to better capture multimodal target distributions. Experimentally, NAF yields state-of-the-art performance on a suite of density estimation tasks and outperforms IAF in variational autoencoders trained on binarized MNIST.
Introduction
In deep generative modeling and variational inference, normalizing flows are used to transform simple probability distributions into complex, real-world distributions. Autoregressive flows—such as Inverse Autoregressive Flows (IAF) and Masked Autoregressive Flows (MAF)—are highly popular variants because they allow for tractable density evaluation.
However, previous autoregressive flows rely on conditionally affine transformations. This means they only scale and shift the data. While computationally efficient, affine transformations are severely limited in expressivity. Specifically, they struggle to model multimodal distributions. Because a simple affine function lacks inflection points, it cannot easily fold and mold the probability space to form multiple distinct modes, often causing the model to produce "bridges" of density between peaks or get stuck in suboptimal local minima.
Methods
To address this expressivity bottleneck, Neural Autoregressive Flows (NAF) replace simple affine transformations with a richer family of functions: a small, deep neural network.
The core challenge is that normalizing flows must be invertible and have a tractable Jacobian determinant. The authors solve this by designing strictly monotonic neural networks. By forcing all weights to be strictly positive and using strictly monotonic activation functions (like sigmoids), the network's output is guaranteed to be strictly increasing and thus naturally invertible.
The resulting architecture acts like a hypernetwork:
- An autoregressive conditioner (like MADE) looks at previous variables and outputs a set of pseudo-parameters.
- These pseudo-parameters dictate the weights of a small, monotonic transformer neural network.
- The transformer network then processes the current variable.
The authors propose two specific transformer architectures: Deep Sigmoidal Flows (DSF) and Deep Dense Sigmoidal Flows (DDSF). To keep the conditioner's output manageable, they introduce a parameter-sharing trick that reduces the output complexity from $O(d^2)$ to $O(d)$.
Experimental Results
Toy Multimodal Tasks
On 2D toy datasets, NAF demonstrates a superior ability to capture complex multimodality compared to affine flows. While affine flows often fail to separate distinct modes, NAF's sigmoidal activations provide the necessary inflection points to isolate density peaks.
Density Estimation and Variational Inference
NAF achieved new state-of-the-art test log-likelihoods across five standard density estimation datasets (POWER, GAS, HEPMASS, MINIBOONE, and BSDS300). For example, on the POWER dataset, MAF-DDSF achieved a log-likelihood of 0.62 compared to MAF-affine's 0.24. Additionally, on Binarized MNIST, using IAF-DSF as the approximate posterior in a VAE improved the negative log-likelihood to 79.86, outperforming standard IAF-affine (80.05).
Key Insights and Theoretical Contributions
- Universal Approximation: The authors provide a rigorous mathematical proof that NAFs (specifically DSFs) are universal approximators for continuous probability distributions. This is the first such proof for finite normalizing flows.
- Inflection Points: The primary reason affine flows fail on multimodal data is their lack of inflection points. Sigmoid activations naturally provide these, allowing the flow to easily compress and expand density into distinct peaks.
- Hypernetwork Paradigm: Framing normalizing flows as a hypernetwork allows for highly flexible, dynamic transformations that go far beyond simple scaling and shifting.
Conclusion
Neural Autoregressive Flows represent a significant advancement in the flexibility of normalizing flows. By leveraging monotonic neural networks as transformers, NAF provides a theoretically grounded and empirically superior method for modeling complex, multimodal probability distributions.
Summary updated