                                In-Context Fine-Tuning for Time-Series Foundation Models

values in the history for the whole horizon. Then we report        datasets in these benchmarks are in our pretraining datasets
the Geometric Mean of these scaled MASE values across              (like Electricity and Traffic). Therefore, for the interest of
all datasets. Note that when dealing with normalized met-          zero-shot evaluation we use the 4 Electricity Transformer
rics it is better to report the Geometric Mean (Fleming &          Temperature (ETT) datasets, specifically ETTh1, ETTh2
Wallace, 1986). We borrow the official numbers for base-           (hourly) and ETTm1, ETTm2 (15 min).
lines from (Ansari et al., 2024) whenever possible. More
                                                                   We conduct the same evaluation as in the long se-
details about the benchmark, error metrics and baselines are
                                                                   quence forecasting evaluation (Woo et al., 2024) on these
provided in Appendix A.6.
                                                                   datasets, focusing on the task of predicting horizon lengths
We include around 20 baselines including task specific             96, 192, 336, and 720. We provide rolling validation num-
(trained on the training set of each dataset and then              bers for the test time-period which consists the last 1/5-
evaluated) deep learning models such as DeepAR (Sali-              th of the time-points. This is standard for these bench-
nas et al., 2020), N-BEATS (Oreshkin et al., 2020) and             marks (Nie et al., 2023), where the datasets are split into
WaveNet (van den Oord et al., 2016), statistical local (per        train:validation:test in the ratio 7:1:2.
time-series) models like as Exponential Smoothing(ETS)
                                                                   In addition to the evaluations on these datasets from (Woo
and ARIMA and other leading pretrained foundation models
                                                                   et al., 2024, Table 6), we evaluate our TimesFM-ICF against
like Chronos-T5 (Ansari et al., 2024), and LLMTime (Gru-
                                                                   TimesFM (base), and the TimesFM-FT model discussed in
ver et al., 2023), more in Appendix A.2. Note that we are
                                                                   Section 6.1.
unable to compare with MOIRAI (Woo et al., 2024) be-
cause its pretraining data has more than 80% overlap with          We present the MAE loss for each dataset, averaged over
this benchmark. We extensively compare with MOIRAI on              the four horizon lengths 96, 192, 336, 720, in Table 1. For a
long horizon tasks in Section 6.3.                                 detailed breakdown of the MAE losses, see Table 9. Note
                                                                   that since the MAE is computed on scaled datasets in this
TimesFM-ICF can handle a maximum of 50 examples in
                                                                   benchmark (Zhou et al., 2021), we can directly report the
its context. Whenever the time-series is long enough we
                                                                   arithmetic mean across datasets. We see that TimesFM-
include 5 within series examples (including the history of
                                                                   ICF rivals or outperforms TimesFM-FT which was fine-
the time-series to be forecasted on) within the context and
                                                                   tuned explicitly on the target dataset’s distribution. More-
the rest of the examples are gathered randomly from other
                                                                   over, TimesFM-ICF outperforms or equals the performance
time-series in the same dataset (we ablate on a few other
                                                                   of all other baselines.
ways of choosing examples in Section A.9). Since there is
randomness during inference, we average over 10 runs and
report the standard error bar.                                     6.4. Ablation

Results. We summarize our results in Figure 5. We                  6.4.1. N UMBER OF I N -C ONTEXT E XAMPLES
can observe that unsurprisingly the per dataset fine-tuned         An important trade-off between speed and accuracy can be
TimesFM-FT is the strongest performer as it starts from a          achieved by the number of in-context examples. We perform
strong zero-shot model and is further finetuned to adapt to        an ablation study of the same using the short context datasets
the dataset at hand. However, it can be seen that TimesFM-         in the OOD Benchmark i.e., datasets where we can only
ICF can match the performance of TimesFM-FT completely             get one example per time-series (the one whose future we
out of the box at inference time, when supplied with in-           are predicting) and the rest of the examples are generated
context examples. Due to this ability TimesFM-ICF im-              randomly from all the other time-series across the dataset.
proves over TimesFM (base) by 6.8%. Moreover, TimesFM-             We perform the ablation over these datasets for two reasons
ICF is better than the next best baseline, PatchTST by 5%.         (i) this removes the complication of the example selection
Timing-wise, TimesFM-ICF directly utilizes in-context ex-          strategy (studied separately later) (ii) short context datasets
amples and TimesFM-FT needs to be fine-tuned per dataset.          are where we know for sure that the positive effects in-
Although TimesFM-ICF requires more time to perform each            context fine-tuning are coming from few-shot examples
forecast, it overall completes the OOD Benchmark 16x               and not from just having a longer context (again studied
faster than TimesFM-FT does (25 minutes vs 418 minutes,            separately in the next section). The short context datasets
see Appendix A.7).                                                 are listed in Table 5.
                                                                   We plot the Scaled MASE (GM) vs number of in-context
6.3. Long Horizon Forecasting on ETT                               examples in Figure 6. The same figure also shows the total
                                                                   inference time3 . The experiments are repeated 5 times and
A group of long horizon datasets have been commonly used
for benchmarking (mainly) transformer based deep learning             3
                                                                        The inference numbers are reported on TPUv5e with 8 tensor
algorithms starting from (Zhou et al., 2021). Some of the          cores.


                                                               7
