Improving Function Space Flow Matching with Kernel Optimal Transport

Fred Xu, Thomas Markovich, Barbora Barancikova, Yizhou SunNeurIPS 2026

TL;DR

Generative models that create continuous functions—like weather trajectories or fluid turbulence—typically learn by pairing random starting noise with data samples completely at random, forcing the network to untangle chaotic, high-variance paths. This paper introduces kernel Functional Flow Matching (kFFM), a method that uses domain-aware kernels and optimal transport to "matchmake" geometrically similar noise and data before training begins. With zero changes to the underlying neural architecture and minimal compute overhead, kFFM dramatically improves generation quality across time series and physics simulations.

What Problem Does This Paper Address?

Standard generative models operate on finite grids of pixels or tokens. But phenomena like economic time series or partial differential equation (PDE) solutions are functions—continuous objects living in infinite-dimensional spaces. Functional Flow Matching (FFM) handles this by learning a velocity field (via a Fourier Neural Operator, or FNO) that pushes a smooth Gaussian noise process toward real data functions.

However, FFM inherits a quirky flaw from standard flow matching: in every training batch, noise functions and data functions are paired up completely at random. Because two random functions rarely look alike, the model must simultaneously figure out the dataset's shared global structure and bridge massive, arbitrary gaps for each specific pair.

