TSLib Pyraformer
Pyraformer, a Transformer for long time series whose attention runs over a multi-resolution pyramid.
Time series · 91 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Time series
- Parameters
- 7.6M
- Operations
- 91
- Framework
- PyTorch
- Recurrent
- No
- Published
- ICLR 2022
- Paper
- Pyraformer: Low-Complexity Pyramidal Attention for Long-Range Time Series Modeling and Forecasting
- Cited by
- 464 (as of 23 October 2026)
- Authors
- Shizhan Liu, Hang Yu, Cong Liao and others
- License
- MIT
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m3041
- Graph hash
- 14860155e60a8f98dfc183ac2fe50d20c3462023f09c365b918bb74104cd9adc
- Skeleton hash
- 2c0cef517d1b90bdaac04000c227d9918fdc6ed508e485359ec98ff32ea7acf1
- Architecture hash
- 2604f337aca89418026300b7cbd7da9a29551bc5ae09194128cd7c42eefc70c1
- Diagram SHA-256
- 7495a256dbd6a1bbfcf0cbbb8239ccae5539c8e0e57b71b5ce34b0b723b74ae6
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
Pyraformer is a Transformer for time series forecasting that uses pyramidal attention to capture long-range dependencies while keeping time and space complexity low. The paper shows that, under mild conditions, the longest signal path between two positions stays constant as the sequence grows, while time and space complexity scale linearly with sequence length.
The core is the pyramidal attention module (PAM), which passes messages by attention over a pyramidal graph. Nodes at the finest scale correspond to the time points of the original series, and nodes at coarser scales represent features with lower resolutions. Within each scale, edges connect neighboring nodes to capture the temporal dependencies at that resolution. The coarser nodes are built by a coarser-scale construction module that applies several convolution layers with kernel size C and stride C to the embedded sequence.
For multi-step forecasting the paper proposes two prediction modules, one of which is a decoder with two full attention layers. The paper reports that in its experiments Pyraformer typically achieved the highest prediction accuracy in both single-step and long-range multi-step forecasting, with the least time and memory consumption. This version of Pyraformer is the one included in Time-Series-Library.
Key idea. Pyraformer introduces a pyramidal attention module whose inter-scale tree and intra-scale neighbor connections give a constant maximum signal path with time and space complexity linear in sequence length.
- pyraformer
- pyramidal attention based transformer
- pyramidal attention
- pyramidal attention module
- tslib pyraformer
- long-range time series forecasting
- time series forecasting
- low-complexity attention
- multi-resolution attention
- time-series-library
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{https://doi.org/10.34726/2945,
doi = {10.34726/2945},
url = {https://repositum.tuwien.at/handle/20.500.12708/135874},
author = {Liu, Shizhan and Yu, Hang and Liao, Cong and Li, Jianguo and Lin, Weiyao and Liu, Alex X. and Dustdar, Schahram},
keywords = {sparse attention, pyramidal graph, Transformer, time series forecasting, long-range dependence, multiresolution},
language = {en},
title = {Pyraformer: Low-Complexity Pyramidal Attention for Long-Range Time Series Modeling and Forecasting},
publisher = {TU Wien},
year = {2022},
copyright = {In Copyright}
}