Abstract
Time-series analysis (TSA) has traditionally relied on specialized models for distinct tasks, hindering the development of a unified foundation model. We present aLLM4TS, a novel framework that adapts Large Language Models (LLMs) for time-series representation learning. By reframing forecasting as a self-supervised, multi-patch prediction task, aLLM4TS aligns LLM sequence-modeling logic with temporal data nuances. Our approach utilizes a two-stage causal training strategy and a highly efficient patch-wise decoder, reducing decoder parameters to 0.34% of traditional sequence-wise decoders. Experimental results demonstrate a 9.71% average improvement over previous state-of-the-art LLM-based models in long-term forecasting, alongside superior performance in anomaly detection and classification.
Introduction
Despite the success of LLMs in natural language and vision, their application to time-series data faces significant challenges. Existing methods often suffer from modeling inconsistency, where high-level features from contrastive learning do not translate well to low-level downstream tasks. Furthermore, common "mask-and-reconstruct" pre-training strategies can disrupt vital temporal dependencies. aLLM4TS addresses these issues by treating time-series data as a sequence of patches and employing a causal prediction objective that mirrors the pre-training of modern LLMs.
Methodology
The aLLM4TS framework introduces two key innovations: a two-stage causal training paradigm and a lightweight patch-wise decoder.
Two-Stage Causal Training
Unlike random masking, aLLM4TS adopts a "causal" approach to learning temporal dynamics:
- Stage I: Causal Next-Patch Pre-training: The model is pre-trained on diverse datasets to predict the subsequent patch in a sequence. This stage synchronizes the LLM's pre-trained sequence capabilities with time-series modalities.
- Stage II: Multi-patch Prediction Fine-tuning: The model is refined to predict multiple future patches (the forecasting horizon) based on "anchors"—initial representations of the target period.
Patch-Wise Decoder
Traditional TSA models often use large sequence-wise decoders that map hidden states to the entire output sequence. These decoders are computationally expensive and prone to overfitting. aLLM4TS replaces this with a patch-wise decoding layer ($W_P$). This layer uses a small, shared linear transformation to decode each patch independently, forcing the LLM backbone to capture the primary representations. This architectural shift reduces the decoder's parameter count to just 0.34% of traditional sequence-wise versions ($W_S$), enhancing transferability and robustness.
Experimental Results
The model was evaluated across long-term and short-term forecasting, anomaly detection, and classification benchmarks.
Forecasting Performance
aLLM4TS achieved a 9.71% average improvement over GPT4TS in long-term forecasting tasks. The model's efficiency is highlighted by its performance in few-shot scenarios; when trained on only 5% of the data, it outperformed competitors by an average of 8.6%.
Versatility and Efficiency
The framework set new benchmarks in anomaly detection with an 87.51% F1-score and showed competitive results in classification across 10 multivariate datasets. The patch-wise decoder allows the model to handle varying look-back or prediction horizons more robustly without extensive re-training.
Discussion and Conclusion
The success of aLLM4TS underscores the importance of aligning LLM architectures with the directional nature of time series. By moving from sequence-level to patch-level decoding, the model avoids the "decoder bottleneck" and leverages the LLM's pre-trained sequence knowledge more effectively.
Future work includes addressing the current limitation of channel independence by exploring cross-variable correlations and scaling the framework to larger LLM backbones like Llama or Mistral. Additionally, more sophisticated anchor initialization methods could further enhance multi-patch prediction performance.
Summary updated