Abstract
A normalizing flow (NF) is a mapping that transforms a chosen probability distribution to a normal distribution. Such flows are a common technique used for data generation and density estimation in machine learning and data science. The density estimate obtained with a NF requires a change of variables formula that involves the computation of the Jacobian determinant of the NF transformation. In order to tractably compute this determinant, continuous normalizing flows (CNF) estimate the mapping and its Jacobian determinant using a neural ODE. Optimal transport (OT) theory has been successfully used to assist in finding CNFs by formulating them as OT problems with a soft penalty for enforcing the standard normal distribution as a target measure. A drawback of OT-based CNFs is the addition of a hyperparameter, $\alpha$, that controls the strength of the soft penalty and requires significant tuning. We present JKO-Flow, an algorithm to solve OT-based CNF without the need of tuning $\alpha$. This is achieved by integrating the OT CNF framework into a Wasserstein gradient flow framework, also known as the JKO scheme. Instead of tuning $\alpha$, we repeatedly solve the optimization problem for a fixed $\alpha$ effectively performing a JKO update with a time-step $\alpha$. Hence we obtain a "divide and conquer" algorithm by repeatedly solving simpler problems instead of solving a potentially harder problem with large $\alpha$.
Introduction
Continuous Normalizing Flows (CNFs) model data transformations as continuous paths defined by Ordinary Differential Equations (ODEs). While powerful, training these models often relies on Optimal Transport (OT) regularization to ensure efficient, straight-line trajectories. However, this introduces a critical hyperparameter, $\alpha$, which balances the transport cost against the accuracy of the target distribution. Finding the optimal $\alpha$ is notoriously difficult: values too small lead to insufficient movement, while values too large make the optimization problem ill-posed and computationally unstable.
The JKO-Flow Framework
To address the challenges of hyperparameter tuning, we propose JKO-Flow. This method reinterprets the CNF training process through the lens of the Jordan–Kinderlehrer–Otto (JKO) scheme, a proximal algorithm for gradient flows in the Wasserstein space.
Instead of a single-shot optimization, JKO-Flow decomposes the transformation into a sequence of $K$ smaller, more manageable steps. In this context, $\alpha$ is no longer a parameter requiring exhaustive search but acts as a fixed "time-step" in the discretization of the gradient flow. This "divide and conquer" strategy allows the model to converge to the target distribution for any $\alpha > 0$, significantly reducing the need for manual tuning. Furthermore, by utilizing the "OT-Flow" framework, we achieve exact Jacobian trace estimation, avoiding the noise inherent in stochastic approximations.
Experimental Evaluation
We evaluated JKO-Flow across a variety of tasks:
- Synthetic 2D Benchmarks: Seven standard toy datasets, including Checkerboard, 2 Spirals, and Swiss Roll, were used to test the model's ability to capture complex geometries.
- High-Dimensional Data: The 43-dimensional Miniboone dataset was employed to assess scalability and performance on real-world scientific data.
Key Results and Discussion
The primary advantage of JKO-Flow is its robustness to hyperparameters. Unlike single-shot methods, which exhibit highly variable performance depending on the choice of $\alpha$, JKO-Flow maintains stable and high-quality results across a wide range of values.
As shown in the figure above, JKO-Flow significantly outperforms the single-shot baseline on the Checkerboard task. For instance, at $\alpha=1$, JKO-Flow achieves an MMD of $4.90 \times 10^{-4}$, nearly two orders of magnitude better than the single-shot result of $3.58 \times 10^{-2}$.
Beyond accuracy, JKO-Flow demonstrates remarkable parameter efficiency. In our tests, iterative models with significantly fewer parameters outperformed larger single-shot models, suggesting that breaking down the learning task reduces the representational burden on the underlying neural network.
Conclusion
JKO-Flow offers a robust and efficient alternative to standard CNF training. While the iterative nature of the algorithm introduces some sequential computational overhead, this is largely offset by the elimination of expensive hyperparameter grid searches. Future work will explore adaptive iteration counts and the application of this framework to other domains like deep optimal control.
Summary updated