Reading + AI

Sundial: A Family of Highly Capable Time Series Foundation Models

Yong Liu, Guo Qin, Zhiyuan Shi, Zhi Chen, Caiyin Yang, Xiangdong Huang, Jianmin Wang, Mingsheng Long

arXiv:2502.00816v4 · This workspace stays on this version. Check arXiv for newer versions

Affiliations and author notes
  • School of Software, BNRist, Tsinghua University. Yong Liu <<liuyong21@mails.tsinghua.edu.cn>>. Guo Qin <<qinguo24@mails.tsinghua.edu.cn>>
  • mingsheng@tsinghua.edu.cn
Some source details need review 11 to check

Original formulas, table values and figures are preserved. Comparison can miss differences; use the original PDF to check details.

Reading view checked: 197 math expressions, 0 rendering failures; 24 of 24 images available.

Compared 116 of 116 source passages against 23 of 23 PDF pages.

  • An unsupported comparison claim was rejected; source verification is incomplete.
  • Additional source conflicts need review; automatic escalation was bounded to four.

HTML S1_p2_1 quotes “Liu et al., 2024a”; the original PDF page 1 quotes “Liu et al., 2024c”. Check PDF page 1

HTML block S2_SS2_p1_1 says “Liu et al., 2024b,” while the original PDF page 2 says “Liu et al., 2024a.” The PDF contradicts the HTML. Check PDF page 2

HTML [S2_SS2_p1_1] cites Timer as “Liu et al., 2024b” and “Liu et al., 2024c”; the original PDF (page 3) reads “Timer (Liu et al., 2024a;b).” Check PDF page 3

HTML S4_p1_1 says “Liu et al. (2024c)”; PDF page 4 says “Liu et al. (2024b)”, so the PDF contradicts the HTML. Check PDF page 4

The Liu et al. citation year differs. Check PDF page 9

The Liu et al. citation year differs. Check PDF page 13

The Liu et al. citation years differ. Check PDF page 13

The Liu et al. citation year differs. Check PDF page 13

The Liu et al. citation years differ. Check PDF page 16

24 of 24 figure, table and graphic images captured. Open original PDF

Abstract

We introduce Sundial, a family of native, flexible, and scalable time series foundation models. To predict the next-patch’s distribution, we propose a TimeFlow Loss based on flow-matching, which facilitates native pre-training of Transformers on continuous-valued time series without discrete tokenization. Conditioned on arbitrary-length time series, our models are pre-trained without specifying any prior distribution and can generate multiple probable predictions, achieving more flexibility in representation learning than using parametric densities. Towards time series foundation models, we leverage minimal but crucial adaptations of Transformers and curate TimeBench with one trillion time points, comprising mostly real-world datasets and synthetic data. By mitigating mode collapse via TimeFlow Loss, we pre-train a family of Sundial models on TimeBench, which achieve unprecedented model capacity and generalization performance. In addition to excellent scalability, Sundial achieves state-of-the-art results on both point and probabilistic forecasting benchmarks with a just-in-time inference speed, i.e., making zero-shot predictions within a few milliseconds. We believe that Sundial’s pioneering generative forecasting capability can improve model reliability in real-world decision-making. Code is available at: https://github.com/thuml/Sundial.

Time series forecasting has fascinated people for thousands of years. Although people have been able to determine the time using instruments like sundials in 3000 BC, time series forecasting is intrinsically non-deterministic (Box et al., 2015). Therefore, generating a variety of probable predictions is crucial for decision-making. The growing demand has facilitated numerous statistical approaches over the past decades (Hyndman, 2018; Box, 2013), which provide high-profile theories and probabilistic tools for making reliable schedules. Recent advancements bring the boom of deftly designed models that automatically learn intricate dynamics and correlations from raw data (Oreshkin et al., 2019; Nie et al., 2022; Zhang and Yan, 2023; Liu et al., 2023a). Despite the impressive performance, deep models necessitate task-specific training on sufficient in-distribution data. Motivated by advances in large models (Bommasani et al., 2021), pre-trained time series foundation models have shown promising capabilities in out-of-distribution tasks (Das et al., 2023b; Liu et al., 2024c; Woo et al., 2024; Ansari et al., 2024).

Figure 1
Figure 1: A native time series model operates on the original series of continuous values. A flexible foundation model is pre-trained without specifying prior distributions. Sundial is the first family of native and flexible time series foundation models.

Current research on time series foundation models has converged on building unified, scalable, and out-of-the-box forecasters, exhibiting zero-shot performance close to or sometimes surpassing supervised methods (Aksu et al., 2024). Notably, Transformers (Radford et al., 2018) are currently the de facto architecture of these models. While pre-trained Transformers with an inherent generative ability have facilitated great success in language, image, and video generation (Ramesh et al., 2021; OpenAI, 2023; Liu et al., 2024a), most time series foundation models are not “generative” or, more specifically, probabilistic forecasters, thereby limiting reliability in decision-making. Although parametric densities specified with prior distributions (Wen et al., 2017; Woo et al., 2024) can be adopted to address uncertainty in time series forecasting, they can reduce the capacity of distributions learned by pre-trained models, especially on time series modality characterized by high heterogeneity. To learn arbitrarily intricate distributions without mode collapse, language modeling (Bengio et al., 2000) that learns the categorical distribution via cross-entropy loss inspires subsequent works (Gruver et al., 2023; Ansari et al., 2024), which treat time series as a foreign language using discrete tokenization. Still, discrepancies between continuous-valued time series and discrete language tokens can lead to out-of-vocabulary issues and coarse-grained prediction intervals.

As shown in Figure 1, Sundial is presented as the first family of generative models among time series foundation models. As foundation models intend to learn complicated distributions from extensive datasets and facilitate transferability across agnostic downstream datasets, we do not specify any prior parametric densities, such as unimodal and multimodal Gaussian mixtures. Instead, we delve into generative modeling to tame Transformers as native, flexible, and scalable time series foundation models. By comparing to denoising diffusion models (Li et al., 2024), we opt for a simple yet effective flow-matching framework (Lipman et al., 2022), which provides notable efficiency and sample quality (Tong et al., 2023). We propose TimeFlow Loss, a parameterized training objective (Zhang et al., 2018) for autoregressive models to learn and sample from each token’s predictive distribution. Optimizing models in the original continuous-valued domain, TimeFlow Loss facilitates patch-level generation and enables fast inference, which is naturally compatible with the time series modality.

In addition to TimeFlow, we enhance the Transformer with minimal but critical adaptations. We develop feasible patch tokenization for arbitrary-length input time series. We adopt RoPE (Su et al., 2024), Pre-LN (Xiong et al., 2020), FlashAttention (Dao et al., 2022), and KV Cache (Pope et al., 2023), which are crucial but generally neglected in the development of time series foundation models. Besides, we pre-train our models by multi-patch prediction to reduce autoregression steps. We realize a rapid generation of multiple samples by reusing a shared lookback representation. Beyond facilitating scalable pre-training, these adaptations help real-time long-context inference and long-term generation.

To validate the scaling law of time series foundation models, we collect and curate TimeBench with an unprecedented volume of a trillion time points. We present Sundial as a family of highly capable foundation models, which achieve state-of-the-art on three large-scale and best-recognized benchmarks, including Time-Series-Library (TSLib) (Wu et al., 2022), GIFT-Eval (Aksu et al., 2024), and FEV (Ansari et al., 2024). Our contributions lie in these aspects:

  • •

    We propose TimeFlow Loss to predict next-patch’s distribution, allowing Transformers to be trained without discrete tokenization and make probable predictions.

  • •

    We present Sundial, a family of scalable and efficient time series foundation models built upon our enhanced Transformer and pre-trained on a trillion time points.

  • •

    Experimentally, Sundial achieves state-of-the-art zero-shot performance on point and probabilistic forecasting benchmarks, including TSLib, GIFT-Eval, and FEV, indicating a promising generative approach for the future improvement of time series foundation models.

Forecasting is essential for decision-making. Advancements in deep learning for time series include theory-inspired deep modules (Wu et al., 2021; Liu et al., 2023b; Wu et al., 2022), architecture-oriented adaptations (Bai et al., 2018; Salinas et al., 2020; Lim et al., 2021), and time series preprocessing (Kim et al., 2021; Nie et al., 2022). Deep models learn the dataset-level distribution and benefit from strong generalization and model capacity. Statistical methods conduct case-by-case fitting on input series, achieving notable performance on small data (Ke et al., 2017; Hyndman, 2018).

One of the efforts towards more capable forecasters focuses on the foundation models (Bommasani et al., 2021), which address data-scarce scenarios by pre-training. More capable models support zero-shot forecasting, making inferences as fast as statistical methods and possessing large model capacity as deep models. Another aspect is to address uncertainty in time series forecasting. There is a growing research emphasis on probabilistic forecasting (Woo et al., 2024; Ansari et al., 2024). While parametric densities can be adopted as training objectives of probabilistic forecasting, they can be too specific to meet the heterogeneity of large-scale datasets, resulting in mode collapse in representation learning and over-smooth predictions (Figure 14-15). In this work, we introduce generative time series foundation models, which naturally address the uncertainty in forecasting.

Recent research has concentrated on building versatile large time series models (Liang et al., 2024). With the advances made in large language models, Transformer has become the dominant architecture. Several works adapt Transformers to address the unique 2D-dimensionality and heterogeneity of time series (Woo et al., 2024; Liu et al., 2024b). Specifically, our work delves into tokenization and optimization. Models such as TimesFM (Das et al., 2023b), Timer (Liu et al., 2024b; Liu et al., 2024c), and Time-MoE (Shi et al., 2024b) embed continuous values and fit unimodal distributions via MSE or quantile loss (Wen et al., 2017). However, prior loss may result in mode collapse because predictive distributions are highly divergent across different domains. Besides, these models cannot provide the confidence level of predictions, limiting reliability for decision-making. Based on continuous tokenization, Moirai (Woo et al., 2024) presents a probabilistic model learning a mixture of distributions, but this prior can still fail to accommodate complex distributions. Inspired by language modeling, Chronos (Ansari et al., 2024) discretizes series via bucket quantization, learning more flexible categorical distributions by cross-entropy. Still, discrete tokenization is applied at each time point, which can lead to long contexts. Also, the final performance can be sensitive to quantization techniques. Unlike before, we tame Transformers as native time series foundation models, learning flexible distributions without discrete tokenization.

