
Published as a conference paper at ICLR 2022
PYRAFORMER: LOW-COMPLEXITY PYRAMIDAL AT-
TENTION FOR LONG-RANGE TIME SERIES MODELING
AND FORECASTING
Shizhan Liu
1,2∗
, Hang Yu
1∗
, Cong Liao
1
, Jianguo Li
1†
, Weiyao Lin
2
, Alex X. Liu
1
,
and Schahram Dustdar
3
1
Ant Group,
2
Shanghai Jiaotong University,
3
TU Wien, Austria
ABSTRACT
Accurate prediction of the future given the past based on time series data is of
paramount importance, since it opens the door for decision making and risk man-
agement ahead of time. In practice, the challenge is to build a flexible but parsi-
monious model that can capture a wide range of temporal dependencies. In this
paper, we propose Pyraformer by exploring the multi-resolution representation of
the time series. Specifically, we introduce the pyramidal attention module (PAM)
in which the inter-scale tree structure summarizes features at different resolutions
and the intra-scale neighboring connections model the temporal dependencies of
different ranges. Under mild conditions, the maximum length of the signal travers-
ing path in Pyraformer is a constant (i.e., O(1)) with regard to the sequence length
L, while its time and space complexity scale linearly with L. Extensive experi-
mental results show that Pyraformer typically achieves the highest prediction ac-
curacy in both single-step and long-range multi-step forecasting tasks with the
least amount of time and memory consumption, especially when the sequence is
long
1
.
1 INTRODUCTION
Time series forecasting is the cornerstone for downstream tasks such as decision making and risk
management. As an example, reliable prediction of the online traffic for micro-services can yield
early warnings of the potential risk in cloud systems. Furthermore, it also provides guidance for
dynamic resource allocation, in order to minimize the cost without degrading the performance. In
addition to online traffic, time series forecasting has also found vast applications in other fields,
including disease propagation, energy management, and economics and finance.
The major challenge of time series forecasting lies in constructing a powerful but parsimonious
model that can compactly capture temporal dependencies of different ranges. Time series often
exhibit both short-term and long-term repeating patterns (Lai et al., 2018), and taking them into
account is the key to accurate prediction. Of particular note is the more difficult task of handling
long-range dependencies, which is characterized by the length of the longest signal traversing path
(see Proposition 2 for the definition) between any two positions in the time series (Vaswani et al.,
2017). The shorter the path, the better the dependencies are captured. Additionally, to allow the
models to learn these long-term patterns, the historical input to the models should also be long. To
this end, low time and space complexity is a priority.
Unfortunately, the present state-of-the-art methods fail to accomplish these two objectives simul-
taneously. On one end, RNN (Salinas et al., 2020) and CNN (Munir et al., 2018) achieve a low
time complexity that is linear in terms of the time series length L, yet their maximum length of the
signal traversing path is O(L), thus rendering them difficult to learn dependencies between distant
positions. On the other extreme, Transformer dramatically shortens the maximum path to be O(1)
∗
Equal contribution. This work was done when Shizhan Liu was a research intern at Ant Group.
†
Corresponding author
1
Code is available at: https://github.com/alipay/Pyraformer
1
评论