Flow Matching with Gaussian Process Priors for Probabilistic Time Series Forecasting

## Abstract

Abstract Recent advancements in generative modeling, particularly diffusion models, have opened new directions for time series modeling, achieving state-of-the-art performance in forecasting and synthesis.
However, the reliance of diffusion-based models on a simple, fixed prior complicates the generative process since the data and prior distributions differ significantly.
We introduce TSFlow, a conditional flow matching (CFM) model for time series that simplifies the generative problem by combining Gaussian processes, optimal transport paths, and data-dependent prior distributions.
By incorporating (conditional) Gaussian processes, TSFlow aligns the prior distribution more closely with the temporal structure of the data, enhancing both unconditional and conditional generation.
Furthermore, we propose conditional prior sampling to enable probabilistic forecasting with an unconditionally trained model.
In our experimental evaluation on eight real-world datasets, we demonstrate the generative capabilities of TSFlow, producing high-quality unconditional samples.
Finally, we show that both conditionally and unconditionally trained models achieve competitive results in forecasting benchmarks, surpassing other methods on 6 out of 8 datasets.

## 1 Introduction

Diffusion (Sohl-Dickstein et al., ; Ho et al., ) and score-based generative models (Song et al., ) have demonstrated strong performance in time series analysis, effectively capturing the distribution of time series data in both conditional (Rasul et al., ; Tashiro et al., ; Biloš et al., ; Alcaraz & Strodthoff, ) and unconditional (Kollovieh et al., ) settings.
However, these models typically transform non-i.i.d. distributions of time series data into a simple isotropic Gaussian prior by iteratively adding noise leading to long and complex paths. This can hinder the generative process and potentially limit the models’ performance.

Conditional Flow Matching (CFM) (Lipman et al., ; Tong et al., ) provides an efficient alternative to diffusion models and simplifies trajectories by constructing probability paths based on conditional optimal transport. The model is trained by regressing the flow fields of these paths and can accommodate arbitrary prior distributions. Despite its advantages, the application of CFM to time series forecasting remains unexplored.

In this work, we simplify the trajectories of generative time series modeling through *informed priors*, specifically using Gaussian Processes (GPs) as prior distributions within the CFM framework. By aligning the prior distribution more closely with the underlying temporal dynamics of real-world data, we simplify and shorten the probability paths. This approach not only reduces the complexity of the learned transformations but also enhances the model’s performance in conditional and unconditional generation tasks. Furthermore, we demonstrate how both conditionally trained and unconditionally trained models can be leveraged for probabilistic forecasting. We propose *conditional prior sampling* and demonstrate how to use guidance (Dhariwal & Nichol, ) to bridge the gap between conditional and unconditional generation, allowing for flexible application of unconditional models without the need for conditional training procedures.

Our empirical evaluations show that using conditional GPs as priors improves generative modeling and forecasting performance, surpassing various baselines from different frameworks on multiple datasets. This validates the effectiveness of our approach in simplifying the generative problem and enhancing model versatility.

Our *key contributions* are summarized as follows:

- •
We introduce TSFlow, a novel time series generative model that incorporates conditional Gaussian Processes as informed prior distributions within the Conditional Flow Matching framework.
- •
We demonstrate how these priors simplify the probability paths and improve the generative performance.
- •
We show how to utilize both conditionally trained and unconditionally trained models for forecasting tasks, enhancing the flexibility and applicability of our approach.
- •
Through extensive empirical evaluation, we validate the effectiveness of TSFlow, achieving competitive performance and outperforming existing methods on several benchmark datasets.

## 2 Background: Conditional Flow Matching

Conditional Flow Matching (CFM) was recently introduced as a framework for generative modeling by learning a flow field to transform one distribution into another (Lipman et al., ).
The learned flow field then yields a transformation $\phi_{1}$ that maps a sample $\mathbf{x}_{0}\sim q_{0}$ from a prior distribution $q_{0}$, e.g., an isotropic Gaussian, to a transformed sample $\phi_{1}(\mathbf{x}_{0})$ that follows the data distribution $q_{1}$, i.e., $\phi_{1}(\mathbf{x}_{0})\sim q_{1}$. The flow field $\phi_{t}$ is parametrized through a vector field $u_{\bm{\theta}}$, which is learned in a simple regression task.

### 2.1 Probability Flows

The flow $\phi_{t}(\mathbf{x})$ describes the path of a sample $\mathbf{x}$ following the time-dependent vector field $u_{t}(\mathbf{x}):[0,1]\times\mathbb{R}^{d}\to\mathbb{R}^{d}$ and is itself the solution to the ordinary differential equation

$$ $\mathrm{d}\phi_{t}(\mathbf{x})=u_{t}(\phi_{t}(\mathbf{x}))\,\mathrm{d}t,\qquad \phi_{0}(\mathbf{x})=\mathbf{x}_{0}.$ (1) $$

For a given density $p_{0}$, $\phi_{t}$ induces a time-dependent density called a probability path via the push forward operator $p_{t}(\mathbf{x})\coloneq([\phi_{t}]_{*}p_{0})(\mathbf{x})=p_{0}(\phi_{t}^{-1}
(\mathbf{x}))\,\det[\nicefrac{{\mathrm{d}\phi_{t}^{-1}}}{{\mathrm{d}x}}(
\mathbf{x})]$. Our goal is to find a simple, i.e., short and straight, probability path $p_{t}$ whose boundary probabilities align with our prior and data distribution, i.e., $p_{0}\approx q_{0}$ and $p_{1}\approx q_{1}$.

If we now consider two flows $\phi_{t}$ and $\phi^{\prime}_{t}$, their induced probability paths $p_{t}$ and $p^{\prime}_{t}$ will be equal if their flow fields $u_{t}$ and $u^{\prime}_{t}$ are equal. Consequently, we can train a generative model for a data distribution $q_{1}$ by matching a model $u_{\bm{\theta}}$ to a flow field $u_{t}$ corresponding to a probability path between a prior distribution $q_{0}$ and $q_{1}$.

Lipman et al. () propose to model the marginal probability paths as a mixture of conditional paths, i.e.,

$$ $\displaystyle p_{t}(\mathbf{x})=\int p_{t}(\mathbf{x}\mid\mathbf{z})q(\mathbf{ z})\mathrm{d}\mathbf{z}.$ (2) $$

More specifically, they choose low-variance Gaussian paths centered on each data point $\mathbf{x}_{1}$, i.e., $p_{t}(\mathbf{x}\mid\mathbf{x}_{1})=\mathcal{N}(t\mathbf{x}_{1},(1-(1-\sigma_{
\mathrm{min}}^{2})t)\mathbf{I})$, with $\mathbf{z}=\{\mathbf{x}_{1}\}$ and $q=q_{1}$, which result in an isotropic prior distribution, i.e., $q_{0}=\mathcal{N}(\mathbf{0},\mathbf{I})$.
These conditional probability paths have a closed form for their conditional flow field $u_{t}(\mathbf{x}\mid\mathbf{x}_{1})$.
Furthermore, they show that the marginal flow field arising from these conditional flow fields generates the approximate data distribution $q_{1}$ and derive the Conditional Flow Matching objective:

$$ $\mathcal{L}_{\mathrm{CFM}}({\bm{\theta}})=\operatorname*{\mathbb{E}}\nolimits_ {t\sim\mathcal{U}[0,1],\mathbf{x}_{1}\sim q_{1},\mathbf{x}\sim p_{t}(\mathbf{x }\mid\mathbf{x}_{1})}\lVert u_{\bm{\theta}}(t,\mathbf{x})-u_{t}(\mathbf{x}\mid \mathbf{x}_{1})\rVert^{2}.$ (3) $$

### 2.2 Couplings

Tong et al. () generalize Conditional Flow Matching to encapsulate arbitrary source distributions. This is achieved by including not only samples from the target distribution but also from the source into the conditioning of the probability paths, i.e., $\mathbf{z}=\{\mathbf{x}_{0},\mathbf{x}_{1}\}$. More specifically, they choose

$$ $\displaystyle p_{t}(\mathbf{x}\mid\mathbf{x}_{0},\mathbf{x}_{1})=\mathcal{N}(t \mathbf{x}_{1}-(1-t)\mathbf{x}_{0},\sigma_{\mathrm{min}}^{2}\mathbf{I}),$ (4) $$

satisfying $p_{0}=q_{0}$ and $p_{1}=q_{1}$ for $\sigma_{\mathrm{min}}^{2}\to 0$. The respective conditional vector field is simply the difference of $\mathbf{x}_{1}$ and $\mathbf{x}_{0}$, i.e., $u_{t}(\mathbf{x}\mid\mathbf{x}_{0},\mathbf{x}_{1})=\mathbf{x}_{1}-\mathbf{x}_{0}$ and can be learned as a regression task:

$$ $\displaystyle\mathcal{L}({\bm{\theta}})=\mathbb{E}_{t\sim\mathcal{U}[0,1],( \mathbf{x}_{0},\mathbf{x}_{1})\sim q(\mathbf{x}_{0},\mathbf{x}_{1}),\mathbf{x} \sim p_{t}(\mathbf{x}\mid\mathbf{x}_{0},\mathbf{x}_{1})}\left\lVert u_{\bm{ \theta}}(t,\mathbf{x})-u_{t}(\mathbf{x}\mid\mathbf{x}_{0},\mathbf{x}_{1}) \right\rVert^{2}.$ (5) $$

While the simple choice is to sample $\mathbf{x}_{0}$ and $\mathbf{x}_{1}$ independently, the framework allows for arbitrary joint distributions $q(\mathbf{x}_{0},\mathbf{x}_{1})$ with marginals $q_{0}$ and $q_{1}$.

### 2.3 Mini-Batch Optimal Transport

A natural choice for joint distributions is the optimal transport coupling between source and target distributions.
In practice, however, finding the optimal transport map $\pi$ is only feasible for small datasets.
Instead, propose a mini-batch variant of the algorithm.
For each batch of data $\{\mathbf{x}_{1}^{(i)}\}_{i=1}^{B}$ seen during training, they sample $B$ points $\mathbf{x}_{0}^{(i)}\sim q_{0}$ and then compute $\pi$ between these batches.
This makes finding $\pi$ computationally feasible while retaining the benefits of the optimal transport coupling empirically (Tong et al., ). Choosing $q$ as the optimal transport map $\pi$ between the prior and data distribution makes both training and sampling more efficient by lowering the variance of the objective and straightening the probability paths.

## 3 TSFlow

