One Fits All: Universal Time Series Analysis by Pretrained LM and Specially Designed Adaptors

Tian Zhou, Peisong Niu, Xue Wang, Liang Sun, Rong Jin · OpenReview

Abstract

Despite the impressive achievements of pre-trained models in the fields of natural language processing (NLP) and computer vision (CV), progress in the domain of time series analysis has been limited. In contrast to NLP and CV, where a single model can handle various tasks, time series analysis still relies heavily on task-specific methods for activities such as classification, anomaly detection, forecasting, and few-shot learning. The primary obstacle to developing a pre-trained model for time series analysis is the scarcity of sufficient training data. In our research, we overcome this obstacle by utilizing pre-trained models from language or CV, which have been trained on billions of data points, and apply them to time series analysis. We assess the effectiveness of the pre-trained transformer model in two ways. Initially, we maintain the original structure of the self-attention and feedforward layers in the residual blocks of the pre-trained language or image model, using the Frozen Pre-trained Transformer (FPT) for time series analysis with the addition of projection matrices for input and output. Additionally, we introduce four unique adapters, designed specifically for downstream tasks based on the pre-trained model, including forecasting and anomaly detection. These adapters are further enhanced with efficient parameter tuning, resulting in superior performance compared to all state-of-the-art methods. Our comprehensive experimental studies reveal that (a) the simple FPT achieves top-tier performance across various time series analysis tasks; and (b) fine-tuning the FPT with the custom-designed adapters can further elevate its performance, outshining specialized task-specific models.

Introduction

Time series analysis has traditionally lagged behind NLP and CV in the development of universal pre-trained models, primarily due to data scarcity. Recent attempts to repurpose Large Language Models (LLMs) for time series tasks have shown promise, often relying on textual prompts to bridge the modality gap. However, the actual utility of semantic context in these prompts has been a subject of debate. This paper investigates whether LLMs truly "understand" time series data through language or if prompts serve a different, more structural purpose.

The "Semantic Myth" and Implicit Adapters

A key contribution of this research is the debunking of the "semantic myth" in time series prompting. Through a series of sanity checks, the authors found that replacing meaningful dataset descriptions with random gibberish or using randomized word embeddings did not significantly degrade performance.

Comparison of semantic vs. random prompts and standard vs. random word embeddings, illustrating that semantic content is not the primary driver of performance.

This finding suggests that prompts act as "implicit adapters"—clunky ways of adding learnable parameters to a frozen model. While effective, these textual prompts are inefficient because they are constrained by the language model's vocabulary and embedding space, which are not optimized for numerical data.

Methodology: The GPT2-adapter Framework

To move beyond inefficient textual prompts, the authors propose the GPT2-adapter framework. This approach keeps the backbone of a pre-trained model (like GPT-2) frozen while inserting four specialized "Explicit Adapters" designed to handle time-series-specific inductive biases.

The GPT2-adapter architecture, showing the integration of specialized adapters (Temporal, Channel, Frequency) with a frozen pre-trained transformer backbone.

The framework includes:

  1. Temporal & Channel Adapters: These use bottleneck structures to capture correlations across time steps and between different variables (channels) without the risk of overfitting.
  2. Frequency Adapter: By employing Fast Fourier Transforms (FFT), this adapter allows the model to perceive seasonal and periodic patterns that are often hidden in raw time-domain data.
  3. Anomaly Adapter: This component identifies outliers by measuring the KL divergence between self-attention maps and a Gaussian kernel, representing "normal" local correlation.
  4. Select Gate: A learnable gating mechanism that dynamically weights the importance of each adapter for a given dataset.

Experimental Evaluation

The GPT2-adapter was tested across a wide range of benchmarks, including long-term forecasting (ETT, Weather, Traffic, Electricity), short-term forecasting (M4), anomaly detection (SMD, MSL), and classification (UEA archive).

The results were decisive. The proposed model achieved a 4.4% average reduction in Mean Squared Error (MSE) for long-term forecasting compared to previous state-of-the-art methods. Furthermore, a 6-layer GPT-2 based model outperformed much larger architectures like the 32-layer LLaMA-7B used in Time-LLM, despite having 100x fewer parameters. In anomaly detection, the model achieved a record-breaking 95.35% average F1-score.

Conclusion

This research demonstrates that the power of LLMs in time series analysis lies not in their semantic understanding of natural language prompts, but in their capacity as high-quality feature extractors when properly adapted. By replacing textual prompts with domain-specific explicit adapters, the GPT2-adapter framework achieves superior performance and efficiency, setting a new standard for universal time series analysis. Future work will focus on more effectively integrating external cross-modal information and optimizing the size of the frozen backbone.

Summary updated

BibTeX
@misc{zhou2023one,
  author = {Tian Zhou and Peisong Niu and Xue Wang and Liang Sun and Rong Jin},
  title = {{One Fits All: Universal Time Series Analysis by Pretrained LM and Specially Designed Adaptors}},
  year = {2023},
  eprint = {2311.14782},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.14782},
}
Figure