By addressing complicated distributions during pre-training, generative modeling has become a focal point in the development of various foundation models (Zhao et al., 2023; Liu et al., 2024a). While this direction for time series mostly focused on time series generation (Tashiro et al., 2021) and task-specific forecasters (Rasul et al., 2021; Shen and Kwok, 2023; Kollovieh et al., 2024), generative modeling for time series foundation models is hardly explored. With the comparable flexibility in distribution learning as language modeling, diffusion denoising (Sohl-Dickstein et al., 2015) and flow-matching (Lipman et al., 2022) have gained increasing prevalence in continuous-valued modalities (Lipman et al., 2024). Compared with diffusion denoising models, flow-matching provides a simple yet efficient framework. With fewer steps involved in the forward and reverse processes, large models based on flow-matching have shown superior performance in image generation (Esser et al., 2024).

Despite the connection in value continuity, generating images and future time series are fundamentally different tasks due to the autoregressive property of forecasting. Our proposed TimeFlow Loss is designed for autoregressive models to conduct conditional generation, which is a parameterized loss function (Zhang et al., 2018) for arbitrary distributions and enhances representation learning of foundation models.

The goal of generative modeling is to learn the underlying probability distribution that generates the data. The framework of flow-matching transforms a sample x0∼p0\mathbf{x}_{0}\sim p_{0} drawn from a source distribution into a sample x1∼p1\mathbf{x}_{1}\sim p_{1} drawn from a target distribution. The transformation is continuous in time. For dd-dimensional distributions, it is defined by a time-dependent velocity field ut:[0,1]×Rd→Rdu_{t}:[0,1]\times\mathbb{R}^{d}\to\mathbb{R}^{d} , which is the solution of the ordinary differential equation (ODE):

ddtψt(x)=ut(ψt(x)) and ψ0(x)=x.\frac{\mathrm{d}}{\mathrm{d}t}\psi_{t}(\mathbf{x})=u_{t}\big(\psi_{t}(\mathbf{x})\big)\ \text{and}\ \psi_{0}(\mathbf{x})=\mathbf{x}.

The velocity field utu_{t} determines a flow ψt\psi_{t}. For all t∈[0,1]t\in[0,1], ψt\psi_{t} generates the probability path ptp_{t} that interpolates p0p_{0} and p1p_{1}, i.e., xt=ψt(x0)∼pt\mathbf{x}_{t}=\psi_{t}\left(\mathbf{x}_{0}\right)\sim p_{t} for x0∼p0\mathbf{x}_{0}\sim p_{0}. The implementation of flow-matching is to train a network utθu^{\theta}_{t} parametrized by θ\theta to fit the velocity field utu_{t}, which is a regression-based task formulated as the Flow-Matching objective:

LFM(θ)=Et,xt∥utθ(xt)−ut(xt)∥2.\mathcal{L}_{\mathrm{FM}}(\theta)=\mathbb{E}_{t,\mathbf{x}_{t}}\left\|u^{\theta}_{t}(\mathbf{x}_{t})-u_{t}(\mathbf{x}_{t})\right\|^{2}.

Furthermore, Lipman et al. (2022) proved the equivalence of optimizing the Conditional Flow-Matching objective:

LCFM(θ)=Et,xt,x1∥utθ(xt)−ut(xt∣x1)∥2.\mathcal{L}_{\mathrm{CFM}}(\theta)=\mathbb{E}_{t,\mathbf{x}_{t},\mathbf{x}_{1}}\left\|u^{\theta}_{t}(\mathbf{x}_{t})-u_{t}(\mathbf{x}_{t}|\mathbf{x}_{1})\right\|^{2}.

Leveraging the conditional optimal-transport (linear) path and a source Gaussian, the objective can be formulated as:

LCFMGauss(θ)=Et,ϵ,x1∥utθ(xt)−(x1−x0)∥2.\mathcal{L}^{\mathrm{Gauss}}_{\mathrm{CFM}}(\theta)=\mathbb{E}_{t,\epsilon,\mathbf{x}_{1}}\left\|u^{\theta}_{t}(\mathbf{x}_{t})-(\mathbf{x}_{1}-\mathbf{x}_{0})\right\|^{2}.
(1)

where t∼U[0,1],x0∼N(0,1)t\sim\mathcal{U}[0,1],\mathbf{x}_{0}\sim\mathcal{N}(0,1) and xt=tx1+(1−t)ϵ\mathbf{x}_{t}=t\mathbf{x}_{1}+(1-t)\epsilon.

Consequently, we can train a generative network on given samples from the target distribution, and generate new samples by applying a push-forward process on samples drawn from a simple source Gaussian distribution:

xt+Δt−xt=utθ(xt)Δt, x0∼N(0,I), t∈[0,1].\mathbf{x}_{t+\Delta t}-\mathbf{x}_{t}=u^{\theta}_{t}(\mathbf{x}_{t})\Delta t,\ \mathbf{x}_{0}\sim\mathcal{N}(\mathbf{0},\mathbf{I}),\ t\in[0,1].
(2)
Figure 2
Figure 2: Overall architecture of Sundial. The input time series is divided into patch tokens, which are embedded from original continuous values. The patch embeddings are fed into a decoder-only Transformer, a stable and speedup version that learns token representations via causal self-attention. The model is optimized using our TimeFlow Loss, a parameterized loss function that models per-token probability distribution conditioned on the learned representations, and generates multiple plausible predictions under the flow-matching framework.

Given a historical observation x1:t={x1,...,xt}x_{1:t}=\{x_{1},...,x_{t}\}, the target of time series forecasting is to predict future time series xt+1:t+f={xt+1,…,xt+f}x_{t+1:t+f}=\{x_{t+1},\dots,x_{t+f}\}. The task can be generally formulated as p(xt+1:t+f∣ht)p(x_{t+1:t+f}|\mathbf{h}_{t}), where ht=fϕ(x1:t)\mathbf{h}_{t}=f_{\phi}(x_{1:t}) is the learned representation from a deep model fϕf_{\phi}. In probabilistic forecasting, explicit optimization objectives are utilized to predict the statistics of future series, e.g., MSE or quantile loss, which have specified pp as a prior distribution. While using one parametric density generally fits well on a small amount of data, it can be the major bottleneck for scaling time series foundation models. Inspired by the success of large generative models (Rombach et al., 2022; OpenAI, 2023; Esser et al., 2024), we introduce generative modeling to realize probabilistic forecasting:

pθ(xt+1:t+f∣ht)=gθ(fϕ(x1:t)).p_{\theta}(x_{t+1:t+f}|\mathbf{h}_{t})=g_{\theta}\big(f_{\phi}({x_{1:t}})\big).
(3)

gθg_{\theta} is a small trainable generative network conditioned on the learned representations of fϕf_{\phi}, which is jointly optimized with fϕf_{\phi}. While the generative model automatically fits the target distribution, it can sample raw predictions and calculating their statistics for probabilistic forecasting. The aim is conceptually related to conformal prediction (Vovk et al., 2005) but models uncertainty beyond prediction intervals.

In this work, we conduct a univariate pre-training paradigm, which adopts the S3 format proposed by Liu et al. (2024c) to address multivariate data. To mitigate value range discrepancy, we conduct normalization on time series individually per variable. Afterwards, we sample varying-length training samples with the maximum context length of 28802880. As a foundation model, Sundial is required to predict on out-of-distribution series with varied lengths during inference.

As shown in Figure 2, the Sundial models consist of three parts: (1) time series tokenization, including a context-level re-normalization and a patch embedding that addresses any-length time series, (2) a Transformer backbone that learns the per-token representation of time series, and (3) TimeFlow Loss, a parameterized loss function to model the per-token distribution and generate raw series during inference. Intuitively, Sundial can be regarded as an ARMA (Auto-Regression and Moving-Average) deep model, i.e., Transformer learns token representations autoregressively. Conditioned on the lookback representations, TimeFlow transforms random noises into non-deterministic predictions.

We adopt stationarization (Liu et al., 2022), a non-parametric two-stage instance normalization conducted within each sample, which is initially proposed to mitigate non-stationarity of time series. Here, it helps to address temporal distribution shift and outlier ranges in input series, improving generalizability for zero-shot forecasting.

Given a univariate time series X={x1,…,xT}\mathbf{X}=\{x_{1},\dots,x_{T}\}, it is divided into patches xi=x1+(i−1)P:iP\mathbf{x}_{i}=x_{1+(i-1)P:iP} with the length of PP. To address non-divisible length, we pad the input at the beginning and use a binary mask mi∈RP\mathbf{m}_{i}\in\mathbb{R}^{P} for each patch to indicate the padded position. It will lead to N=⌈T/P⌉N=\lceil T/P\rceil such input tokens. Subsequently, we use a shared MLP :R2P↦RD:\mathbb{R}^{2P}\mapsto\mathbb{R}^{D} to embed all patch tokens:

hi=PatchEmbed⁡(Concat⁡(xi,mi)),\mathbf{h}_{i}=\operatorname{PatchEmbed}\big(\operatorname{Concat}(\mathbf{x}_{i},\mathbf{m}_{i})\big),
(4)

where hi∈RD\mathbf{h}_{i}\in\mathbb{R}^{D} and DD is the dimension of token embedding. Unlike point-level quantization (Ansari et al., 2024), we reserve original values without discrete quantization. It also reduces the context length (in token) of the Transformer.

Given NN token embeddings {hi}\{\mathbf{h}_{i}\}, we adopt several crucial adaptations on a decoder-only Transformer to obtain per-token representations aggregated from all previous tokens. First, we adapt Pre-LN (Xiong et al., 2020) to improve pre-training stability. Second, we leverage a causal self-attention mechanism with RoPE (Su et al., 2024) that introduces the position information of patch tokens. It can be formulated as follows (the layer index is omitted for simplicity):

Aij=hi⊤WqRΘ,i−jWk⊤hj,Attention⁡(H)=Softmax⁡(Mask⁡(A)d)HWv,\begin{aligned}\displaystyle\mathcal{A}_{ij} & \displaystyle=\mathbf{h}_{i}^{\top}\mathbf{W}_{\mathbf{q}}\mathbf{R}_{\Theta,i-j}\mathbf{W}_{\mathbf{k}}^{\top}\mathbf{h}_{j}, \\ \displaystyle\operatorname{Attention}(\mathbf{H}) & \displaystyle=\operatorname{Softmax}\left(\frac{\operatorname{Mask}(\mathcal{A})}{\sqrt{d}}\right)\mathbf{H}\mathbf{W}_{\mathbf{v}},\end{aligned}
(5)

