Introduction
Normalizing flows are a powerful class of generative models that transform a simple probability distribution (like a Gaussian) into a complex one using invertible mappings. However, researchers have long faced a frustrating trade-off between flexibility and speed. Autoregressive flows (e.g., MAF, IAF) are highly flexible and excel at density estimation but are slow to invert, requiring sequential passes through a neural network. Conversely, coupling flows (e.g., Real NVP, Glow) are fast in both directions but often lack the local flexibility needed for complex density modeling due to their reliance on simple affine transformations.
Cubic-spline flows address this gap by introducing a new type of normalizing flow that combines the high flexibility of autoregressive models with the lightning-fast sampling of coupling-based models.
Methods
The core innovation is the monotonic cubic-spline coupling transform. Instead of simple scaling and shifting, the model uses a neural network to predict the parameters of a piecewise cubic spline.
To ensure the transformation is always invertible, the spline must be monotonic. The authors utilize Steffen’s method to constrain derivatives at the "knots" (the points connecting the bins), ensuring the resulting curve is smooth ($C^1$ continuous) and strictly increasing. These spline layers are stacked with LU-decomposed linear layers to allow efficient interaction across all data dimensions. Crucially, while a cubic equation is more complex than a linear one, it still possesses an analytical solution, allowing the model to be inverted in a single pass without slow numerical optimization.
Key Results
The model was evaluated on standard benchmarks, including UCI tabular datasets, synthetic 2D densities, and image datasets like Fashion-MNIST.
State-of-the-Art Performance
On UCI tabular datasets, cubic-spline flows outperformed FFJORD and were statistically superior to quadratic splines on the majority of tests. The model achieved results competitive with NAF and TAN—the gold standards for density estimation—while remaining significantly faster to sample from.
High-Fidelity Modeling
As shown in the synthetic data experiments, the model successfully captured extremely intricate patterns, such as a mixture of 225 Gaussians and an "Einstein" density map, which previous flows struggled to resolve. Furthermore, the model generates high-quality Fashion-MNIST samples in a single forward pass, unlike autoregressive models that require $D$ passes.
Conclusion
Cubic-spline flows demonstrate that coupling-based flows can match or exceed the performance of autoregressive models if the coupling function is sufficiently expressive. By providing local flexibility through splines while maintaining an analytical inverse, this architecture effectively breaks the speed-flexibility trade-off. Future work includes scaling these flexible splines to high-resolution natural images and addressing minor numerical stability issues at the extreme edges of the distribution.
Summary updated