Normalizing flows (NFs) are the "gold standard" for density estimation, but they are notoriously difficult to design. They require strict invertibility and efficient Jacobian calculations, which often forces researchers to use specialized, constrained architectures. But what if we could take the highly optimized architectures we already use for classification—like standard Convolutional Neural Networks (CNNs) and Multi-Layer Perceptrons (MLPs)—and simply "turn them into" normalizing flows?
In their NeurIPS 2022 paper, Bálint Máté and colleagues introduce Flowification, a framework designed to bridge the gap between flexible classification architectures and mathematically rigorous generative models.
The Architectural Divide
Normalizing flows are powerful because they allow us to compute the exact likelihood of data, making them excellent tools for anomaly detection and data generation. However, they are "architectural divas." To function correctly, every layer in a normalizing flow must be a diffeomorphism—a differentiable, invertible mapping that preserves dimensionality.
This strict requirement excludes the vast majority of successful deep learning architectures. Standard layers, such as convolutions or pooling operations, frequently change dimensions (via padding or stride) and are not naturally invertible. Consequently, researchers have historically faced a rigid choice: utilize a flexible, high-performance architecture for classification, or adopt a constrained, mathematically "nice" architecture for density estimation. Flowification aims to eliminate this compromise.
The Flowification Framework
The core idea behind Flowification is to treat standard neural network layers as "generalized" normalizing flows that are permitted to change dimensions. The authors achieve this through several key transformations:
1. SVD Parametrization
To make standard linear layers flow-friendly, the authors parametrize the weight matrix $W$ using Singular Value Decomposition ($W = V \Sigma U$). Because $V$ and $U$ are orthogonal matrices (representing rotations), they are easily invertible and do not alter the likelihood. The "non-invertible" aspect of the transformation is cleanly isolated to the diagonal matrix $\Sigma$.
2. Handling Dimension Changes
Standard networks constantly change dimensionality, which Flowification addresses in two ways:
- Decreasing Dimensions (Funnels): When a layer reduces dimensionality, the authors employ a "stochastic inverse." They train a small auxiliary network to "guess" the discarded information, effectively treating the inverse as a conditional probability distribution.
- Increasing Dimensions (Augmentation): When a layer increases dimensionality (such as during zero-padding), data-independent noise is added to the extra dimensions to ensure the resulting distribution maintains a non-zero measure.
3. Convolutional and Residual Flowification
The authors decompose standard convolutions into three flowifiable steps: zero-padding, "unfolding" (tiling the image into patches), and applying a linear layer to those patches. Furthermore, they demonstrate that ResNet-style additions can be viewed as coordinate duplication followed by a sum, which can also be flowified using stochastic inversion.
Key Insights and Results
By moving from strictly deterministic inverses to stochastic ones, the authors show that the definition of a "Normalizing Flow" can be broadened to include almost any neural network. This suggests that the difference between a discriminative model and a generative model is less about the architecture itself and more about how the forward and backward passes are defined.
The authors successfully trained Flowified MLPs (FMLP) and Flowified CNNs (FCONV) using maximum likelihood on standard benchmarks, including tabular data (UCI datasets) and images (MNIST, CIFAR-10, BSDS300). This serves as a strong proof of concept that standard layers can indeed function as flows.
While the flowified models achieved the "right order of magnitude" for log-likelihood, they do not yet outperform state-of-the-art specialized flows like Neural Spline Flows (NSF) or GLOW. For example, on CIFAR-10, the best flowified model achieved 3.69 bits per dimension (BPD), compared to 3.35 for GLOW. The authors also noted that architecture plays a critical role; models with non-overlapping kernels performed significantly better than those with overlapping kernels, highlighting the importance of how information is "folded" and "unfolded."
Limitations and Future Work
The primary limitation of Flowification is that current models are not yet competitive with state-of-the-art normalizing flows in raw density estimation performance. The authors hypothesize that dimension-reducing steps might be discarding too much information, or that standard layers lack the complex "entanglement" found in specialized flow layers.
Future work will likely focus on making the forward pass parameters data-dependent (similar to coupling layers in traditional NFs) and refining the stochastic inverse to better capture the information lost during dimension reduction. Despite these current limitations, Flowification represents a significant conceptual leap toward unifying discriminative and generative deep learning architectures.
Summary updated