Are Transformers Effective for Time Series Forecasting?

26 May 2022  ·  Ailing Zeng, Muxi Chen, Lei Zhang, Qiang Xu ·

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. 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}.

PDF Abstract

Datasets


Task Dataset Model Metric Name Metric Value Global Rank Result Benchmark
Time Series Forecasting ETTh1 (168) NLinear MSE 0.066 # 1
MAE 0.199 # 1
Time Series Forecasting ETTh1 (24) DLinear MSE 0.026 # 1
MAE 0.122 # 1
Time Series Forecasting ETTh1 (336) DLinear MSE 0.098 # 4
MAE 0.244 # 4
Time Series Forecasting ETTh1 (336) NLinear MSE 0.081 # 1
MAE 0.226 # 1
Time Series Forecasting ETTh1 (48) NLinear MSE 0.039 # 1
MAE 0.150 # 1
Time Series Forecasting ETTh1 (48) DLinear MSE 0.040 # 2
MAE 0.152 # 2
Time Series Forecasting ETTh1 (720) NLinear(Multivariate) MSE 0.440 # 9
MAE 0.453 # 9
Time Series Forecasting ETTh1 (720) NLinear(univariate) MSE 0.080 # 1
MAE 0.226 # 1
Time Series Forecasting ETTh1 (720) DLinear MSE 0.119 # 3
MAE 0.274 # 3
Time Series Forecasting ETTh2 (24) DLinear MSE 0.066 # 1
MAE 0.193 # 2
Time Series Forecasting ETTh2 (336) DLinear MSE 0.209 # 4
MAE 0.367 # 2
Time Series Forecasting ETTh2 (48) DLinear MSE 0.096 # 2
MAE 0.235 # 2
Time Series Forecasting ETTh2 (720) DLinear MSE 0.276 # 6
MAE 0.426 # 6
Time Series Forecasting ETTh2 (720) NLinear MSE 0.224 # 2
MAE 0.380 # 1

Methods