Kernelised Normalising Flows

Eshant English, Matthias Kirchler, Christoph Lippert

Normalising Flows (NFs) are a powerful class of generative models that allow for both exact density estimation and efficient sampling. Unlike Variational Autoencoders (VAEs) or Diffusion models, which often approximate the likelihood, NFs use the "change of variables" theorem to calculate it exactly.

However, NFs come with a major catch: to be mathematically valid, their internal transformations must be invertible. This constraint often limits their expressiveness. To compensate, researchers usually build massive architectures with millions of parameters (e.g., the Glow model). While this works for big datasets like ImageNet, it fails miserably in "low-data" domains like medicine or genetics, where you might only have a few hundred samples. In these cases, the neural networks simply memorize the training data, leading to poor generalization.

To address this, researchers introduce Ferumal Flow, a novel approach that replaces the "black box" neural networks inside Normalising Flows with kernel machines. This swap creates models that are significantly more parameter-efficient (up to 93% fewer parameters) and far more robust in low-data regimes.

The Ferumal Flow Methodology

Ferumal Flow replaces the standard neural network scaling ($s$) and translation ($t$) functions in affine coupling layers with kernel-based functions.

  1. The Kernel Swap: Instead of a multi-layer perceptron (MLP) predicting the shift and scale, the model uses functions from a Reproducing Kernel Hilbert Space (RKHS).
  2. Representer Theorem for Flows: The authors prove that even though the maximum likelihood objective for flows is non-convex, the optimal transformation functions can still be expressed as a weighted sum of kernel evaluations.
  3. Auxiliary Points: To prevent the model from becoming computationally heavy as the dataset grows (the classic $O(n^2)$ kernel problem), they introduce "auxiliary points." These act like "inducing variables" in Gaussian Processes—a small, learnable set of points that summarize the data distribution.
  4. Parameter Efficiency: By using these kernels, the model's complexity scales with the number of auxiliary points and layers, rather than the width and depth of a massive neural network.

Experimental Validation and Key Insights

The researchers evaluated Ferumal Flow across a wide spectrum of datasets, including synthetic 2D toy data (Line, Pinwheel, Moons, and discontinuous densities like Checkerboard), standard tabular benchmarks, real-world medical data, and images.

Synthetic 2D toy data distributions including Line, Pinwheel, and Moons.

Several key insights and performance breakthroughs emerged from the evaluation:

  • Inductive Bias is a Superpower: Neural networks have a "low inductive bias," meaning they need lots of data to learn patterns. Kernels have a "strong inductive bias"—they assume a certain level of smoothness or structure. This makes them much better at "filling in the gaps" when data is sparse.
  • Data-Dependent Initialization: Because the auxiliary points are initialized from actual data points, the model starts much closer to a "good" solution than a randomly initialized neural network. This leads to significantly faster convergence.
  • Handling Discontinuity: One of the most striking findings was how well kernels handle sharp edges. In discontinuous datasets, neural networks produced blurry boundaries, while kernelised flows captured the sharp transitions much more accurately.
  • The "Less is More" Paradox: By using 93% fewer parameters, the model actually performed better on several benchmarks. This suggests that for many tabular and small-scale tasks, we are currently over-engineering our flow models.
  • Low-Data Dominance: On datasets restricted to only 500 samples, Ferumal Flow significantly beat FFJORD (a state-of-the-art continuous flow). For example, on the "Gas" dataset, it achieved a log-likelihood of 0.22 nats, while FFJORD trailed at -7.50 nats.
  • Efficiency: On the UK Biobank dataset, Ferumal Flow trained in just 21 minutes using 41K parameters, whereas FFJORD took 13.1 hours and required 1.1M parameters to achieve a worse result.

Limitations and Future Work

While highly effective, kernelised flows do have limitations. The "length scale" of the kernel is a critical hyperparameter: if it's too small, the model overfits; too large, and it underfits. Finding the "Goldilocks" zone requires careful tuning.

Furthermore, extending this approach beyond affine coupling layers to architectures like Residual Flows (ResFlow) is challenging because those require strict control over "Lipschitz constants" to ensure invertibility. Finally, while Ferumal Flow successfully modeled CIFAR-10 images with fewer parameters than its neural-net counterpart, scaling to high-resolution images without a parameter explosion remains an open challenge for future research.

Summary updated

BibTeX
@inproceedings{english2024kernelised,
  author = {Eshant English and Matthias Kirchler and Christoph Lippert},
  title = {{Kernelised Normalising Flows}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=iTFdNLHE7k},
}
Figure