Are Transformers Effective for Time Series Forecasting?

Ailing Zeng, Muxi Chen, Lei Zhang, Qiang Xu
5/26/2022
5,228 citations
cs.AIcs.LG
transformer-attention

Official code: cure-lab/LTSF-Linear (2,532 stars, Python, Apache-2.0, PyTorch, last commit 2024-01-27). 1 more implementation below.

Abstract

Recently, there has been a surge of Transformer-based solutions for the long-term time series forecasting (LTSF) task. Despite the growing performance over the past few years, we question the validity of this line of research in this work.

Show full abstract

Specifically, Transformers is arguably the most successful solution to extract the semantic correlations among the elements in a long sequence. However, in time series modeling, we are to extract the temporal relations in an ordered set of continuous points. While employing positional encoding and using tokens to embed sub-series in Transformers facilitate preserving some ordering information, the nature of the \emph{permutation-invariant} self-attention mechanism inevitably results in temporal information loss. To validate our claim, we introduce a set of embarrassingly simple one-layer linear models named LTSF-Linear for comparison. Experimental results on nine real-life datasets show that LTSF-Linear surprisingly outperforms existing sophisticated Transformer-based LTSF models in all cases, and often by a large margin. Moreover, we conduct comprehensive empirical studies to explore the impacts of various design elements of LTSF models on their temporal relation extraction capability. We hope this surprising finding opens up new research directions for the LTSF task. We also advocate revisiting the validity of Transformer-based solutions for other time series analysis tasks (e.g., anomaly detection) in the future. Code is available at: \url{https://github.com/cure-lab/LTSF-Linear}.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
cure-lab/LTSF-LinearOfficial2,532PythonApache-2.02024-01-27
WenjieDu/PyPOTSCommunity2,093PythonBSD-3-Clause2026-05-04
PyTorchApache-2.0

[AAAI-23 Oral] Official implementation of the paper "Are Transformers Effective for Time Series Forecasting?"

2,532513Python, ShellMay 26, 20222 years agoApache-2.0
aaaiaaai2023deep-learningforecastingforecasting-model+5 more
WenjieDu/PyPOTSCommunity100%
PyTorchBSD-3-Clause

A Python toolkit/library for reality-centric machine/deep learning & data mining on partially-observed time series, with 50+ SOTA neural network models for scientific analysis tasks (imputation, classification, clustering, forecasting, anomaly detection, cleaning) on incomplete industrial irregularly-sampled multivariate TS with NaN missing values

2,093195Python, ShellMar 29, 20227 months agoBSD-3-Clause
anomaly-detectionclassificationclusteringdata-analysisdata-mining+10 more

Similar Papers

Cite this paper

@article{zeng2022transformers,
  title  = {Are Transformers Effective for Time Series Forecasting?},
  author = {Ailing Zeng and Muxi Chen and Lei Zhang and Qiang Xu},
  year   = {2022},
  eprint = {2205.13504},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.13504}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2205.13504.svg)](https://codeofpaper.com/paper/2205.13504)

Discussion