Abstract
Time Series Foundation Models (TSFMs) have demonstrated remarkable zero-shot capabilities, yet they often encounter a "knowledge wall" when faced with domain-specific patterns absent from their training data. We introduce TimeRAF, a framework that brings Retrieval-Augmented Generation (RAG) to time series forecasting. TimeRAF equips frozen TSFMs with a learnable retriever and a large-scale external knowledge base, enabling the model to dynamically consult relevant historical sequences. Experimental results show that TimeRAF significantly enhances zero-shot accuracy, frequently outperforming models fine-tuned on downstream data.
Introduction
The emergence of Time Series Foundation Models (TSFMs) has mirrored the success of Large Language Models, offering impressive "zero-shot" performance across diverse datasets. However, these models are limited by the scope of their pre-training data. When encountering niche industrial sensors or unique regional weather patterns, a general-purpose model lacks the specific prior knowledge required for high-precision forecasting. While fine-tuning is a common remedy, it is computationally expensive and data-intensive. TimeRAF addresses this by providing models with a "library" of external data to consult during inference.
Methodology
The TimeRAF framework integrates three core components with a frozen foundation model backbone:
- Time Series Knowledge Base: A repository of diverse segments (e.g., Energy, Transport) pre-processed to match the model's lookback window.
- Learnable Retriever: A dual-encoder system that calculates similarity between input queries and knowledge base candidates. It is optimized using a feedback loop where the foundation model acts as an evaluator; the retriever is rewarded when its selections lead to lower forecasting error (MSE).
- Channel Prompting: Retrieved sequences are treated as additional "channels." Their embeddings are concatenated with the input and processed via a Multi-Layer Perceptron (MLP) to distill relevant context while preserving the original signal through a residual connection.
Experiments and Results
TimeRAF was evaluated using subsets of the LOTSA and UTSD datasets (totaling 320M time points) and tested on standard benchmarks including ETT, Weather, and Electricity (ECL).
- Zero-Shot Excellence: Built on a TTM-Base backbone, TimeRAF consistently outperformed vanilla TTM and other state-of-the-art models like Moirai, Chronos, and TimesFM.
- Efficiency: By keeping the TSFM backbone frozen and only training lightweight retriever and prompting modules, TimeRAF enables domain specialization without full-parameter fine-tuning.
- Performance vs. Fine-Tuning: Notably, TimeRAF's zero-shot performance often exceeded that of the same foundation model fine-tuned on 5% of the target downstream data.
Conclusion
TimeRAF demonstrates that time series data is highly amenable to retrieval-augmented approaches due to its periodic and repetitive nature. While current integration methods are heuristic, future work will explore more flexible architectures and multi-modal knowledge bases (e.g., incorporating textual descriptions) to further bridge the gap between general pre-training and domain-specific precision.
Summary updated