| [ |
| { |
| "type": "text", |
| "text": "PYRAFORMER: LOW-COMPLEXITY PYRAMIDAL AT-TENTION FOR LONG-RANGE TIME SERIES MODELINGAND FORECASTING", |
| "text_level": 1, |
| "bbox": [ |
| 174, |
| 98, |
| 823, |
| 171 |
| ], |
| "page_idx": 0 |
| }, |
| { |
| "type": "text", |
| "text": "Shizhan $ { \\mathbf { L i u ^ { 1 , 2 * } } }$ , Hang $\\mathbf { Y u } ^ { 1 }$ ∗, Cong Liao1, Jianguo $\\mathbf { L i } ^ { 1 }$ †, Weiyao Lin2, Alex X. Liu1, and Schahram Dustdar3 ", |
| "bbox": [ |
| 183, |
| 194, |
| 745, |
| 228 |
| ], |
| "page_idx": 0 |
| }, |
| { |
| "type": "text", |
| "text": "1Ant Group, 2Shanghai Jiaotong University, 3 TU Wien, Austria ", |
| "bbox": [ |
| 186, |
| 233, |
| 606, |
| 248 |
| ], |
| "page_idx": 0 |
| }, |
| { |
| "type": "text", |
| "text": "ABSTRACT ", |
| "text_level": 1, |
| "bbox": [ |
| 454, |
| 286, |
| 544, |
| 301 |
| ], |
| "page_idx": 0 |
| }, |
| { |
| "type": "text", |
| "text": "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 management ahead of time. In practice, the challenge is to build a flexible but parsimonious 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 traversing path in Pyraformer is a constant (i.e., $\\mathcal { O } ( 1 ) \\mathrm { { _ { \\it } } }$ ) with regard to the sequence length $L$ , while its time and space complexity scale linearly with $L$ . Extensive experimental results show that Pyraformer typically achieves the highest prediction accuracy 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 $\\mathrm { l o n g ^ { 1 } }$ . ", |
| "bbox": [ |
| 233, |
| 318, |
| 764, |
| 525 |
| ], |
| "page_idx": 0 |
| }, |
| { |
| "type": "text", |
| "text": "1 INTRODUCTION ", |
| "text_level": 1, |
| "bbox": [ |
| 178, |
| 550, |
| 336, |
| 566 |
| ], |
| "page_idx": 0 |
| }, |
| { |
| "type": "text", |
| "text": "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. ", |
| "bbox": [ |
| 174, |
| 582, |
| 823, |
| 665 |
| ], |
| "page_idx": 0 |
| }, |
| { |
| "type": "text", |
| "text": "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. ", |
| "bbox": [ |
| 174, |
| 672, |
| 825, |
| 797 |
| ], |
| "page_idx": 0 |
| }, |
| { |
| "type": "text", |
| "text": "Unfortunately, the present state-of-the-art methods fail to accomplish these two objectives simultaneously. 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 $\\mathcal { O } ( L )$ , thus rendering them difficult to learn dependencies between distant positions. On the other extreme, Transformer dramatically shortens the maximum path to be $\\mathcal { O } ( 1 )$ ", |
| "bbox": [ |
| 176, |
| 804, |
| 820, |
| 875 |
| ], |
| "page_idx": 0 |
| }, |
| { |
| "type": "image", |
| "img_path": "images/cdf77eb19d8c5bb6faae2ef9f8506ac4c8d47ead1a5b2a18785a17c7a43fae51.jpg", |
| "image_caption": [ |
| "Figure 1: Graphs of commonly used neural network models for sequence data. " |
| ], |
| "image_footnote": [], |
| "bbox": [ |
| 173, |
| 99, |
| 825, |
| 314 |
| ], |
| "page_idx": 1 |
| }, |
| { |
| "type": "text", |
| "text": "Table 1: Comparison of the complexity and the maximum signal traveling path for different models, where $G$ is the number of global tokens in ETC. In practice, the $G$ increases with $L$ , and so the complexity of ETC is super-linear. ", |
| "bbox": [ |
| 173, |
| 356, |
| 826, |
| 397 |
| ], |
| "page_idx": 1 |
| }, |
| { |
| "type": "table", |
| "img_path": "images/626481153aa20b388c15fa64bb9c13cbb3dc9d0c3b61a4d2103faa3becc1404b.jpg", |
| "table_caption": [], |
| "table_footnote": [], |
| "table_body": "<table><tr><td>Method</td><td>Complexityper layer</td><td>Maximum path length</td></tr><tr><td>CNN (Munir et al., 2018)</td><td>O(L)</td><td>O(L)</td></tr><tr><td>RNN (Salinas et al.,2020)</td><td>O(L)</td><td>O(L)</td></tr><tr><td>Full-Attention (Vaswani et al.,2017)</td><td>O(L2)</td><td>0(1)</td></tr><tr><td>ETC (Ainslie et al., 2020)</td><td>O(GL)</td><td>0(1)</td></tr><tr><td>Longformer (Beltagy et al., 2020)</td><td>O(L)</td><td>O(L)</td></tr><tr><td>LogTrans (Li et al., 2019)</td><td>O(L log L)</td><td>O(log L)</td></tr><tr><td>Pyraformer</td><td>O(L)</td><td>0(1)</td></tr></table>", |
| "bbox": [ |
| 238, |
| 404, |
| 753, |
| 539 |
| ], |
| "page_idx": 1 |
| }, |
| { |
| "type": "text", |
| "text": "at the sacrifice of increasing the time complexity to $\\mathcal { O } ( L ^ { 2 } )$ . As a consequence, it cannot tackle very long sequences. To find a compromise between the model capacity and complexity, variants of Transformer are proposed, such as Longformer (Beltagy et al., 2020), Reformer (Kitaev et al., 2019), and Informer (Zhou et al., 2021). However, few of them can achieve a maximum path length less than $\\mathcal { O } ( L )$ while greatly reducing the time and space complexity. ", |
| "bbox": [ |
| 173, |
| 551, |
| 825, |
| 622 |
| ], |
| "page_idx": 1 |
| }, |
| { |
| "type": "text", |
| "text": "In this paper, we propose a novel pyramidal attention based Transformer (Pyraformer) to bridge the gap between capturing the long-range dependencies and achieving a low time and space complexity. Specifically, we develop the pyramidal attention mechanism by passing messages based on attention in the pyramidal graph as shown in Figure 1(d). The edges in this graph can be divided into two groups: the inter-scale and the intra-scale connections. The inter-scale connections build a multiresolution representation of the original sequence: nodes at the finest scale correspond to the time points in the original time series (e.g., hourly observations), while nodes in the coarser scales represent features with lower resolutions (e.g., daily, weekly, and monthly patterns). Such latent coarser-scale nodes are initially introduced via a coarser-scale construction module. On the other hand, the intra-scale edges capture the temporal dependencies at each resolution by connecting neighboring nodes together. As a result, this model provides a compact representation for long-range temporal dependencies among far-apart positions by capturing such behavior at coarser resolutions, leading to a smaller length of the signal traversing path. Moreover, modeling temporal dependencies of different ranges at different scales with sparse neighboring intra-scale connections significantly reduces the computational cost. In short, our key contributions comprise: ", |
| "bbox": [ |
| 173, |
| 628, |
| 825, |
| 837 |
| ], |
| "page_idx": 1 |
| }, |
| { |
| "type": "text", |
| "text": "• We propose Pyraformer to simultaneously capture temporal dependencies of different ranges in a compact multi-resolution fashion. To distinguish Pyraformer from the stateof-the-art methods, we summarize all models from the perspective of graphs in Figure 1. • Theoretically, we prove that by choosing parameters appropriately, the maximum path length of $\\mathcal { O } ( 1 )$ and the time and space complexity of $\\mathcal O ( L )$ can be reached concurrently. To highlight the appeal of the proposed model, we further compare different models in terms of the maximum path and the complexity in Table 1. ", |
| "bbox": [ |
| 217, |
| 848, |
| 825, |
| 924 |
| ], |
| "page_idx": 1 |
| }, |
| { |
| "type": "text", |
| "text": "", |
| "bbox": [ |
| 225, |
| 103, |
| 821, |
| 132 |
| ], |
| "page_idx": 2 |
| }, |
| { |
| "type": "text", |
| "text": "• Experimentally, we show that the proposed Pyraformer yields more accurate predictions than the original Transformer and its variants on various real-world datasets under the scenario of both single-step and long-range multi-step forecasting, but with lower time and memory cost. ", |
| "bbox": [ |
| 218, |
| 137, |
| 823, |
| 193 |
| ], |
| "page_idx": 2 |
| }, |
| { |
| "type": "text", |
| "text": "2 RELATED WORKS ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 213, |
| 354, |
| 231 |
| ], |
| "page_idx": 2 |
| }, |
| { |
| "type": "text", |
| "text": "2.1 TIME SERIES FORECASTING ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 246, |
| 411, |
| 261 |
| ], |
| "page_idx": 2 |
| }, |
| { |
| "type": "text", |
| "text": "Time series forecasting methods can be roughly divided into statistical methods and neural network based methods. The first group involves ARIMA (Box & Jenkins, 1968) and Prophet (Taylor & Letham, 2018). However, both of them need to fit each time series separately, and their performance pales when it comes to long-range forecasting. ", |
| "bbox": [ |
| 174, |
| 272, |
| 825, |
| 328 |
| ], |
| "page_idx": 2 |
| }, |
| { |
| "type": "text", |
| "text": "More recently, the development of deep learning has spawned a tremendous increase in neural network based time series forecasting methods, including CNN (Munir et al., 2018), RNN (Salinas et al., 2020) and Transformer (Li et al., 2019). As mentioned in the previous section, CNN and RNN enjoy a low time and space complexity (i.e., $\\mathcal { O } ( L ) )$ ), but entail a path of $\\mathcal O ( L )$ to describe long-range dependence. We refer the readers to Appendix A for a more detailed review on related RNN-based models. By contrast, Transformer (Vaswani et al., 2017) can effectively capture the long-range dependence with a path of $\\mathcal { O } ( 1 )$ steps, whereas the complexity increases vastly from $\\mathcal O ( L )$ to $\\check { \\mathcal { O } } ( L ^ { 2 } )$ . To alleviate this computational burden, LogTrans (Li et al., 2019) and Informer (Zhou et al., 2021) are proposed: the former constrains that each point in the sequence can only attend to the point that is $2 ^ { n }$ steps before it, where $n = 1 , 2 , \\cdots$ , and the latter utilizes the sparsity of the attention score, resulting in substantial decrease in the complexity (i.e., $\\mathcal { O } ( L \\log L )$ at the expense of introducing a longer maximum path length. ", |
| "bbox": [ |
| 174, |
| 335, |
| 825, |
| 502 |
| ], |
| "page_idx": 2 |
| }, |
| { |
| "type": "text", |
| "text": "2.2 SPARSE TRANSFORMERS ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 520, |
| 387, |
| 534 |
| ], |
| "page_idx": 2 |
| }, |
| { |
| "type": "text", |
| "text": "In addition to the literature on time series forecasting, a plethora of methods have been proposed for enhancing the efficiency of Transformer in the field of natural language processing (NLP). Similar to CNN, Longformer (Beltagy et al., 2020) computes attention within a local sliding window or a dilated sliding window. Although the complexity is reduced to $\\mathcal { O } ( A L )$ , where $A$ is the local window size, the limited window size makes it difficult to exchange information globally. The consequent maximum path length is $\\mathcal { O } ( L / A )$ . As an alternative, Reformer (Kitaev et al., 2019) exploits locality sensitive hashing (LSH) to divide the sequence into several buckets, and then performs attention within each bucket. It also employs reversible Transformer to further reduce memory consumption, and so an extremely long sequence can be processed. Its maximum path length is proportional to the number of buckets though, and worse still, a large bucket number is required to reduce the complexity. On the other hand, ETC (Ainslie et al., 2020) introduces an extra set of global tokens for the sake of global information exchange, leading to an $\\mathcal { O } ( G L )$ time and space complexity and an $\\mathcal { O } ( 1 )$ maximum path length, where $G$ is the number of global tokens. However, $G$ typically increases with $L$ , and the consequent complexity is still super-linear. Akin to ETC, the proposed Pyraformer also introduces global tokens, but in a multiscale manner, successfully reducing the complexity to $\\mathcal { O } ( L )$ without increasing the order of the maximum path length as in the original Transformer. ", |
| "bbox": [ |
| 174, |
| 546, |
| 825, |
| 768 |
| ], |
| "page_idx": 2 |
| }, |
| { |
| "type": "text", |
| "text": "2.3 HIERARCHICAL TRANSFORMERS ", |
| "text_level": 1, |
| "bbox": [ |
| 178, |
| 786, |
| 442, |
| 800 |
| ], |
| "page_idx": 2 |
| }, |
| { |
| "type": "text", |
| "text": "Finally, we provide a brief review on methods that improve Transformer’s ability to capture the hierarchical structure of natural language, although they have never been used for time series forecasting. HIBERT (Miculicich et al., 2018) first uses a Sent Encoder to extract the features of a sentence, and then forms the EOS tokens of sentences in the document as a new sequence and input it into the Doc Encoder. However, it is specialized for natural language and cannot be generalized to other sequence data. Multi-scale Transformer (Subramanian et al., 2020) learns the multi-scale representations of sequence data using both the top-down and bottom-up network structures. Such multi-scale representations help reduce the time and memory cost of the original Transformer, but it still suffers from the pitfall of the quadratic complexity. Alternatively, BP-Transformer (Ye et al., 2019) recursively partitions the entire input sequence into two until a partition only contains a single token. The partitioned sequences then form a binary tree. In the attention layer, each upper-scale node can attend to its own children, while the nodes at the bottom scale can attend to the adjacent $A$ nodes at the same scale and all coarser-scale nodes. Note that BP-Transformer initializes the nodes at coarser scale with zeros, whereas Pyraformer introduces the coarser-scale nodes using a construction module in a more flexible manner. Moreover, BP-Transformer is associated with a denser graph than Pyraformer, thus giving rise to a higher complexity of $\\mathcal { O } ( L \\log L )$ . ", |
| "bbox": [ |
| 174, |
| 811, |
| 825, |
| 924 |
| ], |
| "page_idx": 2 |
| }, |
| { |
| "type": "image", |
| "img_path": "images/56cd8894c208a5e364b1dc0bb7b398b69c875aae166d907b12cd98ff3ac99fe5.jpg", |
| "image_caption": [ |
| "Figure 2: The architecture of Pyraformer: The CSCM summarizes the embedded sequence at different scales and builds a multi-resolution tree structure. Then the PAM is used to exchange information between nodes efficiently. " |
| ], |
| "image_footnote": [], |
| "bbox": [ |
| 173, |
| 99, |
| 825, |
| 239 |
| ], |
| "page_idx": 3 |
| }, |
| { |
| "type": "text", |
| "text": "", |
| "bbox": [ |
| 174, |
| 314, |
| 825, |
| 426 |
| ], |
| "page_idx": 3 |
| }, |
| { |
| "type": "text", |
| "text": "3 METHOD ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 445, |
| 281, |
| 462 |
| ], |
| "page_idx": 3 |
| }, |
| { |
| "type": "text", |
| "text": "The time series forecasting problem can be formulated as predicting the future $M$ steps $z _ { t + 1 : t + M }$ given the previous $L$ steps of observations $z _ { t - L + 1 : t }$ and the associated covariates $\\pmb { x } _ { t - L + 1 : t + M }$ (e.g., hour-of-the-day). To move forward to this goal, we propose Pyraformer in this paper, whose overall architecture is summarized in Figure 2. As shown in the figure, we first embed the observed data, the covariates, and the positions separately and then add them together, in the same vein with Informer (Zhou et al., 2021). Next, we construct a multi-resolution $C$ -ary tree using the coarserscale construction module (CSCM), where nodes at a coarser scale summarize the information of $C$ nodes at the corresponding finer scale. To further capture the temporal dependencies of different ranges, we introduce the pyramidal attention module (PAM) by passing messages using the attention mechanism in the pyramidal graph. Finally, depending on the downstream task, we employ different network structures to output the final predictions. In the sequel, we elaborate on each part of the proposed model. For ease of exposition, all notations in this paper are summarized in Table 4. ", |
| "bbox": [ |
| 173, |
| 478, |
| 825, |
| 643 |
| ], |
| "page_idx": 3 |
| }, |
| { |
| "type": "text", |
| "text": "3.1 PYRAMIDAL ATTENTION MODULE (PAM) ", |
| "text_level": 1, |
| "bbox": [ |
| 174, |
| 661, |
| 508, |
| 676 |
| ], |
| "page_idx": 3 |
| }, |
| { |
| "type": "text", |
| "text": "We begin with the introduction of the PAM, since it lies at the heart of Pyraformer. As demonstrated in Figure 1(d), we leverage a pyramidal graph to describe the temporal dependencies of the observed time series in a multiresolution fashion. Such a multiresolution structure has proved itself an effective and efficient tool for long-range interaction modeling in the field of computer vision (Sun et al., 2019; Wang et al., 2021) and statistical signal processing (Choi et al., 2008; Yu et al., 2019). We can decompose the pyramidal graph into two parts: the inter-scale and the intra-scale connections. The inter-scale connections form a $C$ -ary tree, in which each parent has $C$ children. For example, if we associate the finest scale of the pyramidal graph with hourly observations of the original time series, the nodes at coarser scales can be regarded as the daily, weekly, and even monthly features of the time series. As a consequence, the pyramidal graph offers a multi-resolution representation of the original time series. Furthermore, it is easier to capture long-range dependencies (e.g., monthly dependence) in the coarser scales by simply connecting the neighboring nodes via the intra-scale connections. In other words, the coarser scales are instrumental in describing long-range correlations in a manner that is graphically far more parsimonious than could be solely captured with a single, finest scale model. Indeed, the original single-scale Transformer (see Figure 1(a)) adopts a full graph that connects every two nodes at the finest scale so as to model the long-range dependencies, leading to a computationally burdensome model with $\\mathcal { O } ( L ^ { 2 } )$ time and space complexity (Vaswani et al., 2017). In stark contrast, as illustrated below, the pyramidal graph in the proposed Pyraformer reduces the computational cost to $\\mathcal O ( L )$ without increasing the order of the maximum length of the signal traversing path. ", |
| "bbox": [ |
| 174, |
| 688, |
| 825, |
| 924 |
| ], |
| "page_idx": 3 |
| }, |
| { |
| "type": "text", |
| "text": "", |
| "bbox": [ |
| 174, |
| 103, |
| 823, |
| 146 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "text", |
| "text": "Before delving into the PAM, we first introduce the original attention mechanism. Let $\\boldsymbol { X }$ and $\\mathbf { Y }$ denote the input and output of a single attention head respectively. Note that multiple heads can be introduced to describe the temporal pattern from different perspectives. $\\boldsymbol { X }$ is first linearly transformed into three distinct matrices, namely, the query $Q = X W _ { Q }$ , the key $\\pmb { K } = \\pmb { X } \\pmb { W } _ { K }$ , and the value $\\pmb { V } = \\pmb { X } \\pmb { W } _ { V }$ , where $W _ { Q }$ , $W _ { K }$ , $W _ { V } \\in \\mathbb { R } ^ { L \\times D _ { K } }$ . For the $i$ -th row $\\pmb q _ { i }$ in $Q$ , it can attend to any rows (i.e., keys) in $\\kappa$ . In other words, the corresponding output $\\mathbf { \\nabla } _ { \\mathbf { \\psi } _ { 3 } } \\psi _ { i }$ can be expressed as: ", |
| "bbox": [ |
| 173, |
| 151, |
| 825, |
| 238 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/a4ab598b546f6b7ebb82b39ce9ff06398783e40dac4c9cea4945eff5dbeb48ba.jpg", |
| "text": "$$\n{ \\pmb y } _ { i } = \\sum _ { \\ell = 1 } ^ { L } \\frac { \\mathrm { e x p } ( { \\pmb q } _ { i } { \\pmb k } _ { \\ell } ^ { T } / \\sqrt { D _ { K } } ) { \\pmb v } _ { \\ell } } { \\sum _ { \\ell = 1 } ^ { L } \\mathrm { e x p } ( { \\pmb q } _ { i } { \\pmb k } _ { \\ell } ^ { T } / \\sqrt { D _ { K } } ) } ,\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 379, |
| 239, |
| 617, |
| 282 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "text", |
| "text": "where $k _ { \\ell } ^ { T }$ denotes the transpose of row $\\ell$ in $\\kappa$ . We emphasize that the number of query-key dot products (Q-K pairs) that need to be calculated and stored dictates the time and space complexity of the attention mechanism. Viewed another way, this number is proportional to the number of edges in the graph (see Figure 1(a)). Since all Q-K pairs are computed and stored in the full attention mechanism (1), the resulting time and space complexity is $\\mathcal { O } ( L ^ { 2 } )$ . ", |
| "bbox": [ |
| 173, |
| 285, |
| 825, |
| 356 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "text", |
| "text": "As opposed to the above full attention mechanism, every node only pays attention to a limited set of keys in the PAM, corresponding to the pyramidal graph in Figure 1d. Concretely, suppose that $n _ { \\ell } ^ { ( s ) }$ denotes the $\\ell \\cdot$ -th node at scale $s$ , where $s = 1 , \\cdots , S$ represents the bottom scale to the top scale sequentially. In general, each node in the graph can attend to a set of neighboring nodes $\\mathbb { N } _ { \\ell } ^ { ( s ) }$ at three scales: the adjacent $A$ nodes at the same scale including the node itself (denoted as $\\mathbb { A } _ { \\ell } ^ { ( s ) }$ ), the $C$ children it has in the $C$ -ary tree (denoted as $\\mathbb { C } _ { \\ell } ^ { ( s ) } .$ ), and the parent of it in the $C$ -ary tree (denoted $\\mathbb { P } _ { \\ell } ^ { ( s ) } )$ , that is, ", |
| "bbox": [ |
| 173, |
| 361, |
| 826, |
| 479 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/c1c6b42e71ce1a071839b917e297e956e538cb8315d07f3cdb9c25ccecde1a58.jpg", |
| "text": "$$\n\\left\\{ \\begin{array} { l l l l l l l l l l l l l } { \\mathbb { N } _ { \\ell } ^ { ( s ) } } & { = } & { \\mathbb { A } _ { \\ell } ^ { ( s ) } \\cup \\mathbb { C } _ { \\ell } ^ { ( s ) } \\cup \\mathbb { P } _ { l } ^ { ( s ) } } & & & & & \\\\ { \\mathbb { A } _ { \\ell } ^ { ( s ) } } & { = } & { \\{ n _ { j } ^ { ( s ) } : | j - \\ell | \\leq \\frac { A - 1 } { 2 } , 1 \\leq j \\leq \\frac { L } { C ^ { s - 1 } } \\} } & & & & & \\\\ { \\mathbb { C } _ { \\ell } ^ { ( s ) } } & { = } & { \\{ n _ { j } ^ { ( s - 1 ) } : ( \\ell - 1 ) C < j \\leq \\ell C \\} } & { \\mathrm { i f } s \\geq 2 \\mathrm { e l s e } \\emptyset } & & & \\\\ { \\mathbb { P } _ { \\ell } ^ { ( s ) } } & { = } & { \\{ n _ { j } ^ { ( s + 1 ) } : j = \\lceil \\frac { \\ell } { C } \\rceil \\} } & { \\mathrm { i f } s \\leq S - 1 \\mathrm { e l s e } \\emptyset } & & & & \\end{array} \\right. .\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 284, |
| 481, |
| 714, |
| 564 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "text", |
| "text": "It follows that the attention at node $n _ { \\ell } ^ { ( s ) }$ can be simplified as:√ ", |
| "bbox": [ |
| 173, |
| 566, |
| 573, |
| 584 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/65219bb1ee3e17b2e49fcc877e25c0f00a110a80ddb131298165d032413727b3.jpg", |
| "text": "$$\n\\pmb { y } _ { i } = \\sum _ { \\ell \\in \\mathbb { N } _ { \\ell } ^ { ( s ) } } \\frac { \\exp ( \\pmb { q } _ { i } \\pmb { k } _ { \\ell } ^ { T } / \\sqrt { d _ { K } } ) \\pmb { v } _ { \\ell } } { \\sum _ { \\ell \\in \\mathbb { N } _ { l } ^ { ( s ) } } \\exp ( \\pmb { q } _ { i } \\pmb { k } _ { \\ell } ^ { T } / \\sqrt { d _ { K } } ) } ,\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 367, |
| 585, |
| 629, |
| 631 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "text", |
| "text": "We further denote the number of attention layers as $N$ . Without loss of generality, we assume that $L$ is divisible by $C ^ { S - 1 }$ . We can then have the following lemma (cf. Appendix $\\mathbf { B }$ for the proof and Table 4 for the meanings of the notations). ", |
| "bbox": [ |
| 174, |
| 640, |
| 825, |
| 683 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "text", |
| "text": "Lemma 1. Given $A , C , L , N$ , and $S$ that satisfy Equation (4), after $N$ stacked attention layers, nodes at the coarsest scale can obtain a global receptive field. ", |
| "bbox": [ |
| 173, |
| 684, |
| 820, |
| 713 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/eafe1980cccd7d86fbe5781b52170d343501370e89e2c447787bffb17b333aa3.jpg", |
| "text": "$$\n\\frac { L } { C ^ { S - 1 } } - 1 \\leq \\frac { ( A - 1 ) N } { 2 } .\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 413, |
| 714, |
| 584, |
| 746 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "text", |
| "text": "In addition, when the number of scales $S$ is fixed, the following two propositions summarize the time and space complexity and the order of the maximum path length for the proposed pyramidal attention mechanism. We refer the readers to Appendix C and $\\mathrm { D }$ for proof. ", |
| "bbox": [ |
| 176, |
| 752, |
| 825, |
| 795 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "text", |
| "text": "Proposition 1. The time and space complexity for the pyramidal attention mechanism is $\\mathcal { O } ( A L )$ for given $A$ and $L$ and amounts to $\\mathcal O ( L )$ when $A$ is a constant w.r.t. $L$ . ", |
| "bbox": [ |
| 171, |
| 797, |
| 825, |
| 825 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "text", |
| "text": "Proposition 2. Let the signal traversing path between two nodes in a graph denote the shortest path connecting them. Then the maximum length of signal traversing path between two arbitrary nodes in the pyramidal graph is $\\mathcal { O } ( S + L / C ^ { S - 1 } / A )$ for given $A$ , $C$ , $L$ , and $S$ . Suppose that $A$ and $S$ are fixed and $C$ satisfies Equation (5), the maximum path length is $\\mathcal { O } ( 1 )$ for time series with length $L$ . ", |
| "bbox": [ |
| 173, |
| 828, |
| 825, |
| 885 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/ba62517cd5c850e97d37eb87878ea0cbbdcaa9bcd04097cae7bcc4d114e94a4b.jpg", |
| "text": "$$\n\\sqrt [ s - 1 ] { L } \\geq C \\geq \\sqrt [ s - 1 ] { \\frac { L } { ( A - 1 ) N / 2 + 1 } } .\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 377, |
| 886, |
| 627, |
| 928 |
| ], |
| "page_idx": 4 |
| }, |
| { |
| "type": "image", |
| "img_path": "images/91aa8cb400219056af9686acde2534aae765cbb65f9bf4e842354362211e49b1.jpg", |
| "image_caption": [ |
| "Figure 3: Coarser-scale construction module: $B$ is the batch size and $D$ is the dimension of a node. " |
| ], |
| "image_footnote": [], |
| "bbox": [ |
| 318, |
| 99, |
| 679, |
| 228 |
| ], |
| "page_idx": 5 |
| }, |
| { |
| "type": "text", |
| "text": "In our experiments, we fix $S$ and $N$ , and $A$ can only take 3 or 5, regardless of the sequence length $L$ . Therefore, the proposed PAM achieves the complexity of $\\mathcal { O } ( L )$ with the maximum path length of $\\mathcal { O } ( 1 )$ . Note that in the PAM, a node can attend to at most $A + C + 1$ nodes. Unfortunately, such a sparse attention mechanism is not supported in the existing deep learning libraries, such as Pytorch and TensorFlow. A naive implementation of the PAM that can fully exploit the tensor operation framework is to first compute the product between all Q-K pairs, i.e., $\\mathbf { \\Delta } q _ { i } \\mathbf { \\Delta } k _ { \\ell } ^ { T }$ for $\\ell =$ $1 , \\cdots , L$ , and then mask out $\\ell \\notin \\mathbb { N } _ { \\ell } ^ { ( s ) }$ . However, the resulting time and space complexity of this implementation is still $\\mathcal { O } ( L ^ { 2 } )$ . Instead, we build a customized CUDA kernel specialized for the PAM using TVM (Chen et al., 2018), practically reducing the computational time and memory cost and making the proposed model amenable to long time series. Longer historical input is typically helpful for improving the prediction accuracy, as more information is provided, especially when long-range dependencies are considered. ", |
| "bbox": [ |
| 173, |
| 266, |
| 825, |
| 439 |
| ], |
| "page_idx": 5 |
| }, |
| { |
| "type": "text", |
| "text": "3.2 COARSER-SCALE CONSTRUCTION MODULE (CSCM) ", |
| "text_level": 1, |
| "bbox": [ |
| 174, |
| 457, |
| 583, |
| 470 |
| ], |
| "page_idx": 5 |
| }, |
| { |
| "type": "text", |
| "text": "CSCM targets at initializing the nodes at the coarser scales of the pyramidal graph, so as to facilitate the subsequent PAM to exchange information between these nodes. Specifically, the coarse-scale nodes are introduced scale by scale from bottom to top by performing convolutions on the corresponding children nodes $\\mathbb { C } _ { \\ell } ^ { ( s ) }$ . As demonstrated in Figure 3, several convolution layers with kernel size $C$ and stride $C$ are sequentially applied to the embedded sequence in the dimension of time, yielding a sequence with length $L / C ^ { s }$ at scale $s$ . The resulting sequences at different scales form a $C$ -ary tree. We concatenate these fine-to-coarse sequences before inputting them to the PAM. In order to reduce the amount of parameters and calculations, we reduce the dimension of each node by a fully connected layer before inputting the sequence into the stacked convolution layers and restore it after all convolutions. Such a bottleneck structure significantly reduces the number of parameters in the module and can guard against over-fitting. ", |
| "bbox": [ |
| 173, |
| 481, |
| 825, |
| 637 |
| ], |
| "page_idx": 5 |
| }, |
| { |
| "type": "text", |
| "text": "3.3 PREDICTION MODULE ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 655, |
| 369, |
| 670 |
| ], |
| "page_idx": 5 |
| }, |
| { |
| "type": "text", |
| "text": "For single-step forecasting, we add an end token (by setting $z _ { t + 1 } = 0$ ) to the end of the historical sequence $z _ { t - L + 1 : t }$ before inputting it into the embedding layer. After the sequence is encoded by the PAM, we gather the features given by the last nodes at all scales in the pyramidal graph, concatenate and then input them into a fully connected layer for prediction. ", |
| "bbox": [ |
| 174, |
| 680, |
| 825, |
| 736 |
| ], |
| "page_idx": 5 |
| }, |
| { |
| "type": "text", |
| "text": "For multi-step forecasting, we propose two prediction modules. The first one is the same with the single-step forecasting module, but maps the last nodes at all scales to all $M$ future time steps in a batch. The second one, on the other hand, resorts to a decoder with two full attention layers. Specifically, similar to the original Transformer (Vaswani et al., 2017), we replace the observations at the future $M$ time steps with 0, embed them in the same manner with the historical observations, and refer to the summation of the observation, covariate, and positional embedding as the “prediction token” $F _ { p }$ . The first attention layer then takes the prediction tokens $F _ { p }$ as the query and the output of the encoder $\\pmb { F _ { e } }$ (i.e., all nodes in the PAM) as the key and the value, and yields ${ \\bf { { F } } } _ { d 1 }$ . The second layer takes ${ \\mathbf { } } F _ { d 1 }$ as the query, but takes the concatenated ${ \\bf { { F } } } _ { d 1 }$ and $\\pmb { F _ { e } }$ as the key and the value. The historical information $\\pmb { F _ { e } }$ is fed directly into both attention layers, since such information is vital for accurate long-range forecasting. The final prediction is then obtained through a fully connected layer across the dimension of channels. Again, we output all future predictions together to avoid the problem of error accumulation in the autoregressive decoder of Transformer. ", |
| "bbox": [ |
| 174, |
| 743, |
| 825, |
| 924 |
| ], |
| "page_idx": 5 |
| }, |
| { |
| "type": "table", |
| "img_path": "images/c4e321b0e63f0158f9b19bfa056ecdd39d38f0131f3e85e90ddfeae455ab70aa.jpg", |
| "table_caption": [ |
| "Table 2: Single-step forecasting results on three datasets. “Q-K pairs” refer to the number of querykey dot products performed by all attention layers in the network, which encodes the time and space complexity. We write the number of attention layers by $N$ , the number of attention heads by $H$ , the number of scales by $S$ , the dimension of a node by $D$ , the dimension of a key by $D _ { K }$ , the maximum dimension of feed-forward layer by $D _ { F }$ , and the convolution stride by $C$ . " |
| ], |
| "table_footnote": [], |
| "table_body": "<table><tr><td>Methods</td><td>Parameters</td><td>Datasets</td><td>NRMSE</td><td>ND</td><td>Q-K pairs</td></tr><tr><td rowspan=\"3\">Full-attention</td><td rowspan=\"3\">O(N(HDDK+DDF))</td><td>Electricity</td><td>0.328</td><td>0.041</td><td>456976</td></tr><tr><td>Wind</td><td>0.175</td><td>0.082</td><td>589824</td></tr><tr><td>App Flow</td><td>0.407</td><td>0.080</td><td>589824</td></tr><tr><td rowspan=\"3\">LogTrans</td><td rowspan=\"3\">O(N(HDDK+DDF))</td><td>Electricity</td><td>0.333</td><td>0.041</td><td>50138</td></tr><tr><td>Wind</td><td>0.173</td><td>0.081</td><td>58272</td></tr><tr><td>App Flow</td><td>0.387</td><td>0.073</td><td>58272</td></tr><tr><td rowspan=\"3\">Reformer</td><td rowspan=\"3\">O(N(HDDK+DDF))</td><td>Electricity</td><td>0.359</td><td>0.047</td><td>677376</td></tr><tr><td>Wind</td><td>0.183</td><td>0.086</td><td>884736</td></tr><tr><td>AppFlow</td><td>0.463</td><td>0.095</td><td>884736</td></tr><tr><td rowspan=\"3\">ETC</td><td rowspan=\"3\">O(N(HDDK+DDF))</td><td>Electricity</td><td>0.324</td><td>0.041</td><td>79536</td></tr><tr><td>Wind</td><td>0.167</td><td>0.074</td><td>102144</td></tr><tr><td>App Flow</td><td>0.397</td><td>0.069</td><td>102144</td></tr><tr><td rowspan=\"3\">Longformer</td><td rowspan=\"3\">O(N(HDDK+DDF))</td><td>Electricity</td><td>0.330</td><td>0.041</td><td>41360</td></tr><tr><td>Wind</td><td>0.166</td><td>0.075</td><td>52608</td></tr><tr><td>AppFlow</td><td>0.377</td><td>0.07</td><td>52608</td></tr><tr><td rowspan=\"3\">Pyraformer</td><td rowspan=\"3\">O(N(HDDK+DDF) +(S-1)CD²)</td><td>Electricity</td><td>0.324</td><td>0.041</td><td>17648</td></tr><tr><td>Wind</td><td>0.161</td><td>0.072</td><td>20176</td></tr><tr><td>App Flow</td><td>0.366</td><td>0.067</td><td>20176</td></tr></table>", |
| "bbox": [ |
| 222, |
| 193, |
| 774, |
| 497 |
| ], |
| "page_idx": 6 |
| }, |
| { |
| "type": "text", |
| "text": "4 EXPERIMENTS ", |
| "text_level": 1, |
| "bbox": [ |
| 174, |
| 508, |
| 328, |
| 525 |
| ], |
| "page_idx": 6 |
| }, |
| { |
| "type": "text", |
| "text": "4.1 DATASETS AND EXPERIMENT SETUP ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 539, |
| 468, |
| 554 |
| ], |
| "page_idx": 6 |
| }, |
| { |
| "type": "text", |
| "text": "We demonstrated the advantages of the proposed Pyraformer on the four real-world datasets, including Wind, App Flow, Electricity, and ETT. The first three datasets were used for single-step forecasting, while the last two for long-range multi-step forecasting. We refer the readers to Appendix E and F for more details regarding the data description and the experiment setup. ", |
| "bbox": [ |
| 174, |
| 563, |
| 825, |
| 619 |
| ], |
| "page_idx": 6 |
| }, |
| { |
| "type": "text", |
| "text": "4.2 RESULTS AND ANALYSIS ", |
| "text_level": 1, |
| "bbox": [ |
| 174, |
| 635, |
| 388, |
| 648 |
| ], |
| "page_idx": 6 |
| }, |
| { |
| "type": "text", |
| "text": "4.2.1 SINGLE-STEP FORECASTING", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 659, |
| 426, |
| 672 |
| ], |
| "page_idx": 6 |
| }, |
| { |
| "type": "text", |
| "text": "We conducted single-step prediction experiments on three datasets: Electricity, Wind and App Flow. The historical length is 169, 192 and 192, respectively, including the end token. We benchmarked Pyraformer against 5 other attention mechanisms, including the original full-attention (Vaswani et al., 2017), the log-sparse attention (i.e., LogTrans) (Li et al., 2019), the LSH attention (i.e., Reformer) (Kitaev et al., 2019), the sliding window attention with global nodes (i.e., ETC) (Ainslie et al., 2020), and the dilated sliding window attention (i.e., Longformer) (Beltagy et al., 2020). In particular for ETC, some nodes with equal intervals at the finest scale were selected as the global nodes. A global node can attend to all nodes across the sequence and all nodes can attend to it in turn(see Figure 1(e)). The training and testing schemes were the same for all models. We further investigated the usefulness of the pretraining strategy (see Appendix G), the weighted sampler, and the hard sample mining on all methods, and the best results were presented. We adopted the NRMSE (Normalized RMSE) and the ND (Normalized Deviation) as the evaluation indicators (see Appendix H for the definitions). The results are summarized in Table 2. For a fair comparison, except for full-attention, the overall dot product number of all attention mechanisms was controlled to the same order of magnitude. ", |
| "bbox": [ |
| 173, |
| 681, |
| 825, |
| 888 |
| ], |
| "page_idx": 6 |
| }, |
| { |
| "type": "text", |
| "text": "Our experimental results show that Pyraformer outperforms Transformer and its variants in terms of NRMSE and ND, with the least number of query-key dot products (a.k.a. Q-K pairs). Concretely, there are three major trends that can be gleaned from Table 2: (1) The proposed Pyraformer yields the most accurate prediction results, suggesting that the pyramidal graph can better explain the temporal interactions in the time series by considering dependencies of different ranges. Interestingly, for the Wind dataset, sparse attention mechanisms, namely, LogTrans, ETC, Longformer and Pyraformer, outperform the original full attention Transformer, probably because the data contains a large number of zeros and the promotion of adequate sparsity can help avoid over-fitting. (2) The number of Q-K pairs in Pyraformer is the smallest. Recall that this number characterizes the time and space complexity. Remarkably enough, it is $6 5 . 4 \\%$ fewer than that of LogTrans and $9 6 . 6 \\%$ than that of the full attention. It is worth emphasizing that this computational gain will continue to increase for longer time series. (3) The number of parameters for Pyraformer is slightly larger than that of the other models, resulting from the CSCM. However, this module is very lightweight, which incurs merely $5 \\%$ overhead in terms of model size compared to other models. Moreover, in practice, we can fix the hyper-parameters $A$ , $S$ and $N$ , and ensure that $C$ satisfies $C > \\sqrt [ s - 1 ] { L / ( ( A - 1 ) N / 2 + 1 ) }$ . Consequently, the extra number of parameters introduced by the CSCM is only $\\mathcal { O } ( ( S - 1 ) C D _ { K } ^ { 2 } ) \\approx \\mathcal { O } ( \\sqrt [ s ] { L } )$ . ", |
| "bbox": [ |
| 173, |
| 895, |
| 821, |
| 924 |
| ], |
| "page_idx": 6 |
| }, |
| { |
| "type": "table", |
| "img_path": "images/fb65d3346450b25f3f272dc1e4074300781d3c61b8a121948273860cdd52fac9.jpg", |
| "table_caption": [ |
| "Table 3: Long-range multi-step forecasting results. " |
| ], |
| "table_footnote": [], |
| "table_body": "<table><tr><td rowspan=\"2\">Methods</td><td rowspan=\"2\">Metrics</td><td colspan=\"3\">ETTh1</td><td colspan=\"3\">ETTm1</td><td colspan=\"3\">Electricity</td></tr><tr><td>168</td><td>336</td><td>720</td><td>96</td><td>288</td><td>672</td><td>168</td><td>336</td><td>720</td></tr><tr><td rowspan=\"3\">Informer</td><td>MSE</td><td>1.075</td><td>1.329</td><td>1.384</td><td>0.556</td><td>0.841</td><td>0.921</td><td>0.745</td><td>1.579</td><td>4.365</td></tr><tr><td>MAE</td><td>0.801</td><td>0.911</td><td>0.950</td><td>0.537</td><td>0.705</td><td>0.753</td><td>0.266</td><td>0.323</td><td>0.371</td></tr><tr><td>Q-K pairs</td><td>188040</td><td>188040</td><td>423360</td><td>276480</td><td>560640</td><td>560640</td><td>188040</td><td>188040</td><td>423360</td></tr><tr><td rowspan=\"3\">LogTrans</td><td>MSE</td><td>0.983</td><td>1.100</td><td>1.411</td><td>0.554</td><td>0.786</td><td>1.169</td><td>0.791</td><td>1.584</td><td>4.362</td></tr><tr><td>MAE</td><td>0.766</td><td>0.839</td><td>0.991</td><td>0.499</td><td>0.676</td><td>0.868</td><td>0.340</td><td>0.336</td><td>0.366</td></tr><tr><td>Q-K pairs</td><td>74664</td><td>74664</td><td>216744</td><td>254760</td><td>648768</td><td>648768</td><td>74664</td><td>74664</td><td>216744</td></tr><tr><td rowspan=\"3\">Longformer</td><td>MSE</td><td>0.860</td><td>0.975</td><td>1.091</td><td>0.526</td><td>0.767</td><td>1.021</td><td>0.766</td><td>1.591</td><td>4.361</td></tr><tr><td>MAE</td><td>0.710</td><td>0.769</td><td>0.832</td><td>0.507</td><td>0.663</td><td>0.788</td><td>0.311</td><td>0.343</td><td>0.368</td></tr><tr><td>Q-K pairs</td><td>63648</td><td>63648</td><td>249120</td><td>329760</td><td>1007136</td><td>1007136</td><td>63648</td><td>63648</td><td>249120</td></tr><tr><td rowspan=\"3\">Reformer</td><td>MSE</td><td>0.958</td><td>1.044</td><td>1.458</td><td>0.543</td><td>0.924</td><td>0.981</td><td>0.783</td><td>1.584</td><td>4.374</td></tr><tr><td>MAE</td><td>0.741</td><td>0.787</td><td>0.987</td><td>0.528</td><td>0.722</td><td>0.778</td><td>0.332</td><td>0.334</td><td>0.374</td></tr><tr><td>Q-K pairs</td><td>1016064</td><td>1016064</td><td>2709504</td><td>5308416</td><td>14450688</td><td>14450688</td><td>1016064</td><td>1016064</td><td>2709504</td></tr><tr><td rowspan=\"3\">ETC</td><td>MSE</td><td>1.025</td><td>1.084</td><td>1.137</td><td>0.762</td><td>1.227</td><td>1.272</td><td>0.777</td><td>1.586</td><td>4.361</td></tr><tr><td>MAE</td><td>0.771</td><td>0.811</td><td>0.866</td><td>0.653</td><td>0.880</td><td>0.908</td><td>0.326</td><td>0.340</td><td>0.368</td></tr><tr><td>Q-K pairs</td><td>125280</td><td>125280</td><td>288720</td><td>331344</td><td>836952</td><td>836952</td><td>125280</td><td>125280</td><td>288720</td></tr><tr><td rowspan=\"3\">Pyraformer</td><td>MSE</td><td>0.808</td><td>0.945</td><td>1.022</td><td>0.480</td><td>0.754</td><td>0.857</td><td>0.719</td><td>1.533</td><td>4.312</td></tr><tr><td>MAE</td><td>0.683</td><td>0.766</td><td>0.806</td><td>0.486</td><td>0.659</td><td>0.707</td><td>0.256</td><td>0.291</td><td>0.346</td></tr><tr><td>Q-K pairs</td><td>26472</td><td>26472</td><td>74280</td><td>57264</td><td>96384</td><td>96384</td><td>26472</td><td>26472</td><td>74280</td></tr></table>", |
| "bbox": [ |
| 174, |
| 130, |
| 825, |
| 415 |
| ], |
| "page_idx": 7 |
| }, |
| { |
| "type": "text", |
| "text": "", |
| "bbox": [ |
| 173, |
| 439, |
| 825, |
| 652 |
| ], |
| "page_idx": 7 |
| }, |
| { |
| "type": "text", |
| "text": "4.2.2 LONG-RANGE MULTI-STEP FORECASTING", |
| "text_level": 1, |
| "bbox": [ |
| 174, |
| 670, |
| 521, |
| 684 |
| ], |
| "page_idx": 7 |
| }, |
| { |
| "type": "text", |
| "text": "We evaluated the performance of Pyraformer for long-range forecasting on three datasets, that is, Electricity, ETTh1, and ETTm1. In particular for ETTh1 and ETTm1, we predicted the future oil temperature and the 6 power load features at the same time, which is a multivariate time series forecasting problem. Both prediction modules introduced in Section 3.3 were tested for all models and the better results are listed in Table 3. ", |
| "bbox": [ |
| 174, |
| 694, |
| 825, |
| 763 |
| ], |
| "page_idx": 7 |
| }, |
| { |
| "type": "text", |
| "text": "It is evident that Pyraformer still achieves the best performance with the least number of Q-K pairs for all datasets regardless of the prediction length. More precisely, in comparison with Informer (Zhou et al., 2021), the MSE given by Pyraformer for ETTh1 is decreased by $2 4 . 8 \\%$ , $2 8 . 9 \\%$ , $2 6 . 2 \\%$ respectively when the prediction length is 168, 336, and 720. Once again, this bolsters our belief that it is more beneficial to employ the pyramidal graph when describing the temporal dependencies. Interestingly, we notice that for Pyraformer, the results given by the first prediction module are better than those by the second one. One possible explanation is that the second prediction module based on the full attention layers cannot differentiate features with different resolutions, while the first module based on a single fully connected layer can take full advantages of such features in an automated fashion. To better elucidate the modeling capacity of Pyraformer for long-range forecasting, we refer the readers to Appendix I for a detailed example on synthetic data. ", |
| "bbox": [ |
| 174, |
| 770, |
| 825, |
| 924 |
| ], |
| "page_idx": 7 |
| }, |
| { |
| "type": "image", |
| "img_path": "images/c76b7f33141c4ef44a7a1594f69b85c5196a20fecbd341cd7e0a1ecd285eb186.jpg", |
| "image_caption": [ |
| "Figure 4: Comparison of the time and memory consumption between the full, the prob-sparse, and the TVM implementation of the pyramidal attention: (a) computation time; (b) memory occupation. " |
| ], |
| "image_footnote": [], |
| "bbox": [ |
| 194, |
| 104, |
| 803, |
| 301 |
| ], |
| "page_idx": 8 |
| }, |
| { |
| "type": "text", |
| "text": "4.2.3 SPEED AND MEMORY CONSUMPTION ", |
| "text_level": 1, |
| "bbox": [ |
| 174, |
| 353, |
| 486, |
| 366 |
| ], |
| "page_idx": 8 |
| }, |
| { |
| "type": "text", |
| "text": "To check the efficiency of the customized CUDA kernel implemented based on TVM, we depicted the empirical computation time and memory cost as a function of the sequence length $L$ in Figure 4. Here we only compared Pyraformer with the full attention and the prob-sparse attention in Informer (Zhou et al., 2021). All the computations were performed on a $1 2 \\mathrm { \\ G B }$ Titan $\\mathrm { X p }$ GPU with Ubuntu 16.04, CUDA 11.0, and TVM 0.8.0. Figure 4 shows that the time and memory cost of the proposed Pyraformer based on TVM is approximately a linear function of $L$ , as expected. Furthermore, the time and memory consumption of the TVM implementation can be several orders of magnitude smaller than that of the full attention and the prob-sparse attention, especially for relatively long time series. Indeed, for a 12GB Titan Xp GPU, when the sequence length reaches 5800, full attention encounters the out-of-memory (OOM) problem, yet the TVM implementation of Pyraformer only occupies 1GB of memory. When it comes to a sequence with 20000 time points, even Informer incurs the OOM problem, whereas the memory cost of Pyraformer is only 1.91GB and the computation time per batch is only 0.082s. ", |
| "bbox": [ |
| 174, |
| 375, |
| 825, |
| 555 |
| ], |
| "page_idx": 8 |
| }, |
| { |
| "type": "text", |
| "text": "4.3 ABLATION STUDY ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 571, |
| 341, |
| 585 |
| ], |
| "page_idx": 8 |
| }, |
| { |
| "type": "text", |
| "text": "We also performed ablation studies to measure the impact of $A$ and $C$ , the CSCM architecture, the history length, and the PAM on the prediction accuracy of Pyraformer. The results are displayed in Tables 7-10. Detailed Discussions on the results can be found in Appendix J. Here, we only provide an overview of the major findings: (1) it is better to increase $C$ with $L$ but fix $A$ to a small constant for the sake of reducing the prediction error; (2) convolution with bottleneck strikes a balance between the prediction accuracy and the number of parameters, and hence, we use it as the CSCM; (3) more history helps increase the accuracy of forecasting; (4) the PAM is essential for accurate prediction. ", |
| "bbox": [ |
| 174, |
| 595, |
| 825, |
| 694 |
| ], |
| "page_idx": 8 |
| }, |
| { |
| "type": "text", |
| "text": "5 CONCLUSION AND OUTLOOK ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 713, |
| 449, |
| 729 |
| ], |
| "page_idx": 8 |
| }, |
| { |
| "type": "text", |
| "text": "In this paper, we propose Pyraformer, a novel model based on pyramidal attention that can effectively describe both short and long temporal dependencies with low time and space complexity. Concretely, we first exploit the CSCM to construct a $C$ -ary tree, and then design the PAM to pass messages in both the inter-scale and the intra-scale fashion. By adjusting $C$ and fixing other parameters when the sequence length $L$ increases, Pyraformer can achieve the theoretical $\\mathcal O ( L )$ complexity and $\\mathcal { O } ( 1 )$ maximum signal traversing path length. Experimental results show that the proposed model outperforms the state-of-the-art models for both single-step and long-range multi-step prediction tasks, but with less computational time and memory cost. So far we only concentrate on the scenario where $A$ and $S$ are fixed and $C$ increases with $L$ when constructing the pyramidal graph. On the other hand, we have shown in Appendix I that other configurations of the hyper-parameters may further improve the performance of Pyraformer. In the future work, we would like to explore how to adaptively learn the hyper-parameters from the data. Also, it is interesting to extend Pyraformer to other fields, including natural language processing and computer vision. ", |
| "bbox": [ |
| 174, |
| 743, |
| 825, |
| 924 |
| ], |
| "page_idx": 8 |
| }, |
| { |
| "type": "text", |
| "text": "ACKNOWLEDGEMENT ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 103, |
| 357, |
| 117 |
| ], |
| "page_idx": 9 |
| }, |
| { |
| "type": "text", |
| "text": "In this work, Prof. Weiyao Lin was supported by Ant Group through Ant Research Program and in part by National Natural Science Foundation of China under grant U21B2013. ", |
| "bbox": [ |
| 173, |
| 132, |
| 821, |
| 161 |
| ], |
| "page_idx": 9 |
| }, |
| { |
| "type": "text", |
| "text": "REFERENCES \nJoshua Ainslie, Santiago Ontanon, Chris Alberti, Vaclav Cvicek, Zachary Fisher, Philip Pham, Anirudh Ravula, Sumit Sanghai, Qifan Wang, and Li Yang. Etc: Encoding long and structured inputs in transformers. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 268–284, 2020. \nIz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020. \nGeorge EP Box and Gwilym M Jenkins. Some recent advances in forecasting and control. Journal of the Royal Statistical Society. Series C (Applied Statistics), 17(2):91–109, 1968. \nShiyu Chang, Yang Zhang, Wei Han, Mo Yu, Xiaoxiao Guo, Wei Tan, Xiaodong Cui, Michael Witbrock, Mark Hasegawa-Johnson, and Thomas S Huang. Dilated recurrent neural networks. Advances in Neural Information Processing Systems, 2017:77–87, 2017. \nTianqi Chen, Thierry Moreau, Ziheng Jiang, Lianmin Zheng, Eddie Yan, Haichen Shen, Meghan Cowan, Leyuan Wang, Yuwei Hu, Luis Ceze, et al. $\\{ \\mathrm { T V M } \\}$ : An automated end-to-end optimizing compiler for deep learning. In 13th {USENIX} Symposium on Operating Systems Design and Implementation $\\bar { \\langle } O S D I \\rangle \\bar { I } \\delta )$ , pp. 578–594, 2018. \nM. J. Choi, V. Chandrasekaran, D. M. Malioutov, J. K. Johnson, and A. S. Willsky. Multiscale stochastic modeling for tractable inference and data assimilation. Computer Methods in Applied Mechanics and Engineering, 197(43-44):3492–3515, 2008. \nJunyoung Chung, Sungjin Ahn, and Yoshua Bengio. Hierarchical multiscale recurrent neural networks. In 5th International Conference on Learning Representations, ICLR 2017, 2019. \nMarta R Costa-jussa and Jos \\` e AR Fonollosa. Character-based neural machine translation. In ´ Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 357–361, 2016. \nJaeyoung Kim, Mostafa El-Khamy, and Jungwon Lee. Residual lstm: Design of a deep recurrent architecture for distant speech recognition. arXiv preprint arXiv:1701.03360, 2017. \nNikita Kitaev, Lukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. In International Conference on Learning Representations, 2019. \nGuokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. Modeling long-and short-term temporal patterns with deep neural networks. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pp. 95–104, 2018. \nShiyang Li, Xiaoyong Jin, Yao Xuan, Xiyou Zhou, Wenhu Chen, Yu-Xiang Wang, and Xifeng Yan. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. Advances in Neural Information Processing Systems, 32:5243–5253, 2019. \nLesly Miculicich, Dhananjay Ram, Nikolaos Pappas, and James Henderson. Document level neural machine translation with hierarchical attention networks. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), number CONF, 2018. \nMohsin Munir, Shoaib Ahmed Siddiqui, Andreas Dengel, and Sheraz Ahmed. Deepant: A deep learning approach for unsupervised anomaly detection in time series. Ieee Access, 7:1991–2005, 2018. \nDavid Salinas, Valentin Flunkert, Jan Gasthaus, and Tim Januschowski. Deepar: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting, 36(3):1181– 1191, 2020. ", |
| "bbox": [ |
| 169, |
| 166, |
| 826, |
| 935 |
| ], |
| "page_idx": 9 |
| }, |
| { |
| "type": "text", |
| "text": "M. Schuster. Bi-directional recurrent neural networks for speech recognition. In Proceeding of IEEE Canadian Conference on Electrical and ComputerEngineering, pp. 7–12, 1996. ", |
| "bbox": [ |
| 171, |
| 103, |
| 825, |
| 133 |
| ], |
| "page_idx": 10 |
| }, |
| { |
| "type": "text", |
| "text": "Sandeep Subramanian, Ronan Collobert, Marc’Aurelio Ranzato, and Y-Lan Boureau. Multi-scale transformer language models. arXiv preprint arXiv:2005.00581, 2020. ", |
| "bbox": [ |
| 173, |
| 140, |
| 823, |
| 170 |
| ], |
| "page_idx": 10 |
| }, |
| { |
| "type": "text", |
| "text": "Ke Sun, Bin Xiao, Dong Liu, and Jingdong Wang. Deep high-resolution representation learning for human pose estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5693–5703, 2019. ", |
| "bbox": [ |
| 176, |
| 178, |
| 823, |
| 222 |
| ], |
| "page_idx": 10 |
| }, |
| { |
| "type": "text", |
| "text": "Sean J Taylor and Benjamin Letham. Forecasting at scale. The American Statistician, 72(1):37–45, 2018. ", |
| "bbox": [ |
| 169, |
| 231, |
| 825, |
| 260 |
| ], |
| "page_idx": 10 |
| }, |
| { |
| "type": "text", |
| "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017. ", |
| "bbox": [ |
| 173, |
| 267, |
| 823, |
| 310 |
| ], |
| "page_idx": 10 |
| }, |
| { |
| "type": "text", |
| "text": "W. Wang, E. Xie, X. Li, D. P. Fan, and L. Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. 2021. ", |
| "bbox": [ |
| 171, |
| 319, |
| 821, |
| 349 |
| ], |
| "page_idx": 10 |
| }, |
| { |
| "type": "text", |
| "text": "Zihao Ye, Qipeng Guo, Quan Gan, Xipeng Qiu, and Zheng Zhang. Bp-transformer: Modelling long-range context via binary partitioning. arXiv preprint arXiv:1911.04070, 2019. ", |
| "bbox": [ |
| 173, |
| 357, |
| 821, |
| 387 |
| ], |
| "page_idx": 10 |
| }, |
| { |
| "type": "text", |
| "text": "Hang Yu, Luyin Xin, and Justin Dauwels. Variational wishart approximation for graphical model selection: Monoscale and multiscale models. IEEE Transactions on Signal Processing, 67(24): 6468–6482, 2019. doi: 10.1109/TSP.2019.2953651. ", |
| "bbox": [ |
| 173, |
| 395, |
| 823, |
| 438 |
| ], |
| "page_idx": 10 |
| }, |
| { |
| "type": "text", |
| "text": "Hsiang-Fu Yu, Nikhil Rao, and Inderjit S Dhillon. Temporal regularized matrix factorization for high-dimensional time series prediction. Advances in neural information processing systems, 29: 847–855, 2016. ", |
| "bbox": [ |
| 171, |
| 446, |
| 823, |
| 489 |
| ], |
| "page_idx": 10 |
| }, |
| { |
| "type": "text", |
| "text": "Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Proceedings of AAAI, 2021. ", |
| "bbox": [ |
| 171, |
| 498, |
| 823, |
| 541 |
| ], |
| "page_idx": 10 |
| }, |
| { |
| "type": "text", |
| "text": "Simiao Zuo, Haoming Jiang, Zichong Li, Tuo Zhao, and Hongyuan Zha. Transformer hawkes process. In International Conference on Machine Learning, pp. 11692–11702. PMLR, 2020. ", |
| "bbox": [ |
| 173, |
| 549, |
| 823, |
| 579 |
| ], |
| "page_idx": 10 |
| }, |
| { |
| "type": "table", |
| "img_path": "images/558772b46478afb75a19e4e430ee43cce92001ed79e2a8acfd3f505ea01429a0.jpg", |
| "table_caption": [ |
| "Table 4: Meanings of notations. " |
| ], |
| "table_footnote": [], |
| "table_body": "<table><tr><td>Notation</td><td>Size</td><td>Meaning</td></tr><tr><td>L</td><td>Constant</td><td>The length of historical sequence.</td></tr><tr><td>G</td><td>Constant</td><td>The number of global tokens in ETC.</td></tr><tr><td>M</td><td>Constant</td><td>The length of future sequence to be predicted.</td></tr><tr><td>B</td><td>Constant</td><td>Batch size.</td></tr><tr><td>D</td><td>Constant</td><td>The dimension of each node.</td></tr><tr><td>DK</td><td>Constant</td><td>The dimension of a key.</td></tr><tr><td>X</td><td>B×L×D</td><td>Input of a single attention head.</td></tr><tr><td>Y</td><td>B×L×D</td><td>Output of a single attention head.</td></tr><tr><td>Q</td><td>B×L×Dk</td><td>The query.</td></tr><tr><td>K</td><td>B×L×Dk</td><td>The key.</td></tr><tr><td>V</td><td>B×L×Dk</td><td>The value.</td></tr><tr><td>WQ</td><td>D×Dk</td><td>The weight matrix of the query.</td></tr><tr><td>WK</td><td>D ×Dk</td><td>The weight matrix of the key.</td></tr><tr><td>Wv</td><td>D×Dk</td><td>The weight matrix of the value.</td></tr><tr><td>S</td><td>Constant</td><td>Number of scales.</td></tr><tr><td>A</td><td>Constant</td><td>Number of adjacent nodes at the same scale that a node can attend to.</td></tr><tr><td>C</td><td>Constant</td><td>Number of finer scale nodes that a coarser scale node can summarize.</td></tr><tr><td>N</td><td>Constant</td><td>Number of attention layers.</td></tr><tr><td>n(</td><td>D</td><td>The l-th node at scale s.</td></tr><tr><td>N</td><td>len(N)) × D</td><td></td></tr><tr><td>A</td><td>len(A()) × D</td><td> The adjacent A nodes at the same scale with n(s).</td></tr><tr><td>C</td><td>len(C()) × D</td><td></td></tr><tr><td>P</td><td>len(P(s) × D</td><td> The parent node of n(s).</td></tr><tr><td>Fp</td><td>B×M×D</td><td>The prediction tokens.</td></tr><tr><td>Fe</td><td>B ×Ltot ×D</td><td> The output of the encoder. Ltot represents the output length of the encod</td></tr><tr><td>Fd1</td><td>B×M×D</td><td>The output of the first attention-based decoder layer.</td></tr><tr><td>H</td><td>Constant</td><td>The number of attention heads.</td></tr><tr><td>DF</td><td></td><td></td></tr><tr><td></td><td>Constant</td><td>The maximum dimension of the feed-forward layer.</td></tr></table>", |
| "bbox": [ |
| 179, |
| 136, |
| 797, |
| 707 |
| ], |
| "page_idx": 11 |
| }, |
| { |
| "type": "text", |
| "text": "A A BRIEF REVIEW ON RELATED RNN-BASED MODELS ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 737, |
| 660, |
| 753 |
| ], |
| "page_idx": 11 |
| }, |
| { |
| "type": "text", |
| "text": "In this section, we provide a brief review on the related RNN-based models. Multiscale temporal dependencies are successfully captured in HRNN (Costa-jussa & Fonollosa, 2016) and HM- \\` RNN (Chung et al., 2019). The former requires expert knowledge to partition the sequence into different resolutions, while the latter learns the partition automatically from the data. Note that the theoretical maximum length of the signal traversing path in both models is still $\\mathcal O ( L )$ . Another line of works aim to shorten the signal traversing path by adding residual connections (Kim et al., 2017) or dilated connections to LSTMs (Chang et al., 2017). However, they do not consider the multiresolution temporal dependencies explicitly. Furthermore, all aforementioned RNNs only propagate information in one direction from the past to the future. An appealing approach that allows bidirectional information exchange is Bi-LSTM (Schuster, 1996). The forward and backward propagation is realized through two different LSTMs though, and so still incurs a long signal traversing path. ", |
| "bbox": [ |
| 173, |
| 770, |
| 825, |
| 924 |
| ], |
| "page_idx": 11 |
| }, |
| { |
| "type": "text", |
| "text": "As opposed to the abovementioned RNN-based models, the proposed Pyraformer enables bidirectional information exchange that can better describe the temporal dependencies, while providing a multiresolution representation of the observed sequence at the same time. We also notice that due to the unidirectional property of RNNs, it is difficult the realize the pyramidal graph in Figure 1d based on RNNs. ", |
| "bbox": [ |
| 174, |
| 103, |
| 825, |
| 172 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "text", |
| "text": "B PROOF OF LEMMA 1 ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 193, |
| 377, |
| 209 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "text", |
| "text": "Proof. Let $S$ denote the number of scales in the pyramidal graph, $C$ the number of children nodes in the finer scale $s - 1$ that a node in the the coarser scale $s$ can summarize for $s = 2 , \\cdots , S , A$ the number of adjacent nodes that a node can attend to within each scale, $N$ the number of attention layers, and $L$ the length of the input time series. We define the term “receptive field” of an arbitrary node $n _ { a }$ in a graph as the set of nodes that $n _ { a }$ can receive messages from. We further define the distance between two arbitrary nodes in a graph as the length of the shortest path between them (i.e., the number of steps to travel from one node to another). Note that in each attention layer, the messages can only travel by one step in the graph. ", |
| "bbox": [ |
| 173, |
| 223, |
| 825, |
| 335 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "text", |
| "text": "Without sacrificing generality, we assume that $L$ is divisible by $C ^ { S - 1 }$ , and then the number of nodes at the coarsest scale $S$ is $L / C ^ { S - 1 }$ . Since every node is connected to $A$ closest nodes at the same scale, the distance between the leftmost and the rightmost node at the coarsest scale is $2 ( L / C ^ { S - 1 } - 1 ) / ( A - 1 )$ . Hence, the leftmost and the rightmost node in the coarsest scale are in the receptive field of each other after the stack of $N \\geq 2 ( L / C ^ { S - 1 } - 1 ) / ( A - 1 )$ layers of the pyramidal attention. In addition, owing to the CSCM, nodes at the coarsest scale can be regarded as the summary of the nodes in the finer scales. As a result, when Equation (4) is satisfied, all nodes at the coarsest scale have a global receptive field, which closes the proof. □ ", |
| "bbox": [ |
| 173, |
| 342, |
| 825, |
| 454 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "text", |
| "text": "C PROOF OF PROPOSITION 1 ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 473, |
| 424, |
| 489 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "text", |
| "text": "Proof. Suppose that $L ^ { ( s ) }$ denotes the number of nodes at scale $s$ , that is, ", |
| "bbox": [ |
| 174, |
| 503, |
| 648, |
| 518 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/b5f1b491f95c5fece313706172541d0f149f4f2138e1d758130be0c11d50b1f2.jpg", |
| "text": "$$\nL ^ { ( s ) } = \\frac { L } { C ^ { s - 1 } } , 1 \\leq s \\leq S .\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 411, |
| 521, |
| 586, |
| 551 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "text", |
| "text": "For a node $n _ { \\ell } ^ { ( s ) }$ in the pyramidal graph, the number of dot products $P _ { \\ell } ^ { ( s ) }$ it acts as the query can be decomposed into two parts: ", |
| "bbox": [ |
| 174, |
| 555, |
| 823, |
| 587 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/2975e1a0f9a1eb1b5bffae2f82beb2acc57c16f054675de0e3c15f7727419fe7.jpg", |
| "text": "$$\nP _ { \\ell } ^ { ( s ) } = P _ { \\ell } ^ { ( s ) } { } _ { \\mathrm { i n t e r } } + P _ { \\ell } ^ { ( s ) } { } _ { \\mathrm { i n t r a } } ,\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 406, |
| 588, |
| 589, |
| 612 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "text", |
| "text": "where P (s) $P _ { \\ell } ^ { ( s ) } { _ { \\mathrm { i n t r a } } }$ a and P (s)ℓ int denotes the intra-scale and the inter-scale part respectively. According to the structure of the pyramidal graph, we can have the following inequalities: ", |
| "bbox": [ |
| 171, |
| 617, |
| 823, |
| 647 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/cea9cf030e4643444de64d9af5181bbcc2c41561080ae816e36a4dfd39cd8b1c.jpg", |
| "text": "$$\n\\begin{array} { r l } & { P _ { \\ell \\mathrm { \\tiny ~ \\min i n t r a } } ^ { ( s ) } \\le A , } \\\\ & { P _ { \\ell \\mathrm { \\tiny ~ \\min t e r } } ^ { ( s ) } \\le C + 1 . } \\end{array}\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 436, |
| 648, |
| 560, |
| 694 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "text", |
| "text": "The first inequality (8) holds since a node typically attends to $A$ most adjacent nodes at the same scale but for the leftmost and the rightmost node, the number of in-scale nodes it can attend to is smaller than $A$ . On the other hand, the second inequality (9) holds because a node typically has $C$ children and 1 parent in the pyramidal graph but nodes at the top and the bottom scale can only attend to fewer than $C + 1$ nodes at adjacent scales. ", |
| "bbox": [ |
| 174, |
| 694, |
| 825, |
| 765 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "text", |
| "text": "In summary, the number of dot products that need to be calculated for scale $s$ is: ", |
| "bbox": [ |
| 173, |
| 771, |
| 697, |
| 786 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/193fc7d128d8a5850b6d4ec754f889a089ea0c9aa1cf90ffd011664f378c8bcd.jpg", |
| "text": "$$\nP ^ { ( s ) } = \\sum _ { \\ell = 1 } ^ { L ^ { ( s ) } } \\big ( P _ { \\ell \\mathrm { \\tiny ~ \\mathrm { ~ i n t r a } } } ^ { ( s ) } + P _ { \\ell \\mathrm { \\tiny ~ \\mathrm { ~ i n t e r } } } ^ { ( s ) } \\big ) \\le L ^ { ( s ) } ( A + C + 1 ) .\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 318, |
| 789, |
| 679, |
| 835 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "text", |
| "text": "Note that $P ^ { ( 1 ) } \\leq L ( A + 1 )$ for the finest scale (i.e., $s = 1$ ) since nodes at this scale do not have any children. It follows that the number of dot products that need to be calculated for the entire pyramidal attention layer is: ", |
| "bbox": [ |
| 176, |
| 839, |
| 825, |
| 882 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/27e0bdb332828aee29138af544adda18db9e17d5d6dd7c4f4e6fa80c9ef86533.jpg", |
| "text": "$$\nP = \\sum _ { s = 1 } ^ { S } P ^ { ( s ) }\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 295, |
| 885, |
| 390, |
| 928 |
| ], |
| "page_idx": 12 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/71c6102d4102b1bdd8a922b56682274b1dfbd963fa124950e8fd7ec44c3aa8e4.jpg", |
| "text": "$$\n\\begin{array} { l } { { \\le L ( A + 1 ) + L ^ { ( 2 ) } ( A + C + 1 ) + . . . + L ^ { ( S ) } ( A + C + 1 ) } } \\\\ { { \\displaystyle = L ( \\sum _ { s = 1 } ^ { S } C ^ { - ( s - 1 ) } A + \\sum _ { s = 2 } ^ { S } C ^ { - ( s - 1 ) } + \\sum _ { s = 1 } ^ { S - 1 } C ^ { - ( s - 1 ) } + 1 ) } } \\\\ { { \\displaystyle < L ( ( A + 2 ) \\sum _ { s = 1 } ^ { S } C ^ { - ( s - 1 ) } + 1 ) . } } \\end{array}\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 310, |
| 99, |
| 700, |
| 210 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "text", |
| "text": "In order to guarantee that the nodes at the coarsest scale have a global receptive field, we choose $C$ such that $\\bar { C } \\propto \\ ^ { s - 1 } \\bar { \\sqrt { L } }$ . Consequently, the complexity of the proposed pyramidal attention is: ", |
| "bbox": [ |
| 171, |
| 215, |
| 823, |
| 246 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/0f285521537123eece2567dd5f22e611f7a3ca1ca4616456490cf2911ffc1f86.jpg", |
| "text": "$$\n\\begin{array} { r l } { { \\mathcal { O } ( P ) \\leq \\mathcal { O } ( L ( ( A + 2 ) \\sum _ { s = 1 } ^ { s } C ^ { - ( s - 1 ) } + 1 ) ) } } \\\\ & { = \\mathcal { O } ( L ( A + 2 ) \\sum _ { s = 1 } ^ { S } C ^ { - ( s - 1 ) } ) } \\\\ & { = \\mathcal { O } ( \\frac { ( A + 2 ) L ^ { \\frac { S } { s - 1 } } - 1 } { L ^ { \\frac { S - 1 } { s - 1 } } - 1 } ) } \\\\ & { = \\mathcal { O } ( \\frac { A L ^ { \\frac { S - 1 } { s - 1 } } - 1 } { L ^ { \\frac { S - 1 } { s - 1 } } - 1 } ) . } \\end{array}\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 356, |
| 253, |
| 638, |
| 421 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "text", |
| "text": "When $L$ approaches infinity, the above expression amounts to $\\mathcal { O } ( A L )$ . Since $A$ can be fixed when $L$ changes, the complexity can be further reduced to $\\mathcal { O } ( L )$ . □ ", |
| "bbox": [ |
| 173, |
| 425, |
| 823, |
| 455 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "text", |
| "text": "D PROOF OF PROPOSITION 2 ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 476, |
| 428, |
| 492 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "text", |
| "text": "and Proof. Let $n _ { L } ^ { ( 1 ) }$ ℓ is the largest among all pairs of nodes in the pyramidal graph. The shortest path to travel $n _ { \\ell } ^ { ( s ) }$ represent the $\\ell$ -th node of the $s$ -th scale. It is evident that the distance between $n _ { 1 } ^ { ( 1 ) }$ from n(1)1 to $n _ { L } ^ { ( s ) }$ i s: ", |
| "bbox": [ |
| 174, |
| 506, |
| 825, |
| 560 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/0efba398a60f73f984c2641162cc48e4b0876cd8500ce0e758c65f3affc9fa1e.jpg", |
| "text": "$$\nn _ { 1 } ^ { ( 1 ) } \\to n _ { 1 } ^ { ( 2 ) } \\to \\cdots \\to n _ { 1 } ^ { ( S ) } \\to \\cdots \\to n _ { L ^ { ( S ) } } ^ { ( S ) } \\to n _ { L ^ { ( S - 1 ) } } ^ { ( S - 1 ) } \\to \\cdots \\to n _ { L } ^ { ( 1 ) } .\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 264, |
| 566, |
| 732, |
| 590 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "text", |
| "text": "Correspondingly, the length of the maximum path between two arbitrary nodes in the graph is: ", |
| "bbox": [ |
| 178, |
| 595, |
| 789, |
| 611 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/4920b1996ec98796735325345250236300724d44c333468078950027461a853b.jpg", |
| "text": "$$\nL _ { \\mathrm { m a x } } = 2 ( S - 1 ) + \\frac { 2 ( L ^ { ( S ) } - 1 ) } { A - 1 } .\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 385, |
| 617, |
| 612, |
| 651 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "text", |
| "text": "When $C$ satisfies Equation (5), that is, $L ^ { ( S ) } - 1 \\le ( A - 1 ) N / 2$ , we can obtain: ", |
| "bbox": [ |
| 173, |
| 659, |
| 696, |
| 676 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/93812212f74da44a00aba80fcb897f2afcc112b35df8b4ea14bd0a7b264abbb7.jpg", |
| "text": "$$\n\\begin{array} { l } { \\displaystyle \\mathcal { O } \\big ( L _ { \\mathrm { m a x } } \\big ) = \\mathcal { O } \\bigg ( 2 ( S - 1 ) + \\frac { 2 \\big ( L ^ { ( S ) } - 1 \\big ) } { A - 1 } \\bigg ) } \\\\ { \\displaystyle \\qquad = \\mathcal { O } \\bigg ( 2 ( S - 1 ) + \\frac { 2 \\big ( \\frac { L } { C ^ { S - 1 } } - 1 \\big ) } { A - 1 } \\bigg ) } \\\\ { \\displaystyle \\qquad = \\mathcal { O } \\big ( 2 ( S - 1 ) + N \\big ) } \\\\ { \\displaystyle \\qquad = \\mathcal { O } ( S + N ) . } \\end{array}\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 352, |
| 683, |
| 643, |
| 794 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "text", |
| "text": "Since $A , S$ and $N$ are invariant with $L$ , the order of the maximum path length $L _ { \\mathrm { m a x } }$ can be further simplified as $\\mathcal { O } ( 1 )$ . ", |
| "bbox": [ |
| 173, |
| 799, |
| 825, |
| 829 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "text", |
| "text": "E DATASETS ", |
| "text_level": 1, |
| "bbox": [ |
| 174, |
| 849, |
| 295, |
| 866 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "text", |
| "text": "We demonstrated the advantages of the proposed Pyraformer on the following four datasets. The first three datasets were used for single-step forecasting, while the last two for long-range multi-step forecasting. ", |
| "bbox": [ |
| 174, |
| 881, |
| 825, |
| 924 |
| ], |
| "page_idx": 13 |
| }, |
| { |
| "type": "text", |
| "text": "Wind2: This dataset contains hourly estimation of the energy potential in 28 countries between 1986 and 2015 as a percentage of a power plant’s maximum output. Compared with the remaining datasets, it is more sparse and periodically exhibits a large number of zeros. Due to the large size of this dataset, the ratio between training and testing set was roughly 32:1. ", |
| "bbox": [ |
| 174, |
| 103, |
| 823, |
| 160 |
| ], |
| "page_idx": 14 |
| }, |
| { |
| "type": "text", |
| "text": "App Flow: This dataset was collected at Ant Group3. It consists of hourly maximum traffic flow for 128 systems deployed on 16 logic data centers, resulting in 1083 different time series in total. The length of each series is more than 4 months. Each time series was divided into two segments for training and testing respectively, with a ratio of 32:1. ", |
| "bbox": [ |
| 174, |
| 166, |
| 825, |
| 222 |
| ], |
| "page_idx": 14 |
| }, |
| { |
| "type": "text", |
| "text": "Electricity4 (Yu et al., 2016): This dataset contains time series of electricity consumption recorded every 15 minutes from 370 users. Following DeepAR (Salinas et al., 2020), we aggregated every 4 records to get the hourly observations. This dataset was employed for both single-step and longrange forecasting. We trained with data from 2011-01-01 to 2014-09-01 for single-step forecasting, and from 2011-04-01 to 2014-04-01 for long-range forecasting. ", |
| "bbox": [ |
| 174, |
| 229, |
| 825, |
| 299 |
| ], |
| "page_idx": 14 |
| }, |
| { |
| "type": "text", |
| "text": "$\\mathbf { \\mathbf { E } } \\mathbf { T } \\mathbf { T } ^ { 5 }$ (Zhou et al., 2021): This dataset comprises 2 years of 2 electricity transformers collected from 2 stations, including the oil temperature and 6 power load features. Observations every hour (i.e., ETTh1) and every 15 minutes (i.e., ETTm1) are provided. This dataset is typically exploited for model assessment on long-range forecasting. Here, we followed Informer (Zhou et al., 2021) and partitioned the data into 12 and 4 months for training and testing respectively. ", |
| "bbox": [ |
| 174, |
| 306, |
| 825, |
| 376 |
| ], |
| "page_idx": 14 |
| }, |
| { |
| "type": "text", |
| "text": "F EXPERIMENT SETUP ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 398, |
| 377, |
| 414 |
| ], |
| "page_idx": 14 |
| }, |
| { |
| "type": "text", |
| "text": "We set $S = 4$ and $N = 4$ for Pyraformer in all experiments. When the historical length $L$ is not divisible by $C$ , we only introduced $\\lfloor L / C \\rfloor$ nodes in the upper scale, where $\\lfloor \\cdot \\rfloor$ denotes the round down operation. The last $L - ( \\lfloor L / \\bar { C } \\rfloor - \\bar { 1 } ) C$ nodes at the bottom scale were all connected to the last node at the upper scale. For single-step forecasting, we set $C = 4$ , $A = 3$ , and $H = 4$ in all experiments. Both training and testing used a fixed-size historical sequence to predict the mean and variance of the Gaussian distribution of a single future value. We chose the MSE loss and the log-likelihood (Zuo et al., 2020) as our loss functions. The ratio between them was set to 100. For optimization, we used Adam with the learning rate starting from $1 0 ^ { - 5 }$ and halving in every epoch. We trained Pyraformer with 10 epochs. Weighted sampler based on each window’s average value and hard sample mining were used to improve the generalization ability of the network. On the other hand, for long-range forecasting, we tested four combinations of $A$ and $C$ in each experiment, and the best results were presented. Specifically, when the prediction length is smaller than 600, we tested $A = 3 , 5$ and $C = 4 , 5$ . When the prediction length is larger than 600, we tested $A = 3 , 5$ and $C = 5 , 6$ . The resulting choice of hyper-parameters for each experiment is listed in Table 5. In addition, the loss function was the MSE loss only. We still used Adam as our optimizer, but the learning rate started from $1 0 ^ { - 4 }$ and was reduced to one-tenth every epoch. We set the number of epochs to be 5. ", |
| "bbox": [ |
| 173, |
| 431, |
| 825, |
| 666 |
| ], |
| "page_idx": 14 |
| }, |
| { |
| "type": "text", |
| "text": "G PRETRAINING ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 689, |
| 326, |
| 705 |
| ], |
| "page_idx": 14 |
| }, |
| { |
| "type": "text", |
| "text": "For single-step forecasting, the value to be predicted is usually close to the last value of history. Since we only use the last nodes of all scales to predict, the network tends to focus only on shortterm dependencies. To force the network to capture long-range dependencies, we add additional supervision in the first few epochs of training. Specifically, in the first epoch, we form our network as an auto-encoder, as shown in Figure 5. Apart from predicting future values, the PAM is also trained to recover the input values. Note that we test all methods with and without this pretraining strategy and the better results are displayed in Table 2. ", |
| "bbox": [ |
| 174, |
| 722, |
| 823, |
| 792 |
| ], |
| "page_idx": 14 |
| }, |
| { |
| "type": "table", |
| "img_path": "images/26ecf047e6583e1cbb074f61df77c1a887082b1dd64d8db53e55094ae880fd9b.jpg", |
| "table_caption": [ |
| "Table 5: Hyper-parameter settings of long-range experiments. " |
| ], |
| "table_footnote": [], |
| "table_body": "<table><tr><td>Dataset</td><td>prediction length</td><td>N</td><td>S</td><td>H</td><td>A</td><td>C</td><td>historical length</td></tr><tr><td rowspan=\"3\">ETTh1</td><td>168</td><td>4</td><td>4</td><td>6</td><td>3</td><td>4</td><td>168</td></tr><tr><td>336</td><td>4</td><td>4</td><td>6</td><td>3</td><td>4</td><td>168</td></tr><tr><td>720</td><td>4</td><td>4</td><td>6</td><td>5</td><td>4</td><td>336</td></tr><tr><td rowspan=\"3\">ETTm1</td><td>96</td><td>4</td><td>4</td><td>6</td><td>3</td><td>5</td><td>384</td></tr><tr><td>288</td><td>4</td><td>4</td><td>6</td><td>5</td><td>5</td><td>672</td></tr><tr><td>672</td><td>4</td><td>4</td><td>6</td><td>3</td><td>6</td><td>672</td></tr><tr><td rowspan=\"3\">Elect</td><td>168</td><td>4</td><td>4</td><td>6</td><td>3</td><td>4</td><td>168</td></tr><tr><td>336</td><td>4</td><td>4</td><td>6</td><td>3</td><td>4</td><td>168</td></tr><tr><td>720</td><td>4</td><td>4</td><td>6</td><td>3</td><td>5</td><td>336</td></tr></table>", |
| "bbox": [ |
| 246, |
| 127, |
| 750, |
| 325 |
| ], |
| "page_idx": 15 |
| }, |
| { |
| "type": "image", |
| "img_path": "images/16bca2db6aa268152dfacebb3a8ccf6bd2e2df85f5fcbe3870acda17a4461454.jpg", |
| "image_caption": [ |
| "Figure 5: The pretraining strategy for one-step prediction. Features of nodes surrounded by the dashed ellipses are concatenated to recover the corresponding input value. " |
| ], |
| "image_footnote": [], |
| "bbox": [ |
| 348, |
| 337, |
| 647, |
| 573 |
| ], |
| "page_idx": 15 |
| }, |
| { |
| "type": "text", |
| "text": "", |
| "bbox": [ |
| 173, |
| 640, |
| 823, |
| 669 |
| ], |
| "page_idx": 15 |
| }, |
| { |
| "type": "text", |
| "text": "H METRICS ", |
| "text_level": 1, |
| "bbox": [ |
| 174, |
| 689, |
| 289, |
| 705 |
| ], |
| "page_idx": 15 |
| }, |
| { |
| "type": "text", |
| "text": "Denote the target value as $z _ { j , t }$ and the predicted value as $\\hat { z } _ { j , t }$ , where $j$ is the sample index and $t$ is the time index. Then NRMSE and ND are calculated as follows: ", |
| "bbox": [ |
| 174, |
| 720, |
| 823, |
| 750 |
| ], |
| "page_idx": 15 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/2ce9de10c5adaecb9130fa6a5a862d53df598ea735cf99671fb521a8ec0f3504.jpg", |
| "text": "$$\n\\begin{array} { r l } & { \\mathrm { N R M S E } = \\frac { \\sqrt { \\frac { 1 } { N T } \\sum _ { j = 1 } ^ { N } \\sum _ { t = 1 } ^ { T } ( z _ { j , t } - \\hat { z } _ { j , t } ) ^ { 2 } } } { \\frac { 1 } { N T } \\sum _ { j = 1 } ^ { N } \\sum _ { t = 1 } ^ { T } | z _ { j , t } | } , } \\\\ & { \\quad \\quad \\quad \\quad \\mathrm { N D } = \\frac { \\sum _ { j = 1 } ^ { N } \\sum _ { t = 1 } ^ { T } | z _ { j , t } - \\hat { z } _ { j , t } | } { \\sum _ { j = 1 } ^ { N } \\sum _ { t = 1 } ^ { T } | z _ { j , t } | } . } \\end{array}\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 346, |
| 753, |
| 648, |
| 851 |
| ], |
| "page_idx": 15 |
| }, |
| { |
| "type": "text", |
| "text": "I EXPERIMENTS ON SYNTHETIC DATA ", |
| "text_level": 1, |
| "bbox": [ |
| 173, |
| 863, |
| 506, |
| 880 |
| ], |
| "page_idx": 15 |
| }, |
| { |
| "type": "text", |
| "text": "To further evaluate Pyraformer’s ability to capture different ranges of temporal dependencies, we synthesized an hourly dataset with multi-range dependencies and carried out experiments on it. ", |
| "bbox": [ |
| 173, |
| 895, |
| 826, |
| 924 |
| ], |
| "page_idx": 15 |
| }, |
| { |
| "type": "text", |
| "text": "Specifically, each time series in the synthetic dataset is a linear combination of three sine functions of different periods: 24, 168 and 720, that is, ", |
| "bbox": [ |
| 173, |
| 103, |
| 823, |
| 132 |
| ], |
| "page_idx": 16 |
| }, |
| { |
| "type": "equation", |
| "img_path": "images/463937176375f114a98c6d72dd24dd030190e1bdec26ec4688589e1dc21c0ac9.jpg", |
| "text": "$$\nf ( t ) = \\beta _ { 0 } + \\beta _ { 1 } \\sin ( \\frac { 2 \\pi } { 2 4 } t ) + \\beta _ { 2 } \\sin ( \\frac { 2 \\pi } { 1 6 8 } t ) + \\beta _ { 3 } \\sin ( \\frac { 2 \\pi } { 7 2 0 } t ) .\n$$", |
| "text_format": "latex", |
| "bbox": [ |
| 303, |
| 137, |
| 692, |
| 167 |
| ], |
| "page_idx": 16 |
| }, |
| { |
| "type": "text", |
| "text": "In the above equation, the coefficients of the three sine functions $\\beta _ { 1 } , \\beta _ { 2 }$ , and $\\beta _ { 3 }$ for each time series are uniformly sampled from [5, 10]. $\\beta _ { 0 }$ is a Gaussian process with a covariance function $\\Sigma _ { t _ { 1 } , t _ { 2 } } = | t _ { 1 } - t _ { 2 } | ^ { - 1 }$ and $\\Sigma _ { t _ { 1 } } = \\Sigma _ { t _ { 2 } } = 1$ , where $t _ { 1 }$ and $t _ { 2 }$ denote two arbitrary time stamps. Such polynomially decaying covariance functions are known to have long-range dependence, as oppose to the exponentially decaying covariance functions ( $\\mathrm { Y u }$ et al., 2019). The start time of each time series $t _ { 0 }$ is uniformly sampled from [0, 719]. We first generate 60 time series of length 14400, and then split each time series into sliding windows of width 1440 with a stride of 24. In our experiments, we use the historical 720 time points to predict the future 720 points. Since both the deterministic and stochastic parts of the synthetic time series have long-range correlations, such dependencies should be well captured in the model in order to yield accurate predictions of the next 720 points. The results are summarized in Table 6. Here, we consider two different configurations of Pyraformer: 1) $C = 6$ for all scales in the pyramidal graph (denoted as Pyraformer6,6,6); 2) $C = 1 2$ , 7, and 4 for the three layers sequentially from bottom to top (denoted as Pyraformer12,7,4). ", |
| "bbox": [ |
| 173, |
| 171, |
| 825, |
| 352 |
| ], |
| "page_idx": 16 |
| }, |
| { |
| "type": "table", |
| "img_path": "images/91fa68487755d17c2f286bf23144e06467b5bd3a504816ccc92ed58d65d5b1c6.jpg", |
| "table_caption": [ |
| "Table 6: Long-range forecasting results on the synthetic dataset. " |
| ], |
| "table_footnote": [], |
| "table_body": "<table><tr><td>Method</td><td>MSE</td><td>MAE</td></tr><tr><td>Full attention</td><td>3.550</td><td>1.477</td></tr><tr><td>LogTrans</td><td>3.007</td><td>1.366</td></tr><tr><td>ETC</td><td>4.742</td><td>5.509</td></tr><tr><td>Informer</td><td>7.546</td><td>2.092</td></tr><tr><td>Longformer</td><td>2.032</td><td>1.116</td></tr><tr><td>Reformer</td><td>1.538</td><td>3.069</td></tr><tr><td>Pyraformer6,6,6</td><td>1.258</td><td>0.877</td></tr><tr><td>Pyraformer12,7,4</td><td>1.176</td><td>0.849</td></tr></table>", |
| "bbox": [ |
| 374, |
| 392, |
| 620, |
| 568 |
| ], |
| "page_idx": 16 |
| }, |
| { |
| "type": "text", |
| "text": "It can be observed that Pyraformer6,6,6 with the same $C$ for all scales already outperforms the benchmark methods by a large margin. In particular, the MSE given by Pyraformer is decreased by $1 8 . 2 \\%$ compared with Reformer, which produces the smallest MSE among the existing variants of Transformer. On the other hand, by exploiting the information of the known period, Pyraformer12,7,4 performs even better than Pyraformer6,6,6. Note that in Pyraformer $^ { \\cdot _ { 1 2 , 7 , 4 } }$ , nodes at scale 2, 3, and 4 characterizes coarser temporal resolutions respectively corresponding to half a day, half a week, and half a month. We also tested Pyraformer24,7,4, but setting $C = 2 4$ in the second scale degrades the performance, probably because the convolution layer with a kernel size of 24 is difficult to train. ", |
| "bbox": [ |
| 173, |
| 580, |
| 825, |
| 693 |
| ], |
| "page_idx": 16 |
| }, |
| { |
| "type": "text", |
| "text": "We further visualized the forecasting results produced by Pyraformer $^ { 1 2 , 7 , 4 }$ in Figure 6. The blue solid curve and red dashed curve denote the true and predicted time series respectively. By capturing the temporal dependencies with different ranges, the prediction resulting from Pyraformer closely follows the ground truth. ", |
| "bbox": [ |
| 174, |
| 699, |
| 825, |
| 756 |
| ], |
| "page_idx": 16 |
| }, |
| { |
| "type": "text", |
| "text": "On the other hand, to check whether Pyraformer can extract features with different temporal resolutions, we depicted the extracted features in a randomly selected channel across time at each scale in the pyramidal graph in Figure 7. It is apparent that the features at the coarser scales can be regarded as a lower resolution version of the features at the finer scales. ", |
| "bbox": [ |
| 174, |
| 762, |
| 825, |
| 818 |
| ], |
| "page_idx": 16 |
| }, |
| { |
| "type": "text", |
| "text": "J ABLATION STUDY ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 838, |
| 354, |
| 854 |
| ], |
| "page_idx": 16 |
| }, |
| { |
| "type": "text", |
| "text": "J.1 IMPACT OF $A$ AND $C$ ", |
| "text_level": 1, |
| "bbox": [ |
| 174, |
| 869, |
| 356, |
| 883 |
| ], |
| "page_idx": 16 |
| }, |
| { |
| "type": "text", |
| "text": "We studied the impact of $A$ and $C$ on the performance of Pyraformer for long-range time series forecasting, and showed the results in Table 7. Here, we focus on the dataset ETTh1. The history length is 336 and the prediction length is 720. From Table 7, we can conclude that the receptive fields of the nodes at the coarsest scale in the PAM play an indispensable role in reducing the prediction error of Pyraformer. For instance, there are 42 nodes at the coarsest scale when $C = 2$ . Without the intra-scale connections, each node can only receive messages from 16 nodes at the finest scale. As the number of adjacent connections $A$ in each scale increases, the receptive fields of the coarsestscale nodes also extend, and therefore, the prediction error decreases accordingly. However, as long as the nodes at the top scale have a global receptive field, further increasing $A$ will not bring large gains. For $C = 5$ , the performance does not improve even though $A$ increases. Such observations indicate that it is better to set $A$ to be small once the uppermost nodes in the PAM have a global receptive field. In practice, we only increase $C$ with the increase of $L$ , but keep $A$ small. ", |
| "bbox": [ |
| 174, |
| 895, |
| 823, |
| 924 |
| ], |
| "page_idx": 16 |
| }, |
| { |
| "type": "image", |
| "img_path": "images/0e107628896de0c58e44310218af31bad1997b6ef59d90b98d324d9c9992721a.jpg", |
| "image_caption": [ |
| "Figure 6: Visualization of prediction results on the synthetic dataset. " |
| ], |
| "image_footnote": [], |
| "bbox": [ |
| 186, |
| 99, |
| 810, |
| 356 |
| ], |
| "page_idx": 17 |
| }, |
| { |
| "type": "image", |
| "img_path": "images/78b6ff45bfe2e9e637686e94056b78164c4a40e9a46ac871d93338b981fb0e83.jpg", |
| "image_caption": [ |
| "Figure 7: Visualization of the extracted features across time in second channel at different scales: (a) scale 1; (b) scale 2; (c) scale 3. " |
| ], |
| "image_footnote": [], |
| "bbox": [ |
| 183, |
| 412, |
| 815, |
| 547 |
| ], |
| "page_idx": 17 |
| }, |
| { |
| "type": "text", |
| "text": "", |
| "bbox": [ |
| 173, |
| 625, |
| 825, |
| 765 |
| ], |
| "page_idx": 17 |
| }, |
| { |
| "type": "text", |
| "text": "J.2 IMPACT OF THE CSCM ARCHITECTURE ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 785, |
| 485, |
| 799 |
| ], |
| "page_idx": 17 |
| }, |
| { |
| "type": "text", |
| "text": "In addition to convolution, there exist other mechanisms for constructing the $C$ -ary tree, such as max pooling and average pooling. We studied the impact of different CSCM architectures on the performance for long-range forecasting on dataset ETTh1. The history and the prediction length are both 168 and $C = 4$ for all mechanisms. The results are listed in Table 8. From Table 8, we can tell that: (1) Using pooling layers instead of convolution typically degrades the performance. However, the performance of Pyraformer based on max pooling is still superior to that of Informer, demonstrating the advantages of the PAM over the prob-sparse attention in Informer. (2) The MSE of convolution with the bottleneck is only $1 . 5 1 \\%$ larger than that without bottleneck, but the number of parameters is reduced by almost $9 0 \\%$ . Thus, we adopt the more compact module of convolution with bottleneck as our CSCM. ", |
| "bbox": [ |
| 174, |
| 811, |
| 825, |
| 924 |
| ], |
| "page_idx": 17 |
| }, |
| { |
| "type": "table", |
| "img_path": "images/54bcb3f8e84f20c0a7a29ad24e936fa518bed68768ab8ad6f0b028e860c576a2.jpg", |
| "table_caption": [ |
| "Table 7: Impact of $A$ and $C$ on long-range forecasting. The history length is 336. " |
| ], |
| "table_footnote": [], |
| "table_body": "<table><tr><td rowspan=\"2\"></td><td colspan=\"3\">A=3</td><td colspan=\"3\">A=9</td><td colspan=\"3\">A = 13</td></tr><tr><td>MSE</td><td>MAE</td><td>Q-K pairs</td><td>MSE</td><td>MAE</td><td>Q-K pairs</td><td>MSE MAE</td><td></td><td>Q-K pairs</td></tr><tr><td>C=2</td><td>1.035</td><td>0.811</td><td>73512</td><td>1.029</td><td>0.815</td><td>162648</td><td>1.003</td><td>0.807</td><td>221112</td></tr><tr><td>C=3</td><td>1.029</td><td>0.817</td><td>58992</td><td>1.009</td><td>0.798</td><td>128976</td><td>1.056</td><td>0.805</td><td>174672</td></tr><tr><td>C=4</td><td>1.001</td><td>0.802</td><td>53208</td><td>1.028</td><td>0.806</td><td>115848</td><td>1.027</td><td>0.804</td><td>156696</td></tr><tr><td>C=5</td><td>0.999</td><td>0.796</td><td>49992</td><td>1.005</td><td>0.796</td><td>108744</td><td>1.017</td><td>0.797</td><td>147192</td></tr></table>", |
| "bbox": [ |
| 238, |
| 127, |
| 761, |
| 220 |
| ], |
| "page_idx": 18 |
| }, |
| { |
| "type": "table", |
| "img_path": "images/e056bfab6233f92ef23ff3bb8565237fff87783e4aeb769f13f48b77d51bc013.jpg", |
| "table_caption": [ |
| "Table 8: Impact of the CSCM architecture on long-range forecasting. Parameters introduced by the normalization layers are relatively few, and thus, are ignored. " |
| ], |
| "table_footnote": [], |
| "table_body": "<table><tr><td>CSCM</td><td>MSE</td><td>MAE</td><td>Parameters</td></tr><tr><td>Max-pooling</td><td>0.842</td><td>0.700</td><td>0</td></tr><tr><td>Average-pooling</td><td>0.833</td><td>0.693</td><td>0</td></tr><tr><td>Conv.</td><td>0.796</td><td>0.679</td><td>3147264</td></tr><tr><td>Conv.w/bottleneck</td><td>0.808</td><td>0.683</td><td>328704</td></tr></table>", |
| "bbox": [ |
| 232, |
| 275, |
| 522, |
| 356 |
| ], |
| "page_idx": 18 |
| }, |
| { |
| "type": "table", |
| "img_path": "images/87fa7e2a7d596a8b15c5cfdae6ec9ec9d2af9d9bf2290d28144c6d8149258ce7.jpg", |
| "table_caption": [ |
| "Table 9: Impact of history length. The prediction length is 1344. " |
| ], |
| "table_footnote": [], |
| "table_body": "<table><tr><td>History Length</td><td>MSE</td><td>MAE</td></tr><tr><td>84</td><td>1.234</td><td>0.856</td></tr><tr><td>168</td><td>1.226</td><td>0.868</td></tr><tr><td>336</td><td>1.108</td><td>0.835</td></tr><tr><td>672</td><td>1.057</td><td>0.806</td></tr><tr><td>1344</td><td>1.062</td><td>0.806</td></tr></table>", |
| "bbox": [ |
| 606, |
| 262, |
| 800, |
| 356 |
| ], |
| "page_idx": 18 |
| }, |
| { |
| "type": "table", |
| "img_path": "images/a0c5396a148c8233fb5102e7e18188438e622a1e8a25d1a1db2594e43de3523c.jpg", |
| "table_caption": [ |
| "Table 10: Impact of the PAM. " |
| ], |
| "table_footnote": [], |
| "table_body": "<table><tr><td>Method</td><td>Metrics</td><td>96</td><td>288</td><td>672</td></tr><tr><td rowspan=\"2\">CSCM Only</td><td>MSE</td><td>0.576</td><td>0.782</td><td>0.883</td></tr><tr><td>MAE</td><td>0.544</td><td>0.683</td><td>0.752</td></tr><tr><td rowspan=\"2\">Pyraformer</td><td>MSE</td><td>0.480</td><td>0.754</td><td>0.857</td></tr><tr><td>MAE</td><td>0.486</td><td>0.659</td><td>0.707</td></tr></table>", |
| "bbox": [ |
| 338, |
| 386, |
| 663, |
| 481 |
| ], |
| "page_idx": 18 |
| }, |
| { |
| "type": "text", |
| "text": "", |
| "bbox": [ |
| 173, |
| 506, |
| 823, |
| 534 |
| ], |
| "page_idx": 18 |
| }, |
| { |
| "type": "text", |
| "text": "J.3 IMPACT OF THE HISTORY LENGTH ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 551, |
| 446, |
| 565 |
| ], |
| "page_idx": 18 |
| }, |
| { |
| "type": "text", |
| "text": "We also checked the influence of the history length on the prediction accuracy. The dataset is ETTm1, since its granularity is minute and contains more long-range dependencies. We fixed the prediction length to 1344 and changed the history length from 84 to 1344 in Table 9. As expected, a longer history typically improves prediction accuracy. On the other hand, this performance gain starts to level off when introducing more history stops providing new information. As shown in Figure 8, the time series with length 672 contains almost all periodicity information that is essential for prediction, while length 1344 introduces more noise. ", |
| "bbox": [ |
| 174, |
| 577, |
| 825, |
| 674 |
| ], |
| "page_idx": 18 |
| }, |
| { |
| "type": "text", |
| "text": "J.4 IMPACT OF THE PAM ", |
| "text_level": 1, |
| "bbox": [ |
| 174, |
| 691, |
| 361, |
| 707 |
| ], |
| "page_idx": 18 |
| }, |
| { |
| "type": "text", |
| "text": "Finally, we investigated the importance of the PAM. We compared the performance of Pyraformer with and without the PAM on the dataset ETTm1. For a fair comparison, the number of parameters of the two methods were controlled to be within the same order of magnitude. More precisely, we increased the bottleneck dimension of ”Conv. w/bottleneck” for the model only with the CSCM. The results are shown in Table 10. Obviously, the PAM is vital to yield accurate predictions. ", |
| "bbox": [ |
| 174, |
| 718, |
| 825, |
| 787 |
| ], |
| "page_idx": 18 |
| }, |
| { |
| "type": "text", |
| "text": "K DISCUSSION ON THE SELECTION OF HYPER-PARAMETERS ", |
| "text_level": 1, |
| "bbox": [ |
| 176, |
| 809, |
| 687, |
| 824 |
| ], |
| "page_idx": 18 |
| }, |
| { |
| "type": "text", |
| "text": "We recommend to first determine the number of attention layers $N$ based on the available computing resources, as this number is directly related to the model size. Next, the number of scales $S$ can be determined by the granularity of the time series. For example, for hourly observations, we typically assume that it may also have daily, weekly and monthly periods. Therefore, we can set $S$ to be 4. We then focus on the selection of $A$ and $C$ . According to the ablation study, we typically prefer a small $A$ , such as 3 and 5. Lastly, in order to ensure the network has a receptive field of $L$ , we can select a $C$ that satisfies Equation (5). In practice, we can use a validation set to choose $C$ from its candidates that satisfies (5). It is also worthwhile to check whether choosing different $C$ for different scales based on the granularity of the time series can further improve the performance as we did in Appendix I. ", |
| "bbox": [ |
| 174, |
| 840, |
| 825, |
| 924 |
| ], |
| "page_idx": 18 |
| }, |
| { |
| "type": "image", |
| "img_path": "images/db2eafc4e603577f0d58166014a0fae825efdf9d45557b4f4357d82edaf6f6ac.jpg", |
| "image_caption": [ |
| "Figure 8: Time series with different lengths in the ETTm1 dataset. The sequence length in (a) and (b) is 672, and that in (c) and (d) is 1344. The time series in (a) and (b) corresponds to the latter half of those in (c) and (d) respectively. " |
| ], |
| "image_footnote": [], |
| "bbox": [ |
| 176, |
| 104, |
| 820, |
| 501 |
| ], |
| "page_idx": 19 |
| }, |
| { |
| "type": "text", |
| "text": "", |
| "bbox": [ |
| 174, |
| 589, |
| 825, |
| 646 |
| ], |
| "page_idx": 19 |
| } |
| ] |