Figure: Figure 1: Overview of our proposed model TSFlow. To perform forecasting, we first sample $\mathbf{x}_{0}$ conditioned on our observation $\mathbf{y}^{p}$ from $q_{0}$. In an unconditional setting, we do this via Langevin dynamics (see Sec. 3.1.2), while in the conditional model, we can do this by directly using a conditional prior, e.g., a Gaussian process regression (see Sec. 3.2). Given $\mathbf{x}_{0}$, we can now sample from $q_{1}$ by solving its corresponding ODE (see Eq. 1).
Refer to caption: x1.png

In this section, we present our main contributions: (1) TSFlow, a novel flow matching model tailored for probabilistic time series forecasting (see Fig. 1). TSFlow supports both unconditional and conditional generation, i.e., generation without or with partially observed time series. (2) We explore non-i.i.d. prior distributions within the CFM framework and demonstrate that incorporating a Gaussian process prior improves unconditional generation by simplifying the optimal transport problem. Further, (3) we show how an unconditional model can be employed for forecasting by conditioning it during inference via Langevin dynamics and guidance techniques. Finally, (4) we describe how to use data-dependent prior distributions in the form of Gaussian process regression to train TSFlow for conditional forecasting directly.

##### Problem Statement.

Consider a *univariate* time series $\mathbf{y}\in\mathbb{R}^{L}$ of length $L$ from the data distribution $q_{1}(\mathbf{y})$.
We will denote with $(\mathbf{y}^{p}\ \mathbf{y}^{f})=\mathbf{y}$ the split of the time series into an observed past $\mathbf{y}^{p}$ and an unknown future $\mathbf{y}^{f}$ we aim to predict.

Our objective is to capture the conditional distribution $q_{1}(\mathbf{y}\mid\mathbf{y}^{p})$ using a generative model $p_{\bm{\theta}}(\mathbf{y}\mid\mathbf{y}^{p})$. By marginalizing over the noisy time series $\mathbf{x}_{0}$, we decompose the conditional model into a conditional prior and generative process:

$$ $\displaystyle p_{\bm{\theta}}(\mathbf{y}\mid\mathbf{y}^{p})=\int p_{\bm{\theta }}(\mathbf{y}\mid\mathbf{x}_{0},\mathbf{y}^{p})\,q_{0}(\mathbf{x}_{0}\mid \mathbf{y}^{p})\mathrm{d}\mathbf{x}_{0}.$ (6) $$

Choosing $q_{0}$ as an isotropic Gaussian (as in existing diffusion models) neglects to condition the prior on the observed past.
In the following, we describe how TSFlow models both the conditional generative model and the conditional prior.

First, we introduce an unconditional model $p_{\bm{\theta}}(\mathbf{y})$ to capture the data distribution $q_{1}(\mathbf{y})$. During training, this model is unaware of any conditioning information, such as past observations. We then explain how to condition this model and its prior on past observations during inference, resulting in $p_{\bm{\theta}}(\mathbf{y}\mid\mathbf{y}^{p})$ and $q_{0}(\mathbf{x}_{0}\mid\mathbf{y}^{p})$, respectively.

Then, we introduce a conditionally trained model that directly incorporates $\mathbf{y}^{p}$ to model the conditional distribution $p_{\bm{\theta}}(\mathbf{y}\mid\mathbf{y}^{p})$.
To simplify notation, we will use $\mathbf{y}$ instead of $\mathbf{x}_{1}$.
Furthermore, we denote the noisy time series as $\mathbf{x}_{0}$, and its (temporal) past and future $\mathbf{x}_{0}^{\mathbf{p}}$ and $\mathbf{x}_{0}^{\mathbf{f}}$, respectively.

### 3.1 Unconditional Modeling

We begin by modeling the data distribution $q_{1}(\mathbf{y})$ using an unconditional CFM model $p_{\bm{\theta}}(\mathbf{y})$, which is optimized using mini-batch optimal transport couplings (see Sec. 2.3 and Alg. 1) and does not incorporate any conditioning information during training.

To better capture the temporal correlations in the time series $\mathbf{y}$, we explore Gaussian process priors instead of the default isotropic Gaussian distribution.
By aligning the prior distribution $q_{0}$ more closely with the data distribution $q_{1}$, we simplify the optimal transport problem and enhance the model’s ability to learn temporal patterns (Sec. 3.1.1).
Then, we describe how to condition the unconditional model on observed data $\mathbf{y}^{p}$ during inference by incorporating past observations into the generation process via Langevin dynamics and guidance, effectively transforming it into a conditional one (Sec. 3.1.2 and 3.1.3).

#### 3.1.1 Informed Prior Distributions

Previous work by
Tong et al. () have shown that pairing prior and data samples based on the optimal transport map accelerates training, reduces the number of Neural Function Evaluations (NFEs) required during inference, and enhances the model’s performance by shortening the conditional paths and straightening the learned velocity field.

We can further enhance this effect by choosing a domain-specific prior distribution $q_{0}$ closer to the data distribution $q_{1}$ than the standard isotropic Gaussian, yet similarly easy to specify and sample from.
In the context of time series, we propose to employ Gaussian process (GP) priors $\mathcal{GP}(0,K)$ with a kernel function $K(t,t^{\prime})$ (Rasmussen & Williams, ). Gaussian processes are well-suited for modeling time series data because they naturally capture temporal correlations.
By choosing $K$, we can incorporate dataset-specific structures and temporal patterns into the prior without requiring an extensive training process.

We explore three kernel functions that reflect different types of data characteristics: squared exponential (SE), Ornstein-Uhlenbeck (OU), and periodic (PE) kernels, defined respectively as:

$$ $K_{\mathrm{SE}}(t,t^{\prime})=\exp\left(-\frac{d^{2}}{2\ell^{2}}\right),\ K_{ \mathrm{OU}}(t,t^{\prime})=\exp\left(-\frac{|d|}{\ell}\right),\ \text{and}\ K_ {\mathrm{PE}}(t,t^{\prime})=\exp\left(-\frac{2}{\ell^{2}}\sin^{2}(d)\right),$ $$

where $d=t-t^{\prime}$ and $\ell$ is a non-negative parameter that adjusts the length scale of the kernel.

The squared exponential kernel $K_{\mathrm{SE}}$ produces infinitely smooth samples, making it suitable for modeling time series with a high degree of smoothness.
The Ornstein-Uhlenbeck kernel $K_{\mathrm{OU}}$ is closely related to Brownian motion and ideal for modeling data with a rougher structure.
The periodic kernel $K_{\mathrm{PE}}$ captures repeating patterns in the data by modeling the covariance between points as a function of their periodic differences, making it suitable for time series with periodic behavior. We provide samples drawn from these priors in Sec. A.4.

##### Effect on the Optimal Transport Problem.

To understand the effect of the prior distribution, we measure the Wasserstein distance between batches $\{\mathbf{x}_{0}^{(i)}\sim q_{0}\}$ drawn from the prior and batches $\{\mathbf{y}^{(i)}\sim q_{1}\}$ drawn from the data distribution across four common benchmark datasets in time series forecasting.

Figure: Figure 2: Mini-batch Wasserstein $W_{2}^{2}$ distances between samples from prior and data on common benchmark datasets. x-axis shows data dimension in multiples of each dataset’s base period, e.g., 24h for Solar. Distances relative to the transport distance from a random transport map as used in CFM.
Refer to caption: x2.png

Our results in Fig. 2 show that Gaussian process priors reduce the Wasserstein distance between the prior and data distribution if the kernel exploits characteristics of the data.
When we parametrize the prior with SE and OU kernels, the Wasserstein distance to the data distribution decreases substantially, although it slowly converges to an isotropic prior as the sequence length increases.
Notably, the periodic kernel achieves the largest reduction in distance on these datasets with only marginal growth as the sequence length increases because it effectively captures the periodicity — a common feature of real-world time series — especially well.
These findings support our hypothesis that an informed choice of prior distribution can substantially shorten the probability paths and directly affect the difficulty of the learning problem.

#### 3.1.2 Conditional Prior Sampling

To adapt the unconditional model for conditional generation after training, we propose *conditional prior sampling*, which conditions the prior distribution as $q_{0}(\mathbf{x}_{0}\mid\mathbf{y}^{p})$. It is important to note that this only conditions the prior distribution, not the generation process itself, which we discuss in Sec. 3.1.3.

Given an observation $\mathbf{y}^{p}$, we aim to find a corresponding sample $\mathbf{x}_{0}$ from the prior distribution that aligns with it. Formally, this entails sampling from the distribution $q_{0}(\mathbf{x}_{0}\mid\mathbf{y}^{p})$.
If we have access to its score function $\nabla_{\mathbf{x}_{0}}\log q_{0}(\mathbf{x}_{0}\mid\mathbf{y}^{p})$, we can sample from this distribution via Langevin dynamics:

$$ $\displaystyle\mathbf{x}_{0}^{(i+1)}=\mathbf{x}_{0}^{(i)}-\tau\nabla_{\mathbf{x }_{0}}\log q_{0}(\mathbf{x}_{0}^{(i)}\mid\mathbf{y}^{p})+\sqrt{2\tau}\xi_{i} \text{ with }\xi_{i}\sim\mathcal{N}(\mathbf{0},\mathbf{I})$ (7) $$

where $\tau$ is a fixed step size.
With sufficient iterations, Eq. 7 converges to the conditional distribution (see Durmus & Moulines () for a convergence analysis).

By applying Bayes’ rule, we express the conditional score function as:

$$ $\displaystyle\nabla_{\mathbf{x}_{0}}\log q_{0}(\mathbf{x}_{0}\mid\mathbf{y}^{p })=\nabla_{\mathbf{x}_{0}}\log q_{1}(\mathbf{y}^{p}\mid\mathbf{x}_{0})+\nabla_ {\mathbf{x}_{0}}\log q_{0}(\mathbf{x}_{0}).$ (8) $$

Here, the term $\nabla_{\mathbf{x}_{0}}\log q_{1}(\mathbf{y}^{p}\mid\mathbf{x}_{0})$ guides $\mathbf{x}_{0}$ towards evolving into a sample (after solving the ODE) aligning with the observation $\mathbf{y}^{p}$, while the term $\nabla_{\mathbf{x}_{0}}\log q_{0}(\mathbf{x}_{0})$ ensures adherence to the prior distribution’s manifold.

As $q_{0}(\mathbf{x}_{0})$ is a GP, we can compute its likelihood in closed form.
However, the term $q_{1}(\mathbf{y}^{p}\mid\mathbf{x}_{0})$ is unknown and requires more attention.
We follow Kollovieh et al. () and model it as an asymmetric Laplace distribution centered on the output of the flow $\phi_{{\bm{\theta}},1}$ learned by our model:

$$ $q_{1}(\mathbf{y}^{p}\mid\mathbf{x}_{0})=\mathrm{ALD}(\mathbf{y}^{p}\mid\phi_{{ \bm{\theta}},1}(\mathbf{x}_{0}),\kappa),$ (9) $$

leading to the quantile loss after applying the logarithm with quantile $\kappa$. This aligns better with probabilistic forecasting, which is evaluated using distribution-based metrics.
To accelerate the evaluation of the score function, we approximate the integration of the flow field in $\phi_{{\bm{\theta}},1}$ in Eq. 9 using a small number of Euler steps.

By dynamically choosing the number of iterations in the Langevin dynamics, we can control how strongly the sample should resemble the observation. We provide a pseudocode in Alg. 3.

#### 3.1.3 Guided Generation

To perform conditional generation more effectively, we can employ guidance techniques (Dhariwal & Nichol, ) to modify the score function of the model, directly conditioning the generation process on the observed data $\mathbf{y}^{\mathbf{p}}$. Unlike the previous method, where we only conditioned the prior distribution, we now adjust the dynamics of the generation process itself.

We start by modeling the conditional score function using Bayes’ rule, similar to Eq. 8:

$$ $\displaystyle\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t}\mid\mathbf{y}^{p })=\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{y}^{p}\mid\mathbf{x}_{t})+\nabla_ {\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t}).$ (10) $$

Here, the term $\log p_{t}(\mathbf{y}^{p}\mid\mathbf{x}_{t})$ acts as a guidance term that steers the generation process toward producing samples consistent with the observed past $\mathbf{y}^{p}$.

To incorporate this guidance into the generation process, we adjust the vector field $u_{\bm{\theta}}$ by subtracting the guidance score, scaled by a factor $s$:

$$ $\displaystyle\tilde{u}_{\bm{\theta}}(t,\mathbf{x}_{t})=u_{\bm{\theta}}(t, \mathbf{x}_{t})-s\cdot\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{y}^{p}\mid \mathbf{x}_{t}).$ (11) $$

We provide a detailed derivation of $\tilde{u}_{\bm{\theta}}(\mathbf{x}_{t},t)$ in App. C. By integrating this modified vector field $\tilde{u}_{\bm{\theta}}$ over time, we generate samples that are conditioned on the observed data $\mathbf{y}^{\mathbf{p}}$. The parameter $s$ allows us to control the influence of the conditioning, with larger values of $s$ resulting in samples that more closely resemble the observed past. To model the guidance score, we again use an asymmetric Laplace distribution centered around the output of the flow as before:

$$ $p_{t}(\mathbf{y}^{p}\mid\mathbf{x}_{t})=\mathrm{ALD}(\mathbf{y}^{p}\mid\phi_{{ \bm{\theta}},1}(\mathbf{x}_{t}),\kappa),$ (12) $$

where $\kappa$ is a parameter controlling the asymmetry of the distribution.

By incorporating the guidance term into the vector field and appropriately modeling the guidance score, we effectively condition the generation process to produce forecasts consistent with the observed past, enhancing the model’s ability to generate accurate and coherent time series predictions.

### 3.2 Conditional Modeling

TSFlow imposes additional structure on the prior distribution $q_{0}$ in the form of a Gaussian process, a non-parametric time series model.
We build upon this and propose an alternative training and inference approach for conditional generation, i.e., forecasting, with TSFlow.
Instead of only conditioning the sampling process on an observed sample $\mathbf{y}^{p}$, we additionally condition the prior distribution on the observed past data by approximating $q_{0}(\mathbf{x}_{0}\mid\mathbf{y}^{p})$ with $q_{0}(\mathbf{x}_{0}\mid\mathbf{y}^{p})$.

While Tong et al. () couple $\mathbf{x}_{0}$ and $\mathbf{y}$ via the optimal transport map $\pi$ during training (Sec. 2.3), we exploit the GP prior and define the joint distribution as $q(\mathbf{x}_{0},\mathbf{y})=q_{1}(\mathbf{y})\,q_{0}(\mathbf{x}_{0}\mid
\mathbf{y}^{p})$.
We condition the model using equation Eq. 6 during inference.
Consequently, our choice of joint distribution $q(\mathbf{x}_{0},\mathbf{y})$ effectively trains the model with a conditional prior distribution. This aligns the training process with how the model is employed during inference and improves forecasting performance (see Sec. 4.2).

##### Gaussian Process Regression.

Since $q_{0}(\mathbf{x}_{0})$ is a GP, we can compute $q_{0}(\mathbf{x}_{0}\mid\mathbf{y}^{p})$ analytically.
We begin by factorizing the conditional prior as:

$$ $\displaystyle q_{0}(\mathbf{x}_{0}\mid\mathbf{y}^{p})=q_{0}(\mathbf{x}^{p}_{0} \mid\mathbf{y}^{p})\,q_{0}(\mathbf{x}^{f}_{0}\mid\mathbf{y}^{p}),$ $$

which follows by assuming independence of $\mathbf{x}^{p}$ and $\mathbf{x}^{f}$ given $\mathbf{y}^{p}$.
We choose $q_{0}(\mathbf{x}^{p}_{0}\mid\mathbf{y}^{p})=\mathcal{N}(\mathbf{x}^{p}_{0}\mid
\mathbf{y}^{p},{\bm{I}})$ to retain the information from the observation.
For the unobserved future part, we employ GPR to model the conditional distribution (Rasmussen & Williams, ).
Specifically,

$$ $q_{0}(\mathbf{x}^{f}_{0}\mid\mathbf{y}^{p})=\mathcal{N}(\mathbf{x}^{f}_{0}\mid \bm{\mu}_{f\mid p},{\bm{\Sigma}}_{f\mid p}),$ (13) $$

with

$$ $\displaystyle\bm{\mu}_{f\mid p}={\bm{\Sigma}}_{fp}{\bm{\Sigma}}_{pp}^{-1} \mathbf{y}^{p}\quad\text{and}\quad{\bm{\Sigma}}_{f\mid p}={\bm{\Sigma}}_{ff}-{ \bm{\Sigma}}_{fp}{\bm{\Sigma}}_{pp}^{-1}{\bm{\Sigma}}_{pf},$ (14) $$

where ${\bm{\Sigma}}_{ff}=K(f,f)$, ${\bm{\Sigma}}_{fp}=K(f,p)$, ${\bm{\Sigma}}_{pf}$, ${\bm{\Sigma}}_{pp}=K(p,p)$ correspond to covariance matrices computed using the kernel function $K$.

Here, $K(f,f)$ represents the covariance matrix among all future points in the series, indicating how each point in the future relates to others and similarly for $K(p,p)$ among past points.
$K(f,p)$ describes the covariance between future and past points, illustrating how future values are expected to relate to the observed past.
Conversely, $K(p,f)$ is the transpose of $K(f,p)$, reflecting the same relationships but from the perspective of past points relating to future points.

Rather than learning the transformation from an isotropic Gaussian to the data distribution, TSFlow leverages an informed prior simplifying the modeling process by utilizing structured, relevant historical data. Note that this approach introduces only minimal computational overhead, as the covariance matrices are computed just once, and only a single vector-matrix multiplication is required for each new instance. We provide the training algorithm in Alg. 2.

## 4 Experiments

In this section, we present our empirical results and compare TSFlow against various baselines using real-world datasets. Our primary objectives are threefold: First, to determine whether the generative capabilities are competitive to other generative frameworks. Second, to investigate the impact of different prior distributions on the results. Third, to evaluate how TSFlow compares to other models in probabilistic forecasting. Additionally, we aim to explore how conditional prior sampling of the unconditional version of TSFlow fares against its conditionally trained counterpart.

##### Datasets.

We conduct experiments on eight *univariate* time series datasets from various domains and with different frequencies from GluonTS (Alexandrov et al., ). Specifically, we use the datasets Electricity (Dheeru & Taniskidou, ),
Exchange (Lai et al., ),
KDDCup (Godahewa et al., ),
M4-Hourly (Makridakis et al., ),
Solar (Lai et al., ), Traffic (Dheeru & Taniskidou, ), UberTLC-Hourly (FiveThirtyEight, ), and Wikipedia (Gasthaus et al., ). We provide further details about the datasets in Sec. A.1.

##### Baselines.

To benchmark the unconditional performance of TSFlow, our experiments include TimeVAE (Desai et al., ) and TSDiff (Kollovieh et al., ), representing different types of generative models. To assess the forecasting performance of TSFlow, i.e., conditional generation, we compare against various established time series forecasting methods. This includes traditional statistical methods such as Seasonal Naive (SN), AutoARIMA, and AutoETS (Hyndman et al., ). In the domain of deep learning, we evaluate TSFlow against established models including DLinear (Zeng et al., ), DeepAR (Salinas et al., ), TFT (Temporal Fusion Transformers) (Lim et al., ), WaveNet (Oord et al., ), and PatchTST (Nie et al., ). Finally, we extend our comparison to include the four diffusion-based approaches CSDI (Tashiro et al., ), TSDiff (Kollovieh et al., ), SSSD (Alcaraz & Strodthoff, ), and (Biloš et al., ) which represent generative models in probabilistic time series forecasting. We provide more information in Sec. A.3.

##### Evaluation Metrics.

To assess the generative capabilities of TSFlow in an unconditional setting, we calculate the 2-Wasserstein distance between the synthetic and real samples. Specifically, we generate 10,000 samples using our defined context length for this evaluation. Additionally, to compare the quality of the synthetic samples in a downstream task, we employ the *Linear Predictive Score* (LPS) (Kollovieh et al., ), which is defined as the (real) test CRPS of a linear regression model trained on synthetic samples.

To evaluate the probabilistic forecasts, we use the *Continuous Ranked Probability Score* (CRPS) (Gneiting & Raftery, ), defined as

$$ $\text{CRPS}(F^{-1},y)=\int_{0}^{1}2\Lambda_{\kappa}(F^{-1}(\kappa),y)\,\mathrm {d}\kappa,$ $$

where $\Lambda_{\kappa}(q,y)=(\kappa-\mathbbm{1}_{\{y<q\}})(y-q)$ represents the pinball loss at a specific quantile level $\kappa$ and $F$ is the cumulative distribution function of the forecast. CRPS is a proper scoring function that reaches its minimum when the forecast distribution $F$ coincides with the target value $y$. As computing the integral is generally not feasible, we follow previous works (Rasul et al., ; Kollovieh et al., ; Rasul et al., ) and approximate the CRPS using nine uniformly distributed quantile levels $\{0.1,0.2,\dots,0.9\}$. The randomized methods approximate $F$ using 100 samples.