In finite dimensions, we fix this using Optimal Transport (OT)—pairing each noise vector with its closest data vector using standard Euclidean ($L^2$) distance. Lifting OT to infinite-dimensional function spaces, however, is a mathematical minefield (probability densities don't behave nicely without a Lebesgue measure). Worse, a naive, flat $L^2$ grid distance is blind to what makes functions special, such as spatial derivatives in fluid fields or jagged "roughness" in financial paths.

Methods

The authors propose kernel Functional Flow Matching (kFFM). What stays standard is the entire FFM neural-operator backbone, interpolation paths, and generation procedure. What is new is a clever matchmaking step right at the start of each minibatch.

Instead of pairing endpoints randomly or with raw $L^2$ distance, kFFM maps the functions into a Reproducing Kernel Hilbert Space (RKHS)—a mathematical arena where inner products naturally capture complex functional geometry. It then computes a fast, entropically regularized OT plan (via the Sinkhorn algorithm, grounded in the Hilbert Sinkhorn Divergence) using a kernel-induced cost matrix:

  • For PDE fields (Sobolev spaces): They use a Sobolev-RBF or Euclidean-RBF kernel, which compares functions using derivative-aware norms while bounding extreme outliers.
  • For time series (Path spaces): They use the Signature kernel, derived from rough path theory, which captures the geometric shape and order of events in a sequence regardless of time-warping.

Crucially, the neural network never operates inside the RKHS; the kernel is only used to pick better dance partners for the minibatch before standard flow matching takes over. The authors also back this surrogate with three theorems proving uniform boundedness on Banach spaces, an explicit error decomposition, and discretization invariance (meaning the continuum math holds up on finite computer grids).

Datasets

No brand-new datasets are minted here, as the authors test on established benchmarks across two distinct mathematical worlds:

  • Time-Series / Path Space: AEMET (weather), Gene Expression, Maddison Project Economy (GDP/population), and synthetic financial volatility paths from the Heston model.
  • PDE Snapshots / Sobolev Space: 1D Korteweg–de Vries (KdV) waves, 2D incompressible Navier–Stokes fluid flows, their stochastic variants, plus a high-Reynolds-number ($Re \approx 2000$) turbulent 2D Navier–Stokes benchmark added specifically to stress-test the model where smooth mathematical assumptions break down.

Key Insights and Ideas

  • Geometry matters, and one size does not fit all: Injecting domain geometry into the pairing cost changes everything. On path data, flat $L^2$ distance is a terrible matchmaker—its pair rankings correlate poorly with the signature kernel ($0.33\text{--}0.37$). Using the signature kernel prevents the model from destroying temporal structure: naive $L^2$ OT actually produces $66\times$ to $105\times$ worse autocorrelation errors than kFFM on gene and economic sequences.
  • Bounded kernels tame the Sinkhorn solver: Even on smooth PDEs where RBF kernels rank pairs identically to $L^2$, bounding the cost matrix between $0$ and $4B_\kappa$ compresses extreme outliers. This prevents numerical underflow in the Sinkhorn solver, making pairing $8\times$ faster at batch size 512 and cutting end-to-end training time by $15\text{--}25\%$ compared to raw $L^2$ OT.
  • No "straightness" magic required: Finite-dimensional OT-CFM is often praised for straightening flow trajectories for faster sampling. The authors prove that infinite-dimensional Gaussian geometry doesn't actually inherit this straightness property—yet kFFM wins anyway simply by giving the neural operator smaller, structured residuals to regress.

Key Results

Across all eight standard benchmarks, kFFM achieves the best distributional quality (measured by unbiased MMD-RBF) against FFM, functional diffusion (DDPM, DDO/NCSN), adversarial operators (GANO), and finite-dimensional $L^2$ OT.

Table 1: Population-level distributional quality measured by MMD-RBF (lower is better; unbiased estimator, so small negative values occur). “kFFM (selected)” is the per-dataset configuration chosen on a held-out validation split by sliced Wasserstein distance (Appendix C.5); each cell is tagged (cost/base) with Sig = signature kernel, RBF = Euclidean–RBF kernel, Sob-RBF = Sobolev-RBF kernel, gp = Gaussian-process prior, wn = white noise. The kFFM and FFM columns are the matched- seed runs of Table 2 (n as given there); the remaining baselines are averaged over 10 seeds. “Gain (%)” is relative to the strongest non-kFFM baseline in the row and is omitted (–) where that baseline sits at the noise floor of the unbiased estimator (non-positive MMD), where ratios are not meaningful; Table 2 reports paired tests instead.
  • Massive error reductions: Relative to the strongest non-kFFM baseline, kFFM slashes MMD-RBF error by 60.4% on Economy, 60.1% on Gene Expression, and 74.0% on Stochastic KdV. Compared directly to flat-$L^2$ minibatch OT, kFFM lowers distributional error by 75% on Gene Expression and 66% on Economy.
  • Non-kernel & statistical validation: To ensure they aren't "grading on their own curve" with kernel metrics, the authors evaluate Sliced Wasserstein and Marginal-$W_1$ distances, beating FFM by $18\text{--}20\%$ on sequences and $2.9\text{--}4.1\times$ on Navier–Stokes, with statistically significant paired-seed wins across every dataset.
Table 3: Non-kernel metrics for kFFM (selected configuration in parentheses) vs. FFM on the runs of Table 2; lower is better. Sequence rows: mean±std over 10 shared seeds (Economy averages the population and GDP series within each seed), each comparison significant when paired by seed (Wilcoxon p = 0.002); Navier–Stokes rows are means. Appendix Table 16 adds the autocorrelation and log-spectrum errors.
  • Surviving turbulence at low cost: On turbulent Navier–Stokes, diffusion models collapse or miss heavy-tailed physics, while kFFM tracks the true bimodal vorticity distribution ($23\text{--}32\times$ better vorticity-PDF $W_1$ than diffusion/score baselines). Best of all, at the largest $128^2$ grid resolution, the Sinkhorn matchmaking adds just 5–7% end-to-end training overhead.

Limitations and Future Work

The authors are refreshingly candid about where the math stops and empiricism begins:

  • Theory vs. practice: Their theorems guarantee that the kernel-OT surrogate is well-behaved and grid-consistent, not why it yields better samples or faster ODE integration.
  • Saturation in rough turbulence: In turbulent fluids, prior-to-data distances double, pushing smooth RBF kernels into saturation. In that chaotic regime, switching the base noise from a smooth Gaussian Process to white noise actually does more heavy lifting than the kernel choice itself, and all methods still leave headroom on small-scale statistics.
  • Memory bottlenecks on long sequences: Computing the signature kernel requires memory that scales Steeply with sequence length—jumping from $0.63\text{ GB}$ at 100 steps to $12.5\text{ GB}$ at 512 steps—forcing very long time series to fall back on simpler RBF or $L^2$ costs. Future work aims to build custom base measures and true function-space OT formulations tailored for rough, turbulent regimes.

Summary updated

Abstract

Generative models for function-valued data, such as time series and solutions to partial differential equations, must learn distributions over infinite-dimensional spaces rather than over finite-dimensional vectors. Functional Flow Matching (FFM) is a recent extension of Flow Matching to this setting, learning a velocity field whose flow transports a Gaussian prior to the data distribution. However, FFM inherits a structural limitation from standard Flow Matching: in each training batch, prior and data samples are paired independently, so the conditional bridge between them must simultaneously traverse the shared global structure of the dataset and instance-specific residuals. This limitation is more consequential in function space than in finite dimensions: directly formulating optimal transport on function spaces is technically delicate, and a flat Euclidean surrogate ignores the function-space geometry that distinguishes function-valued data. We propose kernel Functional Flow Matching (kFFM), which replaces the independent pairing by entropic optimal transport in a kernel-induced Hilbert space via the Hilbert Sinkhorn Divergence, leaving the FFM neural-operator architecture unchanged. Theoretically, we prove the HSD objective is well-posed on Banach ambient spaces with bounded kernels, derive compact-metric approximation bounds against quadratic-cost OT with an explicit kernel-cost mismatch term, and quantify the gap between the function-space objective and the truncated representation computed on a grid, at a rate governed by data regularity. Empirically, kFFM consistently improves MMD-RBF distributional matching over FFM, diffusion, adversarial, and finite-dimensional OT baselines on time-series and PDE benchmarks, with function-space-aware kernels emerging as the strongest choices on every PDE and path-valued benchmarks.
BibTeX
@inproceedings{xu2026improving,
  author = {Fred Xu and Thomas Markovich and Barbora Barancikova and Yizhou Sun},
  title = {{Improving Function Space Flow Matching with Kernel Optimal Transport}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=QT7iczCUkm},
}
Figure