Neural Inverse Transform Sampler

Henry Li, Yuval Kluger

Introduction

In generative modeling, representing a complex probability density function (PDF) typically presents two major hurdles: normalization and sampling. To be a valid PDF, a function must integrate to 1. However, computing this integral—known as the partition function, $Z$—is often mathematically intractable or computationally expensive for complex neural networks. Furthermore, drawing new samples from these distributions often requires slow, iterative processes like Markov Chain Monte Carlo (MCMC).

Existing solutions have notable trade-offs: Normalizing Flows require strict architectural constraints to remain invertible, while Score-based models avoid the partition function but cannot provide exact likelihoods. The Neural Inverse Transform Sampler (NITS) addresses these gaps by introducing a highly expressive generative framework that leverages the Fundamental Theorem of Calculus to enable exact, cheap likelihood evaluation and fast direct sampling.

Methodology

The core engine of NITS is the Probabilistically Normalized Network (PNN), which relies on two clever mathematical strategies:

  1. The Integration Trick: Instead of modeling the PDF directly, NITS models the Cumulative Distribution Function (CDF), $F_\theta(x)$, using a neural network. By the Fundamental Theorem of Calculus, the integral of the density over an interval $[A, B]$ is simply $F_\theta(B) - F_\theta(A)$. This makes normalizing the density exact and computationally cheap. To ensure the CDF is valid (always monotonically increasing), the authors enforce positive weights and monotonic activation functions (like Sigmoid or ReLU) within the PNN.
  2. Inverse Transform Sampling: Because the model provides direct access to the CDF, sampling becomes a simple two-step process: draw a random number $z$ from a uniform distribution $[0, 1]$, and then find $x$ such that $F_\theta(x) = z$. Since the CDF is strictly monotonic, this can be solved very quickly using a bisection search.
The NITS pipeline transforming a CDF into a normalized conditional density.

To handle high-dimensional data such as images, NITS uses an autoregressive structure. It breaks down a multi-dimensional density into a sequence of one-dimensional conditional densities. Each dimension is modeled by its own PNN, conditioned on the previous dimensions.

Key Insights

  • Universal Approximation: The authors prove that NITS is a universal density estimator for any continuous, compactly supported distribution. With enough parameters, it can represent any real-world probability shape.
  • Deep Mixture of Logistics: Mathematically, a two-layer PNN is shown to be a "deep" version of a Mixture of Logistics distribution, successfully bridging classical statistical models with modern deep learning.
  • Continuous Image Modeling: NITS-CONV is one of the first modern autoregressive models to treat image pixels as continuous values rather than discrete categories, potentially leading to smoother generative results.

Experiments and Results

NITS was evaluated on both natural images (CIFAR-10) and tabular data (UCI machine learning repository and BSDS300).

  • CIFAR-10: NITS-CONV achieved a negative log-likelihood of 2.97 bits/dim, outperforming standard continuous models like RealNVP (3.49) and Glow (3.35), and rivaling discretized models like PixelCNN++.
  • UCI Benchmarks: NITS-MLP achieved state-of-the-art results on four out of five UCI datasets, particularly excelling on the GAS and HEPMASS datasets.
  • Efficiency: Because the partition function is computed via simple subtraction of CDF values, likelihood evaluation is significantly faster than methods requiring numerical integration or complex Jacobian determinants.

Limitations and Future Work

Like all autoregressive models, NITS suffers from an autoregressive bottleneck: sampling is sequential. Generating an image pixel-by-pixel can be slow for very high-resolution data compared to parallel methods like GANs. Additionally, the current formulation assumes the data exists within a bounded interval (compact support). While most data can be scaled to fit this, extending NITS to handle infinite support without manual scaling is a key area for future research. Finally, scaling the parameter network to extremely large-scale datasets like ImageNet remains to be tested.

Summary updated

BibTeX
@inproceedings{li2022neural,
  author = {Henry Li and Yuval Kluger},
  title = {{Neural Inverse Transform Sampler}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=MNmfBPVMhU},
}
Figure