Figure: Figure 3: Architecture of TSFlow. The architecture consists of three residual blocks containing an S4 layer operating across the time dimension. The input to the model are noisy time series $\mathbf{x}_{t}$, the timestep $t$, and in the case of the conditional setup, a condition $\mathbf{c}$, which contains $\mathbf{y}^{p}$ and a binary observation mask. The prediction is the approximated flow field $u_{\bm{\theta}}(t,\mathbf{x}_{t})$.
Refer to caption: x3.png

##### Practical Considerations.

TSFlow uses a DiffWave (Kong et al., ) architecture with S4 layers (Gu et al., ) similar to previous works (Kollovieh et al., ; Alcaraz & Strodthoff, ). We depict the architecture in Fig. 3. The conditional model (see Sec. 3.2) gets an additional input $\mathbf{c}$, which contains $\mathbf{y}^{p}$ and a binary observation mask indicating which steps are observed. We train the model using Adam (Kingma & Ba, ) with a learning rate of ${10}^{-3}$ and gradient clipping set to $0.5$ and use a standard Euler ODE solver. Furthermore, we do not fit the Gaussian processes to the corresponding datasets to keep the prior distributions simple. Finally, we report the mean and standard deviations of five random seeds for all experiments to ensure reproducibility.

### 4.1 Unconditional Generation

We test the unconditional generative capability of TSFlow in three experiments. First, we investigate how well the synthetic samples align with the real data. Then, we train a downstream model on synthetic data and compare it to the performance of the real data. Finally, we test *conditional prior sampling* (see Sec. 3.1.2) to condition TSFlow during inference time.

#### 4.1.1 Generative Capabilities

We follow Tong et al. () and compute the 2-Wasserstein distance of 10,000 synthetic and real samples for TSFlow using different priors to investigate whether the optimal transport problem is simplified with non-homoscedastic distributions while keeping confounders constant. We report the results in Tab. 1.

**Table 1: 2-Wasserstein distance between real and synthetic samples on eight real-world datasets for different generative models and prior distributions. Best scores in bold, second best underlined.**
|  | Method | NFE($\downarrow$) | Electr. | Exchange | KDDCup | M4 (H) | Solar | Traffic | UberTLC | Wiki2000 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|  | TimeVAE | 1 | $3.201$$\pm 0.08$ | $0.034$$\pm 0.005$ | $39.975$$\pm 13.239$ | $7.071$$\pm 0.096$ | $7.537$$\pm 0.092$ | $9.626$$\pm 0.241$ | $79.35$$\pm 16.065$ | $218.764$$\pm 2.021$ |
|  | TSDiff | 100 | $3.112$$\pm 0.32$ | $0.085$$\pm 0.129$ | $29.556$$\pm 1.445$ | $6.095$$\pm 0.292$ | $5.422$$\pm 1.173$ | $7.228$$\pm 0.128$ | $67.281$$\pm 6.992$ | $183.833$$\pm 7.741$ |
| TSFlow | Isotropic | $4$ | $2.931$$\pm 0.246$ | $\underline{0.021}$$\pm 0.010$ | $27.320$$\pm 0.910$ | $6.745$$\pm 0.360$ | $5.059$$\pm 0.376$ | $7.616$$\pm 0.146$ | $63.576$$\pm 0.634$ | $193.809$$\pm 2.701$ |
| OU | $4$ | $2.588$$\pm 0.078$ | $0.037$$\pm 0.018$ | $\mathbf{24.133}$$\pm 0.648$ | $6.203$$\pm 0.183$ | $4.389$$\pm 0.161$ | $7.292$$\pm 0.232$ | $62.038$$\pm 0.897$ | $191.342$$\pm 1.913$ |  |
| SE | $4$ | $2.540$$\pm 0.090$ | $0.035$$\pm 0.016$ | $\underline{24.455}$$\pm 0.954$ | $6.351$$\pm 0.220$ | $\mathbf{4.346}$$\pm 0.126$ | $7.300$$\pm 0.224$ | $\mathbf{61.763}$$\pm 0.511$ | $190.359$$\pm 1.511$ |  |
| PE | $4$ | $\mathbf{2.501}$$\pm 0.091$ | $0.033$$\pm 0.012$ | $25.712$$\pm 0.437$ | $6.353$$\pm 0.184$ | $4.456$$\pm 0.140$ | $7.411$$\pm 0.210$ | $\underline{61.912}$$\pm 0.744$ | $194.178$$\pm 0.938$ |  |
| TSFlow | Isotropic | $16$ | $2.729$$\pm 0.218$ | $\mathbf{0.018}$$\pm 0.008$ | $27.235$$\pm 0.911$ | $6.078$$\pm 0.171$ | $4.584$$\pm 0.106$ | $7.403$$\pm 0.205$ | $62.990$$\pm 0.935$ | $187.921$$\pm 2.688$ |
| OU | $16$ | $2.659$$\pm 0.130$ | $0.029$$\pm 0.015$ | $25.999$$\pm 1.352$ | $\mathbf{5.930}$$\pm 0.124$ | $4.392$$\pm 0.062$ | $\underline{7.177}$$\pm 0.159$ | $64.800$$\pm 2.048$ | $\underline{179.398}$$\pm 4.839$ |  |
| SE | $16$ | $2.615$$\pm 0.100$ | $0.029$$\pm 0.015$ | $26.001$$\pm 1.814$ | $\underline{5.967}$$\pm 0.127$ | $\underline{4.369}$$\pm 0.064$ | $\mathbf{7.147}$$\pm 0.144$ | $63.860$$\pm 2.705$ | $\mathbf{176.837}$$\pm 9.782$ |  |
| PE | $16$ | $\underline{2.532}$$\pm 0.056$ | $0.027$$\pm 0.010$ | $26.501$$\pm 0.920$ | $6.158$$\pm 0.181$ | $4.504$$\pm 0.091$ | $7.202$$\pm 0.097$ | $63.775$$\pm 3.574$ | $186.977$$\pm 1.469$ |  |

We observe that the three domain-specific Gaussian process priors outperform the isotropic prior, except on the datasets Exchange and UberTLC. Furthermore, on most datasets, the non-isotropic prior distributions with 4 NFEs are competitive with the isotropic prior with 16 NFEs. All variations of TSFlow consistently outperform TimeVAE, demonstrating its strong generative capabilities. TSFlow also outperforms TSDiff with 16 NFEs and remains competitive when reducing to 4 NFEs.
These results align with our observations in Fig. 2 and demonstrate that choosing a suitable prior distribution improves unconditional generation.

#### 4.1.2 Training Downstream Models

In addition to the 2-Wasserstein distances, we compute the Linear Predictive Score (LPS), which measures the performance of a linear regression model trained on synthetic samples and evaluated on the real test set. We present these results in Tab. 2.

**Table 2: LPS for different generative models on eight real-world datasets. Best scores in bold, second best underlined.**
|  | Method | Electr. | Exchange | KDDCup | M4 (H) | Solar | Traffic | UberTLC | Wiki2000 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
|  | TimeVAE | $0.161$$\pm 0.013$ | $0.012$$\pm 0.000$ | $5.853$$\pm 0.781$ | $0.053$$\pm 0.007$ | $0.864$$\pm 0.058$ | $0.504$$\pm 0.026$ | $0.754$$\pm 0.092$ | $0.891$$\pm 0.076$ |
|  | TSDiff | $\underline{0.094}$$\pm 0.007$ | 0.010$\pm 0.000$ | $\mathbf{0.651}$$\pm 0.036$ | $0.042$$\pm 0.014$ | $0.634$$\pm 0.009$ | $0.235$$\pm 0.006$ | $0.392$$\pm 0.011$ | $0.369$$\pm 0.027$ |
| TSFlow | Isotropic | $\underline{0.094}$$\pm 0.004$ | $\underline{0.011}$$\pm 0.000$ | $\underline{0.691}$$\pm 0.062$ | $\mathbf{0.032}$$\pm 0.003$ | $\underline{0.608}$$\pm 0.011$ | $\underline{0.233}$$\pm 0.001$ | $\underline{0.345}$$\pm 0.011$ | $\underline{0.337}$$\pm 0.005$ |
| OU | $0.098$$\pm 0.008$ | $\underline{0.011}$$\pm 0.000$ | $0.745$$\pm 0.019$ | $\underline{0.035}$$\pm 0.002$ | $0.618$$\pm 0.009$ | $0.235$$\pm 0.003$ | $0.350$$\pm 0.005$ | $0.342$$\pm 0.011$ |  |
| SE | $0.096$$\pm 0.003$ | $\underline{0.011}$$\pm 0.000$ | $0.748$$\pm 0.022$ | $\underline{0.035}$$\pm 0.003$ | $0.616$$\pm 0.003$ | $0.238$$\pm 0.002$ | $0.351$$\pm 0.007$ | $0.348$$\pm 0.010$ |  |
| PE | $\mathbf{0.090}$$\pm 0.002$ | $\underline{0.011}$$\pm 0.000$ | $0.812$$\pm 0.043$ | $\mathbf{0.032}$$\pm 0.003$ | $\mathbf{0.606}$$\pm 0.008$ | $\mathbf{0.229}$$\pm 0.002$ | $\mathbf{0.337}$$\pm 0.006$ | $\mathbf{0.332}$$\pm 0.004$ |  |

As we observe, all variations of TSFlow consistently outperform TimeVAE and, on four out of eight datasets, also surpass TSDiff. The periodic prior outperforms the other priors, achieving the best scores on six datasets. TSDiff only marginally outperforms TSFlow on the Exchange and KDDCup datasets.

### 4.2 Probabilistic Forecasting

