Convex Potential Flows: Universal Probability Distributions with Optimal Transport and Convex Optimization

Chin-Wei Huang, Ricky T. Q. Chen, Christos Tsirigotis, Aaron C. Courville

Normalizing flows are powerful generative models that learn complex data distributions by applying a series of invertible transformations to a simple base distribution, such as a Gaussian. However, training these models using maximum likelihood requires two strict conditions: the transformation must be strictly invertible, and we must be able to compute the log-determinant of the Jacobian (which measures how the transformation warps probability space).

Historically, ensuring these conditions has forced researchers to heavily restrict neural network architectures—relying on tricks like coupling layers, triangular matrices, or strict Lipschitz constraints. These constraints often limit the model's expressivity or require massive parameter counts to compensate. This paper asks a fundamental question: What is the most mathematically natural way to parameterize a normalizing flow without crippling its flexibility?

The answer proposed is Convex Potential Flows (CP-Flows), a novel architecture that parameterizes normalizing flows as the gradient of a strongly convex neural network. Rooted in optimal transport theory, CP-Flows are mathematically guaranteed to be universal and optimal, while utilizing a clever optimization trick that allows for model training with constant $\mathcal{O}(1)$ memory.

The CP-Flow Architecture

Instead of modeling the transformation as a standard vector-to-vector neural network, CP-Flows model it as the gradient of a scalar potential function. This makes the parameterization highly compact, mapping $\mathbb{R}^d \to \mathbb{R}$ rather than $\mathbb{R}^d \to \mathbb{R}^d$.

  1. Input Convex Neural Networks (ICNNs): The model uses an ICNN to learn a strongly convex scalar function $F(x)$. The actual flow transformation is the gradient of this function: $f(x) = \nabla F(x)$. Because $F$ is strictly convex, its gradient map $f$ is mathematically guaranteed to be invertible.
  2. Inversion via Convex Optimization: To run the model in reverse, the authors avoid using a specialized inverse neural network. Instead, they leverage standard convex optimization solvers (like L-BFGS) to find the unique global minimum of the convex conjugate.
Inversion Algorithm
  1. $\mathcal{O}(1)$-Memory Gradient Estimator: The Jacobian of a gradient map is the Hessian matrix of the potential function. Computing the log-determinant of a massive Hessian is notoriously expensive. Instead of backpropagating through a heavy log-determinant estimator, the authors derive a surrogate training objective. They use the Hutchinson trace estimator and the Conjugate Gradient (CG) method to solve inverse-Hessian vector products on the fly. This bypasses the need to store the computational graph of the solver, resulting in an unbiased, constant-memory gradient estimator.

Key Insights: Optimal Transport and Universality

The design of CP-Flows is directly inspired by Brenier’s Theorem from optimal transport (OT) theory. The theorem states that the most efficient way to move mass from one distribution to another (minimizing quadratic cost) is exactly the gradient of a convex potential. Therefore, CP-Flows are theoretically guaranteed to find the "cheapest" mapping between distributions.

Because of this connection, a single CP-Flow layer is a universal density approximator. It doesn't strictly require stacking dozens of layers to achieve high expressivity, unlike many affine coupling flows. Furthermore, the authors proved that simply training CP-Flows with standard maximum likelihood (KL divergence) naturally causes the model to converge to the optimal transport map, avoiding the need to solve complex constrained OT optimization problems.

Toy 2D Dataset Visualization

Performance and Results

The authors evaluated CP-Flows across several standard benchmarks, including toy 2D datasets (like the Eight Gaussians shown above), tabular density estimation, image datasets (MNIST and CIFAR-10), and Variational Inference (VAE) tasks.

  • Parameter Efficiency: On CIFAR-10, CP-Flow achieved 3.40 bits/dim using only 1.9M parameters. For context, Neural Spline Flows achieve similar performance (3.38 bits/dim) but require ~11.8M parameters, and Glow requires 44M parameters.
  • Memory Efficiency: The proposed Conjugate Gradient-based estimator successfully maintained a flat, $\mathcal{O}(1)$ memory profile during training. In contrast, standard backpropagation through a log-determinant estimator scales linearly and quickly runs out of memory.
  • Competitive Density Estimation: CP-Flow performed competitively on all tabular datasets, outperforming or matching standard baselines like MAF, Real NVP, and FFJORD.
  • Amortized Inference: When used to enhance Variational Autoencoders (VAEs), CP-Flows achieved state-of-the-art or near state-of-the-art Evidence Lower Bound (ELBO) scores on Freyfaces, Omniglot, and Caltech.

Limitations and Future Directions

While mathematically elegant, CP-Flows are sensitive to architecture choices. Vanilla ICNNs can be difficult to optimize and may limit effective expressivity. To achieve their best results, the authors had to design an "input-augmented ICNN" with skip connections, indicating that tuning the architecture of the convex potential is crucial for performance.

Future work exploring better ICNN architectures—particularly convolutional ICNNs tailored for high-dimensional image generation—stands as the most promising next step to scale this approach to larger generative modeling tasks.

Summary updated

BibTeX
@inproceedings{huang2021convex,
  author = {Chin-Wei Huang and Ricky T. Q. Chen and Christos Tsirigotis and Aaron C. Courville},
  title = {{Convex Potential Flows: Universal Probability Distributions with Optimal Transport and Convex Optimization}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
}
Figure