Transformer Multivariate Forecasting: Less is More?

Jingjing Xu, Caesar Wu, Yuan-Fang Li, Pascal BouvryarXiv 2023

Abstract

In the domain of multivariate forecasting, transformer models stand out as powerful apparatus, displaying exceptional capabilities in handling messy datasets from real-world contexts. However, the inherent complexity of these datasets, characterized by numerous variables and lengthy temporal sequences, poses challenges, including increased noise and extended model runtime. This paper focuses on reducing redundant information to elevate forecasting accuracy while optimizing runtime efficiency. We propose a novel transformer forecasting framework enhanced by Principal Component Analysis (PCA) to tackle this challenge. The framework is evaluated by five state-of-the-art (SOTA) models and four diverse real-world datasets. Our experimental results demonstrate the framework's ability to minimize prediction errors across all models and datasets while significantly reducing runtime. From the model perspective, one of the PCA-enhanced models: PCA+Crossformer, reduces mean square errors (MSE) by 33.3% and decreases runtime by 49.2% on average. From the dataset perspective, the framework delivers 14.3% MSE and 76.6% runtime reduction on Electricity datasets, as well as 4.8% MSE and 86.9% runtime reduction on Traffic datasets. This study aims to advance various SOTA models and enhance transformer-based time series forecasting for intricate data. Code is available at: https://github.com/jingjing-unilu/PCA_Transformer.

Introduction

Multivariate time series forecasting—predicting future values based on multiple correlated variables—is a cornerstone of modern AI. Transformer architectures have become the gold standard for this task due to their ability to capture long-range dependencies. However, as research in this field accelerates, models are hitting a "complexity wall."

Trends in time series forecasting publications, highlighting the rapid rise of Transformer-based methods.

Real-world datasets are often "messy," containing hundreds of variables and lengthy sequences. This leads to two major issues: computational overload and the "noise trap." High-dimensional data often contains redundant information that can confuse the model's attention mechanism, leading to lower forecasting accuracy despite higher resource consumption.

Methodology

The proposed framework introduces an elegantly simple solution: PCA-enhanced Transformer forecasting. The core idea is to use Principal Component Analysis (PCA) as a preprocessing step to compress input features.

The PCA-enhanced Transformer forecasting framework, illustrating the dimensionality reduction pipeline.

Specifically, the framework employs randomized Singular Value Decomposition (SVD) to reduce the number of input variables from $M$ to a much smaller number $P$. Crucially, the target variable is excluded from the PCA process to prevent data leakage. This approach is model-agnostic and was evaluated using five state-of-the-art (SOTA) Transformer models: PatchTST, Crossformer, Autoformer, Non-stationary Transformer, and iTransformer.

Results and Key Insights

The framework was evaluated on four diverse benchmarks: ETTh1 (7 variables), Weather (21 variables), Electricity (321 clients), and Traffic (862 sensors). Quantitative results show that the PCA-enhanced versions outperformed the original "full-data" models in almost every metric:

  • Efficiency: On the Traffic dataset, the framework achieved an 86.9% reduction in runtime.
  • Accuracy: The PCA+Crossformer model reduced Mean Square Error (MSE) by an average of 33.3% across all datasets.
  • Information Retention: For the Electricity dataset, using 80 principal components (instead of 320 variables) kept 94.7% of the information but improved MSE by 14.3% and cut runtime by 76.6%.

The "aha moment" of the study is that many SOTA datasets are highly correlated. For the Traffic dataset, reducing 862 variables down to just one principal component still captured 57.6% of the information and resulted in better forecasts than using all 862 variables. PCA acts as a denoiser; by discarding lower-variance components, the model ignores noise and focuses on the underlying structural patterns.

Conclusion and Future Work

This study proves that in the world of complex multivariate data, "less" really can be "more." By applying spatial compression via PCA, researchers can simultaneously improve forecasting accuracy and drastically slash computation time.

While highly effective, there are avenues for future exploration. Future work should investigate temporal compression (reducing sequence length) and non-linear reduction techniques like Independent Component Analysis (ICA) or LDA. Additionally, automating the discovery of the "sweet spot" for the number of principal components remains a valuable next step for the field.

Summary updated

BibTeX
@misc{xu2023transformer,
  author = {Jingjing Xu and Caesar Wu and Yuan-Fang Li and Pascal Bouvry},
  title = {{Transformer Multivariate Forecasting: Less is More?}},
  year = {2023},
  eprint = {2401.00230},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.00230},
}
Figure