FlexTSF: A Flexible Forecasting Model for Time Series with Variable Regularities
Organizations: L3S Research Center, Leibniz University Hannover, Germany · Nanyang Technological University, Singapore
Abstract
Generalizing across time series with irregular temporal structures poses a persistent challenge for universal time series forecasting models. Existing approaches often assume regular sampling or depend heavily on imputation, which limits their applicability in real-world scenarios where irregularities are prevalent due to diverse sensing devices and recording practices. To address this gap, we propose FlexTSF, a flexible and domain-adaptive forecasting model specifically designed for time series with variable temporal regularities. At its foundation lies the IVP Patcher, a continuous-time patching module leveraging Initial Value Problems (IVPs) to inherently handle uneven sampling intervals, variable sequence lengths, and missing values. Built upon a decoder-only Transformer architecture, FlexTSF integrates normalized timestamp inputs and domain-specific statistical descriptors through a specialized causal self-attention mechanism, enabling adaptability across domains. Extensive experiments on 16 datasets demonstrate FlexTSF's effectiveness, significantly outperforming existing models in classic forecasting scenarios, zero-shot generalization, and low-resource fine-tuning conditions.
Figures & tables
| ForecastPFN | Lag-Llama | DAM | TimesFM | MOIRAI-MoE | Sundial | FlexTSF (Ours) | |
|---|---|---|---|---|---|---|---|
| Tokenization | Point-wise TV | Lag Feature | Point-wise TV | Patch | Patch | Patch | IVP Patcher |
| Architecture | Encoder-Only | Decoder-Only | Encoder-Only | Decoder-Only | Encoder-Only | Decoder-Only | Decoder-Only |
| Forecast | Time Query | Autoregression | Basis Functions | Autoregression | Masked Prediction | Autoregression | Direct Multi-Horizon |
| Variate | Univariate | Univariate | Univariate | Univariate | Multi/Univariate | Univariate | Univariate |
| Probabilistic | ✗ | ✓ | ✗ | ✗ | ✓ | ✓ | ✓ |
| Missing Values | ✗ | ✗ | ✓ | ✗ | ✗ | ✗ | ✓ |
| Notation | Description |
|---|---|
| A time series sample | |
| Number of observations in | |
| Forecast horizon (number of future steps) | |
| Observed value sequence | |
| Observed timestamps | |
| Static vector |
| Dataset | Irreg. | #Var | (s) | Missing rate (%) | Input length | Sampling interval | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Min | Max | Mean | Min | Max | Mean | Min | Max | Mean | ||||
| SaTSM | 13 | 86400 | 0.00 | 0.00 | 0.00 | 8 | 48 | 26 | 1.00 | 335.00 | 12.91 | |
| MetrLA | 207 | 86400 | 0.00 | 63.65 | 3.95 | 4 | 12 | 11 | 3.5e-3 | 3.5e-3 | 3.5e-3 | |
| ArabDigit | 13 | 9.1e-5 | 5.39 | 14.25 | 10.00 | 4 | 41 | 19 | 1.00 | 1.00 | 1.00 | |
| CharTraj | 3 | 0.005 | 5.25 | 17.31 | 10.09 | 30 | 91 | 59 | 1.00 | 1.00 | 1.00 | |
| HAR | 12 | 0.1 | 74.00 | 75.00 | 75.00 | 25 | 25 | 25 | 1.00 | 17.00 | 3.31 | |
| SaTSM | MetrLA | ArabDigit | CharTraj | HAR | eICU | Physio12 | MIMIC4 | ||
| Regular | |||||||||
| DLinear | 0.25 | 0.294 0.001 | 0.365 0.000 | 0.825 0.000 | 0.479 0.001 | 0.621 0.066 | 0.658 0.008 | 0.563 0.042 | 0.733 0.002 |
| 0.50 | 0.372 0.001 | 0.448 0.000 | 0.928 0.001 | 0.615 0.001 | 0.678 0.018 | 0.671 0.005 | 0.599 0.042 | 0.752 0.017 | |
| 1.00 | 0.424 0.000 | 0.571 0.000 | 0.905 0.001 | 0.773 0.003 | 0.686 0.027 | 0.714 0.007 | 0.622 0.028 | 0.802 0.015 | |
| NHiTS | 0.25 | 0.488 0.002 | 1.051 0.002 | 0.925 0.001 | 0.262 0.009 | 0.934 0.009 | 0.976 0.029 | 0.855 0.053 | 0.906 0.009 |
| 0.50 | 0.498 0.002 | 1.041 0.001 | 0.963 0.002 | 0.399 0.000 | 0.930 0.003 | 0.951 0.020 | 0.867 0.052 | 0.903 0.009 | |
| Dataset | Lag‐Llama | TimesFM | MOIRAI-MoE | Sundial | ARIMA | FlexTSF |
|---|---|---|---|---|---|---|
| SaTSM | 0.946 | 0.900 | 0.913 | 0.684 | 0.895 | 0.675 |
| MetrLA | 0.691 | 0.645 | 0.563 | 0.365 | 0.771 | 0.420 |
| ArabDigit | 0.947 | 1.038 | 1.076 | 0.767 | 0.943 | 0.881 |
| CharTraj | 0.513 | 0.908 | 0.637 | 0.541 | 0.619 | 0.414 |
| HAR | 0.464 | 0.681 | 0.350 | 0.550 | 0.685 | 0.242 |
| eICU | 0.710 | 0.915 | 0.878 | 0.604 | 0.944 | 0.593 |
| IVP Patcher | Time Norm | Leader Node | ||||
|---|---|---|---|---|---|---|
| Dataset | MSE | MSE+/- | MSE | MSE+/- | MSE | MSE+/- |
| SaTSM | 0.703 | +4.15% | 0.676 | +0.15% | 0.688 | +1.93% |
| MetrLA | 0.459 | +9.29% | 0.486 | +15.71% | 0.466 | +10.95% |
| ArabDigit | 0.908 | +3.06% | 0.888 | +0.79% | 0.944 | +7.15% |
| CharTraj | 0.544 | +31.40% | 0.535 | +29.23% | 0.519 | +25.36% |
| HAR | 0.291 | +20.25% | 0.245 | +1.24% | 0.248 | +2.48% |
| Model | T-epoch (s) | # Epochs | T-forward (ms) |
|---|---|---|---|
| Latent-ODE | 292.9 | 38.4 | 916 |
| IVP-VAE | 11.2 | 68.0 | 12 |
| ContiFormer | 119.4 | 43.7 | 217 |
| FlexTSF | 15.9 | 34.1 | 23 |