where Wq,Wk,Wv∈RD×d\mathbf{W}_{\mathbf{q}},\mathbf{W}_{\mathbf{k}},\mathbf{W}_{\mathbf{v}}\in\mathbb{R}^{D\times d} project token embeddings H={hi}\mathbf{H}=\{\mathbf{h}_{i}\} into dd-dimensional queries, keys, and values. RΘ,t∈Rd×d\mathbf{R}_{\Theta,t}\in\mathbb{R}^{d\times d} is the rotary matrix with rotation degree (t⋅Θ)(t\cdot\Theta). Lastly, we implement FlashAttention (Dao et al., 2022) and KV Cache (Pope et al., 2023), since these enhancements for deployment are increasingly emphasized in large foundation models (Shoeybi et al., 2019; Rasley et al., 2020).

Given representations {hi}\{\mathbf{h}_{i}\} extracted by the last layer of the Transformer, we aim to generate length-FF predictions y^i=x^1+iP,F+iP\widehat{\mathbf{y}}_{i}=\widehat{x}_{1+iP,F+iP} at each position ii via our autoregressive model. Motivated by the empirical observation that a larger patch size improves the performance in decoder-only Transformers (Das et al., 2023b) while a small patch size can be more flexible to accommodate data of different frequencies, we adopt multi-patch predictions (F>PF>P) for pre-training, which also reduces the steps of autoregressive inference.

Based on Equations 1 and 3, we formulate a new generative forecasting conditioned on a sequential representation hi\mathbf{h}_{i}:

L(θ,hi)=Et,ϵ,yi∥utθ(yi(t)∣hi)−(yi−yi(0))∥2.\mathcal{L}(\theta,\mathbf{h}_{i})=\mathbb{E}_{t,\epsilon,\mathbf{y}_{i}}\left\|u^{\theta}_{t}\big(\mathbf{y}_{i}^{(t)}|\mathbf{h}_{i}\big)-\big(\mathbf{y}_{i}-\mathbf{y}_{i}^{(0)}\big)\right\|^{2}.
(6)

where yi∈RF\mathbf{y}_{i}\in\mathbb{R}^{F} is the groundtruth value and yi(0)\mathbf{y}_{i}^{(0)} is a FF-dimensional Gaussian noise, tt is sampled from U[0,1]\mathcal{U}[0,1], and yi(t)=tyi+(1−t)yi(0)\mathbf{y}_{i}^{(t)}=t\mathbf{y}_{i}+(1-t)\mathbf{y}_{i}^{(0)} is constructed by the conditional optimal-transport path. It is important to note that the conditional representation hi\mathbf{h}_{i} differs from the conditional path and the conditional source distribution. Instead, hi\mathbf{h}_{i} is a condition of position ii, also a time-invariant condition of the whole flow-matching process t∈[0,1]t\in[0,1]. Technically, we implement the flow-matching network by a small MLP:

utθ(yi(t)∣hi)=FM-Net⁡(yi(t),t,hi).u^{\theta}_{t}\big(\mathbf{y}_{i}^{(t)}|\mathbf{h}_{i}\big)=\operatorname{FM-Net}\big(\mathbf{y}_{i}^{(t)},t,\mathbf{h}_{i}\big).
(7)

The training process involves sampling the noised yi(t)\mathbf{y}_{i}^{(t)}, and jointly input it with tt. The condition hi\mathbf{h}_{i} is integrated into the flow-matching network via AdaLN (Peebles and Xie, 2023). TimeFlow Loss for autoregressive models is formulated as:

LTimeFlow=∑i=1N∥FM-Net⁡(yi(t),t,hi)−(yi−yi(0))∥2.\mathcal{L}_{\mathrm{TimeFlow}}=\sum_{i=1}^{N}\left\|\operatorname{FM-Net}\big(\mathbf{y}_{i}^{(t)},t,\mathbf{h}_{i}\big)-\big(\mathbf{y}_{i}-\mathbf{y}_{i}^{(0)}\big)\right\|^{2}.
(8)

Based on Equation 2, the push-forward process conditioned on a learned representation hi\mathbf{h}_{i} is formulated as

yi(t+Δt)=yi(t)+utθ(yi(t)∣hi)Δt.\mathbf{y}_{i}^{(t+\Delta t)}=\mathbf{y}_{i}^{(t)}+u^{\theta}_{t}\big(\mathbf{y}_{i}^{(t)}|\mathbf{h}_{i}\big)\Delta t.
(9)

Technically, we adopt a KK-step uniform trajectory, and set Δt=1/K\Delta t=1/K. The sampling is done via starting from an initial Gaussian noise and advancing with the velocity generated by the trained FM-Net⁡\operatorname{FM-Net} iteratively, as shown in Algorithm 1.

Algorithm 1 TimeFlow Loss: Sampling
0:  condition hi∈RD\mathbf{h}_{i}\in\mathbb{R}^{D}, path steps KK.
1:  Sample initial noise y^i∼N(0,I)\widehat{\mathbf{y}}_{i}\sim\mathcal{N}(\mathbf{0},\mathbf{I}).
2:  Δt=1/K\Delta t=1/K
3:  for k in {0,1…,K−1} do\textbf{for}\ k\ \textbf{in}\ \{0,1\dots,K-1\}\ \textbf{do}
4:  for y^i←y^i+FM-Net⁡(y^i,kΔt,hi)Δt\widehat{\mathbf{y}}_{i}\leftarrow\widehat{\mathbf{y}}_{i}+\operatorname{FM-Net}\big(\widehat{\mathbf{y}}_{i},k\Delta t,\mathbf{h}_{i}\big)\Delta t
5:  end for
6:  Return: y^i\widehat{\mathbf{y}}_{i}

This procedure generates a predicted sample y^i\widehat{\mathbf{y}}_{i} at position ii. To calibrate probabilistic forecasting results during inference, we repeat this procedure using different initial noises and estimate statistics such as the median and quantiles from a set of generated predictions. We implement an efficient repeated-sampling in the TimeFlow module. The condition (representation) of lookback series is shared and reused for different initial noises, thereby reducing the overhead of repeated forwarding in the Transformer backbone.

We collected and curated TimeBench, which comprises over a trillion time points from various sources, as shown in Figure 3. Several datasets originate from research teams (Woo et al., 2024; Ansari et al., 2024; Liu et al., 2024b; Liu et al., 2024c). While most datasets are collected from real-world records, a small portion (0.05%) is generated synthetically to enhance pattern diversity, following KernelSynth proposed by Ansari et al. (2024). We also leverage substantial meteorological data (Hersbach et al., 2020) because of the predictability of weather systems. Data of different frequencies encompasses common and comprehensive temporal dynamics.

Figure 3
Figure 3: Ratios of data sources in TimeBench, the pre-training corpora of Sundial. Detailed statistics are provide in Table 4.

We evaluate Sundial on best-recognized zero-shot forecasting benchmarks (Section 5.1) and investigate the scaling behavior of Sundial (Section 5.2). We compare TimeFlow with other training objectives (Section 5.3). We delve into test-time calibration of generative forecasters (Section 5.4). We conduct model adaptation of Sundial, i.e., instruction tuning (Section 5.5) and provide in-depth ablation studies to evaluate our modular enhancement (Section 5.6).

Table 1
ModelsSundialSmall\textbf{Sundial}_{\textit{Small}}SundialBase\textbf{Sundial}_{\textit{Base}}SundialLarge\textbf{Sundial}_{\textit{Large}}Time-MoEBase\textbf{Time-MoE}_{\textit{Base}}Time-MoELarge\textbf{Time-MoE}_{\textit{Large}}Time-MoEUltra\textbf{Time-MoE}_{\textit{Ultra}}Timer-XLMoiraiBase\textbf{Moirai}_{\textit{Base}}MoiraiLarge\textbf{Moirai}_{\textit{Large}}ChronosBase\textbf{Chronos}_{\textit{Base}}ChronosLarge\textbf{Chronos}_{\textit{Large}}TimesFM
(Ours)(Ours)(Ours)(2024b)(2024b)(2024b)(2024b)(2024)(2024)(2024)(2024)(2023b)
MetricMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAE
ETTm10.3540.3880.3360.3770.3310.3690.3940.4150.3760.4050.3560.3910.3730.3920.4060.3850.4220.3910.6450.5000.5550.4650.4330.418
ETTm20.2650.3240.2580.3200.2540.3150.3170.3650.3160.3610.2880.3440.2730.3360.3110.3370.3290.3430.3100.3500.2950.3380.3280.346
ETTh10.3900.4180.4110.4340.3950.4200.4000.4240.3940.4190.4120.4260.4040.4170.4170.4190.4800.4390.5910.4680.5880.4660.4730.443
ETTh20.3400.3870.3330.3870.3340.3870.3660.4040.4050.4150.3710.3990.3470.3880.3620.3820.3670.3770.4050.4100.4550.4270.3920.406
ECL0.1690.2650.1690.2650.1660.262------0.1740.2780.1870.2740.1860.2700.2140.2780.2040.273--
Weather0.2330.2710.2340.2700.2380.2750.2650.2970.2700.3000.2560.2880.2560.2940.2870.2810.2640.2730.2920.3150.2790.306--
1st1^{\text{st}} Count72851616010021130206000000
Table 1: Zero-shot forecasting results of time series foundation models on long-term forecasting datasets (Time-Series-Library) (Wu et al., 2022). Corresponding prediction lengths include {96,192,336,720}\{96,192,336,720\}. A lower MSE or MAE indicates a better prediction. Averaged results of four prediction lengths are reported here. 1st1^{\text{st}} Count represents the number of wins achieved by a model under all prediction lengths and datasets. Results of baseline models are officially reported by Shi et al. (2024b). Datasets in pre-training are not evaluated on corresponding models, which are denoted by the dash (−-). Full results under all prediction lengths are provided in Table 9.
View original tableOriginal Table 1
Table 2
TypeStatistical MethodsTask-Specific Models (Superwised)Time Series Foundation Models (Zero-Shot)
ModelNaïveSeasonalAutoAutoDeepARTiDEN-BEATSPTST.iTrans.TimesFMTabPFNChronosMoiraiSundial
NaïveARIMATheta(2020)(2023a)(2019)(2022)(2023a)(2023b)(2025)(2024)(2024)(Ours)
MASE1.2601.0000.9640.9781.2060.9800.8420.7620.8020.6800.7480.7860.8090.673
CRPS1.3831.0000.7701.0510.7210.6520.6890.4960.5240.4650.4800.5510.5150.472
Rank28.07226.17521.51524.03118.93818.55721.38110.05211.3208.2378.26814.30910.1759.062
Table 2: GIFT-Eval comprises 2323 datasets characterized by a variety of frequencies, variate numbers, and prediction lengths. We evaluate zero-shot performance using 100100 generated series, being consistent with Woo et al. (2024). A lower MASE or CRPS indicates a better performance. Rank assigns a numerical ranking of all 9797 configurations. Baseline results are officially reported by Aksu et al. (2024).
View original tableOriginal Table 2

