A decoder-only foundation model for time-series forecasting (2024)

\NewEnviron

resize[2][!]\BODY\NewEnvironrescale[2][]\BODY

Abhimanyu Das&Weihao kong&Rajat Sen&Yichen Zhou
&Google Research
{abhidas, weihaokong, senrajat, yichenzhou}@google.com

Abstract

Author names are listed in alphabetical order.

Motivated by recent advances in large language models for Natural Language Processing (NLP), we design a time-series foundation model for forecasting whose out-of-the-box zero-shot performance on a variety of public datasets comes close to the accuracy of state-of-the-art supervised forecasting models for each individual dataset. Our model is based on pretraining a decoder style attention model with input patching, using a large time-series corpus comprising both real-world and synthetic datasets. Experiments on a diverse set of previously unseen forecasting datasets suggests that the model can yield accurate zero-shot forecasts across different domains, forecasting horizons and temporal granularities.

1 Introduction

Time-series data is ubiquitous in various domains such as retail, finance, manufacturing, healthcare and natural sciences. In many of these domains, one of the most important use-cases of time-series data is forecasting. Time-series forecasting is critical to several scientific and industrial applications, like retail supply chain optimization, energy and traffic prediction, and weather forecasting. In recent times, Deep learning models[30, 25] have emerged as a popular approachfor forecasting rich, multivariate, time-series data, often outperforming classical statistical approaches such as ARIMA or GARCH[3]. In several forecasting competitions such as the M5 competition[22] and IARAI Traffic4cast contest[15] deep network based solutions performed very well.

At the same time, we are witnessing a rapid progress in the Natural Language Processing (NLP) domain on large foundation models for downstream NLP tasks. Large language models (LLMs) are growing in popularity because they can be used to generate text, translate languages, write different kinds of creative content, and answer your questions in an informative way[29]. They are trained on massive amounts of data, which allows them to learn the patterns of human language. This makes them very powerful tools that can be used for a variety of downstream tasks, often in a zero-shot learning mode.

This motivates the question: “Can large pretrained models trained on massive amounts of time-series data learn temporal patterns that can be useful for time-series forecasting on previously unseen datasets?” In particular, can we design a time-series foundation model that obtains good zero-shot out-of-the-box forecasting performance ? Such a pretrained time-series foundation model, if possible, would bring significant benefits for downstream forecasting users in terms of no additional training burden and significantly reduced compute requirements. It is not immediately obvious that such a foundation model for time-series forecasting is possible. Unlike in NLP, there is no well defined vocabulary or grammar for time-series. Additionally, such a model would need to support forecasting with varying history lengths (context) , prediction lengths (horizon) and time granularities. Furthermore, unlike the huge volume of public text data for pretraining language models, vast amounts of time-series data is not readily available. In spite of these issues, we provide evidence to answer the above question in the affirmative.

