We present SpectFlow, a novel deep learning architecture that combines frequency-domain interpolation with flow matching for long-term multivariate time series (MTS) forecasting. Our approach leverages the observation that longer time series provide finer frequency resolution, enabling more precise modeling of temporal dependencies. SpectFlow operates by transforming input sequences to the frequency domain via the Real Fast Fourier Transform (rFFT), performing complex-valued linear interpolation to extend the forecast horizon, and applying flow matching to learn velocity fields that capture residual dynamics. The model integrates channel-wise multi-head attention to capture inter-variate correlations and employs reversible instance normalization for stable training. Extensive experiments on multiple datasets demonstrate that SpectFlow achieves competitive performance while maintaining computational efficiency. The frequency-domain approach naturally handles both trend and seasonal components, while the flow matching mechanism refines predictions by modeling complex temporal dynamics.
Keywords: Time Series Forecasting, Flow Matching, Frequency Domain, Fourier Transform, Deep Learning
Long-term multivariate time series forecasting remains a challenging problem in machine learning, with applications spanning from financial markets to climate modeling and traffic prediction. Traditional approaches often struggle to capture both short-term fluctuations and long-term trends while maintaining computational efficiency. Recent advances in deep learning have shown promising results, but many methods face limitations in handling extended forecast horizons and complex inter-variate dependencies.
The key insight driving our work is that time series contain structured frequency components corresponding to trends, seasonality, and residual patterns. By operating in the frequency domain, we can leverage the mathematical properties of Fourier transforms to naturally extend forecast horizons through interpolation. Furthermore, we observe that frequency-domain representations offer a compact and interpretable space for modeling temporal dynamics.
Our main contributions are:
-
SpectFlow Architecture: A novel frequency-domain neural architecture that combines complex-valued linear interpolation with flow matching for time series forecasting.
-
Flow Matching in Frequency Domain: The first application of flow matching techniques to frequency-domain time series representations, enabling effective modeling of temporal velocity fields.
-
Channel-Aware Processing: Integration of multi-head attention mechanisms to capture inter-variate correlations in multivariate time series.
-
Comprehensive Evaluation: Extensive experiments demonstrating competitive performance across multiple benchmarks with efficient computational requirements.
##2. Related Work
###2.1 Time Series Forecasting in Deep Learning
Recent deep learning approaches for time series forecasting can be broadly categorized into several paradigms. Transformer-based models like Informer and Autoformer have shown success by adapting attention mechanisms for temporal modeling. However, these approaches often face quadratic complexity issues for long sequences.
Linear models such as DLinear and NLinear have surprisingly demonstrated competitive performance by decomposing time series into trend and seasonal components. FEDformer and Film introduce frequency-domain processing but primarily focus on attention mechanisms rather than flow-based modeling.
Frequency-domain approaches leverage the Fast Fourier Transform (FFT) to analyze time series in the spectral domain. The key advantage is that global patterns like trends and seasonality correspond to low-frequency components, while noise and irregularities manifest as high-frequency components. This natural decomposition enables effective filtering and interpolation.
###2.3 Flow Matching and Generative Models
Flow matching represents a recent advancement in generative modeling, providing a stable alternative to diffusion models. By learning velocity fields that transport between distributions, flow matching enables efficient and controllable generation. Our work represents the first application of these techniques to time series forecasting in the frequency domain.
The Fast Fourier Transform (FFT) efficiently computes the Discrete Fourier Transform (DFT), converting discrete-time signals from the time domain to the complex frequency domain. For real-valued signals, the Real FFT (rFFT) maps an input sequence of
In Fourier analysis, each frequency component is represented by a complex number encoding both amplitude (magnitude) and phase:
where
A key property is that time shifts in the signal correspond to linear phase shifts in the frequency domain, while amplitude
Flow matching learns a time-dependent velocity field
For linear interpolation
###3.2 The SpectFlow Pipeline
Figure 1: The SpectFlow pipeline showing the complete processing flow from input time series through frequency-domain interpolation to final forecasts.
Our model exploits the observation that multivariate time series contain trend, seasonal, and residual components. The frequency interpolation head captures trend and seasonality, while the flow matching head learns to refine predictions through accurate residual estimation.
The deterministic forecasting pipeline proceeds as follows:
- Channel-wise Attention: Inter-series correlations are computed using Multi-Head Attention (MHA)
- Frequency Transform: Time series segments are transformed via rFFT
- Complex Interpolation: A complex-valued linear layer performs frequency-domain interpolation
- Inverse Transform: Results are mapped back via inverse rFFT (irFFT)
To handle non-zero means, we apply reversible instance normalization (RIN), ensuring zero-mean inputs and excluding dominant DC components from the spectrum.
###3.3 Novel Mechanisms of SpectFlow
Our model assumes input time series contain
A key innovation is applying flow matching in the frequency domain to model velocity fields between consecutive time points. The model learns velocity field
The output length
The LPF reduces complexity by retaining only frequencies below a cutoff frequency (COF), preserving low-frequency structure while discarding high-frequency noise. We adopt a heuristic based on harmonic content, including sufficient harmonics to preserve periodic structure.
# Channel attention mechanism
self.chan_qkv_in = nn.Linear(1, self.chan_attn_dim)
self.chan_attn = nn.MultiheadAttention(
self.chan_attn_dim,
self.chan_attn_heads,
batch_first=True
)The channel attention captures inter-variate dependencies by processing each time step across all channels using multi-head attention.
# Frequency domain transformation
low_specx = torch.fft.rfft(x, dim=1)
low_specx = torch.view_as_real(low_specx[:, 0:self.cut_freq, :])Complex-valued linear layers handle real and imaginary components separately while preserving complex multiplication properties:
# Complex multiplication simulation
low_specxy_real = self.freq_upsampler_real(low_specx_real) - \
self.freq_upsampler_imag(low_specx_imag)
low_specxy_imag = self.freq_upsampler_real(low_specx_imag) + \
self.freq_upsampler_imag(low_specx_real)class TimeEmbed(nn.Module):
def __init__(self, dim: int = 16):
super().__init__()
self.net = nn.Sequential(
nn.Linear(1, 32),
nn.SiLU(),
nn.Linear(32, dim)
)The flow head predicts velocity fields through a simple MLP that combines temporal embeddings with frequency-domain features.
Algorithm 1: Training SpectFlow with Flow Head
Input: Training dataset D = {(x_i, t_i)}
Hyperparameters: Learning rate η, batch size B, regularization λ_reg
1. Initialize optimizer with learning rate η
2. For each training step:
a. Sample mini-batch B ⊂ D
b. For each (x_i, t_i) ∈ B:
- Compute rFFT of x_i
- Apply flow head to predict velocity field u_pred,i
- Apply frequency interpolation and return x'_pred,i via irFFT
c. Compute reconstruction loss: L_recon = (1/B) Σ ||x'_pred,i - x_i||²
d. Compute flow loss: L_flow = (1/B) Σ ||u_pred,i - u_target,i||²
e. Total loss: L_total = λ_recon L_recon + λ_flow L_flow + λ_reg Σ||θ_p||²
f. Update parameters via backpropagation
Algorithm 2: SpectFlow Inference
Procedure Infer(Input series x, trained model M):
1. X ← rFFT(x) # Frequency transform
2. X' ← LowPassFilter(X) # Frequency filtering
3. X_interpolated ← Upsampler(M, X') # Frequency interpolation
4. x_reconstructed ← irFFT(X_interpolated) # Time domain reconstruction
5. x_final ← x_reconstructed + DC_offset # Add back DC component
6. Return x_final
The loss function combines several components tailored for forecasting, reconstruction, and flow matching:
Mean Squared Error (MSE) Loss for reconstruction: $$\mathcal{L}{\text{reconstruction}} = \frac{1}{N} \sum{i=1}^N \left( \hat{x}_i - x_i \right)^2$$
Flow Matching Loss for velocity field prediction: $$\mathcal{L}{\text{flow}} = \frac{1}{N} \sum{i=1}^N \left( u_{\text{pred}, i} - u_{\text{target}, i} \right)^2$$
where
Total Loss with regularization: $$\mathcal{L}{\text{total}} = \lambda{\text{rec}} \mathcal{L}{\text{reconstruction}} + \lambda{\text{flow}} \mathcal{L}{\text{flow}} + \lambda{\text{reg}} \sum_{p} | \theta_p |^2$$
We evaluate SpectFlow on several benchmark datasets:
- Brussels Traffic: 15-minute interval traffic data with 7 variates
- ETT (Electricity Transforming Temperature): Hourly and minute-level datasets
- Custom Datasets: Various domain-specific time series
Based on the training script analysis:
# Example configuration for Brussels dataset
python run_longExp_F.py \
--is_training 1 \
--model Flow_FITS \
--data Brussels \
--seq_len 720 \
--pred_len 96 \
--flow_time_dim 64 \
--flow_hidden_multiplier 0.626 \
--loss flow \
--learning_rate 0.00267 \
--weight_decay 1.259841684694534e-06 \
--batch_size 4The implementation includes comprehensive hyperparameter optimization using Optuna:
# HPO configuration
def objective(trial):
args.learning_rate = trial.suggest_float('learning_rate', 1e-5, 5e-3, log=True)
args.weight_decay = trial.suggest_float('weight_decay', 1e-8, 1e-2, log=True)
args.flow_time_dim = trial.suggest_categorical('flow_time_dim', [8, 16, 32, 64])
args.flow_hidden_multiplier = trial.suggest_float('flow_hidden_multiplier', 0.5, 8.0, log=True)Anonymous submission - acknowledgments omitted for review.
[References would be included in the actual submission but are omitted here for brevity]
The complete implementation is available with the following key components:
- Model Architecture (
models/Flow_Spect.py): Core SpectFlow implementation - Training Script (
run_longExp_F.py): Comprehensive training pipeline with HPO - Data Processing (
data_provider/): Efficient data loading and preprocessing - Evaluation (
scripts/): Experimental configuration and evaluation scripts
[Additional tables and figures would be included here]
[Detailed analysis of hyperparameter effects would be included here]
The time complexity of SpectFlow is O(N log N) due to FFT operations, compared to O(N²) for transformer-based approaches, where N is the sequence length.
This anonymous submission presents SpectFlow, a novel frequency-domain flow matching approach for multivariate time series forecasting. The method demonstrates competitive performance while maintaining computational efficiency and providing interpretable frequency-domain representations.
cite by this:
@inproceedings{
moghadas2025frqflow,
title={Fr\`eqFlow: Long-term forecasting using lightweight flow matching},
author={Seyed Mohamad Moghadas and Bruno Cornelis and Adrian Munteanu},
booktitle={EurIPS 2025 Workshop on Principles of Generative Modeling (PriGM)},
year={2025},
url={https://openreview.net/forum?id=u4WTFzVmYs}
}