In this section, we focus on zero-shot forecasting, we compare Sundial with advanced time series foundation models on various benchmarks, including (1) point forecasting: we adopt the long-term forecasting benchmark (Wu et al., 2022), which assesses the performance under different forecasting horizons using MSE and MAE; (2) probabilistic forecasting: we experiment on GIFT-Eval (Aksu et al., 2024) and FEV leaderboard (Ansari et al., 2024), following their official evaluation suite and assessing point (MASE) and probabilistic (CRPS and WQL) metrics. All evaluated datasets are excluded from the pre-training dataset. Model is available on HuggingFace1^{1} and configurations are detailed in Table 5.

As shown in Table 1, Sundial consistently outperforms other advanced time series foundation models. Compared with the previous state-of-the-art model Time-MoE (Shi et al., 2024b), the Sundial family using fewer parameters achieves the average MSE reduction of 7.57%7.57\% and averaged MAE reduction of 4.71%4.71\%. Notably, continuous tokenization allows our model to conduct patch-level forecasting with fewer autoregression steps, while Chronos using point-wise discrete tokenization may not be suitable in long-term forecasting.

Figure 4
Figure 4: Model evaluation on the FEV leaderboard, which includes 2727 datasets not seen by Sundial. Baseline models can be categorized into statistical methods fitting on each time series, task-specific deep models trained on each dataset, and pre-trained foundation models. Pre-trained Models that have seen several datasets during pre-training are denoted as Pre-trained Models (Other). A lower MASE/WQL indicates a better result. Sundial makes probabilistic predictions using 2020 generated series, being consistent with Ansari et al. (2024).

Beyond point forecasting, Sundial possesses a unique generative capability for making probabilistic predictions. Following Ansari et al. (2024), we calculate the median and quantiles using a set of raw predictions of Sundial. While several baseline models have been pre-trained by the consistent objective function for probabilistic evaluation, e.g., quantile loss for WQL, Sundial calculates these statistics for evaluation without any prior knowledge.

Aggregated results are presented in Table 2. The benchmark evaluates performance from 2323 datasets and 1313 baseline models, encompassing statistical methods, task-specific models, and time series foundation models. Among supervised models and advanced foundation models, Sundial attains the first place in MASE and second place in CRPS on all unseen datasets. While the top PatchTST (Nie et al., 2022) is exhaustively trained and tweaked on each dataset, the zero-shot performance of Sundial highlights its simplicity and robustness on this comprehensive benchmark.

We evaluate our Sundial on the open leaderboard established by AutoGluon (Ansari et al., 2024), which includes 2727 datasets for probabilistic forecasting. As shown in Figure 4, the zero-shot forecasting performance of Sundial exceeds 70%70\% statistical methods and deep models that are superwisedly trained in distribution. While Sundial is ranked as the second zero-shot pre-trained models after Chronos, Sundial realizes 35×35\times inference speedup as shown in Figure 5. Based on patch-wise tokenization and multi-patch prediction, our inference speed is near to N-BEATS.

Besides, we provide qualitative showcases in Appendix D. TimeFlow can generate highly eventful and coherent temporal patterns with input series. Beyond the mean or quantiles, our model enables the estimation of arbitrary statistics by sampling directly from the predictive distribution.

Figure 5
Figure 5: Inference time evaluation following Ansari et al. (2024), which is averaged from the FEV leaderboard. Computing resources of different models are marked. We plot the logarithmic x-axis.

From Table 1, the larger Sundial model consistently achieves better performance with the scaling of parameters. Beyond downstream performance, we delve into the utilization of model capacity. Figure 6 shows training curves of different sizes. Compared to Sundial (Small), the large version leads to 15.38%15.38\% reduction in the converged training loss, exhibiting promising model capacity of generative forecasters.

Figure 6
Figure 6: Training curves on TimeBench of different model sizes.

Based on the flow-matching framework, TimeFlow Loss allows autoregressive models to learn and generate flexible distributions while enhancing representation learning. To validate the effectiveness of this design, we implement two alternatives: (1) an MLP network and MSE Loss and (2) a parameterized training objective based on the denoising diffusion procedure (Li et al., 2024). We adopt the same parameterized network and Transformer backbone and pre-train them on TimeBench. Since the converged training loss is not comparable across different objective functions, we compare zero-shot performance in Table 3. Despite allowing for sampling predictions, performance using diffusion-based objective is notably inferior to TimeFlow Loss.

Table 3
ObjectiveETTm1ETTm2ETTh1ETTh2ECLWeatherAvg.
TimeFlow0.3360.2580.4110.3330.1690.2340.290
Diffusion0.3620.2650.4440.3600.2020.2520.314
MSE0.3600.2640.4040.3410.1750.2310.296
Table 3: Zero-shot performance using different training objectives. We use the same model configuration and pre-training scale. Averaged MSE of four prediction lengths are reported here.
View original tableOriginal Table 3

In addition to zero-shot performance, we provide showcases for quality evaluations in Appendix D.2. Pre-trained models optimized by the specific MSE Loss can only output a single prediction. And the prediction is sometimes over-smooth due to mode collapse (refer to Appendix C.1). Instead, generative modeling can accommodate significantly different future variations even if their lookback series are similar. We also provide a probablistic metric CRPS to compare different objectives in Table 7, which validate that the predictive distribution modeled by TimeFlow is more coherent and diverse than counterpart training objectives. It benefits downstream tasks by generating multiple plausible predictions, conveys various future possibilities and enhances the reliability of decision-making.

Generative modeling facilitates the flexibility to calibrate the final prediction during inference. Based on the median-based forecasting strategy, i.e., starting from multiple noise of a standard Gaussian and calculating the median of raw predictions, there are two configurations to calibrate final predictions: (1) the number of samples to calculate statistics and (2) sampling steps KK used for flow-matching. Figure 7 shows the results using different configurations.

Figure 7
Figure 7: We show the MASE (left) and WQL (right) on FEV w.r.t. the number of generated raw predictions (top) and the steps to sample a prediction (down). More predictions or more sampling steps generally achieve better probabilistic metrics.

The top two figures conform to the central limit theorem. Generating more samples leads to more calibrated estimation of prediction and confidence interval. The bottom two figures indicate that using fine-grained steps during the push-forward process can leads to more precise predictions.

The trade-off between inference time and performance reveals the potential of test-time calibration, which does not require retraining models. The generative capability of Sundial provides flexibility for various use cases requiring different levels of uncertainty. In our experiments, sampling 2020 predictions with each generated by 5050 steps consumes nearly one second on a CPU, which is notably more efficient than tuning deep models or statistical methods. Advanced strategies of sampling and post-processing of raw prediction leave interesting directions for future exploration.

Inspired by the prevalence of instruction tuning (Wei et al., 2021) that adapts foundation models on a collection of tasks. We fine-tune pre-trained Sundial (Base) on the FEV leaderboard, including short-term tasks with different prediction lengths. Our model is tuned once on all aggregated datasets. We evaluate the performance on unseen test splits (Figure 8). We observe that the performance can be further improved compared to zero-shot forecasting. Furthermore, training from scratch on aggregated datasets results in inferior performance, implying knowledge transfer in pre-trained models.

Figure 8
Figure 8: Performance on the FEV leaderboard, including (1) training Sundial from scratch on all datasets from the FEV leaderboard, (2) zero-shot forecasting using pre-trained Sundial, and (3) fine-tuning once on all datasets from the FEV leaderboard.
Figure 9
Figure 9: Ablation studies with respect to architectural enhancements. We report the averaged results of TSLib datasets (Wu et al., 2022) from four prediction lengths {96,192,336,720}\{96,192,336,720\} and all six datasets. The context length is set to 28802880 and the patch length is 1616.

We conducted several ablation studies that provide insights into the enhancement made to Sundial’s architecture. We evaluate the overall zero-shot performance on TSLib, which covers six different datasets and four prediction lengths.

Prior research (Liu et al., 2024b) observed that the introduction of RoPE (Su et al., 2024) yields better results in supervised forecasting tasks. As shown in Figure 9 (a), RoPE can also improve zero-shot forecasting, presenting a general enhancement for time series foundation models.

Pre-LN (Baevski and Auli, 2018) is widely adopted in large language models (Touvron et al., 2023) due to the training stability. As depicted in Figure 9 (b), training with Pre-LN for more iterations yield better performance. In contrast, training with Post-LN, which is the predominant choice in supervised models, may adversely affect downstream results.

We make it to leverage FlashAttention (Dao et al., 2022) and KV Cache to reduce the computational costs. As shown in Figure 9 (c) and (d), they notably reduce 14.8%14.8\% memory footprint and 43.6%43.6\% inference time without affecting performance.

In this work, we collect and curate TimeBench, a trillion-scale time series dataset for building time series foundation models, which can benefit the research community. Towards time series foundation models, we delve into tokenization and optimization, presenting contributions in two aspects. First, we demonstrate that continuous tokenization, such as patch tokens, can be more effective and efficient for the time series modality, and generative modeling presents a native approach for learning on continuous-valued time series. Second, we propose a novel training objective to accommodate heterogeneous time series distribution. It endows autoregressive models with an inherent capability to sample from non-categorical distribution. Our pre-trained Sundial models make substantial advances on best-recognized forecasting leaderboards. We hope this work can inspire future paradigms for pre-training time series foundation models and enhance their applicability to real-world applications.

This work was supported by the National Natural Science Foundation of China (U2342217 and 62021002), State Grid Ningxia Electric Power Co. Science and Technology Project (SGNXYX00SCJS2400058), and the BNRist Innovation Fund (BNR2024RC01010), the National Engineering Research Center for Big Data Software.

We extend our gratitude to Xingzhuo Guo for his expertise in flow-matching and meticulous proofreading of the method section. We further thank Jialong Wu, Yuezhou Ma and Yu Zhang for insightful discussions about generative models. Their collective support significantly enhanced this work.

