Understanding the Role of Textual Prompts in LLM for Time Series Forecasting: an Adapter View

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

TL;DR

This paper reveals that the effectiveness of textual prompts in LLM-based time series forecasting is primarily due to the extra learnable parameters they introduce (acting as "implicit adapters") rather than their semantic content. By replacing these prompts with four specialized, domain-aware adapters—Temporal, Channel, Frequency, and Anomaly—the authors achieve state-of-the-art results using models that are up to 100x smaller than previous prompt-based approaches.

What Problem Does This Paper Address?

There is a growing trend of using Large Language Models (LLMs) for time series forecasting, often by feeding the model "textual prompts" that describe the dataset (e.g., "this is electricity data") or provide summary statistics. While this improves performance, it’s conceptually confusing: why would a model trained on natural language "understand" the relationship between a text description and a sequence of numbers?

The authors tackle this "black box" by questioning the role of these prompts. Do they actually provide useful semantic information, or are they just a roundabout way of adding new weights to a frozen model? Bridging this modality gap is crucial for building more efficient and interpretable time series models.

Methods

The researchers first conducted a "sanity check" using two simple tests:

  1. Random Textual Test: Replacing meaningful prompts with random, unrelated sentences.
  2. Random Word Embedding Test: Replacing standard word embeddings with random learnable values.
The authors compared standard prompts against random text and random embeddings to see if semantic meaning actually mattered.

Finding that random prompts performed just as well, they moved to developing Explicit Adapters tailored for time series data. Their architecture keeps the LLM backbone frozen and inserts these specialized modules:

  • Temporal Adapter: Captures time-based correlations.
  • Channel Adapter: Uses a bottleneck "compressor" structure to model cross-channel correlations without overfitting.
  • Frequency Adapter: Operates in the frequency domain using Fast Fourier Transforms (FFT) to capture seasonal and global patterns.
  • Anomaly Adapter: Specifically for anomaly detection, it uses a Gaussian kernel and KL-divergence to identify points that deviate from periodic patterns.
  • Select Gate: An adaptive gating mechanism (scaled sigmoid) that allows the model to dynamically weight the importance of each adapter based on the specific dataset.
Figure 2: Model architecture: The self-attention and feedforward layers in the transformer blocks, along with the positional embeddings, are fixed. Designed adapters are integrated into each trans- former block of the pre-trained model and fine-tuned during the training process.

Datasets

The authors evaluated their approach across a massive range of tasks and benchmarks:

  • Long-term Forecasting: Weather, Traffic, Electricity (ECL), and the ETT family (ETTh1, ETTh2, ETTm1, ETTm2).
  • Short-term Forecasting: The M4 dataset.
  • Anomaly Detection: SMD, MSL, SMAP, SWaT, and PSM.
  • Classification: 10 multivariate datasets from the UEA archive (e.g., Heartbeat, FaceDetection).
  • Imputation & Few-shot/Zero-shot Learning: Evaluated on the forecasting datasets mentioned above.

Key Insights and Ideas

  • Semantics are Secondary: The most striking finding is that LLMs don't seem to use the meaning of textual prompts for forecasting. Random gibberish prompts provide the same performance boost as expert-crafted ones.
  • Prompts as Implicit Adapters: Textual prompts are essentially a "hack" to introduce new learnable parameters into a frozen LLM. The model treats the prompt embeddings as a set of weights that help align the time series input with the LLM's internal representations.
  • Domain-Specific Bias Wins: While generic adapters like LoRA help, they hit a performance plateau. Adapters that explicitly incorporate time-series inductive biases (like frequency domain modeling) significantly outperform generic prompting.
  • Efficiency Matters: By using explicit adapters, a small 6-layer GPT-2 can match or beat a 32-layer LLaMA model. This suggests that for time series, specialized architecture is more important than raw model scale.

Key Results

  • Superior Accuracy: The proposed GPT2(6)-adapter achieved a 4.4% average MSE reduction in long-term forecasting compared to the previous state-of-the-art (OFA).
  • Massive Efficiency Gains: The 6-layer GPT-2 adapter matched the performance of the much larger Time-LLM-LLaMA(32) model, despite the latter having a backbone roughly 100 times larger.
  • Versatility: The model achieved state-of-the-art results in anomaly detection (95.35% F1-score) and classification (74.1% average accuracy), proving the adapters help the LLM learn high-level representations beyond simple regression.
  • Zero-Shot Prowess: In zero-shot settings (training on one dataset, testing on another), the adapter-based approach consistently outperformed specialized models like N-BEATS.

Limitations and Future Work

The authors clarify that they are not claiming textual information cannot aid LLMs in time series analysis, only that its current effectiveness hasn't been demonstrated beyond the "adapter effect."

A primary limitation is that the current study focuses on how prompts act as adapters; it does not yet provide a definitive method for actually utilizing cross-modality semantic information (like a news report about a power outage) to improve numerical forecasts. Future research could investigate more sophisticated ways to fuse true semantic knowledge with time series data.

Summary updated

BibTeX
@misc{niu2023understanding,
  author = {Peisong Niu and Tian Zhou and Xue Wang and Liang Sun and Rong Jin},
  title = {{Understanding the Role of Textual Prompts in LLM for Time Series Forecasting: an Adapter View}},
  year = {2023},
  eprint = {2311.14782},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.14782},
}
Figure