Abstract
Normalizing flows (NF) use a continuous generator to map a simple latent (e.g. Gaussian) distribution, towards an empirical target distribution associated with a training data set. Once trained by minimizing a variational objective, the learnt map provides an approximate generative model of the target distribution. Since standard NF implement differentiable maps, they may suffer from pathological behaviors when targeting complex distributions. For instance, such problems may appear for distributions on multi-component topologies or characterized by multiple modes with high probability regions separated by very unlikely areas. A typical symptom is the explosion of the Jacobian norm of the transformation in very low probability areas. This paper proposes to overcome this issue thanks to a new Markov chain Monte Carlo algorithm to sample from the target distribution in the latent domain before transporting it back to the target domain. The approach relies on a Metropolis adjusted Langevin algorithm whose dynamics explicitly exploits the Jacobian of the transformation. Contrary to alternative approaches, the proposed strategy preserves the tractability of the likelihood and it does not require a specific training. Notably, it can be straightforwardly used with any pre-trained NF network, regardless of the architecture. Experiments conducted on synthetic and high-dimensional real data sets illustrate the efficiency of the method.
Introduction: The Challenge of Topological Mismatch
Normalizing Flows (NFs) are powerful generative models that learn a bijective (reversible) mapping between a simple latent distribution—usually a Gaussian—and a complex data distribution. However, a fundamental "topological mismatch" often occurs. While a Gaussian is a single, connected "blob," target data often consists of multiple distinct clusters (modes) separated by empty space.
Because NFs must remain continuous and differentiable, they are mathematically forced to "stretch" the latent space to create bridges between these clusters. When performing standard "naive sampling" (drawing a random point from the Gaussian and pushing it through the flow), samples often land on these bridges. This results in out-of-distribution artifacts—such as blurry, "ghostly" images that exist between two distinct data points.
Methodology: NF-SAILS
The authors introduce NF-SAILS (NF SAmpling In the Latent Space), a method that replaces naive sampling with a sophisticated Markov Chain Monte Carlo (MCMC) approach. The core idea is to treat the latent space as a curved manifold where the geometry is defined by the NF's Jacobian.
The Jacobian as a Red Flag
The paper formalizes why artifacts occur: the Jacobian norm of the transformation must explode in low-probability regions where the model is forced to create a bridge. NF-SAILS uses this information to steer the sampler away from these pathological regions.
Sampling Strategy
- RMMALA (Local Exploration): The method uses a Riemannian Manifold Metropolis-Adjusted Langevin Algorithm. It treats high-Jacobian areas as steep "mountains" to be avoided, ensuring the sampler stays within high-quality regions of the data distribution.
- Independent Metropolis-Hastings (Global Jumps): To prevent the sampler from getting stuck in a single mode, the authors incorporate occasional "global jumps."
- Efficiency: By using a first-order Taylor expansion to approximate the inverse Jacobian, the algorithm remains practical for high-dimensional data without the extreme computational cost typically associated with manifold MCMC.
Experimental Evaluation
The researchers evaluated NF-SAILS across several benchmarks:
- Synthetic 2D Mixtures: Gaussian mixtures with up to 9 modes were used to visualize how the sampler avoids "dead zones."
- Image Benchmarks: The method was tested on CIFAR-10, CelebA (high-resolution faces), and LSUN (bedroom scenes).
Key Results and Insights
- Quantitative Improvements: On synthetic data, NF-SAILS consistently outperformed naive sampling and even Denoising Diffusion Probabilistic Models (DDPM) in log-likelihood and Kolmogorov-Smirnov tests.
- Enhanced Image Quality: For image datasets, the method improved the Fréchet Inception Distance (FID) and reduced bits-per-dimension (bpd). Qualitatively, NF-SAILS eliminates the "ghostly" artifacts seen in standard NF samples, producing sharper, more distinct images.
- Plug-and-Play Utility: A major advantage of NF-SAILS is that it requires no retraining. It can be applied to any pre-trained flow model to improve its output quality immediately.
Conclusion and Future Work
While NF-SAILS introduces some computational overhead due to the nature of MCMC, it demonstrates that we can significantly improve generative models by being smarter about how we use them after training. Future research may look into using this latent-space geometry to improve the training objectives themselves, potentially creating flows that are inherently easier to sample from.
Summary updated