This paper aims to advance the development of time series foundation models. We curated a pre-training dataset from publicly available resources. Our models employ an efficient tokenization and incorporate a generative training objective. The proposed TimeFlow Loss provides insights for training generative foundation models for time series forecasting. We released our pre-trained models that demonstrate notable zero-shot forecasting performance. The generative forecasting paradigm enhances the model reliability for decision-making. Our paper mainly focuses on scientific research and has no obvious negative social impact.

References

  1. Aksu et al. (2024) T. Aksu, G. Woo, J. Liu, X. Liu, C. Liu, S. Savarese, C. Xiong, and D. Sahoo GIFT-eval: a benchmark for general time series forecasting model evaluation. In NeurIPS Workshop on Time Series in the Age of Large Models, Cited by: Appendix B, §C.1, §1, §1, §5.1, Table 2.
  2. Ansari et al. (2024) A. F. Ansari, L. Stella, C. Turkmen, X. Zhang, P. Mercado, H. Shen, O. Shchur, S. S. Rangapuram, S. P. Arango, S. Kapoor, et al. Chronos: learning the language of time series. arXiv preprint arXiv:2403.07815. Cited by: Table 4, Table 4, Appendix A, Table 6, Appendix B, §C.2, §C.4, §C.5, Figure 11, Figure 12, §D.1, Table 9, Table 9, §1, §1, §1, §2.1, §2.2, §4.1.1, §4.2, Figure 4, Figure 5, §5.1.2, §5.1.2, §5.1, Table 1, Table 1, Table 2.
  3. Baevski and Auli (2018) A. Baevski and M. Auli Adaptive input representations for neural language modeling. arXiv preprint arXiv:1809.10853. Cited by: §5.6.
  4. Bai et al. (2018) S. Bai, J. Z. Kolter, and V. Koltun An empirical evaluation of generic convolutional and recurrent networks for sequence modeling. arXiv preprint arXiv:1803.01271. Cited by: §2.1.
  5. Bengio et al. (2000) Y. Bengio, R. Ducharme, and P. Vincent A neural probabilistic language model. Advances in neural information processing systems 13. Cited by: §1.
  6. Bommasani et al. (2021) R. Bommasani, D. A. Hudson, E. Adeli, R. Altman, S. Arora, S. von Arx, M. S. Bernstein, J. Bohg, A. Bosselut, E. Brunskill, et al. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258. Cited by: §1, §2.1.
  7. Box et al. (2015) G. E. Box, G. M. Jenkins, G. C. Reinsel, and G. M. Ljung Time series analysis: forecasting and control. John Wiley & Sons. Cited by: §1.
  8. Box (2013) G. Box Box and jenkins: time series analysis, forecasting and control. In A Very British Affair: Six Britons and the Development of Time Series Analysis During the 20th Century, pp. 161–215. Cited by: §1.
  9. Dao et al. (2022) T. Dao, D. Fu, S. Ermon, A. Rudra, and C. Ré Flashattention: fast and memory-efficient exact attention with io-awareness. Advances in Neural Information Processing Systems 35, pp. 16344–16359. Cited by: §1, §4.1.2, §5.6.
  10. Das et al. (2023a) A. Das, W. Kong, A. Leach, R. Sen, and R. Yu Long-term forecasting with tide: time-series dense encoder. arXiv preprint arXiv:2304.08424. Cited by: Table 2.
  11. Das et al. (2023b) A. Das, W. Kong, R. Sen, and Y. Zhou A decoder-only foundation model for time-series forecasting. arXiv preprint arXiv:2310.10688. Cited by: Appendix A, Table 6, §C.4, Table 9, §1, §2.2, §4.1.3, Table 1, Table 2.
  12. Esser et al. (2024) P. Esser, S. Kulal, A. Blattmann, R. Entezari, J. Müller, H. Saini, Y. Levi, D. Lorenz, A. Sauer, F. Boesel, et al. Scaling rectified flow transformers for high-resolution image synthesis. In Forty-first International Conference on Machine Learning, Cited by: §2.3, §3.2.
  13. Goldberger et al. (2000) A. L. Goldberger, L. A. Amaral, L. Glass, J. M. Hausdorff, P. C. Ivanov, R. G. Mark, J. E. Mietus, G. B. Moody, C. Peng, and H. E. Stanley PhysioBank, physiotoolkit, and physionet: components of a new research resource for complex physiologic signals. circulation 101 (23), pp. e215–e220. Cited by: Table 4, Appendix A.
  14. Goswami et al. (2024) M. Goswami, K. Szafer, A. Choudhry, Y. Cai, S. Li, and A. Dubrawski MOMENT: a family of open time-series foundation models. arXiv preprint arXiv:2402.03885. Cited by: Table 6.
  15. Gruver et al. (2024) N. Gruver, M. Finzi, S. Qiu, and A. G. Wilson Large language models are zero-shot time series forecasters. Advances in Neural Information Processing Systems 36. Cited by: Table 6.
  16. Gruver et al. (2023) N. Gruver, M. Finzi, S. Qiu, and A. G. Wilson Large language models are zero-shot time series forecasters. arXiv preprint arXiv:2310.07820. Cited by: §1.
  17. Hersbach et al. (2020) H. Hersbach, B. Bell, P. Berrisford, S. Hirahara, A. Horányi, J. Muñoz-Sabater, J. Nicolas, C. Peubey, R. Radu, D. Schepers, et al. The era5 global reanalysis. Quarterly Journal of the Royal Meteorological Society 146 (730), pp. 1999–2049. Cited by: §4.2.
  18. Hoo et al. (2025) S. B. Hoo, S. Müller, D. Salinas, and F. Hutter The tabular foundation model tabpfn outperforms specialized time series forecasting models based on simple features. arXiv preprint arXiv:2501.02945. Cited by: Table 2.
  19. Hyndman (2018) R. Hyndman Forecasting: principles and practice. OTexts. Cited by: §1, §2.1.
  20. Ke et al. (2017) G. Ke, Q. Meng, T. Finley, T. Wang, W. Chen, W. Ma, Q. Ye, and T. Liu Lightgbm: a highly efficient gradient boosting decision tree. Advances in neural information processing systems 30. Cited by: §2.1.
  21. Kim et al. (2021) T. Kim, J. Kim, Y. Tae, C. Park, J. Choi, and J. Choo Reversible instance normalization for accurate time-series forecasting against distribution shift. In International Conference on Learning Representations, Cited by: §2.1.
  22. Kingma and Ba (2014) D. P. Kingma and J. Ba Adam: a method for stochastic optimization. arXiv preprint arXiv:1412.6980. Cited by: Appendix B.
  23. Kollovieh et al. (2024) M. Kollovieh, M. Lienen, D. Lüdke, L. Schwinn, and S. Günnemann Flow matching with gaussian process priors for probabilistic time series forecasting. arXiv preprint arXiv:2410.03024. Cited by: §2.3.
  24. Li et al. (2024) T. Li, Y. Tian, H. Li, M. Deng, and K. He Autoregressive image generation without vector quantization. arXiv preprint arXiv:2406.11838. Cited by: §1, §5.3.
  25. Liang et al. (2024) Y. Liang, H. Wen, Y. Nie, Y. Jiang, M. Jin, D. Song, S. Pan, and Q. Wen Foundation models for time series analysis: a tutorial and survey. In Proceedings of the 30th ACM SIGKDD conference on knowledge discovery and data mining, pp. 6555–6565. Cited by: §2.2.
  26. Lim et al. (2021) B. Lim, S. Ö. Arık, N. Loeff, and T. Pfister Temporal fusion transformers for interpretable multi-horizon time series forecasting. International Journal of Forecasting 37 (4), pp. 1748–1764. Cited by: §2.1.
  27. Lipman et al. (2022) Y. Lipman, R. T. Chen, H. Ben-Hamu, M. Nickel, and M. Le Flow matching for generative modeling. arXiv preprint arXiv:2210.02747. Cited by: §1, §2.3, §3.1.
  28. Lipman et al. (2024) Y. Lipman, M. Havasi, P. Holderrieth, N. Shaul, M. Le, B. Karrer, R. T. Chen, D. Lopez-Paz, H. Ben-Hamu, and I. Gat Flow matching guide and code. arXiv preprint arXiv:2412.06264. Cited by: §2.3.
  29. Liu et al. (2024a) Y. Liu, K. Zhang, Y. Li, Z. Yan, C. Gao, R. Chen, Z. Yuan, Y. Huang, H. Sun, J. Gao, et al. Sora: a review on background, technology, limitations, and opportunities of large vision models. arXiv preprint arXiv:2402.17177. Cited by: §1, §2.3.
  30. Liu et al. (2023a) Y. Liu, T. Hu, H. Zhang, H. Wu, S. Wang, L. Ma, and M. Long Itransformer: inverted transformers are effective for time series forecasting. arXiv preprint arXiv:2310.06625. Cited by: §1, Table 2.
  31. Liu et al. (2023b) Y. Liu, C. Li, J. Wang, and M. Long Koopa: learning non-stationary time series dynamics with koopman predictors. arXiv preprint arXiv:2305.18803. Cited by: §2.1.
  32. Liu et al. (2024b) Y. Liu, G. Qin, X. Huang, J. Wang, and M. Long Timer-xl: long-context transformers for unified time series forecasting. arXiv preprint arXiv:2410.04803. Cited by: Appendix A, Table 6, §C.4, Table 9, §2.2, §4.2, §5.6, Table 1.
  33. Liu et al. (2022) Y. Liu, H. Wu, J. Wang, and M. Long Non-stationary transformers: exploring the stationarity in time series forecasting. Advances in Neural Information Processing Systems 35, pp. 9881–9893. Cited by: §4.1.1.
  34. Liu et al. (2024c) Y. Liu, H. Zhang, C. Li, X. Huang, J. Wang, and M. Long Timer: generative pre-trained transformers are large time series models. In Forty-first International Conference on Machine Learning, Cited by: Appendix A, Appendix A, Appendix B, §C.4, §1, §2.2, §4.2, §4.
  35. Muñoz-Sabater et al. (2021) J. Muñoz-Sabater, E. Dutra, A. Agustí-Panareda, C. Albergel, G. Arduini, G. Balsamo, S. Boussetta, M. Choulga, S. Harrigan, H. Hersbach, et al. ERA5-land: a state-of-the-art global reanalysis dataset for land applications. Earth system science data 13 (9), pp. 4349–4383. Cited by: Table 4, Table 4, Table 4, Table 4, Table 4, Table 4, Appendix A.
  36. Nie et al. (2022) Y. Nie, N. H. Nguyen, P. Sinthong, and J. Kalagnanam A time series is worth 64 words: long-term forecasting with transformers. arXiv preprint arXiv:2211.14730. Cited by: §1, §2.1, §5.1.2, Table 2.
  37. OpenAI (2023) R. OpenAI Gpt-4 technical report. arxiv 2303.08774. View in Article 2, pp. 13. Cited by: §1, §3.2.
  38. Oreshkin et al. (2019) B. N. Oreshkin, D. Carpov, N. Chapados, and Y. Bengio N-beats: neural basis expansion analysis for interpretable time series forecasting. arXiv preprint arXiv:1905.10437. Cited by: §1, Table 2.
  39. Paszke et al. (2019) A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al. Pytorch: an imperative style, high-performance deep learning library. Advances in neural information processing systems 32. Cited by: Appendix B.
  40. Peebles and Xie (2023) W. Peebles and S. Xie Scalable diffusion models with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4195–4205. Cited by: §4.1.3.
  41. [41] PEMS Traffic Dataset. Note: http://pems.dot.ca.gov/ Cited by: Table 9.Source
  42. Pope et al. (2023) R. Pope, S. Douglas, A. Chowdhery, J. Devlin, J. Bradbury, J. Heek, K. Xiao, S. Agrawal, and J. Dean Efficiently scaling transformer inference. Proceedings of Machine Learning and Systems 5, pp. 606–624. Cited by: §1, §4.1.2.
  43. Radford et al. (2018) A. Radford, K. Narasimhan, T. Salimans, I. Sutskever, et al. Improving language understanding by generative pre-training. OpenAI. Cited by: §1.
  44. Ramesh et al. (2021) A. Ramesh, M. Pavlov, G. Goh, S. Gray, C. Voss, A. Radford, M. Chen, and I. Sutskever Zero-shot text-to-image generation. In International conference on machine learning, pp. 8821–8831. Cited by: §1.
  45. Rasley et al. (2020) J. Rasley, S. Rajbhandari, O. Ruwase, and Y. He Deepspeed: system optimizations enable training deep learning models with over 100 billion parameters. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 3505–3506. Cited by: §4.1.2.
  46. Rasul et al. (2023) K. Rasul, A. Ashok, A. R. Williams, A. Khorasani, G. Adamopoulos, R. Bhagwatkar, M. Biloš, H. Ghonia, N. V. Hassen, A. Schneider, et al. Lag-llama: towards foundation models for time series forecasting. arXiv preprint arXiv:2310.08278. Cited by: Table 6.
  47. Rasul et al. (2021) K. Rasul, C. Seward, I. Schuster, and R. Vollgraf Autoregressive denoising diffusion models for multivariate probabilistic time series forecasting. In International Conference on Machine Learning, pp. 8857–8868. Cited by: §2.3.
  48. Rombach et al. (2022) R. Rombach, A. Blattmann, D. Lorenz, P. Esser, and B. Ommer High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10684–10695. Cited by: §3.2.
  49. Salinas et al. (2020) D. Salinas, V. Flunkert, J. Gasthaus, and T. Januschowski DeepAR: probabilistic forecasting with autoregressive recurrent networks. International journal of forecasting 36 (3), pp. 1181–1191. Cited by: §2.1, Table 2.
  50. Shen and Kwok (2023) L. Shen and J. Kwok Non-autoregressive conditional diffusion models for time series prediction. In International Conference on Machine Learning, pp. 31016–31029. Cited by: §2.3.
  51. Shi et al. (2024a) J. Shi, Q. Ma, H. Ma, and L. Li Scaling law for time series forecasting. arXiv preprint arXiv:2405.15124. Cited by: Appendix A.
  52. Shi et al. (2024b) X. Shi, S. Wang, Y. Nie, D. Li, Z. Ye, Q. Wen, and M. Jin Time-moe: billion-scale time series foundation models with mixture of experts. arXiv preprint arXiv:2409.16040. Cited by: Appendix A, Table 6, §C.4, Table 9, Table 9, Table 9, Table 9, §2.2, §5.1.1, Table 1, Table 1, Table 1, Table 1.
  53. Shoeybi et al. (2019) M. Shoeybi, M. Patwary, R. Puri, P. LeGresley, J. Casper, and B. Catanzaro Megatron-lm: training multi-billion parameter language models using model parallelism. arXiv preprint arXiv:1909.08053. Cited by: §4.1.2.
  54. Sohl-Dickstein et al. (2015) J. Sohl-Dickstein, E. Weiss, N. Maheswaranathan, and S. Ganguli Deep unsupervised learning using nonequilibrium thermodynamics. In International conference on machine learning, pp. 2256–2265. Cited by: §2.3.
  55. Su et al. (2024) J. Su, M. Ahmed, Y. Lu, S. Pan, W. Bo, and Y. Liu Roformer: enhanced transformer with rotary position embedding. Neurocomputing 568, pp. 127063. Cited by: §1, §4.1.2, §5.6.
  56. Tashiro et al. (2021) Y. Tashiro, J. Song, Y. Song, and S. Ermon Csdi: conditional score-based diffusion models for probabilistic time series imputation. Advances in Neural Information Processing Systems 34, pp. 24804–24816. Cited by: §2.3.
  57. Tong et al. (2023) A. Tong, K. Fatras, N. Malkin, G. Huguet, Y. Zhang, J. Rector-Brooks, G. Wolf, and Y. Bengio Improving and generalizing flow-based generative models with minibatch optimal transport. arXiv preprint arXiv:2302.00482. Cited by: §1.
  58. Touvron et al. (2023) H. Touvron, T. Lavril, G. Izacard, X. Martinet, M. Lachaux, T. Lacroix, B. Rozière, N. Goyal, E. Hambro, F. Azhar, et al. Llama: open and efficient foundation language models. arXiv preprint arXiv:2302.13971. Cited by: §5.6.
  59. Vovk et al. (2005) V. Vovk, A. Gammerman, and G. Shafer Algorithmic learning in a random world. Vol. 29, Springer. Cited by: §3.2.
  60. Wei et al. (2021) J. Wei, M. Bosma, V. Y. Zhao, K. Guu, A. W. Yu, B. Lester, N. Du, A. M. Dai, and Q. V. Le Finetuned language models are zero-shot learners. arXiv preprint arXiv:2109.01652. Cited by: §5.5.
  61. Wen et al. (2017) R. Wen, K. Torkkola, B. Narayanaswamy, and D. Madeka A multi-horizon quantile recurrent forecaster. arXiv preprint arXiv:1711.11053. Cited by: §1, §2.2.
  62. Woo et al. (2024) G. Woo, C. Liu, A. Kumar, C. Xiong, S. Savarese, and D. Sahoo Unified training of universal time series forecasting transformers. arXiv preprint arXiv:2402.02592. Cited by: Table 4, Appendix A, Table 6, Appendix B, §C.4, Table 9, Table 9, §1, §1, §2.1, §2.2, §4.2, Table 1, Table 1, Table 2, Table 2.
  63. Wu et al. (2022) H. Wu, T. Hu, Y. Liu, H. Zhou, J. Wang, and M. Long Timesnet: temporal 2d-variation modeling for general time series analysis. arXiv preprint arXiv:2210.02186. Cited by: Appendix B, Figure 10, §C.4, Table 8, Figure 13, §D.1, Table 9, §1, §2.1, Figure 9, §5.1, Table 1.
  64. Wu et al. (2021) H. Wu, J. Xu, J. Wang, and M. Long Autoformer: decomposition transformers with auto-correlation for long-term series forecasting. Advances in Neural Information Processing Systems 34, pp. 22419–22430. Cited by: §2.1.
  65. Xiong et al. (2020) R. Xiong, Y. Yang, D. He, K. Zheng, S. Zheng, C. Xing, H. Zhang, Y. Lan, L. Wang, and T. Liu On layer normalization in the transformer architecture. In International Conference on Machine Learning, pp. 10524–10533. Cited by: §1, §4.1.2.
  66. Zhang et al. (2018) R. Zhang, P. Isola, A. A. Efros, E. Shechtman, and O. Wang The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 586–595. Cited by: §1, §2.3.
  67. Zhang and Yan (2023) Y. Zhang and J. Yan Crossformer: transformer utilizing cross-dimension dependency for multivariate time series forecasting. In The eleventh international conference on learning representations, Cited by: §1.
  68. Zhao et al. (2023) W. X. Zhao, K. Zhou, J. Li, T. Tang, X. Wang, Y. Hou, Y. Min, B. Zhang, J. Zhang, Z. Dong, et al. A survey of large language models. arXiv preprint arXiv:2303.18223. Cited by: §2.3.