In particular, we design TimesFM, a single foundation model for time-series forecasting that, when applied to a variety of previously-unseen forecasting datasets across different domains, obtains close to state-of-the-art zero-shot accuracy (compared to the best supervised models trained individually for these datasets). Our model can work well across different forecasting history lengths, prediction lengths and time granularities at inference time. The key elements of our foundation model are twofold: 1) a large-scale time-series corpus built using both real-world (mostly time-series data from web search queries111https://trends.google.com and Wikipedia page visits222https://wikimedia.org/api/rest_v1/) and synthetic data, which meets the volume and diversity of data needed for training our foundation model, and 2) a decoder style attention architecture with input patching, that can be efficiently pre-trained on this time-series corpus.

Compared to the latest large language models, our time-series foundation model is much smaller in both parameter size (200M parameters) and pretraining data size (O(100B) timepoints); yet we show that even at such scales, it is possible to pretrain a practical foundation model for forecasting whose zero-shot performance comes close to the accuracy of fully-supervised approaches on a diverse set of time-series data. Our work also suggests that unlike recent work[11] that recommends Large Language Models such as GPT-3 and LLama-2 as out-of-the-box zero-shot forecasters, foundation models trained from scratch exclusively on time-series data can obtain much better zero-shot performance at a tiny fraction of its costs.

2 Related Work

In the last decade, deep learning models[30, 25] have emerged as powerful contenders in forecasting time-series in the presence of large training datasets and have been shown to outperform traditional statistical methods such as ARIMA and Exponential smoothing[20]. Forecasting models can be categorized broadly into: (i) Local univariate models that include traditional methods like ARIMA, exponential smoothing[20] and non-autoregressive models like Prophet[32]. These models are trained individually for each time-series in a dataset in order to predict the corresponding time-series’s future. (ii) Global univariate models like DeepAR[30], Temporal Convolutions[2], N-BEATS[25] and long-term forecasting models such as[24, 7] that are trained globally on many time-series but during inference they predict the future of a time-series as a function of its own past and other related covariates. (iii) Global multivariate models that take in the past of all time-series in the dataset to predict the future of all the time-series. Such models include the classical VAR model[43] as well as deep learning models like[31, 41, 4] to name a few.

All the works cited above have primarily been applied in the supervised setting with the notable exception of PatchTST[24] and N-BEATS[25]. PatchTST has a section on dataset-to-dataset transfer learning in the semi-supervised setting.[26] also show that the N-BEATS architecture lends itself to transfer learn between various source-target dataset pairs. However, none of these works aim to train a single foundation model that can work on a plethora of datasets. For an in-depth discussion about transfer learning in time-series we refer the reader to the survey in[21].

There has been some very recent work on re-using or fine-tuning large language models for time-series forecasting. In particular, [11] benchmarks pretrained LLMs like GPT-3 and LLaMA-2 for zero-shot forecasting performance. As we show later, our model obtains much superior zero-shot performance at a tiny fraction of these model sizes.[42] and [6] show how to fine-tune a GPT-2[29] backbone model for time-series forecasting tasks.With the exception of a transfer-learning study (forecasting on a target dataset after having trained on a source dataset), these papersmostly focus on fine-tuning a pretrained model on target datasets, and not on pretraining a single foundation model with good out-of-the box zero-shot performance on a variety of datasets. To the best of our knowledge, the very recent work in TimeGPT-1[12] is the only other parallel work on a zero-shot foundation model for time-series forecasting. However the model is not public access, and several model details and the benchmark dataset have not been revealed.

3 Problem Definition

The task at hand is to build a general purpose zero-shot forecaster that takes in the past C𝐶Citalic_C time-points of a time-series as context and predicts the future H𝐻Hitalic_H time-points. Let the context be denoted by 𝐲1:L:={y1,,yL}assignsubscript𝐲:1𝐿subscript𝑦1subscript𝑦𝐿\mathbf{y}_{1:L}:=\{y_{1},\cdots,y_{L}\}bold_y start_POSTSUBSCRIPT 1 : italic_L end_POSTSUBSCRIPT := { italic_y start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , ⋯ , italic_y start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT } where we follow a numpy-like notation for indices. Similarly the actual values in the horizon are denoted by 𝐲L+1:L+Hsubscript𝐲:𝐿1𝐿𝐻\mathbf{y}_{L+1:L+H}bold_y start_POSTSUBSCRIPT italic_L + 1 : italic_L + italic_H end_POSTSUBSCRIPT. Note that since we are building a single pre-trained model, we cannot have dataset specific dynamic or static covariates during training time.The task is then to learn a foundation model that can map any time-series context to horizon,

f:(𝐲1:L)𝐲^L+1:L+H.:𝑓subscript𝐲:1𝐿subscript^𝐲:𝐿1𝐿𝐻f:\mathopen{}\mathclose{{}\left(\mathbf{y}_{1:L}}\right)\longrightarrow\hat{%\mathbf{y}}_{L+1:L+H}.italic_f : ( bold_y start_POSTSUBSCRIPT 1 : italic_L end_POSTSUBSCRIPT ) ⟶ over^ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_L + 1 : italic_L + italic_H end_POSTSUBSCRIPT .(1)

The accuracy of the prediction can be measured by a metric that quantifies their closeness to the actual values, for instance, Mean Absolute Error (MAE) defined in Equation6.

4 Model Architecture

A foundation model for time-series forecasting should be able to adapt to variable context and horizon lengths, while having enough capacity to encode all patterns from a large pretraining datasets. Transformers have been shown to be able to adapt to different context lengths in NLP[29]. However, there are several time-series specific design choices. The main guiding principles for our architecture are the following:

Patching. Inspired by the success of patch based modeling in the recent long horizon forecasting work[24] we also choose to break down the time-series into patches during training. A patch of a time-series is a natural analogue for a token in language models and patching has been shown to improve performance. Moreover this improves inference speed as the number of tokens being fed into the transformer is reduced by a factor of the patch length. On the other hand, increasing the patch length all the way to the context length moves us away from decoder-only training and the efficiencies that come with it. We delve into this further in Section6.2.

Decoder-only model. A key difference between our architecture and PatchTST[24] is that our model is trained in decoder-only mode[18]. In other words, given a sequence of input patches, the model is optimized to predict the next patch as a function of all past patches. Similar to LLMs this can be done in parallel over the entire context window, and automatically enables the model to predict the future after having seen varying number of input patches.

Longer output patches. In LLMs the output is always generated in an auto-regressive fashion one token at a time. However, in long-horizon forecasting it has been observed that directly predicting the full horizon yields better accuracy than multi-step auto-regressive decoding[40]. But this is not possible when the horizon length is not known apriori, as in the case of zero-shot forecasting which is our primary goal.

We propose a middle ground by allowing our output patches for prediction to be longer than the input patches. As an example, suppose the input patch length is 32 and output patch length is 128. During training, the model is simultaneously trained to use the first 32 time-points to forecast the next 128 time-steps, the first 64 time-points to forecast time-steps 65 to 192, the first 96 time-points to forecast time-steps 97 to 224 and so on. During inference, suppose the model is given a new time-series of length 256 and tasked with forecasting the next 256 time-steps into the future. The model will first generate the future predictions for time-steps 257 to 384, then condition on the initial 256 length input plus the generated output to generate time-steps 385 to 512. On the other hand, if in a model the output patch length was fixed to the input patch length of 32, then for the same task we would have to go through 8 auto-regressive generation steps instead of just the 2 above. However, there is a trade-off. If the output patch length is too long, then it is difficult to handle time-series whose lengths are less than the output patch length for instance monthly, yearly time-series in our pretraining data.

Patch Masking. If we use patches naively, the model might only learn to predict well for context lengths that are multiples of the input patch length. Therefore we make a careful use of masking during training. Parts of patches as well as entire patches from the beginning of the context window can be masked in a data batch. We employ a specific random masking strategy (described later) during training that helps the model see all possible context lengths starting from 1 to a maximum context length.

Now that we have mentioned the guiding principles, we next formally describe each component of our model architecture (illustrated in Figure1), which we name as TimesFM(Time-series Foundation Model).

A decoder-only foundation model for time-series forecasting (1)

Input Layers. The job of the input layers is to preprocess the time-series into input tokens to the transformer layers. We first break the input into contiguous non-overlapping patches. Then each patch is processed by a Residual Block into a vector of size model_dim. Along with the input, we also supply a binary padding mask 𝐦1:Lsubscript𝐦:1𝐿\mathbf{m}_{1:L}bold_m start_POSTSUBSCRIPT 1 : italic_L end_POSTSUBSCRIPT where 1111 denotes that the corresponding input in 𝐲1:Lsubscript𝐲:1𝐿\mathbf{y}_{1:L}bold_y start_POSTSUBSCRIPT 1 : italic_L end_POSTSUBSCRIPT should be ignored and vice-versa. The Residual Block is essentially a Multi-layer Perceptron (MLP) block with one hidden layer with a skip connection, similar to that defined in[7].

In other words, the inputs 𝐲1:Lsubscript𝐲:1𝐿\mathbf{y}_{1:L}bold_y start_POSTSUBSCRIPT 1 : italic_L end_POSTSUBSCRIPT are broken down into patches of size input_patch_len (p𝑝pitalic_p). The j𝑗jitalic_j-th patch can be denoted as 𝐲~j=𝐲p(j1)+1:pjsubscript~𝐲𝑗subscript𝐲:𝑝𝑗11𝑝𝑗\tilde{\mathbf{y}}_{j}=\mathbf{y}_{p(j-1)+1:pj}over~ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT = bold_y start_POSTSUBSCRIPT italic_p ( italic_j - 1 ) + 1 : italic_p italic_j end_POSTSUBSCRIPT. Similarly the mask can also be patched as 𝐦~j=𝐦p(j1)+1:pjsubscript~𝐦𝑗subscript𝐦:𝑝𝑗11𝑝𝑗\tilde{\mathbf{m}}_{j}=\mathbf{m}_{p(j-1)+1:pj}over~ start_ARG bold_m end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT = bold_m start_POSTSUBSCRIPT italic_p ( italic_j - 1 ) + 1 : italic_p italic_j end_POSTSUBSCRIPT. Then the j𝑗jitalic_j-th input token to the subsequent transformer layers can be denoted as,

𝐭j=𝙸𝚗𝚙𝚞𝚝𝚁𝚎𝚜𝚒𝚍𝚞𝚊𝚕𝙱𝚕𝚘𝚌𝚔(𝐲~j(1𝐦~j))+𝙿𝙴jsubscript𝐭𝑗𝙸𝚗𝚙𝚞𝚝𝚁𝚎𝚜𝚒𝚍𝚞𝚊𝚕𝙱𝚕𝚘𝚌𝚔direct-productsubscript~𝐲𝑗1subscript~𝐦𝑗subscript𝙿𝙴𝑗\displaystyle\mathbf{t}_{j}=\texttt{InputResidualBlock}(\tilde{\mathbf{y}}_{j}%\odot(1-\tilde{\mathbf{m}}_{j}))+\texttt{PE}_{j}bold_t start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT = InputResidualBlock ( over~ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ⊙ ( 1 - over~ start_ARG bold_m end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ) ) + PE start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT(2)

where 𝙿𝙴jsubscript𝙿𝙴𝑗\texttt{PE}_{j}PE start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT denotes the j𝑗jitalic_j-th positional encoding as defined in the original transformer paper[33]. There will be N=L/p𝑁𝐿𝑝N=\mathopen{}\mathclose{{}\left\lfloor{L/p}}\right\rflooritalic_N = ⌊ italic_L / italic_p ⌋ such input tokens.

Stacked Transformer. The bulk of the parameters in our model are in num_layers (nlsubscript𝑛𝑙n_{l}italic_n start_POSTSUBSCRIPT italic_l end_POSTSUBSCRIPT) transformer layers stacked on top of each other. Each of these layers have the standard multi-head self-attention (SA) followed by a feed-forward network (FFN). The main hyperparameters are model_dim which is equal to the dimension of the input tokens 𝐭jsubscript𝐭𝑗\mathbf{t}_{j}bold_t start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT’s and number of heads (num_heads). We set the hidden size of the FFNs to be equal to model_dim as well. We use causal attention that is each output token can only attend to input tokens that come before it in the sequence (including the corresponding input token). This can be described by the equation

𝐨j=𝚂𝚝𝚊𝚌𝚔𝚎𝚍𝚃𝚛𝚊𝚗𝚜𝚏𝚘𝚛𝚖𝚎𝚛((𝐭1,m˙1),\displaystyle\mathbf{o}_{j}=\texttt{StackedTransformer}((\mathbf{t}_{1},\dot{m%}_{1}),bold_o start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT = StackedTransformer ( ( bold_t start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , over˙ start_ARG italic_m end_ARG start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) ,,(𝐭j,m˙j)),\displaystyle\cdots,(\mathbf{t}_{j},\dot{m}_{j})),⋯ , ( bold_t start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT , over˙ start_ARG italic_m end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ) ) ,(3)

for all j[N]𝑗delimited-[]𝑁j\in[N]italic_j ∈ [ italic_N ]. m˙jsubscript˙𝑚𝑗\dot{m}_{j}over˙ start_ARG italic_m end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT is the masking indicator for the j𝑗jitalic_j-th token defined as min{𝐦p(j1)+1:pj}subscript𝐦:𝑝𝑗11𝑝𝑗\min\{\mathbf{m}_{p(j-1)+1:pj}\}roman_min { bold_m start_POSTSUBSCRIPT italic_p ( italic_j - 1 ) + 1 : italic_p italic_j end_POSTSUBSCRIPT } i.e if a patch has any non-masked time-point the corresponding token marked as not being masked. All patches that are masked out completely are not attended to by the causal self attention.

Output Layers. The remaining task is to map the output tokens into predictions. We train in decoder only mode i.e each output token should be able to be predictive of the part of the time-series that follows the last input patch corresponding to it. This is common for popular large language models like[29]. However, one key difference in our time-series foundation model is that input patch length need not be equal to output patch length i.e we should be able to predict a larger chunk of the time-series based on the encoded information from the input patches seen so far. Let the output patch length be output_patch_len (hhitalic_h). We use another Residual Block to map the output tokens to the predictions. This can be described as,

𝐲^pj+1:pj+h=𝙾𝚞𝚝𝚙𝚞𝚝𝚁𝚎𝚜𝚒𝚍𝚞𝚊𝚕𝙱𝚕𝚘𝚌𝚔(𝐨j).subscript^𝐲:𝑝𝑗1𝑝𝑗𝙾𝚞𝚝𝚙𝚞𝚝𝚁𝚎𝚜𝚒𝚍𝚞𝚊𝚕𝙱𝚕𝚘𝚌𝚔subscript𝐨𝑗\displaystyle\hat{\mathbf{y}}_{pj+1:pj+h}=\texttt{OutputResidualBlock}%\mathopen{}\mathclose{{}\left(\mathbf{o}_{j}}\right).over^ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_p italic_j + 1 : italic_p italic_j + italic_h end_POSTSUBSCRIPT = OutputResidualBlock ( bold_o start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ) .(4)

Thus we encode all the data in 𝐲1:pjsubscript𝐲:1𝑝𝑗\mathbf{y}_{1:pj}bold_y start_POSTSUBSCRIPT 1 : italic_p italic_j end_POSTSUBSCRIPT into 𝐨jsubscript𝐨𝑗\mathbf{o}_{j}bold_o start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT and use that to predict the subsequent hhitalic_h time-points 𝐲pj+1:pj+hsubscript𝐲:𝑝𝑗1𝑝𝑗\mathbf{y}_{pj+1:pj+h}bold_y start_POSTSUBSCRIPT italic_p italic_j + 1 : italic_p italic_j + italic_h end_POSTSUBSCRIPT. This is done for all patches in one training mini-batch.

Loss Function. In this work, we focus on point forecasting. Therefore we can use a point forecasting loss during training like Mean Squared Error (MSE). The loss that is minimized during training can be expressed as,

𝚃𝚛𝚊𝚒𝚗𝙻𝚘𝚜𝚜=1Nj=1NMSE(𝐲^pj+1:pj+h,𝐲pj+1:pj+h).𝚃𝚛𝚊𝚒𝚗𝙻𝚘𝚜𝚜1𝑁superscriptsubscript𝑗1𝑁MSEsubscript^𝐲:𝑝𝑗1𝑝𝑗subscript𝐲:𝑝𝑗1𝑝𝑗\displaystyle\texttt{TrainLoss}=\frac{1}{N}\sum_{j=1}^{N}\mathrm{MSE}\mathopen%{}\mathclose{{}\left(\hat{\mathbf{y}}_{pj+1:pj+h},\mathbf{y}_{pj+1:pj+h}}%\right).TrainLoss = divide start_ARG 1 end_ARG start_ARG italic_N end_ARG ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT roman_MSE ( over^ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_p italic_j + 1 : italic_p italic_j + italic_h end_POSTSUBSCRIPT , bold_y start_POSTSUBSCRIPT italic_p italic_j + 1 : italic_p italic_j + italic_h end_POSTSUBSCRIPT ) .(5)

Note that if one is interested in probabilistic forecasting, then it is easy to have multiple output heads for each output patch, each head minimizing a separate quantile loss as in[37]. Another approach can be to output the logits of a probability distribution family and minimize the maximum likelihood loss for probabilistic forecasting[1, 30].

Training. We train the model with standard mini-batch gradient descent in decoder-only fashion, that goes through all windows for a time-series and across time-series. The only non-standard part is the way we sample the mask during training. For each time-series in the batch, we sample a random number r𝑟ritalic_r between 00 and p1𝑝1p-1italic_p - 1. Then we set the 𝐦1:r=1subscript𝐦:1𝑟1\mathbf{m}_{1:r}=1bold_m start_POSTSUBSCRIPT 1 : italic_r end_POSTSUBSCRIPT = 1 and the rest as zero i.e we mask out a fraction of the first input patch. However, this is sufficient to cover all input context lengths from 1 to the maximum training context length. We explain this using an example below:

Suppose the maximum context length is 512 and p=32𝑝32p=32italic_p = 32. Then if r=4𝑟4r=4italic_r = 4, the output prediction after seeing the first patch (from 𝐨1subscript𝐨1\mathbf{o}_{1}bold_o start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT) is optimized to predict after seeing 28=3242832428=32-428 = 32 - 4 time-points, the output of the next patch (from 𝐨2subscript𝐨2\mathbf{o}_{2}bold_o start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT) is optimized to predict after seeing 28+32283228+3228 + 32 time-points, and so on. When this argument is repeated for all such r𝑟ritalic_r’s, the model has seen all possible context lengths till 512512512512.

Inference. The trained network can be used to produce forecasts for any horizon using auto-regressive decoding similar to large language models. Given an input 𝐲1:Lsubscript𝐲:1𝐿\mathbf{y}_{1:L}bold_y start_POSTSUBSCRIPT 1 : italic_L end_POSTSUBSCRIPT (assume L𝐿Litalic_L is a multiple of p𝑝pitalic_p for simplicity) it can first predict 𝐲^L+1:L+hsubscript^𝐲:𝐿1𝐿\hat{\mathbf{y}}_{L+1:L+h}over^ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_L + 1 : italic_L + italic_h end_POSTSUBSCRIPT. Then, we can use the concatenated vector 𝐲~1:L+h=[𝐲1:L;𝐲^L+1:L+h]subscript~𝐲:1𝐿subscript𝐲:1𝐿subscript^𝐲:𝐿1𝐿\tilde{\mathbf{y}}_{1:L+h}=[\mathbf{y}_{1:L};\hat{\mathbf{y}}_{L+1:L+h}]over~ start_ARG bold_y end_ARG start_POSTSUBSCRIPT 1 : italic_L + italic_h end_POSTSUBSCRIPT = [ bold_y start_POSTSUBSCRIPT 1 : italic_L end_POSTSUBSCRIPT ; over^ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_L + 1 : italic_L + italic_h end_POSTSUBSCRIPT ] as an input to the network to generate the next output patch prediction 𝐲^L+h+1:L+2hsubscript^𝐲:𝐿1𝐿2\hat{\mathbf{y}}_{L+h+1:L+2h}over^ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_L + italic_h + 1 : italic_L + 2 italic_h end_POSTSUBSCRIPT and so on. If L𝐿Litalic_L is not a multiple of p𝑝pitalic_p, we simply append zeros to make it a multiple of p𝑝pitalic_p and mark the corresponding entries in the mask as 1.

5 Pretraining Details

We would like our pretraining corpus to include large volumes of temporal data representing a variety of domains, trend and seasonality patterns and time granularities that ideally capture the forecasting use-cases which we are interested in serving by the deployed model. It is challenging to find a large time-series dataset that meets the volume and diversity of data needed for training our foundation model. We address this problem by sourcing the bulk of data used to train our models from three major sources: Google trends, Wiki Pageview statistics and synthetic time-series. In summary the main data sources are:

Google Trends. Google Trends333https://trends.google.com captures search interest over time for millions of queries. We choose around22k head queries based on their search interest over 15 years from 2007 to 2022. Beyond these head queries the time-series become more than 50% sparse. We download the search interest over time for these queries in hourly, daily, weekly and monthly granularities to form our dataset. The date ranges are Jan. 2018 to Dec. 2019 for hourly and Jan. 2007 to Dec. 2021 for the other granularities. The trends datasets amounts to roughly 0.5B time-points.

Wiki Pageviews. Wiki Pageviews444https://en.wikipedia.org/wiki/Wikipedia:Pageview_statistics captures the hourly views of all Wikimedia pages. We download all pageview data from Jan. 2012 to Nov. 2023, clean and aggregate the views by page into hourly, daily, weekly and monthly granularities, and filter out pageview time-series with excessive zeros. The final corpus contains roughly 300B time-points.

Synthetic Data. Another major component of our pretraining data is of synthetic origin. We create generators for ARMA[20] processes, seasonal patterns (mixture of sines and cosines of different frequencies), trends (linear, exponential with a few change-points) and step functions. A synthetic time-series can be an additive combination of one or more of these processes. We create 3M synthetic time-series each of length 2048 time-points. More details about our synthetic data generation are presented in AppendixA.8.

Other real-world data sources. Along with the wiki and trends data, we also add time-series from several other publicly available datasets to our pretraining corpus. We add all the granularities of the M4 dataset[22], the hourly and 15 minute Electricity and the hourly Traffic datasets (see [44]). We also add the 10-minute granularity Weather dataset used for evaluations in[44]. M4 has a good mix of granularities with around100k time-series in total. Traffic and Electricity are large long-term forecasting datasets with >>> 800 and >>> 300 time-series each having tens of thousands of time-points. In addition, we add all the 15 min granularity traffic time-series from[36].

DatasetGranularity# Time series# Time points
Synthetic3,000,0006,144,000,000
ElectricityHourly3218,443,584
TrafficHourly86215,122,928
Weather[44]10 Min422,213,232
Favorita SalesDaily111,840139,179,538
LibCity[36]15 Min6,15934,253,622
M4 hourlyHourly414353,500
M4 dailyDaily4,2279,964,658
M4 monthlyMonthly48,00010,382,411
M4 quarterlyQuarterly24,0002,214,108
M4 yearlyYearly22,739840,644
Wiki hourlyHourly5,608,693239,110,787,496
Wiki dailyDaily68,448,204115,143,501,240
Wiki weeklyWeekly66,579,85016,414,251,948
Wiki monthlyMonthly63,151,3063,789,760,907
Trends hourlyHourly22,435393,043,680
Trends dailyDaily22,435122,921,365
Trends weeklyWeekly22,43516,585,438
Trends monthlyMonthly22,4353,821,760

Dataset Mixing and Training. We train on a mixture distribution over these datasets that aims to give sufficient weight to all granularities and datasets. The training loader samples 80% real data and 20% synthetic, with the real data mixture providing equal weights to the groups: hourly + sub-hourly, daily, weekly, and monthly datasets.We train with a maximum context length of 512 whenever the length of the time-series allows that. For weekly granularity we do not have sufficiently long time-series; therefore a maximum context length of 256 is used. For the same reason, a maximum context length of 64 is used while training on \geq monthly granularity data. We also use only the standard normalization part of reversible instance normalization[16] – i.e, the context of each time-series is scaled by the context mean and standard deviation of the first input patch in the context.

A decoder-only foundation model for time-series forecasting (2)
A decoder-only foundation model for time-series forecasting (3)
A decoder-only foundation model for time-series forecasting (4)

6 Empirical Results

We evaluate our model in zero-shot settings on three groups of well known public datasets against the best performing baselines for each group. These datasets have been intentionally held out from our pretraining data. We show that a single pretrained model can come close or surpass the performance of baselines models on the benchmarks even when the baselines are specially trained or tuned for each specific task. Subsequently, we perform ablation studies that justify different choices made in our architecture.

6.1 Zero-shot Evaluation

To benchmark our model’s performance, we choose three groups of commonly used forecastingdatasets that cover various domains, sizes, granularities, and horizon lengths: Darts[14], Monash[9] and Informer datasets[44], to test the generalization power of our foundation model against other baselines.

In all cases, we report performance on the official metrics and scalings of the datasets, using either their standard test splits or common test splits in other literature. We present a summary of the results below - more details can be found in AppendixA.5. We provide the hyper-parameters and other details about our model in AppendixA.6.

Monash[9]. Monash archive is a collection of 30 datasets of different training and prediction lengths that covers granularities ranging from minutes to years and domains including finance, demand forecasting, weather and traffic. The archive reports four official metrics for several statistical baselines such as Exponential Smoothing(ETS) and ARIMA, as well as supervised ML baselines like CatBoost[28], DeepAR[30] and WaveNet[27]. Following llmtime[11] we start from the Monash Huggingface repository555https://huggingface.co/datasets/monash_tsf and filter out the datasets that contain missing values. This leaves us with 18 datasets which we specify in AppendixA.5.2.

Out of the four official metrics, following prior work[11], we report our performance in terms of mean MAE (see AppendixA.2). As the datasets have massively different scales, for each dataset we normalize the metric by the metric achieved by a naive baseline that just constantly predicts the last value in the context for each time-series. Then the scaled MAE’s are averaged across all datasets. The scaled aggregation was also used in[11]. In Figure1(a), we use the Geometric Mean (GM) for averaging since it is more robust for normalized metrics[8]. We also report the Arithmetic Mean based aggregated metrics in Figure4 in the appendix.

The mean scaled MAE across all datasets is plotted in Figure1(a) along with standard error bars. We compare the performance of TimesFMwith the baseline models implemented in Monash, and the zero-shot llmtime[11] model that uses GPT-3[29] with a specific prompting technique. Note that the zero-shot models are marked as (Zero-Shot). TimesFMis the top model even though we never trained on these datasets. It is slightly better but within significance of N-BEATS but outperforms deep supervised models like DeepAR[30], and improves on llmtime’s performance by more than 25%.

Darts[14]. This is a collection of 8 univariate datasets which include interesting seasonalities and additive+multiplicative trends. We report performance of several baselines implemented in the Darts package like TCN[19], N-HiTS[5] and N-BEATS[25]. All these baselines are supervised. As before, we also report zero-shot forecasting results from llmtime[11] using GPT-3[29]. Other supervised baselines in[11] like SM-GP[35] and ARIMA[20] are also added.

We report the official metric for this dataset group that is MAE for each individual dataset in AppendixA.5. In Figure1(b), we present the average scaled MAE across all 8 datasets, as we did for the Monash datasets. TimesFMis within statistical significance of the best models that is llmtime and seasonal ARIMA in this case. Note that since there are only 8 individual time-series in this dataset group, the standard errors are not sharp and therefore does not provide a clear ordering among the models. Also, note that for ARIMA, the seasonality needs to be encoded correctly in the parameters for the best results, which needed manual tuning. Further, since these datasets are used in numerous time series blog posts for illustrative purposes, data contamination for llmtime cannot be ruled out.

Informer[44]. The Informer datasets have been widely used for benchmarking various supervised long-horizon forecasting methods. A few of these datasets are used in pretraining, so we focus on the other datasets in this collection (ETTm1, ETTm2. ETTh1 and ETTh2) related to electricity transformer temperatures over a two year period in 1111 hour and 15151515 minutes granularities. Note that the long horizon baselines usually report rolling validation results on the test set which would amount to millions of tokens for evaluating llmtime[11] and would be too expensive. Therefore, following llmtime, we compare all methods on the last test window. Also, it is reasonable to directly average the MAE for these datasets since the results are reported on standard normalized dataset (using the statistics of the training portion).

We consider the task of predicting horizon length 96 and 192, given a context length of 512 for all methods. The MAE averaged over all 8 tasks (4 datasets with two horizons each) is presented in Figure1(b). TimesFMperforms the best and the supervised PatchTST[24] baseline (which is a state-of-the-art long horizon deep forecasting method) is within significance of it. The other long horizon methods are quite a bit worse even though they have been trained these datasets. llmtime is better than FEDFormer but worse than PatchTST with statistical significance.

We present visual examples of our forecasts along with baselines in AppendixA.9.

6.2 Ablation

A decoder-only foundation model for time-series forecasting (5)
A decoder-only foundation model for time-series forecasting (6)
A decoder-only foundation model for time-series forecasting (7)
A decoder-only foundation model for time-series forecasting (8)

Next, we perform several ablation studies that inform the design decisions we made for our model architecture.

Scaling. Performance curves with respect to number of parameters in a model have been a keenly studied area in the context of LLMs. [17] established a power law like relationship between the number of parameters in a language model and its downstream performance i.e the more the number of paramaters the better the performance. However, [13] established a more nuanced scaling law that lays down methods to train compute optimal models based on the number of tokens available in a training dataset.

We perform a preliminary scaling study where we train three TimesFMmodels of sizes 17M, 70M and 200M parameters, using the same pre-training dataset till 1.5M iterations with a global batch-size of 4096. Then we collect checkpoints that represent varying number of FLOPS (Floating Point OPerationS) across the different model runs. Then we plot the performance on Scaled MAE (GM) on Monash as a function of FLOPS, in Figure2(a). This is now a standard way to perform scaling studies in LLMs (see recent work like[10]). It can be clearly seen that the errors decrease monotonically with the number of FLOPS (in log scale). All experiments were performed on a TPUv5e666https://cloud.google.com/tpu/docs/v5e-training setup with 16 tensor-cores. For the 200M model it takes 2 days to complete 1.5M iterations on our setup.

Autoregressive Decoding. In recent long-term forecasting works[40, 24, 7] it has been observed that directly predicting the entire forecasting horizon in one shot from a decoder can yield better results than auto-regressive decoding on long horizon benchmarks. For a foundation model, the horizon length of the task is not known before inference time, therefore one-shot decoding might not be possible for very long horizons. However, as mentioned earlier, by keeping the output_patch_len longer than input_patch_len one can ensure fewer autoregressive steps. This was one of the key decisions in the design of TimesFM, that is quite different from LLMs. In order to showcase this we choose the task of predicting 512 time-steps into the future for the ETT datasets on the original rolling validation task of the ETT test sets[44]. In Figure2(b), we present results from models with output_patch_len varying from 8 to 128. We see a monotonic decrease in average MAE with output_patch_len.

Input Patch Length. The size of input_patch_len represents an important trade-off. We have typically seen that increasing its value from 8 to 32 increases performance but having too high a input_patch_len is impractical since that makes the model shift from decoder only training more towards encoder-decoder style training. Note that in the "Training" paragraph of Section4, we describe the mask sampling strategy to support any context length. If in the extreme case p𝑝pitalic_p is set the maximum context length we have to individually sample all possible context windows from 1 to maximum context length, which would be required for encoder-decoder style of training.

In Figure2(c), we show the mean scaled MAE (GM) TimesFM(ZS) - 70M model on Monash with input_patch_len varying from 8 to 128. Note that both models have been trained to about 1.5M steps even though the p=8 model is three times slower to train. We can see that p=16,32𝑝1632p=16,32italic_p = 16 , 32 marks the best performance, with the error increasing towards either end. Note that p=32𝑝32p=32italic_p = 32 model is almost twice as fast to train compared to p=16𝑝16p=16italic_p = 16 and thus constitutes a prudent choice.

Dataset Ablation.Next we showcase the need for synthetic data. Intuitively, the majority of our real datasets have commonly found granularities like hourly, daily etc which have specific periodic patterns like 24 time-point period for hourly data. This can make the model not generalize well to underrepresented frequencies. We train a 200M model with no synthetic data added in the mix and showcase the performance on Monash and ETT datasets in Figure3. It can be seen that there is a performance drop on Monash because many of the datasets in Monash have under-represented granularities like quarterly, yearly or 10 minutes etc. Perhaps even more compelling is the comparison on ETT datasets. We can see that there is almost no difference between the two models on the hourly ETTh datasets which has a well represented granularity. However, for the 15min ETTm datasets the model with synthetic data performs quite a bit better.

We provide a finetuning study in the same setting as[42] in AppendixA.3, where our model performs better than all baselines on all the reported datasets. This shows the utility of our model on downstream tasks.

7 Conclusion

In this paper, we presented TimesFM, a practical foundation model for forecasting whose zero-shot performance comes close to the accuracy of fully-supervised forecasting models on a diverse set of time-series data. This model is pretrained on real-world and synthetic datasets comprising O(100B) timepoints. We discuss limitations and future work in more detail in AppendixA.1.

8 Impact Statement

This paper shows that it is possible to train a single pretrained model that has phenomenal zero-shot performance on a variety of forecasting tasks, thus opening up exciting possibilities for downstream applications. Therefore it is crucial to discuss ethical and societal considerations of using such a model and how some of the related concerns can be mitigated.

Data Privacy. Note that most of our data sources are publicly available and are aggregated i.e no individual user activity constitutes a time-point. Further the Google Trends data is differentially private.

Bias. Biases can creep into a foundation model through a variety of sources especially through data. The model might perpetuate these biases in forecasts, leading to unfair outcomes. Biased forecasts can have real-world consequences. For example, a biased forecast of crime rates in a neighborhood could lead to increased police presence, disproportionately impacting certain communities. Note that our model is not trained with any covariates so some of these sensitivities are reduced but cannot be ruled out.

In this regard, we believe that it is best to release the exact details of the datasets used for training and therefore we have summarized our data sources in Table1. Moreover we plan to do a open weights release of our model so that the community can analyze the model for downstream tasks. We will ensure that we release a good model card[23]. This will also aid in finetuning the model with more diverse data-sources.

Training cost. Our largest model has 200M parameters which is much smaller compared to even smaller scale LLMs. Our data volume is quite large but still smaller compared to SOTA LLMs. We have revealed the exact computation requirements for the models i.e 16 core TPUv5e for 2 days. Note that experimentation and trial runs of course cost more than the final model run. Therefore in the interest of equitability we would like to release the weights of our model in a responsible manner.

Lastly we would like to note that similar to LLMs there could be inputs on which the model does not perform well or hallucinates. Therefore in many critical use cases it might be recommended to use the model in a human-in-the-loop fashion or alternatively do a wide range of testing or finetuning.

References

  • ADSS [21]Pranjal Awasthi, Abhimanyu Das, Rajat Sen, and AnandaTheertha Suresh.On the benefits of maximum likelihood estimation for regression and forecasting.arXiv preprint arXiv:2106.10370, 2021.
  • BBO [17]Anastasia Borovykh, Sander Bohte, and CornelisW Oosterlee.Conditional time series forecasting with convolutional neural networks.arXiv preprint arXiv:1703.04691, 2017.
  • BJ [68]GeorgeEP Box and GwilymM Jenkins.Some recent advances in forecasting and control.Journal of the Royal Statistical Society. Series C (Applied Statistics), 17(2):91–109, 1968.
  • CLY+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [23]Si-An Chen, Chun-Liang Li, Nate Yoder, SercanO Arik, and Tomas Pfister.Tsmixer: An all-mlp architecture for time series forecasting.arXiv preprint arXiv:2303.06053, 2023.
  • COO+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [23]Cristian Challu, KinG. Olivares, BorisN. Oreshkin, Federico Garza, Max Mergenthaler, and Artur Dubrawski.NHITS: Neural Hierarchical Interpolation for Time Series forecasting.In The Association for the Advancement of Artificial Intelligence Conference 2023 (AAAI 2023), 2023.
  • CPC [23]Ching Chang, Wen-Chih Peng, and Tien-Fu Chen.Llm4ts: Two-stage fine-tuning for time-series forecasting with pre-trained llms.arXiv preprint arXiv:2308.08469, 2023.
  • DKL+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [23]Abhimanyu Das, Weihao Kong, Andrew Leach, ShaanK Mathur, Rajat Sen, and Rose Yu.Long-term forecasting with TiDE: Time-series dense encoder.Transactions on Machine Learning Research, 2023.
  • FW [86]PhilipJ Fleming and JohnJ Wallace.How not to lie with statistics: the correct way to summarize benchmark results.Communications of the ACM, 29(3):218–221, 1986.
  • GBW+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [21]Raksh*tha Godahewa, Christoph Bergmeir, GeoffreyI Webb, RobJ Hyndman, and Pablo Montero-Manso.Monash time series forecasting archive.arXiv preprint arXiv:2105.06643, 2021.
  • GD [23]Albert Gu and Tri Dao.Mamba: Linear-time sequence modeling with selective state spaces.arXiv preprint arXiv:2312.00752, 2023.
  • GFQW [23]Nate Gruver, Marc Finzi, Shikai Qiu, and AndrewGordon Wilson.Large language models are zero-shot time series forecasters.arXiv preprint arXiv:2310.07820, 2023.
  • GMC [23]Azul Garza and Max Mergenthaler-Canseco.Timegpt-1.arXiv preprint arXiv:2310.03589, 2023.
  • HBM+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [22]Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego deLas Casas, LisaAnne Hendricks, Johannes Welbl, Aidan Clark, etal.Training compute-optimal large language models.arXiv preprint arXiv:2203.15556, 2022.
  • HLP+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [22]Julien Herzen, Francesco Lässig, SamueleGiuliano Piazzetta, Thomas Neuer, Léo Tafti, Guillaume Raille, Tomas VanPottelbergh, Marek Pasieka, Andrzej Skrodzki, Nicolas Huguenin, etal.Darts: User-friendly modern machine learning for time series.The Journal of Machine Learning Research, 23(1):5442–5447, 2022.
  • KKN+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [21]Michael Kopp, David Kreil, Moritz Neun, David Jonietz, Henry Martin, Pedro Herruzo, Aleksandra Gruca, Ali Soleymani, Fanyou Wu, Yang Liu, Jingwei Xu, Jianjin Zhang, Jay Santokhi, Alabi Bojesomo, HasanAl Marzouqi, Panos Liatsis, PakHay Kwok, QiQi, and Sepp Hochreiter.Traffic4cast at neurips 2020 - yet more on the unreasonable effectiveness of gridded geo-spatial processes.In HugoJair Escalante and Katja Hofmann, editors, Proceedings of the NeurIPS 2020 Competition and Demonstration Track, volume 133 of Proceedings of Machine Learning Research, pages 325–343. PMLR, 06–12 Dec 2021.
  • KKT+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [21]Taesung Kim, Jinhee Kim, Yunwon Tae, Cheonbok Park, Jang-Ho Choi, and Jaegul Choo.Reversible instance normalization for accurate time-series forecasting against distribution shift.In International Conference on Learning Representations, 2021.
  • KMH+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [20]Jared Kaplan, Sam McCandlish, Tom Henighan, TomB Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei.Scaling laws for neural language models.arXiv preprint arXiv:2001.08361, 2020.
  • LSP+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [18]PeterJ Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer.Generating wikipedia by summarizing long sequences.arXiv preprint arXiv:1801.10198, 2018.
  • LVRH [16]Colin Lea, Rene Vidal, Austin Reiter, and GregoryD Hager.Temporal convolutional networks: A unified approach to action segmentation.In Computer Vision–ECCV 2016 Workshops: Amsterdam, The Netherlands, October 8-10 and 15-16, 2016, Proceedings, Part III 14, pages 47–54. Springer, 2016.
  • McK [84]EDMcKenzie.General exponential smoothing and the equivalent arma process.Journal of Forecasting, 3(3):333–344, 1984.
  • MLZ+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [23]Qianli Ma, Zhen Liu, Zhenjing Zheng, Ziyang Huang, Siying Zhu, Zhongzhong Yu, and JamesT Kwok.A survey on time-series pre-trained models.arXiv preprint arXiv:2305.10716, 2023.
  • MSA [22]Spyros Makridakis, Evangelos Spiliotis, and Vassilios Assimakopoulos.M5 accuracy competition: Results, findings, and conclusions.International Journal of Forecasting, 38(4):1346–1364, 2022.
  • MWZ+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [19]Margaret Mitchell, Simone Wu, Andrew Zaldivar, Parker Barnes, Lucy Vasserman, Ben Hutchinson, Elena Spitzer, InioluwaDeborah Raji, and Timnit Gebru.Model cards for model reporting.In Proceedings of the conference on fairness, accountability, and transparency, pages 220–229, 2019.
  • NNSK [22]Yuqi Nie, NamH Nguyen, Phanwadee Sinthong, and Jayant Kalagnanam.A time series is worth 64 words: Long-term forecasting with transformers.International conference on learning representations, 2022.
  • OCCB [19]BorisN Oreshkin, Dmitri Carpov, Nicolas Chapados, and Yoshua Bengio.N-beats: Neural basis expansion analysis for interpretable time series forecasting.In International Conference on Learning Representations, 2019.
  • OCCB [21]BorisN Oreshkin, Dmitri Carpov, Nicolas Chapados, and Yoshua Bengio.Meta-learning framework with applications to zero-shot time-series forecasting.In Proceedings of the AAAI Conference on Artificial Intelligence, volume35, pages 9242–9250, 2021.
  • ODZ+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [16]Aaron vanden Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu.Wavenet: A generative model for raw audio.arXiv preprint arXiv:1609.03499, 2016.
  • PGV+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [18]Liudmila Prokhorenkova, Gleb Gusev, Aleksandr Vorobev, AnnaVeronika Dorogush, and Andrey Gulin.Catboost: unbiased boosting with categorical features.Advances in neural information processing systems, 31, 2018.
  • RWC+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [19]Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, etal.Language models are unsupervised multitask learners.OpenAI blog, 1(8):9, 2019.
  • SFGJ [20]David Salinas, Valentin Flunkert, Jan Gasthaus, and Tim Januschowski.Deepar: Probabilistic forecasting with autoregressive recurrent networks.International Journal of Forecasting, 36(3):1181–1191, 2020.
  • SYD [19]Rajat Sen, Hsiang-Fu Yu, and InderjitS Dhillon.Think globally, act locally: A deep neural network approach to high-dimensional time series forecasting.Advances in neural information processing systems, 32, 2019.
  • TL [18]SeanJ Taylor and Benjamin Letham.Forecasting at scale.The American Statistician, 72(1):37–45, 2018.
  • VSP+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [17]Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, AidanN Gomez, Łukasz Kaiser, and Illia Polosukhin.Attention is all you need.Advances in neural information processing systems, 30, 2017.
  • VW [23]Isabella Verdinelli and Larry Wasserman.Feature importance: A closer look at shapley values and loco.arXiv preprint arXiv:2303.05981, 2023.
  • WA [13]Andrew Wilson and Ryan Adams.Gaussian process kernels for pattern discovery and extrapolation.In International conference on machine learning, pages 1067–1075. PMLR, 2013.
  • WJJ+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [23]Jingyuan Wang, Jiawei Jiang, Wenjun Jiang, Chengkai Han, and WayneXin Zhao.Towards efficient and comprehensive urban spatial-temporal prediction: A unified library and performance benchmark.arXiv preprint arXiv:2304.14343, 2023.
  • WTNM [17]Ruofeng Wen, Kari Torkkola, Balakrishnan Narayanaswamy, and Dhruv Madeka.A multi-horizon quantile recurrent forecaster.arXiv preprint arXiv:1711.11053, 2017.
  • WWS+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [22]Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, EdChi, QuocV Le, Denny Zhou, etal.Chain-of-thought prompting elicits reasoning in large language models.Advances in neural information processing systems, 35:24824–24837, 2022.
  • WXWL [21]Haixu Wu, Jiehui Xu, Jianmin Wang, and Mingsheng Long.Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting.Advances in Neural Information Processing Systems, 34:22419–22430, 2021.
  • ZCZX [23]Ailing Zeng, Muxi Chen, Lei Zhang, and Qiang Xu.Are transformers effective for time series forecasting?Proceedings of the AAAI conference on artificial intelligence, 2023.
  • ZMW+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [22]Tian Zhou, Ziqing Ma, Qingsong Wen, Xue Wang, Liang Sun, and Rong Jin.Fedformer: Frequency enhanced decomposed transformer for long-term series forecasting.In International Conference on Machine Learning, pages 27268–27286. PMLR, 2022.
  • ZNW+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [23]Tian Zhou, Peisong Niu, Xue Wang, Liang Sun, and Rong Jin.One fits all: Power general time series analysis by pretrained lm.arXiv preprint arXiv:2302.11939, 2023.
  • ZW [06]Eric Zivot and Jiahui Wang.Vector autoregressive models for multivariate time series.Modeling financial time series with S-PLUS®, pages 385–429, 2006.
  • ZZP+{}^{+}start_FLOATSUPERSCRIPT + end_FLOATSUPERSCRIPT [21]Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang.Informer: Beyond efficient transformer for long sequence time-series forecasting.In Proceedings of the AAAI conference on artificial intelligence, 2021.

Appendix A Appendix

A.1 Limitations and Future Work

Our work shows that we can train a 200M parameter pretrained forecasting model that has impressive zero-shot performance on a variety of real world forecasting benchmarks with different context and horizon lengths. In this section we would like to discuss limitations and future work.

Prompt Tuning. In LLMs it is well known that prompt tuning techniques like chain-of-thought[38] can drastically improve performance in cases where the model is inaccurate with simple prompts. Such techniques are less clear for time-series foundation model. We can tune simple hyper-parameters like context length as the moment. However, with probabilistic forecasting we might be able to output different statistics as well as come up with techniques that align more with user’s expectations while not decreasing likelihood.

Probabilistic Forecasting. It should be straightforward to train with probabilistic loss functions in our framework as detailed in the "Loss Function" part of Section4. However, being one of the first works of building a single foundation model for forecasting, this was not our main focus and is left to future explorations. Note that as mentioned before we plan to release our model weights and after that such loss functions[30, 1] can be added during finetuning.

Covariate handling. Currently the model is not pretrained with covariates as one of the key challenges is finding large volumes of pretrained data with meaningful covariates (apart from date features). We also need methods to have a joint universal representation of covariates. Currently there are two simple techniques we can think of for handling covariates (i) In a zero-shot setting at inference time we can predict in-context and linearly regress the residual on covaraites. Then our model + the residual model can be used for forecasting in the horizon. (ii) during finetuning it is straightforward to handle covariates by adding them as inputs to the input and output residual blocks. Categorical variables can be added as embeddings.

More finetuning studies. We perform a fintuning study in AppendixA.3 following a prior work. However, a more in depth study that involves finetuning in the presence of covariates would be beneficial. This being one of the first works of building a single foundation model for forecasting, this was not our main focus and is left to future explorations. Ideas in recent work such as[4] could be useful in this regard.

Other architectures. Given the cost of training foundation models we did not perform much hyper-parameter tuning in our pretraining, while following some well established best practices for training transformers. In a similar vein, it would also be interesting to try out alternatives like the exciting directions of all MLP structures like[4] or efficient linear state space models like Mamba[10] (and references there in).

Interpretability. Deep foundation models trained on a huge corpuses of data could be inherently less interpretable compared to statistical methods like ARIMA, ETS[3]. In this regard methods like LOCO, SHAP (see[34] and references there in) could be used to some extent to attribute feature importances to different lags in the context supplied to the model. However, this does not solve the problem to a full extent and one of the best things to do would be to open source a version of the model with a proper model card.[23].

A.2 Metrics

The metrics that are used for reporting results in this paper are:

  • MAE[9]

    MAE(𝐲L+1:L+H,𝐲^L+1:L+H)=1H𝐲L+1:L+H𝐲^L+1:L+H1.MAEsubscript𝐲:𝐿1𝐿𝐻subscript^𝐲:𝐿1𝐿𝐻1𝐻subscriptnormsubscript𝐲:𝐿1𝐿𝐻subscript^𝐲:𝐿1𝐿𝐻1\mathrm{MAE}\mathopen{}\mathclose{{}\left(\mathbf{y}_{L+1:L+H},\hat{\mathbf{y}%}_{L+1:L+H}}\right)\\=\frac{1}{H}\mathopen{}\mathclose{{}\left\|{\mathbf{y}_{L+1:L+H}-\hat{\mathbf{%y}}_{L+1:L+H}}}\right\|_{1}.roman_MAE ( bold_y start_POSTSUBSCRIPT italic_L + 1 : italic_L + italic_H end_POSTSUBSCRIPT , over^ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_L + 1 : italic_L + italic_H end_POSTSUBSCRIPT ) = divide start_ARG 1 end_ARG start_ARG italic_H end_ARG ∥ bold_y start_POSTSUBSCRIPT italic_L + 1 : italic_L + italic_H end_POSTSUBSCRIPT - over^ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_L + 1 : italic_L + italic_H end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT .(6)
  • msMAPE[9]

    msMAPE(𝐲L+1:L+H,𝐲^L+1:L+H)=1Hi=1H2|yL+iy^L+i|max{|yL+i|+|y^L+i|+ϵ,0.5+ϵ}.msMAPEsubscript𝐲:𝐿1𝐿𝐻subscript^𝐲:𝐿1𝐿𝐻1𝐻superscriptsubscript𝑖1𝐻2subscript𝑦𝐿𝑖subscript^𝑦𝐿𝑖subscript𝑦𝐿𝑖subscript^𝑦𝐿𝑖italic-ϵ0.5italic-ϵ\mathrm{msMAPE}\mathopen{}\mathclose{{}\left(\mathbf{y}_{L+1:L+H},\hat{\mathbf%{y}}_{L+1:L+H}}\right)\\=\frac{1}{H}\sum_{i=1}^{H}\frac{2\lvert y_{L+i}-\hat{y}_{L+i}\rvert}{\max%\mathopen{}\mathclose{{}\left\{\lvert y_{L+i}\rvert+\lvert\hat{y}_{L+i}\rvert+%\epsilon,0.5+\epsilon}\right\}}.roman_msMAPE ( bold_y start_POSTSUBSCRIPT italic_L + 1 : italic_L + italic_H end_POSTSUBSCRIPT , over^ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_L + 1 : italic_L + italic_H end_POSTSUBSCRIPT ) = divide start_ARG 1 end_ARG start_ARG italic_H end_ARG ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_H end_POSTSUPERSCRIPT divide start_ARG 2 | italic_y start_POSTSUBSCRIPT italic_L + italic_i end_POSTSUBSCRIPT - over^ start_ARG italic_y end_ARG start_POSTSUBSCRIPT italic_L + italic_i end_POSTSUBSCRIPT | end_ARG start_ARG roman_max { | italic_y start_POSTSUBSCRIPT italic_L + italic_i end_POSTSUBSCRIPT | + | over^ start_ARG italic_y end_ARG start_POSTSUBSCRIPT italic_L + italic_i end_POSTSUBSCRIPT | + italic_ϵ , 0.5 + italic_ϵ } end_ARG .(7)

    In Monash benchmarks[9] ϵ=0.1italic-ϵ0.1\epsilon=0.1italic_ϵ = 0.1 was used. This metric is used in order to avoid undefined values in other normalized metrics like MAPE. In multivariate datasets the metrics are calculated for each time-series and then we take the mean or the median. In this paper we only use the mean versions.

Aggregating across datasets. Since the datasets have wildly different scales averaging unnormalized metrics like MAE is not kosher. Therefore following[11] we scale the metric of each baseline for a dataset by the same metric achieved by a naive baseline on that dataset. The naive baseline just makes the constant prediction yLsubscript𝑦𝐿y_{L}italic_y start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT repeated across the prediction length. We did not need to do that for the Informer datasets since on these datasets metrics are usually reported on standard normalized data[24].

A.3 Finetuning study on ETT

In this section, we test whether TimesFMcan be fintuned on a small fraction of a dataset to provide even better performance. We follow the same protocol as in GPT4TS[42] (see Table 13 in their paper). [42] finetune GPT2 input and output blocks on long-term forecasting benchmarks on 10% of the of the original datasets and compare it against models trained from scratch on the same data. Then the models are evaluated on the original test set task of[44]. We also tune the input and output residual blocks on 10% of the training set and present the results in Table2. We can see that our model performs the best by a large margin. In ETTh1, ETTh2, ETTm1 our finetuned model is better than 18%, 3% and 12% better than GPT4TS, respectively. In fact we can see our 10% finetuned model’s performances are comparable or better than that of most baselines trained on the whole training dataset as reported in Table 14 of [42]. This shows that the inductive biases encoded in our model weights by finetuning on a large time-series corpus are better for downstream forecasting task than an off the shelf language model like GPT2, even though our model is orders of magnitude smaller.

DatasetTimesFM(FT)GPT4TS(FT)DLinearPatchTSTTimeNetFEDFormerAutoformer
ETTh1960.3980.4560.4950.4850.6280.4990.552
1920.4240.5160.5380.5240.5930.5550.598
3360.4360.5350.6220.5500.6480.5740.619
7200.4450.5910.7430.6100.6410.6140.616
Avg0.4260.5250.6000.5420.6280.5610.596
ETTh2960.3560.3740.4110.3890.4090.4160.451
1920.4000.4110.5190.4140.4670.4740.477
3360.4280.4330.5720.4410.4940.5010.543
7200.4570.4640.6480.4800.4910.5090.523
Avg0.4100.4210.5380.4310.4650.4750.499
ETTm1960.3450.4040.3920.4190.5010.5180.614
1920.3740.4230.4120.4340.5280.5460.592
3360.3970.4390.4340.4540.5680.7750.677
7200.4360.4980.4770.5560.5490.5790.630
Avg0.3880.4410.4290.4660.5370.6050.628
ETTm2960.2630.2690.3030.2740.2850.3990.454
1920.3090.3090.3450.3170.3230.3790.691
3360.3490.3460.3850.3530.3530.5591.407
7200.4150.4170.4400.4270.4490.6141.166
Avg0.3340.3350.3680.3430.3530.4880.930

A.4 Pretraining PatchTST

Since TimesFMapplies a similar patching strategy as PatchTST[24], for an ablation study we use the same data loader and pretrain a PatchTST model of 200M parameters to the same number of FLOPS as the final 200M TimesFMmodel. We denote it as PatchTST(ZS). The two models share the same hyperparameters of the transformer stack. For PatchTST(ZS) we use the same input patch length = 32, and a stride of length half of input patch size (i.e. stride = 16) as done in the original PatchTST paper.

We report the detailed results on Monash and ETT in AppendixA.5.2 andA.5.3. It can be seen that the results are not that good for PatchTST(ZS) on Monash. This is expected since our pretrain data loader will predominantly have context lengths of 512 instead of shorter context lengths as in Monash. Moreover the PatchTST model does fewer iterations at the same number of FLOPS. On ETT datasets, the PatchTST(ZS) model is performs similarly to TimesFM(ZS) and PatchTST. This is also expected since the context length for this study is indeed 512.

As PatchTST(ZS) is an encoder-decoder model, to pretrain it for zero shot forecasting one should theoretically prepare all possible context lengths and horizon lengths in the pretrain datasets. Pretraining it to its maximum performance requires much more compute and likely more careful tuning compared to pretraining TimesFM.

A.5 Additional Empirical Results

In this section, we provide more detailed tables for our zero-shot datasets and experiments described in Section6.1. The AM based aggregated metrics are presented in Figure4.

A decoder-only foundation model for time-series forecasting (9)
A decoder-only foundation model for time-series forecasting (10)
A decoder-only foundation model for time-series forecasting (11)

A.5.1 Darts

We present the MAE results individually from all 8 datasets in Table3. It can be seen that TimesFMperforms well for all datasets with clear seasonal patterns. On an average we are within significant level of the best model. Note that there are only 8 time-series as a whole in Darts and theerfore these evaluations have very wide confidence intervals.

In Figure8 we present visual comparisons of our forecasts vs some of the baselines.

GPARIMATCNN-BEATSN-HiTSllmtime(ZS)TimesFM(ZS)PatchTSTNAIVE
AirPassengersDataset34.6724.0354.9697.8959.1634.3762.5144.6581.45
AusBeerDataset102.0517.1330.9010.3934.2316.1311.9421.9796.35
GasRateCO2Dataset2.272.372.642.633.853.502.502.672.29
MonthlyMilkDataset30.3337.1970.8633.6432.739.6828.0942.6085.71
SunspotsDataset53.7443.5651.8273.1549.9347.3441.4062.3348.24
WineDataset4552.062306.703287.144562.023909.511569.322871.332498.694075.28
WoolyDataset649.98588.781158.79903.01382.09808.73728.92542.281210.33
HeartRateDataset5.655.565.496.576.106.215.856.745.92
Scaled MAE (Arithmetic Mean)0.81930.60450.84270.91760.81090.66410.68290.74621.0000
Scaled MAE (Geometric Mean)0.75090.52190.79460.73160.69360.48820.57670.64581.0000

A.5.2 Monash

llmtime(ZS)SESThetaTBATSETS(DHR-)ARIMAPRCatBoostFFNNDeepARN-BEATSWaveNetTransformerPatchTST(ZS)TimesFM(ZS)NAIVE
Dataset
australian electricity demand459.96659.60665.04370.741282.991045.92247.18241.77258.76302.41213.83227.50231.45382.23448.81659.60
bitcoin1.75e185.33e185.33e189.90e171.10e183.62e186.66e171.93e181.45e181.95e181.06e182.46e182.61e181.11e181.3e187.77e17
pedestrian counts70.20170.87170.94222.38216.50635.1644.1843.4146.4144.7866.8446.4647.2951.2740.71170.88
weather2.322.242.512.302.352.458.172.512.092.022.342.292.032.072.072.36
nn5 daily9.396.633.803.703.724.415.474.224.063.944.923.974.163.773.548.26
nn5 weekly15.9115.6615.3014.9815.7015.3814.9415.2915.0214.6914.1919.3420.3417.0014.6716.71
tourism yearly140081.7895579.2390653.6094121.0894818.8995033.2482682.9779567.2279593.2271471.2970951.8069905.4774316.52224411.89109977.2999456.05
tourism quarterly14121.0915014.197656.499972.428925.5210475.479092.5810267.978981.049511.378640.569137.129521.6721276.9812102.0415845.10
tourism monthly4724.945302.102069.962940.082004.512536.772187.282537.042022.211871.692003.022095.132146.984596.213183.775636.83
cif 2016715086.33581875.97714818.58855578.40642421.42469059.49563205.57603551.301495923.443200418.00679034.805998224.624057973.048374813.14773980.44386526.37
covid deaths304.68353.71321.3296.2985.5985.77347.98475.15144.14201.98158.811049.48408.66348.60209.80353.71
fred md2013.492798.223492.841989.972041.422957.118921.942475.682339.574264.362557.802508.404666.044965.51947.122825.67
traffic hourly0.030.030.030.040.030.040.020.020.010.010.020.020.010.010.010.03
traffic weekly1.171.121.131.171.141.221.131.171.151.181.111.201.421.231.121.19
saugeenday28.6321.5021.4922.2630.6922.3825.2421.2822.9823.5127.9222.1728.0622.3324.6321.50
us births459.431192.20586.93399.00419.73526.33574.93441.70557.87424.93422.00504.40452.871193.28437.271152.67
hospital24.6221.7618.5417.4317.9719.6019.2419.1722.8618.2520.1819.3536.1920.8719.4124.07
solar weekly2049.091202.391210.83908.651131.01839.881044.981513.491050.84721.591172.641996.89576.351093.461258.271729.41
Scaled MAE (Arithmetic Mean)1.05881.31151.22950.88240.93371.24271.03820.89240.89421.19250.78441.81191.48402.14190.80051.0000
Scaled MAE (Geometric Mean)0.97151.08550.93710.77360.81040.94490.82180.77330.70440.74770.70050.93840.86191.05570.68461.0000

In Table4 we present the actual MAE numbers that are behind the main Figure1(a). In Figure9, we present some examples of our zero-shot forecasts. For most datasets, we set the context window to be the maximum length of the series in the dataset capped at 512 (similar to statistcal models used in the official Monash baselines). For some datasets, we did some inference time-tuning of the context length, i.e we predict the last horizon length number of points in the training set with context lengths 32, 64 and maximum allowed and chose the best one in terms of this validation metric. This is fair as most Monash DL baselines use different context lengths for different datasets during training and our model is completely zero-shot. The max context lengths used for these datasets are (cif 2016, 32), (tourism yearly, 32), (covid deaths, 32), (bitcoin, 32), (tourism monthly, 32) and (tourism monthly, 64).

A.5.3 Informer

We present the MAE on the last split of the test set for all dataset, horizon pairs considered in Table5. Owing to expensive evaluations for llmtime, the results are reported on the last test window of the original test split, as done in[11].

llmtime(ZS)*PatchTSTPatchTST(ZS)FEDFormerAutoFormerInformerTimesFM(ZS)
Dataset
ETTh1 (horizon=96)0.420.410.390.580.550.760.45
ETTh1 (horizon=192)0.500.490.500.640.640.780.53
ETTh2 (horizon=96)0.330.280.370.670.651.940.35
ETTh2 (horizon=192)0.700.680.590.820.822.020.62
ETTm1 (horizon=96)0.370.330.240.410.540.710.19
ETTm1 (horizon=192)0.710.310.260.490.460.680.26
ETTm2 (horizon=96)0.290.230.220.360.290.480.24
ETTm2 (horizon=192)0.310.250.220.250.300.510.27
Avg0.450.370.350.530.530.990.36

A.6 More Details on Models

We now present implementation details about TimesFMand other baselines.

TimesFM. For our main 200M model we use 16 attention heads, 20 layers, a input patch length of 32 and output patch length of 128. The model dimension is set to 1280. We train with layer norm and a cosine decay learning rate schedule with peak learning rate of 5e45𝑒45e-45 italic_e - 4. The hyper-parameters of TimesFMfor various sizes are provided in Table6. Note that the settings are for the base models and not ablation models. The hidden dims of both the residual block and the FFN in the transformer layers are set as the same as model dimensions. We keep layer norm in transformer layers but not in the residual blocks.

num_layersmodel_dimsoutput_patch_leninput_patch_lennum_headsdropout
Size
200M20128012832160.2
70M10102412832160.2
17M1051212832160.2

Monash Baselines. The raw metrics for the Monash baselines are directly taken from Tables 9 and 11 of the supplementary material of the original paper[9]. For llmtime, we use the precomputed outputs provided by the authors of [11].

Darts Baselines. For all the Darts baselines we use the precomputed outputs provided by the authors of [11]. For more details please see Section C.1 in that paper.

Informer Baselines. For FEDFormer[41], Autoformer[39], Informer[44] and PatchTST[24] we use the original hyperparameters and implementation. The results presented in the main paper are obtained on the last test window of length horizon length as stated in the llmtime[11] paper.

We generate the llmtime predictions using the code provided by the authors777https://github.com/ngruver/llmtime/blob/main/experiments/run_monash.py but adapted to the ETT datasets. Note that as of January 2024, OpenAI has discontinued access to GPT-3, therefore we had to use the GPT-3.5-Turbo model.

A.7 Date Features

As we mentioned earlier, since we are building a single pre-trained model, we cannot have dataset specific dynamic or static covariates during training time. However, the datetime column is ubiquitous in all time-series data, so we can technically have date derived features like day of the week, month of the year etc processed into a vector at each time-point t𝑡titalic_t, denoted by 𝐱trsubscript𝐱𝑡superscript𝑟\mathbf{x}_{t}\in\mathbb{R}^{r}bold_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_r end_POSTSUPERSCRIPT.

If so, the learning task can be rewritten as

f:(𝐲1:L,𝐱1:L+H)𝐲^L+1:L+H.:𝑓subscript𝐲:1𝐿subscript𝐱:1𝐿𝐻subscript^𝐲:𝐿1𝐿𝐻f:\mathopen{}\mathclose{{}\left(\mathbf{y}_{1:L},\mathbf{x}_{1:L+H}}\right)%\longrightarrow\hat{\mathbf{y}}_{L+1:L+H}.italic_f : ( bold_y start_POSTSUBSCRIPT 1 : italic_L end_POSTSUBSCRIPT , bold_x start_POSTSUBSCRIPT 1 : italic_L + italic_H end_POSTSUBSCRIPT ) ⟶ over^ start_ARG bold_y end_ARG start_POSTSUBSCRIPT italic_L + 1 : italic_L + italic_H end_POSTSUBSCRIPT .

There are many options to incorporate these features into the model, one being to directly concatenate them after the time-points in each patch. For this paper we decide to focus on the univariate time-series input, and will investigate this enhancement in the future.

A.8 Synthetic Data

We create the synthetic data to reflect common time-series patterns using traditional statistical models. We start with four simple times series patterns:

  • Piece-wise linear trends (I), where the number of the piece-wise linear components is randomly chosen between 2 and 8.

  • ARMA(p,q)𝑝𝑞(p,q)( italic_p , italic_q ) (II), where 1p,q8formulae-sequence1𝑝𝑞81\leq p,q\leq 81 ≤ italic_p , italic_q ≤ 8 and the corresponding coefficients are generated from either a multivariate Gaussian or a uniform, then normalized.

  • Seasonal patterns. In particular we create the sine (III) and the cosine (IV) waves of different random periods between 4 and max context length / 2 time-points and time delays.

We then randomly enable / disable these four components (I) - (IV), generate their time-series of length 2048 respectively, and sum them up using uniformly sampled random weights to create each times series in the synthetic datasets. We also choose to apply the trend multiplicatively 50% of the times the trend component is chosen.

A.9 Illustrative Examples

We conduct a visual inspection of the forecasts generated by TimesFM, first on some synthetic examples and then on the benchmark datasets.

In Figure5 we show 4 different synthetic curves: (1) sum of 5 sine curves of different periods, (2) a sine curve linearly scaled, (3) a sine curve with a linear trend, and (4) minimum of two sine curves with a linear trend. Our results suggests that TimesFMpicks up the trend and seasonal components readily interpretable by humans, while ARIMA and (to a lesser extent) llmtime fail in some of the instances.

As illustrated in Figure6, TimesFMalso effectively captures these subtle characteristics within both the trend and seasonal patterns of the depicted real world time-series. For instance, in the Air Passenger dataset, TimesFMcorrectly captures the amplitude increase with trend –this is also reflected by the fact that it attains the best MAE on this dataset (see Table3). In the traffic hourly example on the left, it can be seen that TimesFMcan correctly identify the seasonal peaks even in the presence of outliers in the context, while llmtime is thrown off.

A decoder-only foundation model for time-series forecasting (12)
A decoder-only foundation model for time-series forecasting (13)

We provide more visualization in Figure7, Figure8 and Figure9.

A decoder-only foundation model for time-series forecasting (14)
A decoder-only foundation model for time-series forecasting (15)
A decoder-only foundation model for time-series forecasting (16)
A decoder-only foundation model for time-series forecasting (2024)

References

Top Articles
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 6442

Rating: 4.6 / 5 (46 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.