TL;DR
This paper introduces LLM4TS, a novel framework that adapts pre-trained Large Language Models (LLMs) for time-series forecasting. By introducing a two-stage fine-tuning process and a multi-scale temporal encoding mechanism, LLM4TS achieves state-of-the-art performance, especially in data-scarce scenarios, demonstrating the power of LLMs beyond natural language processing.
What Problem Does This Paper Address?
Accurate time-series forecasting is crucial across many domains, from economics to weather prediction. Traditional deep learning models often require vast amounts of data, which is frequently unavailable in real-world applications. While pre-trained LLMs have shown promise in transferring their representation learning capabilities to various data types, directly applying them to time-series data presents challenges. These include the inherent differences between linguistic and time-series data structures, and the LLMs' limited ability to capture multi-scale temporal information (e.g., hourly, daily, seasonal patterns). LLM4TS aims to bridge this gap by making LLMs more adept at understanding and forecasting time-series data, particularly in low-data regimes.
Methods
LLM4TS employs a two-stage fine-tuning strategy:
- Time-Series Alignment Stage: This stage adapts the pre-trained LLM to the characteristics of time-series data. It uses an autoregressive objective, similar to the LLM's original pre-training, to learn time-series representations. Instance normalization is used to ensure stable performance across diverse datasets.
- Forecasting Fine-Tuning Stage: This stage further refines the LLM for specific downstream time-series forecasting tasks. It utilizes a sequential approach of linear probing followed by full fine-tuning (LP-FT) to optimize performance. A key innovation here is the use of Reversible Instance Normalization (RevIN) to improve robustness against distribution shifts.
A novel multi-scale temporal encoding layer is also introduced. This layer addresses the LLMs' difficulty in processing temporal information by:
- Level 1 Aggregation: Encoding various temporal attributes (seconds, minutes, hours, holidays) into a high-dimensional space.
- Level 2 Aggregation: Applying a pooling method to extract a final temporal embedding that captures the essence of the multi-scale information within a patch.
The framework also incorporates patching and channel-independence to handle long time-series sequences efficiently within the LLM's context window limitations.
Datasets
The paper evaluates LLM4TS on 7 real-world, publicly accessible benchmark datasets for long-term time-series forecasting:
- Weather
- Traffic
- Electricity
- ETTh1
- ETTh2
- ETTm1
- ETTm2
These datasets vary in their number of features, total length, and sampling frequency, providing a comprehensive evaluation environment.
Key Insights and Ideas
- LLMs are powerful forecasters, even with limited data: LLM4TS demonstrates that pre-trained LLMs, when properly adapted, can achieve superior forecasting performance compared to traditional models, especially when training data is scarce.
- Time-series alignment is crucial: Simply feeding time-series data into an LLM isn't enough. A dedicated alignment stage is necessary for the LLM to learn the unique patterns and characteristics of time-series data.
- Multi-scale temporal information matters: LLMs struggle with temporal nuances. The proposed multi-scale temporal encoding effectively injects this critical information, significantly boosting forecasting accuracy.
- LP-FT strategy is key for fine-tuning: The sequential approach of linear probing followed by full fine-tuning consistently outperforms either strategy alone, especially for robust performance.
- Parameter-efficient fine-tuning (PEFT) is effective: Using methods like LoRA and Layer Normalization Tuning allows for significant adaptation of LLMs with a small fraction of trainable parameters, leading to efficiency and preserving the LLM's core strengths.
Key Results
- State-of-the-art performance: LLM4TS outperforms existing state-of-the-art methods, including those trained from scratch, across 7 datasets in both full-shot and few-shot scenarios.
- Data efficiency: LLM4TS with 5% of the training data outperforms the best baseline using 10% of the data, highlighting its exceptional data efficiency.
- Robustness: The framework shows strong performance even with limited data (5% and 10% training data), making it highly relevant for practical applications.
- Efficiency: LLM4TS is significantly faster in training and inference compared to Transformer-based baselines like PatchTST and FEDformer, due to its efficient parameter usage.
- Unsupervised Representation Learning: LLM4TS also shows strong performance in unsupervised representation learning tasks, outperforming other specialized methods.
Limitations and Future Work
- LLM Choice: The paper primarily uses GPT-2 for fair comparison. Future work will explore more recent LLMs like GPT-3.5 and LLaMA-2 to assess their advancements.
- Task Expansion: The authors plan to extend LLM4TS to other time-series tasks such as classification and anomaly detection, broadening its applicability.
- Dataset Size: While LLM4TS excels in few-shot scenarios, for the largest dataset (Traffic), PatchTST (a train-from-scratch model) can outperform LLM4TS in the full-shot scenario, suggesting that with complete data access, traditional models can still be competitive.
Summary updated