**Table 3: Forecasting results (CRPS) on eight real-world datasets for various statistical and neural methods. Best scores in bold, second best underlined.**
| Method | Electr. | Exchange | KDDCup | M4 (H) | Solar | Traffic | UberTLC | Wiki2000 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| SN | $0.069$$\pm 0.000$ | $0.013$$\pm 0.000$ | $0.561$$\pm 0.000$ | $0.048$$\pm 0.000$ | $0.512$$\pm 0.000$ | $0.221$$\pm 0.000$ | $0.299$$\pm 0.000$ | $0.423$$\pm 0.000$ |
| ARIMA | $0.344$$\pm 0.000$ | $\underline{0.008}$$\pm 0.000$ | $0.514$$\pm 0.000$ | $0.031$$\pm 0.000$ | $0.558$$\pm 0.003$ | $0.486$$\pm 0.000$ | $0.478$$\pm 0.000$ | $0.654$$\pm 0.000$ |
| ETS | $0.055$$\pm 0.000$ | $\underline{0.008}$$\pm 0.000$ | $0.584$$\pm 0.000$ | $0.070$$\pm 0.000$ | $0.550$$\pm 0.000$ | $0.492$$\pm 0.000$ | $0.520$$\pm 0.000$ | $0.651$$\pm 0.000$ |
| DLinear | $0.058$$\pm 0.001$ | $0.015$$\pm 0.004$ | $0.318$$\pm 0.015$ | $0.055$$\pm 0.007$ | $0.794$$\pm 0.027$ | $0.131$$\pm 0.000$ | $0.250$$\pm 0.006$ | $0.259$$\pm 0.002$ |
| DeepAR | $0.051$$\pm 0.000$ | $0.013$$\pm 0.004$ | $0.362$$\pm 0.017$ | $0.045$$\pm 0.013$ | $0.429$$\pm 0.055$ | $0.103$$\pm 0.002$ | $0.168$$\pm 0.002$ | $0.215$$\pm 0.003$ |
| TFT | $0.060$$\pm 0.001$ | $\mathbf{0.007}$$\pm 0.000$ | $0.543$$\pm 0.048$ | $0.038$$\pm 0.002$ | $0.371$$\pm 0.006$ | $0.128$$\pm 0.005$ | $0.202$$\pm 0.009$ | $0.219$$\pm 0.004$ |
| WaveNet | $0.058$$\pm 0.008$ | $0.012$$\pm 0.001$ | $0.305$$\pm 0.018$ | $0.055$$\pm 0.014$ | $0.360$$\pm 0.009$ | $0.099$$\pm 0.002$ | $0.180$$\pm 0.013$ | $\mathbf{0.207}$$\pm 0.003$ |
| PatchTST | $0.055$$\pm 0.001$ | $0.010$$\pm 0.001$ | $0.420$$\pm 0.011$ | $0.034$$\pm 0.004$ | $0.728$$\pm 0.015$ | $0.151$$\pm 0.007$ | $0.219$$\pm 0.004$ | $\underline{0.209}$$\pm 0.001$ |
| CSDI | $0.051$$\pm 0.000$ | $0.013$$\pm 0.001$ | $0.309$$\pm 0.006$ | $0.043$$\pm 0.004$ | $0.360$$\pm 0.006$ | $0.152$$\pm 0.001$ | $0.213$$\pm 0.007$ | $0.318$$\pm 0.012$ |
| SSSD | $\underline{0.048}$$\pm 0.001$ | $0.010$$\pm 0.001$ | $\underline{0.274}$$\pm 0.009$ | $0.050$$\pm 0.007$ | $0.384$$\pm 0.023$ | $0.097$$\pm 0.002$ | $\underline{0.156}$$\pm 0.007$ | $\underline{0.209}$$\pm 0.004$ |
| Biloš et al. () | $0.067$$\pm 0.002$ | $0.012$$\pm 0.004$ | $1.147$$\pm 0.300$ | - | $0.379$$\pm 0.009$ | $0.317$$\pm 0.053$ | $0.450$$\pm 0.086$ | $0.318$$\pm 0.022$ |
| TSDiff | $0.049$$\pm 0.000$ | $0.011$$\pm 0.001$ | $0.311$$\pm 0.026$ | $0.036$$\pm 0.001$ | $\underline{0.358}$$\pm 0.020$ | $0.098$$\pm 0.002$ | $0.172$$\pm 0.005$ | $0.221$$\pm 0.001$ |
| TSFlow-Cond. | $\mathbf{0.045}$$\pm 0.001$ | $0.009$$\pm 0.001$ | $\mathbf{0.273}$$\pm 0.004$ | 0.025$\pm 0.001$ | 0.343$\pm 0.002$ | $\mathbf{0.083}$$\pm 0.000$ | $\mathbf{0.153}$$\pm 0.001$ | $0.227$$\pm 0.000$ |
| TSFlow-Uncond. | $0.049$$\pm 0.001$ | $0.011$$\pm 0.001$ | $0.299$$\pm 0.004$ | $\underline{0.029}$$\pm 0.001$ | $0.464$$\pm 0.004$ | $\underline{0.089}$$\pm 0.000$ | $\mathbf{0.153}$$\pm 0.002$ | $0.279$$\pm 0.007$ |

Figure: Figure 4: Example forecasts and ground truth of TSFlow-Cond. of the first three time series in the test set of Traffic.
Refer to caption: x4.png

We test two variants of TSFlow: a conditional model with domain-specific Gaussian process regression prior (TSFlow-Cond., see Sec. 3.2), and an unconditional model with conditional prior sampling (TSFlow-Uncond., see Sec. 3.1.2). For simplicity, TSFlow-Cond. and TSFlow-Uncond. both use the Ornstein-Uhlenbeck kernel as it performed best in the forecasting setting (see Tab. 9). Tab. 3 shows that TSFlow is competitive with statistical and neural baselines and achieves state-of-the-art results on various datasets. On 6/8 datasets, TSFlow attains the best scores with up to 14% improvement to the second-best method. Furthermore, TSFlow-Cond. outperforms the diffusion-based baselines CSDI, SSSD, (Biloš et al., ), and TSDiff on 7/8 datasets while requiring fewer NFEs. Finally, we observe that, while TSFlow-Uncond. is competitive with other baselines, it is slightly inferior to the conditional version of TSFlow, showing that the conditional training is an effective method to specialize TSFlow for forecasting. We show example forecasts of TSFlow-Cond. on the Traffic dataset in Fig. 4 and for Electricity and Solar in Sec. A.7. Furthermore, we provide an ablation study of TSFlow’s different components in Sec. B.1.

## 5 Related Work

##### Diffusion Models and Conditional Flow Matching.

Diffusion models have been applied to several fields and achieved state-of-the-art performance (Ho et al., ; Hoogeboom et al., ; Lienen et al., ). Various works have demonstrated the effectiveness of unconditional models in conditional tasks through diffusion guidance (Epstein et al., ; Dhariwal & Nichol, ; Bansal et al., ; Nichol et al., ; Avrahami et al., ), solving inverse problems (Kawar et al., ), or iterative resampling (Lugmayr et al., ). Conditional Flow Matching (Lipman et al., ) is a recent approach proposed as an alternative to and generalization of diffusion models. This framework has been extended to incorporate couplings between data and prior samples, and trained to solve the dynamic optimal transport problem (Tong et al., ), and has been further adapted to general geometries (Chen & Lipman, ). Albergo et al. () demonstrated the applicability of data-dependent couplings for stochastic interpolants to improve in-painting and super-resolution image generation. Lastly, recent work shows the potential for conditional generation by solving an optimization problem and differentiating through the flow (Ben-Hamu et al., ).

##### Generative Models for Time Series.

Various generative models have been adapted to time series modeling, including Generative Adversarial Networks (GANs) (Yoon et al., ), normalizing flows (Rasul et al., ; Alaa et al., ), and Variational Autoencoders (VAEs) (Desai et al., ). Recent works have successfully applied diffusion models to time series. The first approach, TimeGrad (Rasul et al., ), applies a diffusion model on top of an LSTM to perform autoregressive multivariate time series forecasting, which was later extended by Biloš et al. () to settings with continuous time and non-isotropic noise distributions. Note that unlike TSFlow, Biloš et al. () neither use optimal transport paths nor couplings. CSDI (Tashiro et al., ) and SSSD (Alcaraz & Strodthoff, ) perform probabilistic forecasting and imputation via conditional diffusion models. While CSDI uses transformer layers for their backbone, SSSD makes use of S4 layers (Gu et al., ) to model temporal dynamics. Lastly, TimeDiff (Shen & Kwok, ) explores conditioning mechanisms, and TSDiff (Kollovieh et al., ) introduced an unconditional diffusion model that allows conditioning during inference time through diffusion guidance.

## 6 Conclusion

In this work, we introduced TSFlow, a novel conditional flow matching model for probabilistic time series forecasting. TSFlow leverages flexible, data-dependent prior distributions and optimal transport paths to enhance unconditional and conditional generative capabilities. Our experiments on eight real-world datasets demonstrated that TSFlow consistently achieves state-of-the-art-performance.

We found that non-isotropic Gaussian process priors, particularly the periodic kernel, often led to better performance than isotropic priors, even with fewer neural function evaluations (NFEs). The conditional version of TSFlow with Gaussian process regression priors showed improvements over diffusion-based approaches, further emphasizing the effectiveness of our proposed methods. Additionally, we demonstrated that the unconditional model can be effectively used in a conditional setting via Langevin dynamics, offering additional flexibility in various forecasting scenarios.

##### Limitations and Future Work.

While TSFlow has demonstrated remarkable performance across multiple benchmarks and reduced the computational costs compared to its diffusion-based predecessors, it has been tested only on univariate time series. Future work could extend this approach to multivariate time series by leveraging multivariate Gaussian processes that capture dependencies across dimensions. Additionally, exploring source distributions with intractable likelihoods, such as neural forecasting methods, might further improve the performance.

## Reproducibility Statement

To ensure the reproducibility of our results, we provide a detailed description of our experimental setup, including the benchmark datasets and evaluation metrics, in Sec. 4. Additionally, we outline the hyperparameters used in Sec. A.2 and include pseudocode for our methods in Sec. A.8.

## Appendix A Experimental Setup and Hyperparameters

### A.1 Datasets

We used eight commonly used datasets and train/test splits from GluonTS (Alexandrov et al., ) encompassing various domains and frequencies. In Tab. 4, we show an overview of the datasets.

