Abstract
Normalizing flows model a complex target distribution in terms of a bijective transform operating on a simple base distribution. As such, they enable tractable computation of a number of important statistical quantities, particularly likelihoods and samples. Despite these appealing properties, the computation of more complex inference tasks, such as the cumulative distribution function (CDF) over a complex region (e.g., a polytope) remains challenging. Traditional CDF approximations using Monte-Carlo techniques are unbiased but have unbounded variance and low sample efficiency. Instead, we build upon the diffeomorphic properties of normalizing flows and leverage the divergence theorem to estimate the CDF over a closed region in target space in terms of the flux across its boundary, as induced by the normalizing flow. We describe both deterministic and stochastic instances of this estimator: while the deterministic variant iteratively improves the estimate by strategically subdividing the boundary, the stochastic variant provides unbiased estimates. Our experiments on popular flow architectures and UCI benchmark datasets show a marked improvement in sample efficiency as compared to traditional estimators.
Introduction
Normalizing Flows (NFs) are a powerful class of generative models that transform a simple base distribution (e.g., a Gaussian) into a complex target distribution via invertible, smooth mappings. While they excel at density estimation and sampling, calculating the probability of a data point falling within a specific region—the Cumulative Distribution Function (CDF)—remains computationally difficult. In high-dimensional spaces, traditional Monte Carlo (MC) integration requires a prohibitive number of samples to achieve low variance, especially for small regions or tail probabilities. This limitation hinders the application of NFs in domains like financial risk assessment or safety-critical uncertainty estimation.
Methodology: From Volume to Surface
The core innovation of this work is transforming a "volume" problem into a "surface" problem. By leveraging the fact that NFs are diffeomorphisms, the CDF over a region in the target space can be related to the volume of that region mapped back into the base space.
Using the divergence theorem, the authors derive a specific vector field in the target space such that the integral of this field across the region's boundary is exactly equal to the probability mass within the region. This "Boundary Flux" approach shifts the focus from sampling points inside a volume to evaluating the flow across its surface.
Boundary Flux Estimators
Two primary estimators are introduced:
- Adaptive Boundary Flux (BF-A): A deterministic algorithm that represents the boundary as a set of simplices. It iteratively refines the estimate by identifying complex boundary segments and subdividing them, focusing computational effort where the flow is most non-linear.
- Stochastic Boundary Flux (BF-S): An unbiased version that randomly samples points on the boundary.
Experimental Evaluation
The method was evaluated on UCI benchmark datasets (Power, Gas, Hepmass, Miniboone) and synthetic polytopes across various flow architectures, including Glow, MAF, and FFJORD.
Key Results
- Accuracy and Efficiency: BF-A achieved a 3.8x lower absolute error than Importance Sampling and 2.5x lower error than standard MC for a fixed budget of 4,000 samples. In 2D, convergence was reached within 500 samples, whereas traditional estimators remained volatile.
- Flow Smoothness: The method performs exceptionally well with continuous-time flows like FFJORD. The inherent smoothness of ODE-based transformations makes the boundary flux easier to approximate linearly.
- Dimensionality Scaling: Significant improvements were observed in 2D through 4D. However, the advantage diminishes around 5D, as the boundary itself becomes a high-dimensional volume that is difficult to sample.
Conclusion and Future Work
The Boundary Flux approach provides a sample-efficient alternative for CDF estimation in low-to-moderate dimensions. While the "curse of dimensionality" remains a challenge as the surface area grows, the strategic refinement of BF-A offers a clear path forward. Future research may involve utilizing higher-order flow information, such as curvature, to improve adaptive splitting and extend the method's scalability to higher-dimensional data.
Summary updated