Large-scale datasets are of paramount importance for pre-training foundation models. Recent research has contributed significant time series datasets (Das et al., 2023b; Liu et al., 2024c; Shi et al., 2024b). While the scaling law of time series foundation models has been explored in the recent work (Shi et al., 2024a), the pre-training scale remains relatively limited. Given the heterogeneity of time series compared to other modalities, it raises the question of whether it is feasible to learn from enormous series. To address the question, we curated TimeBench with a trillion time points from various domains.

Unlike other modalities, most time series are unavailable on open websites or repositories. There are also limited domains that encompass typical and predictable time series, leading to slow progress on dataset construction. Therefore, we conducted tedious preprocessing, including missing values imputation, abnormalities exclusion, and normalization techniques. We conducted statistical analysis, examining time series through the lenses of intrinsic properties, e.g., non-stationarity, forecastability, and seasonality. This approach allows us to characterize the data quality inherent to time series, which affects the training stability of next-token prediction. We also adopt synthetic techniques to improve pattern diversity. Further, we adopt ERA5 (Muñoz-Sabater et al., 2021), including systematic real-world temporal observations.

The statistical details of TimeBench are summarized in Table 4. In addition to open-source datasets from research teams on time series foundation models (Woo et al., 2024; Ansari et al., 2024; Liu et al., 2024c; Liu et al., 2024b), we collected substantial real-world time series from various domains such as finance, IoT, meteorology, and healthcare (Goldberger et al., 2000). These resources enable us to construct large-scale time-series corpora exceeding a trillion time points. The corpora include highly credible and predictable data with a wide range of frequencies, lengths, and numbers of variates, providing comprehensive temporal dynamics and variation patterns to facilitate downstream applications. To prevent data leakage, we exclude all datasets evaluated in Section 5.1 to make sure that Sundial conducts zero-shot forecasting.

