MercerFlow: Flow Matching in a Kernel-Induced Latent Space for Probabilistic Forecasting
Organizations: Applied AI Institute Moscow, Russia
Abstract
Recent work has shown that probabilistic flow matching for time series forecasting benefits from a data-matched prior. The resulting prior introduces local correlations, which a sequential architecture usually absorbs: a recurrent neural network (RNN), a structured state-space model (S4), or a Transformer. However, such a backbone costs GPU memory and time per epoch. A cheaper alternative is MLP-based latent-space flow matching: embed the time series via an invertible map to a single latent vector and learn the flow there, so a tabular MLP can treat the series as a set of features. The relationship between the prior and the choice of linear latent map is understudied in conditional flow matching (CFM) forecasting, yet we found it strongly affects performance. Fixed transforms such as Fourier or discrete cosine (DCT) are only well-conditioned for Ornstein--Uhlenbeck priors, while a principal-component (PCA) map fit to the data is a strong but training-set-dependent reference sensitive to train--test shift. Instead, we propose to use the Mercer eigenbasis of the prior kernel: it diagonalises the centred covariance exactly, decouples from training data, and adapts to non-stationary and periodic priors. On five GluonTS benchmarks (ETTh1, ETTh2, Weather, Electricity, Traffic) under a shared protocol with TSFlow, the resulting MLP matches or beats it on CRPS at about less training memory and -- less time per epoch.
Figures & tables
| Ours | Linear Codec Baselines | Sequential | ||||
|---|---|---|---|---|---|---|
| Metric | Mercer | Fourier | DCT | PCA | Raw | TSFlow (S4) |
| Mean CRPS rank ( ) | ||||||
| # CRPS wins ( ) | ||||||
| Mean MAE rank ( ) | ||||||
| # MAE wins ( ) | ||||||
| Metric / Architecture | ETTh1 | ETTh2 | Weather | Electricity | Traffic |
|---|---|---|---|---|---|
| MLP Time (s, ) | 0.67 | 0.69 | 1.80 | 0.93 | 0.68 |
| S4 Time (s, ) | 2.50 | 2.40 | 7.70 | 4.10 | 2.60 |
| MLP VRAM (GB, ) | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 |
| S4 VRAM (GB, ) | 7.1 | 7.1 | 7.1 | 7.1 | 7.1 |
Appendix figures & tables19 assets
Supplementary material from the paper’s appendix.
Appendix
| Codec | ETTh1 | ETTh2 |
|---|---|---|
| Mercer (Ours) | ||
| Fourier | ||
| DCT | ||
| PCA | ||
| Raw |
| Codec | First-layer Gram Matrix | Jacobi Condition Number Bound |
|---|---|---|
| Identity (Raw) | , increases with length scale | |
| Mercer (Ours) | (exact decorrelation) | |
| Fourier | ||
| DCT | ||
| PCA | Empirical data covariance | Data-dependent (not aligned with prior kernel) |
| Dataset | Raw | Fourier | Mercer | DCT | PCA |
|---|---|---|---|---|---|
| ETTh1 | |||||
| ETTh2 | |||||
| Weather | |||||
| Electricity | |||||
| Traffic |
| Dataset | OU | RBF | Periodic |
|---|---|---|---|
| ETTh1 | |||
| ETTh2 | |||
| Traffic | |||
| Electricity | |||
| Weather |
| Dataset | Kernel | Period | Jitter | |
|---|---|---|---|---|
| ETTh1 | OU | — | ||
| ETTh1 | RBF | — | ||
| ETTh1 | Periodic | |||
| ETTh2 | OU | — | ||
| ETTh2 | RBF | — | ||
| ETTh2 | Periodic |
| Dataset | Length Scale | Runtime Jitter |
|---|---|---|
| ETTh1 | ||
| ETTh2 | ||
| Weather | ||
| Electricity | ||
| Traffic |
| Prior | Mercer | Fourier | Raw | DCT | PCA |
|---|---|---|---|---|---|
| OU | |||||
| Periodic |
| Prior | Learning Rate | Mercer | Fourier | Raw | DCT | PCA |
|---|---|---|---|---|---|---|
| OU | ||||||
| OU | ||||||
| Periodic | ||||||
| Periodic |
| ETTh2 | Weather | Electricity | ETTh1 | Traffic | |
|---|---|---|---|---|---|
| OU NLL | |||||
| Residual |
| Dataset | Raw | Fourier | Mercer | DCT | PCA |
|---|---|---|---|---|---|
| ETTh1 | 1e5 | / | / | / | / |
| ETTh2 | 1e5 | / | / | / | / |
| Weather | 1e4 | / | / | / | / |
| Electricity | 1e3 | / | / | / | / |
| Traffic | 1e3 | / | / | / | / |
| Overall ( ) | Hard ( ) | Easy ( ) | |
|---|---|---|---|
| Test | |||
| Train |
| Method | ETTh1 | ETTh2 | Weather | Electricity | Traffic |
|---|---|---|---|---|---|
| DLinear ( Zeng et al., 2023 ) | |||||
| PatchTST ( Nie et al., 2022 ) | |||||
| DMamba ( Chen and Sun, 2026 ) | |||||
| TSFlow (S4) ( Kollovieh et al., 2025 ) | (5) | (6) | (6) | (6) | (6) |
| Raw | (5) | 13.1 0.2 (1) | (1) | (5) | (5) |
| Fourier | (1) | (1) | (1) | (2) | 8.70 0.09 (1) |
| Method | ETTh1 | ETTh2 | Weather | Electricity | Traffic |
|---|---|---|---|---|---|
| DLinear ( Zeng et al., 2023 ) | |||||
| PatchTST ( Nie et al., 2022 ) | 2.11 0.06 | ||||
| DMamba ( Chen and Sun, 2026 ) | 4.91 0.12 | ||||
| TSFlow (S4) ( Kollovieh et al., 2025 ) | (1) | (6) | (6) | (6) | (6) |
| Raw | (6) | (1) | 10.0 0.2 (1) | (5) | (3) |
| Fourier | (3) | (1) | (1) | (2) | 3.95 0.04 (1) |
| Method | ETTh1 | ETTh2 | Weather | Electricity | Traffic † | |
| CRPS ( , ) | ||||||
| 336 | Raw | 17.77 0.23 | 13.07 0.33 | 3.98 0.05 | 4.43 0.09 | 10.36 0.20 |
| Fourier | 18.07 0.49 | 12.91 0.19 | 3.82 0.02 | 4.51 0.10 | 10.41 0.15 | |
| DCT | 17.81 0.67 | 12.65 0.31 | 3.82 0.02 | 4.49 0.09 | 10.45 0.15 | |
| PCA | 17.93 0.49 | 12.51 0.30 | 3.83 0.03 | 4.49 0.08 | 10.29 0.16 | |
| MercerFlow | 17.82 0.49 | 12.66 0.36 | 3.82 0.03 | 4.52 0.10 | 10.41 0.21 | |
| Dataset | Mercer (Ours) | Fourier | DCT | PCA | Raw |
|---|---|---|---|---|---|
| ETTh1 | |||||
| ETTh2 | |||||
| Weather | |||||
| Electricity | |||||
| Traffic |
| Codec / arm | prior | interp. | Test CRPS ( ) | SGD gap (%) |
|---|---|---|---|---|
| Mercer ( ) | ||||
| Fourier ( ) | ||||
| DCT ( ) | ||||
| Raw ( ) | ||||
| Mercer ( ) | — |
| NFE (Euler Steps) | ||||||
|---|---|---|---|---|---|---|
| Dataset | Method | 4 | 10 | 20 | 50 | 128 |
| ETTh1 | MercerDiff | |||||
| MercerFlow | — | — | ||||
| ETTh2 | MercerDiff | |||||
| MercerFlow | — | — | ||||
| Diagonal Jitter | |||||||
| Metric | Dataset | Codec | |||||
| ( , ) | ETTh1 | Mercer | 23.55 | 30.64 | 29.37 | 47.03 | 334.67 |
| Raw | |||||||
| ETTh2 | Mercer | 62.14 | 74.75 | 95.27 | 524.26 | ||
| Raw | |||||||
| CRPS ( ) | ETTh1 | Mercer | 0.188 | 0.186 | 0.187 | 0.195 | 0.255 |