Source-linked AI summary
TS-RAG: Retrieval-Augmented Generation based Time Series Foundation Models are Stronger Zero-Shot Forecaster
Kanghui Ning, Zijie Pan, Yu Liu, Yushan Jiang, James Yiming Zhang, Kashif Rasul, Anderson Schneider, Lintao Ma, Yuriy Nevmyvaka, Dongjin Song
TL;DR
LLMs and TSFMs have difficulty generalizing or adapting in zero-shot forecasting. TS-RAG retrieves relevant time-series patterns and fuses them into a TSFM without task-specific fine-tuning. Across seven public benchmarks, it reports state-of-the-art zero-shot forecasting and gains of up to 6.84%.
Problem
LLMs and TSFMs face challenges in zero-shot forecasting, including generalization across unseen datasets and adaptation to non-stationary patterns and distribution shifts.
Source: §1 · p. 2Method
TS-RAG uses pre-trained time-series encoders to retrieve relevant segments from a knowledge base and an Adaptive Retrieval Mixer to fuse them with the input for a frozen TSFM.
Source: §1 · p. 2Results
Across seven public benchmark datasets, TS-RAG achieves state-of-the-art zero-shot forecasting, outperforming existing TSFMs by up to 6.84%.
Source: §1 · p. 3Takeaways & Limitations
Retrieved segments provide explicit rationales for TSFM predictions, supporting the framework's interpretability.
Source: §1 · p. 3The current implementation uses only time-series data because multimodal datasets are unavailable.
Source: E Limitations · p. 23
Abstract
from arXiv · showhide
Large Language Models (LLMs) and Foundation Models (FMs) have recently become prevalent for time series forecasting tasks. While fine-tuning LLMs enables domain adaptation, they often struggle to generalize across diverse and unseen datasets. Moreover, existing Time Series Foundation Models (TSFMs) still face challenges in handling non-stationary dynamics and distribution shifts, largely due to the lack of effective mechanisms for adaptation. To this end, we present TS-RAG, a retrieval-augmented generation framework for time series forecasting that enhances the generalization and interpretability of TSFMs. Specifically, TS-RAG leverages pre-trained time series encoders to retrieve semantically relevant segments from a dedicated knowledge base, enriching the contextual representation of the input query. Furthermore, we propose an Adaptive Retrieval Mixer (ARM) module that dynamically fuses the retrieved patterns with the TSFM's internal representation, improving forecasting accuracy without requiring task-specific fine-tuning. Thorough empirical studies on seven public benchmark datasets demonstrate that TS-RAG achieves state-of-the-art zero-shot forecasting performance, outperforming the existing TSFMs by up to 6.84% across diverse domains while also providing desirable interpretability. Our code and data are available at: https://github.com/UConn-DSIS/TS-RAG
1 Introduction
LLMs and TSFMs face challenges in zero-shot forecasting, including generalization across unseen datasets and adaptation to changing time-series patterns. TS-RAG retrieves relevant patterns to augment a frozen TSFM, and reports state-of-the-art results across seven public benchmarks.
- LLMs and TSFMs face barriers to zero-shot forecasting, while TSFMs lack dynamic access to external context for handling complex, non-stationary, and evolving patterns.Source: §1 · p. 2
- Pre-trained time-series encoders retrieve semantically relevant segments from a dedicated knowledge base to supply contextual information for forecasting.The retrieved segments also provide explicit rationales for predictions.Source: §1 · p. 2
- A learnable Adaptive Retrieval Mixer dynamically fuses retrieved patterns with the input query, allowing the model to use both retrieved knowledge and the current series.Source: §1 · p. 2
- On seven public benchmark datasets, TS-RAG achieves state-of-the-art zero-shot forecasting, outperforming existing TSFMs by up to 6.84% while providing desirable interpretability.Source: §1 · p. 3
2 Related Work
Prior time-series retrieval methods often rely on downstream fine-tuning, while RAF offers a zero-shot approach based on concatenating retrieved context. TS-RAG is presented as addressing open questions around retrieval databases and augmentation for zero-shot TSFMs.
- TSFMs span diverse architectures and forecasting strategies, yet the reviewed methods lack dynamic external context and have limited interpretability.Source: §2 · p. 3
- ReTime [49], RATD, TimeRAG [51], and RAFT [52] incorporate retrieval into forecasting, but these approaches typically rely on target-task training data or fine-tuning.Source: §2 · p. 3
- RAF [53] uses Chronos for zero-shot forecasting and concatenates processed retrieved context with the original input, but may face scalability and efficiency challenges on large databases.Source: §2 · p. 3
- TS-RAG targets gaps in knowledge-base construction, augmentation strategies, and integration with TSFMs for zero-shot forecasting.Source: §2 · p. 3
- Figure 2 depicts retrieval of similar segments and their future horizons, followed by ARM integration with the input embedding to generate a forecast.Source: Figure 2 · p. 4
3 TS-RAG for Zero-Shot Time Series Forecasting
TS-RAG retrieves similar time-series examples and adaptively combines their forecast horizons with a TSFM representation. It pretrains the added components on multi-domain data, then forecasts without task-specific fine-tuning.
3.1 Construction of the Retrieval Knowledge Base
- The knowledge base is built from a sampled Chronos pretraining-data subset, storing context–horizon pairs with pretrained-encoder embeddings.Source: §3.1 · pp. 4–5
3.2 Architecture of TS-RAG Framework
- The retriever embeds the query, selects top-k nearest context–forecast pairs by Euclidean distance, and supplies their horizons for augmentation.Source: §3.2 · p. 5
- ARM projects retrieved horizons, attends across them and the TSFM query representation, then weights their mixture with a skip connection before forecast projection.Source: §3.2 · pp. 5–6
3.3 Pretraining Strategy and Zero-shot Inference
- Pretraining updates only the projector and ARM parameters while freezing the TSFM backbone and retrieval encoder; inference uses these components without task-specific fine-tuning.Source: §3.3 · p. 6
4 Experiments
Across seven zero-shot benchmarks, TS-RAG with Chronos-Bolt improves on the backbone and other TSFMs, while ablations examine retrieval choices, extended horizons, and fusion. Comparisons with RAF and case studies also report efficiency and interpretability results.
4.1 Experimental Setup
- Experiments use Chronos-Bolt as the main backbone, seven zero-shot benchmarks, 512-step contexts, 64-step forecasts, and four retrieval knowledge-base settings.The multi-domain knowledge base uses 5 million sampled points and contains 2.8 million segmented pairs; the pretraining data contains 26 million pairs.Source: §4.1 · pp. 6–7
4.2 Experimental Results for Zero-shot Forecasting
- On average, TS-RAGChronos-Bolt reduces MSE by 3.54% and MAE by 1.43% versus Chronos-Bolt, and achieves the lowest MSE and MAE across datasets.On Exchange Rate, it further reduces MSE by 6.84% relative to Chronos-Bolt.Source: §4.2 · p. 7, Table 1 · p. 7
4.3 Ablation Studies
- ARM outperforms gated fusion under the same pretrain-zero-shot setting, while in-domain retrieval achieves the lowest MSE among four knowledge-base configurations.The four configurations are in-domain, distribution shift, cross-domain, and multi-domain; gated fusion also improves over the TSFM baseline, but less than ARM.Source: §4.3 · p. 8, Figure 3 · p. 8
- For extended horizons, TS-RAG improves on its backbone across ETTh, ETTm, Weather, Electricity, and Exchange Rate datasets.The method retrieves the next 64-step horizon at each rolling forecast step; the reported gains suggest mitigation of rolling-error accumulation.Source: §4.3 · p. 8, Table 2 · p. 9
- Lookbacks of 256 or 512 steps generally perform better, though longer windows are not always better; TS-RAG also benefits from a moderate number of retrieved sequences.The reported ablations find robustness to retriever-encoder and retrieval-distance choices.Source: §4.3 · pp. 8–9, Table 3 · p. 9
4.4 Comparison with RAF
- Across seven benchmarks, TS-RAG records an average MSE of 0.1940 versus RAF’s 0.2320, and retrieval takes 9.2 ms per iteration versus RAF’s 3290 ms on ETTh.The paper attributes the retrieval speed difference mainly to FAISS nearest-neighbor search and retrieval over compact embeddings.Source: §4.4 · p. 9, Table 4 · p. 10
4.5 Interpretable Forecasting with Case Studies
- TS-RAG surfaces top-k analogue sequences and transparent similarity-based weights; Weather retrievals align with query trend and periodicity, while an ETTm1 case better captures a sharp downward trend.The ETTm1 example uses the retrieved horizon with the highest weighting; the backbone TSFM fails to capture that downward trend.Source: §4.5 · pp. 9–10, Figure 4 · p. 10, Figure 5 · p. 10
5 Conclusion
TS-RAG combines retrieval-augmented generation with a pretrained retrieval encoder and ARM to improve TSFM zero-shot forecasting generalization and interpretability. Evaluations report consistent performance gains across diverse domains, while future work targets multimodal data and retrieval ranking.
5 Conclusion
- TS-RAG is designed to enhance TSFMs' generalization and interpretability in zero-shot forecasting.It combines retrieval-augmented generation with a pretrained retrieval encoder and an Adaptive Retrieval Mixer (ARM).Source: §5 · p. 10
- Evaluations across multiple benchmark datasets show consistent zero-shot forecasting improvements for various TSFMs across diverse domains.The conclusion presents TS-RAG as a general and flexible retrieval-augmented forecasting framework.Source: §5 · p. 10
- Future work will explore multimodal extensions using heterogeneous data such as text and investigate retrieval-ranking optimization.The paper frames these as directions for further enhancing forecasting capabilities and assessing whether improved retrieval mechanisms can boost zero-shot performance.Source: §5 · p. 10
A.1 TS-RAG Implementation Details
The appendix documents TS-RAG's training and retrieval settings, baseline descriptions, RAF comparison setup, inference datasets, and evaluation metrics.
A.1 TS-RAG Implementation Details
- TS-RAG freezes the TSFM backbone and trains only added parameters, using top-k=10 by default and AdamW for 10,000 steps.The implementation uses a 0.0003 learning rate, 0.01 weight decay, batch size 256, and dropout rate 0.2.Source: §A.1 · p. 15
A.2 TSFM Baseline Introduction
- The baseline overview describes Chronos-Bolt, MOMENT, TTM, Moirai, TimesFM, Chronos, and Time-MOE architectures or pretraining approaches.For example, Chronos tokenizes time series in a quantized manner and processes them using T5.Source: §A.2 · p. 15
A.3 RAF Implementation
- RAF is implemented with Chronos-Base, aligned test and retrieval data, and MAE/MSE metrics for consistency with TS-RAG.A Chronos-Bolt RAF variant and top-10 retrieval are also used to align configurations.Source: §A.3 · p. 15
A.4 Details of Inference Datasets
- The inference datasets are ETT, Weather, Electricity, and Exchange Rate, spanning varied sampling rates, locations, and series.The ETT datasets cover hourly and 15-minute sampling; Weather is sampled every 10 minutes, while Exchange Rate is daily.Source: §A.4 · p. 16
A.5 Evaluation Metrics
- Zero-shot forecasting is evaluated with mean squared error (MSE) and mean absolute error (MAE), with long-term metrics reported in normalized form.Global standardization uses a scaler fit only on training data.Source: §A.5 · p. 16
A.6 Efficiency Analysis
TS-RAG's efficiency analysis reports training and inference costs, and an additional evaluation finds consistent gains across Chronos-Bolt and MOMENT backbones.
A.6 Efficiency Analysis
- 9.62 ms/query is TS-RAG's total inference time on ETTh, and it is over 360× faster than RAF's 3.47 seconds per query.Retrieval adds 9.2 ms/query and the ARM-augmented forward pass adds 0.44 ms; TS-RAG training on 26M pairs for 20,000 steps takes around one hour on one A6000 GPU.Source: §A.6 · p. 16
B.1 Generalization across Backbones
- TS-RAG consistently improves zero-shot forecasting performance on both Chronos-Bolt and MOMENT backbones without changing the backbone architecture or training recipes.The MOMENT prediction head is pretrained on the same pretraining data as TS-RAG to enable zero-shot long-term forecasting.Source: §B.1 · p. 16
B.2 Ablation Study (Extended Results)
The extended ablations report sensitivity to retrieval count, compare retriever encoders, and provide detailed results across retrieval knowledge bases, augmentation techniques, and forecasting horizons.
B.2 Ablation Study (Extended Results)
- The extended ablations provide complete results for different retrieval knowledge bases, augmentation techniques, and forecasting horizons.These results are presented in Tables 7, 8, and 9, respectively.Source: §B.2 · p. 17, Table 7 · p. 17, Table 8 · p. 18
B.3 Sensitivity to the Number of Retrieved Sequences
- Increasing the number of retrieved sequences initially reduces MSE across datasets, but gains plateau and can decrease slightly beyond a threshold.ETTm1 and ETTm2 show the most pronounced improvement; Weather, Electricity, and Exchange Rate show marginal gains as k increases further.Source: Figure 6 · p. 18, §B.3 · p. 18
B.4 Impact of Retriever Encoder Choice
- Performance across Chronos, TTM, and MOMENT retriever encoders is largely comparable, with no encoder consistently outperforming the others.The reported comparison covers MSE and MAE across datasets.Source: Table 10 · p. 19, §B.4 · p. 19
B.5 Effect of Retrieval Distance Metrics
Embedding-based retrieval metrics outperform retrieval without RAG, and TS-RAG consistently outperforms RAF across benchmarks. Case studies show retrieved sequences matching historical patterns in ETTh1.
B.5 Effect of Retrieval Distance Metrics
- Euclidean and cosine retrieval achieve similar performance and clearly outperform the no-RAG baseline, while DTW offers only modest gains and sometimes performs slightly worse.The comparison uses cosine similarity over Chronos embeddings and DTW distance in the original time-series space.Source: §B.5 · p. 19
B.6 Comparison between TS-RAG and RAF
- TS-RAG consistently outperforms RAF across benchmarks on both MSE and MAE, including when RAF uses the Chronos-Bolt backbone.The comparison attributes the result to TS-RAG’s optimized retrieval process and adaptive augmentation module.Source: §B.6 · p. 19, Table 12 · p. 20
C.1 Case Studies on Retrieval Effectiveness
- In ETTh1, retrieved sequences capture input periodicity, seasonal patterns, complex fluctuations, and local variations.The authors describe retrieved patterns as structurally similar to the input; Figure 7 presents ETTh1 retrieval results.Source: Figure 7 · p. 20, §C.1 · p. 20
C.2 Case Studies on Retrieval-Augmented Forecasting
Weather case studies illustrate retrieval-augmented forecasts adapting to trend shifts and predicting peaks more accurately than the standard TSFM.
C.2 Case Studies on Retrieval-Augmented Forecasting
- For an upcoming Weather peak, the standard TSFM underestimates it, while TS-RAG uses similar retrieved patterns to forecast it more accurately.The passage identifies this as the peak-prediction example in Figure 10.Source: §C.2 · p. 20
- The examples show retrieval augmentation helping forecasts respond to complex temporal patterns in the Weather series.The authors describe these case studies as illustrating improved robustness in real-world forecasting tasks.Source: §C.2 · p. 20
- When the baseline TSFM misses a sudden Weather trend shift, TS-RAG adapts using retrieved forecasting horizons.Figure 9 presents the trend-adaptation example.Source: §C.2 · p. 20, Figure 9 · p. 21
D Analysis on Time Series Characteristics Influencing TS-RAG Effectiveness
Across datasets, TS-RAG tends to gain more when autocorrelation is stronger, while higher noise and volatility correspond to smaller improvements.
D Analysis on Time Series Characteristics Influencing TS-RAG Effectiveness
- Autocorrelation measures temporal dependence, noise ratio reflects irregular fluctuations, volatility captures variability relative to the mean, and stationarity estimates distributional stability over time.The study approximates noise ratio and stationarity with variance of first differences, and volatility with standard deviation divided by mean.Source: D Analysis on Time Series… · p. 22
- The analysis measures autocorrelation, noise ratio, volatility, and stationarity, then relates dataset-level averages to TS-RAG’s MSE improvement over its baseline using Pearson correlation.Noise ratio and stationarity are approximated using first differences; volatility is standard deviation divided by mean.Source: D Analysis on Time Series… · pp. 21–22
- Stronger autocorrelation tends to accompany greater TS-RAG improvement, whereas higher noise and volatility correspond to smaller gains.The authors suggest the mechanism is particularly effective when temporal dependencies are strong and patterns are relatively stable.Source: D Analysis on Time Series… · p. 22
E Limitations
The paper identifies limits in modality and application scope: its implementation uses time-series data, and its evaluation uses public benchmarks. It also describes possible broader impacts in critical domains.
E Limitations
- The implementation uses only time-series data because multimodal datasets are unavailable, leaving text and structured metadata as future additions.The authors suggest these external information sources could further enhance forecasting, particularly for complex contextual understanding.Source: E Limitations · p. 23
- Evaluation is limited to standard public benchmarks, which may not capture real-world forecasting complexity; broader domains such as finance and healthcare remain to be explored.The authors identify such real-world evaluation as a direction for future research.Source: E Limitations · p. 23
F Broader Impact
- The broader-impact discussion proposes potential benefits for decision-making in finance, healthcare, and environmental monitoring.It describes possible downstream impacts including resource allocation, patient care, and responses to climate change.Source: F Broader Impact · p. 23