Table 4
SourceChronosECGFinanceIoTLOSTASyntheticERA5 3hERA 12hERA5 DailyERA5 WeeklyERA5 MonthlyERA5 QuarterlyTotal
(2024)(2000)(Ours)(Ours)(2024)(2024)(2021)(2021)(2021)(2021)(2021)(2021)
# Pts.94B48B10.5B5.8B230B0.5B129B32B406B58B13.5B4.5B1032B
%9.11 %4.65 %1.02 %0.56 %22.29 %0.05 %12.50 %3.10 %39.35 %5.62 %1.31 %0.44 %100%
Table 4: Key statistics of TimeBench, the pre-training dataset of Sundial.
View original tableOriginal Table 4

All experiments are implemented using PyTorch (Paszke et al., 2019) and executed with 3232 NVIDIA A100 GPUs. We employ the AdamW optimizer (Kingma and Ba, 2014) for model optimization. We adopt S3 format (Liu et al., 2024c) for univariate pre-training. During training, data from different domains is sampled according to a predefined ratio to balance the domain weightings and ensure diversity in the training data. We implement a global shuffle strategy by loading time series into a standard parquet format. We use variable-wise normalization to unify the scope of values.

On the FEV leaderboard (Ansari et al., 2024), which consists of short-term forecasting datasets, we train Sundial models by TimeFlow Loss with the prediction length of F=16F=16. For the point forecasting (Wu et al., 2022) and GIFT-Eval (Aksu et al., 2024), which consist of forecasting datasets with a prediction length ranging from 66 to 900900, we train Sundial models by TimeFlow Loss with the prediction length of F=720F=720. For the required prediction length less than the model prediction length, we truncate the output generated by Sundial. For the required length more than the prediction horizon, we conduct rolling forecasting. Following Chronos (Ansari et al., 2024), we sample 2020 raw predictions to calculate MASE and WQL on FEV. Being consistent to Moirai (Woo et al., 2024), we sample 100100 raw predictions to calculate MASE and CRPS for GIFT-Eval. The sampling step is fixed as K=50K=50. Configurations of Sundial in different sizes are provided in Table 5. We provide a model summary in Table 6, which summarizes several aspects of current time series foundation models.

Table 5
ModelPatch SizeContext LengthPrediction LengthLayersDimensionMHA HeadsTimeFlowTotal Parameters
(P)(P)(T)(T)(F)(F)(L)(L)(D,Dff)(D,D_{\text{ff}})HH(Dtf,Ltf)(D_{\text{tf}},L_{\text{tf}})#Count\#\text{Count}
SundialSmall\textbf{Sundial}_{\textit{Small}}161628802880{16,720}\{16,720\}6(512,2048)(512,2048)88(512,3)(512,3)3232M
SundialBase\textbf{Sundial}_{\textit{Base}}161628802880{16,720}\{16,720\}12(768,3072)(768,3072)1212(768,3)(768,3)128128M
SundialLarge\textbf{Sundial}_{\textit{Large}}161628802880{16,720}\{16,720\}24(1024,4096)(1024,4096)1616(1024,6)(1024,6)444444M
Table 5: Model configurations of the Sundial family.
View original tableOriginal Table 5
Table 6
MethodSundialTime-MoETimer-XLMoiraiMOMENTLLMTimeChronosLag-LlamaTimesFM
(Ours)(2024b)(2024b)(2024)(2024)(2024)(2024)(2023)(2023b)
ArchitectureDecoderDecoderDecoderEncoderEncoderDecoderEncDecDecoderDecoder
Model Size32M113M84M14M40M-46M200M17M
128M453M91M125M200M70M
444M2.4B311M385M710M200M
Pre-training Scale1032B300B260B231B1.13B-84B0.36B100B
Token LevelPatchPointPatchPatchPatchPointPointPointPatch
TokenizationContinuousContinuousContinuousContinuousContinuousDiscreteDiscreteContinuousContinuous
Context Length≤\leq2880≤\leq4096≤\leq2880≤\leq5000= 512-≤\leq512≤\leq1024≤\leq512
ProbabilisticTrueFalseFalseTrueFalseTrueTrueTrueFalse
Table 6: Comparison of time series foundation models. Architecture denotes the Transformer category. Model Size presents parameter counts of different model sizes. Pre-training Scale measures pre-training datasets in time points. Token Level presents the graininess of time series tokens. Tokenization denotes what kind of values are embedded from time series. Context Length means the input length supported by the model. Probabilistic means generating multiple probable predictions, which is the opposite of deterministic forecasters.
View original tableOriginal Table 6

Mode collapse is a failure of representation learning, where a model generates a limited variety of outputs, ignoring the diversity in the training data. For time series foundation models, mode collapse stems from the heterogeneity of the time series distribution, e.g., a similar lookback time series goes into divergent trending. In other words, the semantics of time series patterns are highly unstable. It sometimes leads to over-smooth predictions from models optimized by MSE becuase the results are global-optimal for this loss (See showcases on the right of Figure 14-15). Such a training objective pre-defines a unimodal predictive distribution of data, which struggles to accommodate large-scale datasets like TimeBench.

Our work addresses this phenomenon through generative modeling. Generative forecasters learn flexible distributions without relying on probabilistic priors. We evaluate the distributional metric Continuous Ranked Probability Score (CRPS) to assess the quality of generated predictions across different training objectives. The results indicate that the predictive distribution modeled by TimeFlow is more coherent and diverse compared to alternative training objectives, particularly on the highly diverse GIFT-Eval (Aksu et al., 2024). It validates the effectiveness of TimeFlow in mitigating mode collapse.

Table 7
ObjectiveETTh1ETTh2ETTm1ETTm2ECLWeatherGIFT-Eval
TimeFlow Loss0.00590.00370.00570.00290.00820.00210.5050
Diffusion Loss0.00820.00530.00700.00390.00950.00320.5340
MSE Loss0.00630.00400.00580.00320.00800.00230.6420
Table 7: Zero-shot probabilistic forecasting performance using different training objectives. Averaged CRPS is reported here.
View original tableOriginal Table 7

We compare Sundial with other time series foundation models that are pre-trained with smaller datasets: Chronos (Ansari et al., 2024) is pre-trained on 94 billion time points, and Moirai is pre-trained on 230 billion time points. As their pre-training datasets are part of the subset of TimeBench, we also conduct pre-training on Sundial using these subsets. As shown in Table 8, these results highlight the scaling behavior of Sundial using larger datasets. Additionally, Sundial still achieves better zero-shot forecasting than its counterpart models with the same pre-training dataset.

Table 8
Model (pts.)Chronos (94B)Moirai (230B)Sundial (94B)Sundial (230B)Sundial (1032B)
DatasetMSEMAEMSEMAEMSEMAEMSEMAEMSEMAE
ETTh10.5910.4680.4170.4190.4020.4290.4030.4190.4110.434
ETTh20.4050.4100.3620.3820.3770.4140.3640.3980.3330.387
ETTm10.6450.5000.4060.3850.3670.4020.3520.3850.3360.377
ETTm20.3100.3500.3110.3370.2800.3410.2730.3340.2580.320
ECL0.2140.2780.1870.2740.1720.2690.1710.2670.1690.265
Weather0.2920.3150.2870.2810.2540.3010.2520.2970.2340.270
Table 8: Zero-shot forecasting performance of models trained on different scales of datasets (measured in time points, pts, and 1B means a billion). We report the averaged results from four prediction lengths {96,192,336,720}\{96,192,336,720\} on Time-Series-Library (Wu et al., 2022).
View original tableOriginal Table 8

Time series foundation models operate independently of training, functioning similarly to statistical methods. Given specific forecasting tasks, one of the most important hyperparameters is the lookback length. Unlike fixed-context models, Sundial offers flexibility for practitioners, allowing the context length to be dynamically adjusted during inference. In Figure 10, we present the performance of Sundial utilizing various lookback lengths. Based on our observations, we contend that performance is largely dependent on the forecasting task itself. Specifically, the size of the lookback window can be tuned to meet the forecasting horizon and data periodicity. Time series foundation models provide a training-free approach for rapid adjustments; still, they should enhance their fundamental long-context capabilities to handle high-frequency data.

Figure 10
Figure 10: Zero-shot forecasting performance using different lookback lengths in {480,960,1440,1920,2400,2880}\{480,960,1440,1920,2400,2880\}. We report the averaged results from four prediction lengths {96,192,336,720}\{96,192,336,720\} on Time-Series-Library (Wu et al., 2022).

Table 9 provides full zero-shot results on Time-Series-Library forecasting benchmark (Wu et al., 2022), including prediction horizons in {96,192,336,720}\{96,192,336,720\}. We build Sundial with different model sizes with configurations in Table 5. The context length is fixed as 28802880. We truncate the model’s predictions for tasks requiring a prediction length less than F=720F=720.

We compare the most advanced time series foundation models based on their official checkpoints, including Time-MoE (Shi et al., 2024b), Timer (Liu et al., 2024b; Liu et al., 2024c), Moirai (Woo et al., 2024), TimesFM (Das et al., 2023b), and Chronos (Ansari et al., 2024). We conduct zero-shot evaluations on datasets that are not included during the pre-training of the corresponding models. For each of the evaluated model, we use their maximum input length during inference. Metrics (MSE/MAE) are calculated from all predicted windows in the test split of each dataset following Liu et al. (2024b).

We evaluate our models on GIFT-Eval, a benchmark designed to comprehensively assess forecasting performance across diverse time series. GIFT-Eval includes 2323 datasets covering 144,000144,000 time series and 177177 million data points, which constitute a total of 9797 forecasting configurations. We use the official evaluation suite established by the research team of Salesforce and report aggregated results in Table 2. We evaluate the performance and inference time on the FEV leaderboard, which was originally proposed by Ansari et al. (2024) and established by AutoGluon, which comprises 2727 datasets for zero-shot evaluation. We report aggregated metrics in Figure 4 and assess the inference time in Figure 5. We released the detailed results by submitting Sundial to their open benchmark2^{2}.

Figure 11-13 present zero-shot forecasting showcases on all the datasets from FEV (Ansari et al., 2024) and TSLib (Wu et al., 2022). By generating 2020 predictions with different initial noise, we estimate the median and 80%80\% prediction interval.