**Table 4: Overview of the datasets and their statistics used in our experiments.**
| Dataset | Train Size | Test Size | Domain | Freq. | Median Seq. Length | Prediction Length |
| --- | --- | --- | --- | --- | --- | --- |
| Electricity(^1^11[https://archive.ics.uci.edu/ml/datasets/ElectricityLoadDiagrams20112014](https://archive.ics.uci.edu/ml/datasets/ElectricityLoadDiagrams20112014)) | 370 | 2590 | $\mathbb{R}^{+}$ | H | 5833 | 24 |
| Exchange(^2^22[https://github.com/laiguokun/multivariate-time-series-data](https://github.com/laiguokun/multivariate-time-series-data)) | 8 | 40 | $\mathbb{R}^{+}$ | D | 6071 | 30 |
| KDDCup(^3^33[https://zenodo.org/record/4656756](https://zenodo.org/record/4656756)) | 270 | 270 | $\mathbb{N}$ | H | 10850 | 48 |
| M4 (H)(^4^44[https://github.com/Mcompetitions/M4-methods/tree/master/Dataset](https://github.com/Mcompetitions/M4-methods/tree/master/Dataset)) | 414 | 414 | $\mathbb{N}$ | H | 960 | 48 |
| Solar(^5^55[https://www.nrel.gov/grid/solar-power-data.html](https://www.nrel.gov/grid/solar-power-data.html)) | 137 | 959 | $\mathbb{R}^{+}$ | H | 7009 | 24 |
| Traffic(^6^66[https://zenodo.org/record/4656132](https://zenodo.org/record/4656132)) | 963 | 6741 | $(0,1)$ | H | 4001 | 24 |
| UberTLC(^7^77[https://github.com/fivethirtyeight/uber-tlc-foil-response](https://github.com/fivethirtyeight/uber-tlc-foil-response)) | 262 | 262 | $\mathbb{N}$ | H | 4320 | 24 |
| Wikipedia(^8^88[https://github.com/mbohlkeschneider/gluon-ts/tree/mv_release/datasets](https://github.com/mbohlkeschneider/gluon-ts/tree/mv_release/datasets)) | 2000 | 10000 | $\mathbb{N}$ | D | 792 | 30 |

### A.2 Hyperparameters and training details

We trained both the conditional and unconditional variants of TSFlow using the Adam optimizer with a learning rate of $1\times 10^{-3}$, applying gradient clipping with a threshold of 0.5. The conditional model was trained for 400 epochs, while the unconditional model was trained for 1000 epochs. Each epoch consists of 128 batches, with each batch containing 64 sequences. To stabilize the training process, we employed an Exponential Moving Average (EMA) of the model parameters with a decay rate of $\beta=0.9999$. To parametrize the Gaussian processes, we choose $\ell=\sqrt{\nicefrac{{1}}{{2}}}$, $\ell=1$, and $\ell=\sqrt{2}$, for the SE, OU, and PE kernels, respectively, simplifying these even further.

TSFlow uses a context length equal to the prediction length and includes additional lag features in the feature vector $\mathbf{c}$. Since TSFlow-Uncond. is an unconditional model and does not utilize feature inputs, we increase the context window to 336 for hourly data and 210 for daily data.

The architecture of TSFlow consists of three residual blocks with a hidden dimension of 64, resulting in approximately 176,000 trainable parameters. We encode timesteps using 64-dimensional sinusoidal embeddings (Vaswani et al., ).

To solve the ordinary differential equation (ODE), we utilized an Euler solver with 32 steps. The unconditional version, TSFlow-Uncond., uses 16 additional NFEs due to the additional conditional prior sampling, which involves 4 iterations with 4 steps each. The unconditional version in Tab. 2 uses 4 steps. TSFlow-Uncond. performs four iterations to sample from the prior distribution with a step size of $\tau=0.001$ and a noise scale of $0.01$. The guidance scale parameter is selected between $4$ and $6$ based on the validation set’s performance. Finally, we choose $\kappa$ in the guidance score uniformly between $0.1$ and $0.9$. An overview of the hyperparameters and training details is provided in Table 5.

**Table 5: Hyperparameters of TSFlow.**
| Hyperparameter | Value |
| --- | --- |
| Learning rate | 1e-3 |
| Optimizer | Adam |
| Batch size | 64 |
| Gradient clipping threshold | 0.5 |
| Epochs | 400 / 1000 |
| EMA momentum | 0.9999 |
| Residual blocks | 3 |
| Residual channels | 64 |
| Time Emb. Dim. | 64 |
| ODE Steps | 32 / 16 / 4 |
| ODE Solver | Euler |
| Guidance strength $s$ | 4 / 6 |
| Quantile $\kappa$ | $\mathcal{U}[0.1,0.9]$ |

##### Normalization.

To account for varying magnitudes across time series within the dataset, we normalize each series by dividing its values by the global mean of the training set:

$$ $\mathbf{x}_{\mathbf{p}}^{\mathrm{norm}}=\frac{\mathbf{x}_{\mathbf{p}}}{\mathrm {mean}(\mathbf{x}_{\mathrm{hist}})},$ $$

where $\mathrm{mean}$ denotes the mean aggregation function, and $\mathbf{x}_{\mathrm{hist}}$ encompasses the entire (train) time series beyond the context window.

### A.3 Baselines

We utilize the official implementations provided by the respective authors for CSDI, TSDiff, and Biloš et al. (). Although the original CSDI paper focuses on multivariate time series experiments, their codebase supports univariate forecasting, allowing us to use it without any modifications with their recommended hyperparameters and training setup. For SSSD, we made slight adjustments because their experiments primarily targeted multivariate datasets, whereas our focus is on univariate settings. Specifically, to avoid overfitting, we set the hidden dimension to 64 and the number of residual layers to 3, aligning the network sizes with those of TSDiff and TSFlow. For PatchTST, ARIMA, and ETS, we use AutoGluon (Shchur et al., ). For the remaining baselines, we employ the publicly available implementations in GluonTS (Alexandrov et al., ) with their recommended hyperparameters.

### A.4 Unconditional Priors

Since the observations occur at discrete time steps, i.e., $t_{i}=i$ for $i=0,\dots,L-1$, we normalize them to align with the periodicity of the dataset. More specifically, we adjust the time steps using the formula:

$$ $\displaystyle t_{i}^{\mathrm{norm}}=\frac{t_{i}\cdot\pi}{p},$ (15) $$

where $p$ represents the frequency length of the time series; for instance, 24 for hourly data and 30 for daily data. This normalization scales the time steps so that one full period corresponds to $\pi$, ensuring that the periodic kernel accurately captures the cyclical patterns in the data. Examples of the different processes for various kernels are illustrated in Fig. 5. To avoid numerical issues such as ill-conditioned covariance matrices, we extend each kernel $K$ with a white noise kernel $K_{\mathrm{white}}(t,t^{\prime})=\delta(t-t^{\prime})$ to $K^{\prime}(t,t^{\prime})=K(t,t^{\prime})+K_{\mathrm{white}}(t,t^{\prime})$.
Adding this white noise ensures that the covariance matrix is positive definite and improves numerical stability during computations.

Figure: Figure 5: Examples of samples from the unconditional Gaussian processes for $L=150$ and $p=30$.
Refer to caption: x5.png

### A.5 Conditional Priors

Before applying Gaussian process regression, we apply a frequency-based z-score normalization to the data, which standardizes each segment according to its periodicity. For each data point $\mathbf{x}_{i}$ , the transformation is defined as:

$$ $\displaystyle\mathbf{x}_{i}^{\mathrm{norm}}=\frac{\mathbf{x}_{i}-\mu_{p}}{ \sigma_{p}},$ (16) $$

where $\mu_{p}$ is the mean and $\sigma_{p}$ is the standard deviation computed over segments of length corresponding to the periodicity $p$ of the time series. This normalization ensures that each segment of the data, organized by its periodic frequency, has a mean of zero and a standard deviation of one, aligning the scales across different frequencies within the dataset.

### A.6 Runtime

In Tab. 6, we provide the runtime of TSFlow on the Solar dataset for both training and evaluation on an Nvidia A100 GPU. The evaluation time includes generating 100 sample forecasts for each time series in the dataset, i.e., generating 95900 samples.

**Table 6: Comparison of different configurations with their corresponding training and evaluation times.**
| Configuration | Train - Epoch | Eval. |
| --- | --- | --- |
| TSFlow-Cond. – Isotropic prior | 2.94 | 24.29 |
| TSFlow-Cond. – GPR prior | 3.17 | 24.65 |
| TSFlow-Uncond. – Random | 3.66 | – |
| TSFlow-Uncond. – Optimal Transport | 3.77 | – |
| TSFlow-Uncond. – CPS + Guidance | – | 81.97 |

We observed minimal differences in runtime between the isotropic and Gaussian process regression (GPR) priors. We attribute this minor difference to the computations in Eq. 14. Apart from a single matrix-vector multiplication, all computations only need to be performed once, which minimizes the overhead associated with the GPR prior.

In the unconditional model, we observed a neglectable computational overhead when using optimal transport maps during training. For evaluation, however, it takes approximately three times longer than the standard conditional version for evaluation. We attribute this increase to two factors: the use of a longer context window (see Sec. A.2) and the need to differentiate through the ODE integration process.

### A.7 Additional Forecasts

We show more example forecasts of TSFlow-Cond. on Solar and Electricity in Fig. 6

Figure: (a) Solar
Refer to caption: x6.png

### A.8 Algorithms

#### A.8.1 Training Algorithms for TSFlow

We provide the training algorithm for the unconditional and conditional versions in  Alg. 1 and  Alg. 2.

Figure: Algorithm 1 Unconditional Training of TSFlow

Figure: Algorithm 2 Conditional Training of TSFlow

### A.9 Evaluation Algorithms for TSFlow

We provide a formal description of the conditional prior sampling (see Alg. 3) algorithm in Alg. 3.

Figure: Algorithm 3 Conditional Prior Sampling (without generation)

## Appendix B Additional Results

### B.1 Ablation

#### B.1.1 Conditional Model

In the following, we describe and ablate different components of our conditional model. We use the same experimental setup as described in Sec. A.2. The basemodel corresponds to a basic Conditional Flow Matching model with an isotropic prior distribution.

##### Ornstein Uhlenbeck Prior.

The CFM framework allows one to accommodate arbitrary prior distributions. Instead of using an isotropic Gaussian, we use a Gaussian Process regression based on the Ornstein Uhlenbeck kernel as explained in Sec. 3.2. The results demonstrate an improvement of the CRPS on all datasets, demonstrating the advantage of conditional prior distributions.

##### Lags.

To extend information into the past without increasing the context window, we use lagged values as features. More specifically, we use the default lags deployed by GluonTS (Alexandrov et al., ), which are also used by various baselines.

##### Bidirectional S4 layers.

To allow information flow in both temporal directions, we can employ bidirectional S4 layers. This allows the model to generate consistent forecasts and slightly improves the results.

##### Exponential Moving Average.

To stabilize training, we employ exponential moving average (EMA), which keeps a copy ${\bm{\theta}}^{\prime}$ of the parameters ${\bm{\theta}}$ and is updated via a momentum update after each gradient step:

$$ $\displaystyle{\bm{\theta}}^{\prime}\leftarrow m{\bm{\theta}}^{\prime}+(1-m){ \bm{\theta}},$ $$

where $m$ is a momentum parameter. To generate forecasts, we use the conditional vector field $u_{{\bm{\theta}}^{\prime}}$ instead of $u_{\bm{\theta}}$.

**Table 7: Ablation forecasting results (CRPS) for TSFlow-Cond. on five real-world datasets. Best scores in bold, second best underlined.**
| Method | Electr. | KDDCup | Solar | Traffic | UberTLC |
| --- | --- | --- | --- | --- | --- |
| Basemodel | $0.058$$\pm 0.002$ | $0.302$$\pm 0.010$ | $\underline{0.339}$$\pm 0.008$ | $0.133$$\pm 0.001$ | $0.199$$\pm 0.004$ |
| + OU Prior | $0.049$$\pm 0.000$ | $\mathbf{0.273}$$\pm 0.007$ | $\mathbf{0.333}$$\pm 0.006$ | $0.107$$\pm 0.001$ | $0.161$$\pm 0.004$ |
| + Lags | $\underline{0.046}$$\pm 0.001$ | $0.392$$\pm 0.025$ | $0.356$$\pm 0.017$ | $\underline{0.084}$$\pm 0.001$ | $\underline{0.154}$$\pm 0.002$ |
| + Bidir. | $\underline{0.046}$$\pm 0.001$ | $\underline{0.285}$$\pm 0.010$ | $0.341$$\pm 0.006$ | $\mathbf{0.083}$$\pm 0.000$ | $\mathbf{0.153}$$\pm 0.005$ |
| + EMA | $\mathbf{0.045}$$\pm 0.001$ | $\mathbf{0.273}$$\pm 0.004$ | $0.343$$\pm 0.002$ | $\mathbf{0.083}$$\pm 0.000$ | $\mathbf{0.153}$$\pm 0.001$ |

#### B.1.2 Conditional Prior Sampling

We present the effect of conditional prior sampling (CPS) in Table 8 on the benchmark datasets, comparing it to a model that employs only guidance without CPS.

**Table 8: Effect of the CPS iterations on the forecasting results (CRPS) for TSFlow-Uncond. on eight real-world datasets. Best scores in bold.**
| #It. | Electr. | Exchange | KDDCup | M4Hourly | Solar | Traffic | UberTLC | Wiki2000 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 0 | $\mathbf{0.049}$$\pm 0.001$ | $0.012$$\pm 0.001$ | $0.308$$\pm 0.002$ | $\mathbf{0.029}$$\pm 0.001$ | $\mathbf{0.371}$$\pm 0.006$ | $0.096$$\pm 0.000$ | $0.154$$\pm 0.001$ | $0.290$$\pm 0.004$ |
| 4 | $\mathbf{0.049}$$\pm 0.001$ | $\mathbf{0.011}$$\pm 0.001$ | $\mathbf{0.299}$$\pm 0.004$ | $\mathbf{0.029}$$\pm 0.001$ | $0.464$$\pm 0.004$ | $\mathbf{0.089}$$\pm 0.000$ | $\mathbf{0.153}$$\pm 0.002$ | $\mathbf{0.279}$$\pm 0.007$ |

As shown in the table, on 7 out of 8 datasets, incorporating CPS yields equal or better CRPS scores compared to the model that uses only guidance. The exception is the Solar dataset, where CPS performs worse than the guided-only model. This suggests that solely using guidance is insufficient for effectively conditioning TSFlow-Uncond. during inference.

### B.2 Gaussian Process Regression

We report the forecasting results of the Gaussian process regression in Tab. 9.

**Table 9: Forecasting results (CRPS) of our Gaussian process regression on eight real-world datasets. Best scores in bold, second best underlined.**
| Kernel | Electricity | Exchange | KDDCup | M4(H) | Solar | Traffic | UberTLC | Wiki2000 |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| OU | $\mathbf{0.053}$ | $\mathbf{0.011}$ | $\mathbf{0.364}$ | $\mathbf{0.032}$ | $\underline{0.346}$ | $\mathbf{0.154}$ | $\mathbf{0.205}$ | $\mathbf{0.331}$ |  |
| SE | $\underline{0.055}$ | $\underline{0.013}$ | $\underline{0.395}$ | $\underline{0.037}$ | $\mathbf{0.345}$ | $\underline{0.163}$ | $\underline{0.230}$ | $\underline{0.350}$ |  |
| PE | $0.066$ | $0.017$ | $0.423$ | $0.047$ | $0.456$ | $0.200$ | $0.284$ | $0.409$ |  |

The results show that the Ornstein-Uhlenbeck kernel yields the best forecasts on 7 out of 8 datasets.

## Appendix C Guided Generation

To enable guided generation, we introduce slightly modified conditional probability paths defined as:

$$ $\displaystyle p_{t}(\mathbf{x}_{t}\mid\mathbf{z})=\mathcal{N}\left(\mathbf{x}_ {t};(1-t)\mathbf{x}_{0}+t\mathbf{x}_{1},\left((1-t)\sigma_{\mathrm{max}}^{2}+t \sigma_{\mathrm{min}}^{2}\right)\mathbf{I}\right),$ (17) $$

where $\sigma_{\mathrm{max}}^{2}$ and $\sigma_{\mathrm{min}}^{2}$ are constant variances with $\sigma_{\mathrm{max}}^{2}>\sigma_{\mathrm{min}}^{2}$. Note that when $\sigma_{\mathrm{max}}^{2}=\sigma_{\mathrm{min}}^{2}$, we recover the same probability path as in Sec. 2.2. However, we require $\sigma_{\mathrm{max}}^{2}>\sigma_{\mathrm{min}}^{2}$ to obtain a score function in our vector field.

Using Theorem 3 from Lipman et al. (), we construct the corresponding vector field:

$$ $\displaystyle u_{t}(\mathbf{x}_{t}\mid\mathbf{z})=\mathbf{x}_{1}-\mathbf{x}_{0 }+\frac{\sigma_{\mathrm{min}}^{2}-\sigma_{\mathrm{max}}^{2}}{(1-t)\sigma_{ \mathrm{max}}^{2}+t\sigma_{\mathrm{min}}^{2}}\left(\mathbf{x}_{t}-(1-t)\mathbf {x}_{0}-t\mathbf{x}_{1}\right).$ (18) $$

We observe that the vector field can be expressed using the score function of the conditional probability paths in Eq. 17:

$$ $\displaystyle u_{t}(\mathbf{x}_{t}\mid\mathbf{z})=\mathbf{x}_{1}-\mathbf{x}_{0 }-(\sigma_{\mathrm{min}}^{2}-\sigma_{\mathrm{max}}^{2})\nabla_{\mathbf{x}_{t}} \log p_{t}(\mathbf{x}_{t}\mid\mathbf{z})$ (19) $$

Here, we used the fact that the score function of the Gaussian in Eq. 17 is:

$$ $\displaystyle\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t}\mid\mathbf{z})=- \frac{\mathbf{x}_{t}-(1-t)\mathbf{x}_{0}-t\mathbf{x}_{1}}{(1-t)\sigma_{\mathrm {max}}^{2}+t\sigma_{\mathrm{min}}^{2}}.$ (20) $$

##### Marginal Vector Field.

By integrating over $\mathbf{z}$ we can rewrite the marginal vector field:

$$ $\displaystyle u_{t}(\mathbf{x}_{t})=$ $\displaystyle\int\frac{u_{t}(\mathbf{x}_{t}\mid\mathbf{z})p_{t}(\mathbf{x}_{t} \mid\mathbf{z})q(\mathbf{z})}{p_{t}(\mathbf{x}_{t})}\mathrm{d}\mathbf{z}$ (21) $\displaystyle=$ $\displaystyle\int\frac{(\mathbf{x}_{1}-\mathbf{x}_{0}-(\sigma_{\mathrm{min}}^{ 2}-\sigma_{\mathrm{max}}^{2})\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t} \mid\mathbf{z}))p_{t}(\mathbf{x}_{t}\mid\mathbf{z})q(\mathbf{z})}{p_{t}( \mathbf{x}_{t})}\mathrm{d}\mathbf{z}$ (22) $\displaystyle=$ $\displaystyle\int\frac{(\mathbf{x}_{1}-\mathbf{x}_{0})p_{t}(\mathbf{x}_{t}\mid \mathbf{z})q(\mathbf{z})}{p_{t}(\mathbf{x}_{t})}\mathrm{d}\mathbf{z}-(\sigma_{ \mathrm{min}}^{2}-\sigma_{\mathrm{max}}^{2})\int\frac{\nabla_{\mathbf{x}_{t}} \log p_{t}(\mathbf{x}_{t}\mid\mathbf{z})p_{t}(\mathbf{x}_{t}\mid\mathbf{z})q( \mathbf{z})}{p_{t}(\mathbf{x}_{t})}\mathrm{d}\mathbf{z}$ (23) $\displaystyle=$ $\displaystyle v_{t}(\mathbf{x}_{t})-(\sigma_{\mathrm{min}}^{2}-\sigma_{\mathrm {max}}^{2})\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t}),$ (24) $$

where $v_{t}(\mathbf{x}_{t})$ represents the expected drift term $\mathbb{E}_{\mathbf{z}\mid\mathbf{x}_{t}}\left[\mathbf{x}_{1}-\mathbf{x}_{0}\right]$.

##### Conditional Score Function.

To incorporate the observed past $\mathbf{y}^{p}$, we substitute the score function with its conditional counterpart:

$$ $\displaystyle\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t}\mid\mathbf{y}^{p })=\nabla_{\mathbf{x}_{t}}\log p_{t}(\mathbf{x}_{t})+\nabla_{\mathbf{x}_{t}} \log p_{t}(\mathbf{y}^{p}\mid\mathbf{x}_{t}),$ (25) $$

leading to the following modified vector field:

$$ $\displaystyle\tilde{u}_{t}(\mathbf{x}_{t})=\underbrace{v_{t}(\mathbf{x}_{t})-( \sigma_{\mathrm{min}}^{2}-\sigma_{\mathrm{max}}^{2})\nabla_{\mathbf{x}_{t}} \log p_{t}(\mathbf{x}_{t})}_{=u_{t}(x_{t})}-\underbrace{\lambda(\sigma_{ \mathrm{min}}^{2}-\sigma_{\mathrm{max}}^{2})}_{:=s}\nabla_{\mathbf{x}_{t}}\log p _{t}(\mathbf{y}^{p}\mid\mathbf{x}_{t}),$ (26) $$

where $\lambda$ and $s$ are scaling parameters introduced to control the strength of the conditioning. We can summarize this as:

$$ $\displaystyle\tilde{u}_{t}(\mathbf{x}_{t})=u_{t}(\mathbf{x}_{t})-s\nabla_{ \mathbf{x}_{t}}\log p_{t}(\mathbf{y}^{p}\mid\mathbf{x}_{t}).$ (27) $$

Thus, to sample from the conditional generative model $p_{t}(\mathbf{x}_{t}\mid\mathbf{y}^{p})$, we use the modified vector field $\tilde{u}_{t}(\mathbf{x}_{t})$ from Eq. 27 with our trained vector field $u_{\bm{\theta}}(t,\mathbf{x}_{t})$.

## Peer Reviews

confidence: 2
contribution: 3
initial_rating: 6
presentation: 3
questions: •	The problem only considers the univariate case. Can the model extend to the multivariate time series problem?

•	I want some more explanation about the effectiveness of informed prior distributions. Why does closedness of the prior and data distribution imply easy learning. Do you have any experiments about train efficiency or path efficiency? 

•	Can the given prior (Gaussian process) extend to the arbitrary prior ? for example, refer to [1].

•	Do you have any theoretical evidence about how the selection of kernel functions effect to the model performance? (ex. OU kernel is better when the data follows OU process)

[1] Leveraging Priors via Diffusion Bridge for Time Series Generation, Arxiv24
soundness: 3
strengths: • By utilizing Gaussian process to the conditional flow matching, the model reflects the temporal dependencies of the given time series data better.

• The model enables both unconditional and conditional generations.

• By conditional prior sampling, the unconditionally trained model could follow the given guidance.
summary: The existing diffusion models have problems in the time series generation since the data and prior distributions differ. The authors handle this problem by utilizing conditional flow matching framework. They propose TSFlow, which sets the prior distribution as Gaussian process to make the prior distribution close to the data distribution. Also, they propose conditional prior sampling which makes an unconditionally trained model possible for probabilistic forecasting.
weaknesses: Please refer to the Questions section.

---

confidence: 4
contribution: 2
initial_rating: 6
presentation: 4
questions: - The exact problem statement was a bit unclear to me. In lines 154-156 the authors describe a time series as a vector in $\mathbb{R}^L$. Does this mean that the authors only work on time series having a fixed length $L$, or does the method allow for variable-length time series? Similarly, are the authors assuming that the time series all share a fixed discretization (i.e., there are some fixed times $t_1, \dots, t_L$ corresponding to $y_1, \dots, y_L$), or can the discretization vary across time series? Is this discretization assumed to be uniform, or can it be irregular as well?
- It seems to me that the setup is not limited just to forecasting, but could be applied to general conditional generation tasks, e.g., imputation. Have the authors tried anything beyond forecasting?
soundness: 4
strengths: - The investigation of techniques for conditional sampling is pretty thorough, and I think the proposed methods are quite interesting
- The proposed method obtains fairly strong empirical results, and the empirical evaluation is convincing 
- Throughout the paper is very clear and well-written
summary: This paper studies the use of flow matching for time series forecasting. The authors first propose the use of flow matching techniques for unconditional generation using Gaussian process priors (section 3.1.1), followed by a technique for conditioning an unconditional model by sampling a relevant prior $x_0$ (section 3.1.2) or guidance (section 3.1.3), and finally the authors discuss a technique which uses a data-dependent Gaussian process prior for conditional sampling (section 3.2). The proposed methodology is empirically validated on several univariate time series datasets.
weaknesses: - There is some highly relevant related work that the authors do not discuss. [Functional Flow Matching, AISTATS 2024](https://arxiv.org/abs/2305.17209) proposes the use of GP priors in conjunction with flow matching and studies techniques for forecasting with these models.  Similarly, [Conditional Flow Matching for Time Series Modeling, SPIGM@ICML 2024](https://openreview.net/forum?id=Hqn4Aj7xrQ) uses GPs with flow matching for time series. The authors should cite these works and discuss the differences with their proposed method.
- There are some (relatively minor) clarity issues throughout
     - The use of equation 9 was a bit unclear to me. Why is this specific form of $q_1$ chosen? Some justification for this modeling choice would be good.
     - In Section 3.1.2, I am guessing that once we sample $x_0 \sim q_0(x_0 \mid y^p)$, then we use $x_0$ as an initial condition for the flow model to generate new samples $y \mid x_0$. Is this the case? If so, it would help to state this explicitly somewhere in the paper.
     - In Line 303, the authors write "approximating q_0(x_0 \mid y^p)$ with $q_0(x_0 \mid y^p)$. I think I understand what is meant here, but this seems to be a typo.

---

confidence: 2
contribution: 2
initial_rating: 5
presentation: 2
questions: See above.
soundness: 3
strengths: **Incorporating Gaussian Process Priors:** The main contribution—replacing the typical isotropic Gaussian prior $q(x_0)$ with a data-dependent conditional prior $q(x_0∣y^p)$ is well-motivated. GP priors are naturally suited for time series due to their ability to model temporal dependencies, and this idea is a clear innovation over existing flow matching methods.

**Empirical Performance:** The empirical results show that TSFlow performs well compared to state-of-the-art models across various benchmark tasks.

**Flexibility in Conditional and Unconditional Modeling:** The approach supports both unconditional and conditional generation. While unconditional generation has fewer use cases compared to conditional generation, it is a feature often overlooked in time-series analysis. The ability to use the same model for both tasks—by applying conditioning only during inference—adds versatility to the paper.
summary: This paper introduces TSFlow, a model for probabilistic time series forecasting that enhances generative modeling by incorporating Gaussian Process (GP) priors within the Conditional Flow Matching (CFM) framework. The use of more informative GP priors helps align the prior distribution with the temporal structure of the data, potentially improving both performance and leading to runtime efficiency by simplifying the probability paths. TSFlow is flexible and can be used for both, conditional and unconditional, time-series generation.

The model demonstrates strong performance across several benchmark datasets, but there are aspects of the paper that could benefit from further clarification and improvement. Depending on the author's response, I am willing to increase my score from "weak reject" to "weak accept".
weaknesses: **Majors**

**Difficulty in Parsing for Non-Experts:** The paper assumes substantial familiarity with flow matching and related generative methods, making it challenging for readers without a deep background in these specific techniques. It took for me considerable time to fully grasp the concepts, which suggests that the paper might also be difficult to read for a broader audience.

**Lack of Runtime Analysis:**  The authors propose replacing the isotropic Gaussian prior with a more complex GP prior. Howeer, they do not address the increased computational cost that comes with using GP priors. Although the GP prior is more suited to time-series tasks, this advantage must be weighed against the computational overhead. The paper should clearly state the theoretical runtime complexity of using GP priors and provide empirical runtime comparisons in the experiments. The reduction in NFEs is a positive, but its trade-off with the computational cost of the GP prior must be considered.

**Baseline Comparison:** A simple baseline for the forecasting tasks could involve using  Eq. 6 but with an isotropic Gaussian prior. Please include this method as a comparison partner in Table 3. If it is not a valid approach, it should be explained why such a baseline is excluded.

**Inconsistent Findings on Kernel Choice:** The periodic kernel minimizes the Wasserstein distance in Figure 2, suggesting it aligns well with the data distribution. However, in Table 1, the periodic kernel does not significantly outperform other kernels, and it is not even considered in Table 4.2. This inconsistency is counterintuitive and warrants further discussion. Moreover, the necessity for different hyperparameter choices across tasks (e.g., generative modeling vs. forecasting) weakens the "one model for all" argument, suggesting more task-specific tuning may be required.

**Minors:**

**Missing Experiments on Guided Generation (3.1.3):** I could not find experiments on Guided Generation (3.1.3) in the paper. Where can I find them?

**LPS Score Clarification:** The Linear Predictive Score (LPS) is not sufficiently explained. Please provide more details on how the LPS is calculated, specifically on what the linear model is regressed against and what the output represents.

**GP Hyperparameter Optimization:** You state in your paper that you did not fit the GP hyperparameters. This is somewhat unexpected, I would have had a strong guess that learning the hyperparameters of the GP brings a large benefit to the model. Can you perform a small experiment to evaluate the difference in performance with/without GP hyperparameter optimization?

---

confidence: 3
contribution: 3
initial_rating: 5
presentation: 2
questions: 1. If my understanding is correct, the overall idea of the model is to push an initial GP to the target time-series. Therefore, the sequence length $L$ in the problem formulation section is equivalent to the vector field dimension $d$ in the background section. Can the author(s) kindly confirm if this is true? It would be nice to clarify the setting a little bit. I think the main source of confusion is that there are two time indices in this paper: the time in flow-matching and the time in the time-series, and these are orthogonal to each other. I think this should be made clear somewhere in the paper.

2. Following the first question, it would be nice to indicate in Figure 1 the time-series index and the flow-matching index. Moreover, different notations should be used. (For instance, on line 202-203, $t$ should not be used for the kernel because it has already been used in Eq. (1).)

3. How would the model respond to a growing $L$? That is, there are two subquestions in this query:
	a. What is the time complexity of the model and how does it compare to other models that you benchmarked against?
	b. When $L$ is large, Eq. (6) seems to suffer from the curse of dimensionality and the integral would be impossible to discretize. How does the model see this issue, or is it not relevant?

4. The section "Effect on the Optimal Transport Problem" only considers the distance between sequences but not anything about the training. Can you show some experiments where models that use the periodic kernel are indeed easier to train on tasks that involve periodicity?

5. On line 302-303, you wrote "we additionally condition the prior distribution on the observed past data by approximating $q_0(\mathbf{x}_0 | \mathbf{y}^p)$ with $q_0(\mathbf{x}_0 | \mathbf{y}^p)$." I assume there is a typo. What would be the intended sentence?
soundness: 3
strengths: 1. The model is flexible with many possible options; the informed prior sampling is intuitive.

2. The model shows promising results on univariate benchmark tasks.
summary: This paper proposes a model that uses flow-matching algorithms to generate and forecast univariate time-series. When trained unconditionally, it replaces the isotropic Gaussian prior distribution with an informed one and uses conditional sampling and inferencing. The model itself can also be made conditional. Experiments show that the model surpasses existing ones on benchmark tasks.
weaknesses: 1. The model right now is only discussed and validated on univariate time-series.

2. While there are many proposed options in the model, there lacks an ablation or a comprehensive comparison of different choices. Neither is there any theoretical insights in the proposed model.

3. The presentation of the model needs a bit more clarification. The problem formulation can potentially be expanded a bit more (see questions below). The discussion of different training/inference choices is a bit dense. Maybe some concise pseudocode or flowchart in the main text could be helpful.

Meta-review: This paper introduces a new generative framework for time series forecasting, based on conditional flow matching and leveraging conditional Gaussian Processes as informed priors. By aligning the prior distribution more closely with the data distribution, this approach simplifies the probability paths. In turn, the experimental results demonstrate that this approach helps to improve the generative performance for forecasting.

Overall, the reviewers are highly positive about this work. They emphasize its originality, strong empirical results, and the intuitive nature of the informed prior sampling strategy. The paper is also well written and clearly presented. One limitation is that the approach has primarily been validated on univariate time series problems.

Given the importance of machine learning for time series, this paper makes a valuable contribution. The positive and supportive reviews underline its merit, and I feel that this paper will motivate future work. I therefore recommend accepting this paper.

Decision: Accept (Poster)