Abstract
Time series forecasting is a critical component in fields such as financial analysis and energy planning. While traditional research has focused primarily on capturing numerical patterns within the time series itself, this paper argues that metadata—describing the domain, variables, and specific tasks—is essential for distinguishing between different forecasting scenarios. We propose MetaTST (Metadata-informed Time Series Transformer), a framework that standardizes unstructured metadata into natural language descriptions and utilizes Large Language Models (LLMs) to encode these into semantic tokens. These tokens are then fused with numerical data via a Transformer encoder, allowing the model to adaptively perceive diverse forecasting contexts. Experimental results across 12 major benchmarks demonstrate that MetaTST consistently achieves state-of-the-art performance in both short-term and long-term forecasting.
Introduction: The Problem of Context-Blindness
Traditional time series models often suffer from "context-blindness." They treat sequences of numbers as isolated mathematical patterns, ignoring the real-world environment that generated them. This leads to a significant limitation: two different time series might exhibit nearly identical historical numerical patterns but diverge sharply in the future due to their underlying contexts. For instance, traffic patterns near a school versus a shopping mall may look similar in the morning but differ drastically in the evening based on school hours or retail schedules. Numerical data alone often lacks the "hidden clues" needed to disambiguate these scenarios.
The MetaTST Framework
MetaTST addresses this gap by incorporating the "story" behind the data into the model's architecture. The framework operates in three primary stages:
- Multi-level Metadata Parsing: Metadata is categorized into three levels: Dataset-level (domain, frequency, and general characteristics), Task-level (prediction goals and window lengths), and Sample-level (dynamic statistics like mean and standard deviation of specific windows).
- LLM-based Encoding: Rather than using simple one-hot encodings, MetaTST employs a frozen Large Language Model (e.g., BERT or GPT-2) to convert textual descriptions into "metadata tokens." This leverages the LLM's pre-trained semantic understanding of the relationship between concepts (e.g., recognizing that "Traffic" and "Road occupancy" are related).
- Deep Fusion Transformer: A Transformer encoder processes three distinct input types: endogenous tokens (patches of the target series), exogenous tokens (external variables like weather), and the semantic metadata tokens. This allows the model to condition its numerical predictions on the provided context.
Experimental Evaluation
The model was rigorously tested on 12 real-world datasets spanning energy (Electricity, ETT), environment (Weather), transportation (Traffic), and economics (Nord Pool prices). The results indicate that MetaTST consistently outperforms 10 leading baselines, including PatchTST, iTransformer, and other LLM-based models like TimeLLM.
- Short-term Forecasting: MetaTST reduced Mean Squared Error (MSE) by an average of 12.8% compared to GPT4TS.
- Long-term Forecasting: The model achieved a 4.9% improvement in MSE over TimeXer and 11.3% over GPT4TS.
- Predictive Certainty: By incorporating metadata, the model significantly narrowed confidence intervals, demonstrating higher predictive certainty and better alignment with ground truth data.
Conclusion
MetaTST proves that understanding what numerical data represents is as vital as the data itself. By using metadata as a semantic prior, the model can navigate complex, multi-dataset environments more effectively than context-blind architectures. Future work will explore the integration of deeper domain knowledge, such as physical or economic laws, and automated metadata generation for scenarios where documentation is sparse.
Summary updated