Table 9
ModelsSundialSmall\textbf{Sundial}_{\textit{Small}}SundialBase\textbf{Sundial}_{\textit{Base}}SundialLarge\textbf{Sundial}_{\textit{Large}}Time-MoEBase\textbf{Time-MoE}_{\textit{Base}}Time-MoELarge\textbf{Time-MoE}_{\textit{Large}}Time-MoEUltra\textbf{Time-MoE}_{\textit{Ultra}}Timer-XLMoiraiBase\textbf{Moirai}_{\textit{Base}}MoiraiLarge\textbf{Moirai}_{\textit{Large}}ChronosBase\textbf{Chronos}_{\textit{Base}}ChronosLarge\textbf{Chronos}_{\textit{Large}}TimesFM
(Ours)(Ours)(Ours)(2024b)(2024b)(2024b)(2024b)(2024)(2024)(2024)(2024)(2023b)
MetricMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAEMSEMAE
ETTm1960.2920.3420.2800.3340.2730.3290.3380.3680.3090.3570.2810.3410.3170.3560.3630.3560.3800.3610.4540.4080.4570.4030.3610.370
1920.3370.3760.3210.3660.3120.3570.3530.3880.3460.3810.3050.3580.3580.3810.3880.3750.4120.3830.5670.4770.5300.4500.4140.405
3360.3700.4010.3500.3890.3430.3780.3810.4130.3730.4080.3690.3950.3860.4010.4160.3920.4360.4000.6620.5250.5770.4810.4450.429
7200.4180.4330.3940.4180.3970.4130.5040.4930.4750.4770.4690.4720.4300.4310.4600.4180.4620.4200.9000.5910.6600.5260.5120.471
Avg0.3540.3880.3360.3770.3310.3690.3940.4150.3760.4050.3560.3910.3730.3920.4060.3850.4220.3910.6450.5000.5550.4650.4330.418
ETTm2960.1780.2600.1700.2560.1720.2550.2010.2910.1970.2860.1980.2880.1890.2770.2050.2730.2110.2740.1990.2740.1970.2710.2020.270
1920.2350.3040.2290.3000.2270.2960.2580.3340.2500.3220.2350.3120.2410.3150.2750.3160.2810.3180.2610.3220.2540.3140.2890.321
3360.2870.3420.2810.3370.2750.3310.3240.3730.3370.3750.2930.3480.2860.3480.3290.3500.3410.3550.3260.3660.3130.3530.3600.366
7200.3600.3900.3510.3870.3430.3780.4880.4640.4800.4610.4270.4280.3750.4020.4370.4110.4850.4280.4550.4390.4160.4150.4620.430
Avg0.2650.3240.2580.3200.2540.3150.3170.3650.3160.3610.2880.3440.2730.3360.3110.3370.3290.3430.3100.3500.2950.3380.3280.346
ETTh1960.3410.3810.3480.3850.3460.3830.3570.3810.3500.3820.3490.3790.3690.3910.3760.3920.3810.3880.4400.3930.4410.3900.4140.404
1920.3810.4080.3930.4180.3860.4100.3840.4040.3880.4120.3950.4130.4050.4130.4120.4130.4340.4150.4920.4260.5020.5240.4650.434
3360.4050.4240.4220.4400.4100.4260.4110.4340.4110.4300.4470.4530.4180.4230.4330.4280.4850.4450.5500.4620.5760.4670.5030.456
7200.4330.4580.4810.4930.4380.4590.4490.4770.4270.4550.4570.4620.4230.4410.4470.4440.6110.5100.8820.5910.8350.5830.5110.481
Avg0.3900.4180.4110.4340.3950.4200.4000.4240.3940.4190.4120.4260.4040.4170.4170.4190.4800.4390.5910.4680.5880.4660.4730.443
ETTh2960.2720.3320.2710.3330.2690.3300.3050.3590.3020.3540.2920.3520.2830.3420.2940.3300.2960.3300.3080.3430.3200.3450.3150.349
1920.3290.3740.3270.3760.3250.3730.3510.3860.3640.3850.3470.3790.3400.3790.3650.3750.3610.3710.3840.3920.4060.3990.3880.395
3360.3570.3990.3540.4020.3540.4000.3910.4180.4170.4250.4060.4190.3660.4000.3760.3900.3900.3900.4290.4300.4920.4530.4220.427
7200.4010.4420.3810.4350.3890.4430.4190.4540.5370.4960.4390.4470.3970.4310.4160.4330.4230.4180.5010.4770.6030.5110.4430.454
Avg0.3400.3870.3330.3870.3340.3870.3660.4040.4050.4150.3710.3990.3470.3880.3620.3820.3670.3770.4050.4100.4550.4270.3920.406
ECL960.1340.2310.1320.2290.1300.227------0.1410.2370.1600.2500.1530.2410.1540.2310.1520.229--
1920.1540.2510.1520.2500.1500.247------0.1590.2540.1750.2630.1690.2550.1790.2540.1720.250--
3360.1740.2710.1730.2710.1700.268------0.1770.2720.1870.2770.1870.2730.2140.2840.2030.276--
7200.2150.3070.2180.3110.2140.307------0.2190.3080.2280.3090.2370.3130.3110.3460.2890.337--
Avg0.1690.2650.1690.2650.1660.262------0.1740.2780.1870.2740.1860.2700.2140.2780.2040.273--
Weather960.1580.2060.1570.2050.1570.2080.1600.2140.1590.2130.1570.2110.1710.2250.2200.2170.1990.2110.2030.2380.1940.235--
1920.2050.2530.2050.2510.2070.2560.2100.2600.2150.2660.2080.2560.2210.2710.2710.2590.2460.2510.2560.2900.2490.285--
3360.2540.2900.2530.2890.2590.2950.2740.3090.2910.3220.2550.2900.2740.3110.2860.2970.2740.2910.3140.3360.3020.327--
7200.3150.3360.3200.3360.3270.3420.4180.4050.4150.4000.4050.3970.3560.3700.3730.3540.3370.3400.3970.3960.3720.378--
Avg0.2330.2710.2340.2700.2380.2750.2650.2970.2700.3000.2560.2880.2560.2940.2870.2810.2640.2730.2920.3150.2790.306--
1st1^{\text{st}} Count72851616010021130206000000
Table 9: Zero-shot forecasting results of time series foundation models on long-term forecasting datasets (Wu et al., 2022). A lower MSE or MAE indicates a better prediction. Averaged results of four prediction lengths are reported here. 1st1^{\text{st}} Count represents the number of wins achieved by a model under all prediction lengths and datasets. Results of baseline models are officially reported by Shi et al. (2024b). Datasets for pre-training are not evaluated on corresponding models, which are denoted by the dash (−-).
View original tableOriginal Table 9
Figure 11
Figure 11: Showcases of zero-shot predictions from Sundial (Base) on the FEV leaderboard (Ansari et al., 2024).
Figure 12
Figure 12: Showcases of zero-shot predictions from Sundial (Base) on the FEV leaderboard (Ansari et al., 2024).
Figure 13
Figure 13: Showcases of zero-shot predictions from Sundial (Base) on long-term forecasting datasets (Wu et al., 2022).

As we introduce generative modeling in time series foundation models, we compare zero-shot forecasting showcases from two types of models, including (1) Sundial, a generative forecaster pre-trained by TimeFlow, which can predict multiple future possibilities based on a lookback series. (2) Using the same backbone and TimeBench, a Transformer pre-trained by MSE Loss. As a deterministic forecaster, the model can only output the mean prediction. As depicted in Figure 14-15, the unimodal Gaussian prior specified by MSE can be infeasible to handle large-scale pre-training, manifested as sometimes over-smooth predictions in downstream forecasting tasks. Therefore, we hope this work can inspire future paradigms for pre-training time series foundation models and enhance their applicability to real-world scenarios.

Figure 14
Figure 14: Showcases of Sundial (Left) and the same Transformer backbone pre-trained by MSE Loss (Right). MSE Loss optimizes a deterministic forecaster: given a lookback series, the model can only produce one prediction as the estimation of mean values. This objective may fail to accommodate divergent future variations during large-scale pre-training, leading to mode collapse and over-smooth results (as illustrated in the fourth row). TimeFlow optimizes a generative forecaster: it generates various possibilities observed in the pre-training dataset. Based on these raw predictions, we can estimate the underlying complicated distribution and different statistics. Besides, the greater concentration in generated predictions, the higher the model’s confidence in its predictions.
Figure 15
Figure 15: Supplementary showcases of Sundial (Left) and the same Transformer backbone pre-trained by MSE Loss (Right).

Our models represent an initial effort to incorporate generative modeling into time series foundation models, which enables pre-training on heterogeneous time series without specifying any prior distribution. This approach mitigates mode collapse in representation learning and generates a diverse range of probable predictions compared to previous deterministic forecasters. Despite significant progress in enlarging model capacity, the Sundial family may still face hallucinations. The performance on very high-frequency data is not guaranteed, since TimeBench contains many middle- and low-frequency time series. Therefore, an important future direction is to generalize Sundial to multi-scale time series. This situation may also indicate new opportunities during inference. As we only adopt a naïve sampling strategy that begins with random Gaussian noise, it leaves much room for future improvement in sampling strategy and post-processing, such as frequency normalization.

Another aspect of future development lies in model adaptation. Sundial is pre-trained in a univariate approach to address the discrepancy in variate numbers, which prevents it from explicitly utilizing variate correlations or covariate information. As an increasing number of studies address 2D dimensionality, multivariate pre-training is likely to be conducted for domain-specific time series foundation models. Lastly, while autoregressive models provide flexibility in the input context length, multiple steps of autoregression may still lead to over-smooth predictions and unreliable results.

In this work, we present Sundial, a family of time series foundation models to facilitate out-of-the-box forecasting. Our models employ native tokenization for continuous-valued time series and incorporate a flexible training objective, proposed as TimeFlow Loss, to enable probabilistic forecasting. With an unprecedented model capacity and a trillion-scale dataset, our models can be used directly or adapted for various forecasting scenarios, such as energy planning, weather forecasting, and financial risk prevention. With multiple predictions generation and a just-in-time inference speed, our model enhances the reliability of decision-making and streamlines the forecasting pipeline for practitioners. This paper primarily focuses on scientific research and does not present any evident negative social impact.

We curate TimeBench, a trillion-level time series dataset for pre-training foundation models for time series analysis, which we believe will be beneficial to the research community. Technically, we propose a TimeFlow Loss to facilitate the learning of flexible next-patch distributions. Conditioned on the lookback representations acquired by autoregressive Transformers, our model is endowed with a novel generative capability for probabilistic forecasting, enhancing representation learning of Transformers without the need for discrete tokenization. Through pre-training on an unprecedented scale, we identify subtle scalability bottlenecks that are not solely attributable to architectural design but are predominantly influenced by the training objectives of foundation models. The proposed TimeFlow Loss applied to autoregressive and generative models may provide insights for the future development of time series foundation models.