All models

Triformer

A forecasting model for long multivariate time series with linear-cost patch attention and per-variable parameters.

Time series · 1,697 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (490 KB)

Open in a new tab

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

Parameters
752.7K
Operations
1,697
Framework
PyTorch
Recurrent
Yes
Published
IJCAI 2022
Cited by
126 (as of 28 October 2026)
Authors
Razvan-Gabriel Cirstea, Chenjuan Guo, Bin Yang and others
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m21067
Graph hash
97d8b321cddb26f1287badb5dd8c5665992a62df5cbd20b0786df0bacbcadf7b
Skeleton hash
9de38f64e65eec8d8cd6faf4f61a3b9942712ff030a56cc497fb9191a4dbea16
Architecture hash
19c43d57f0afd98736a750e9e897f1dc1296b69123eb3577c78c7577a01f2d05
Diagram SHA-256
d70a66b24b752c57fe26948e5b72adf0450281409575d32bcce37b3482deedb1
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

Triformer is an attention model for long sequence multivariate time series forecasting. Its authors start from two limitations of earlier attention-based forecasters: canonical self attention has quadratic complexity in the input length, and the same projection matrices are used for every variable's time series even though variables often have distinct temporal dynamics.

The model first breaks the time series into small patches. Each patch gets a learnable pseudo timestamp, and the timestamps in the patch attend only to that single pseudo timestamp, which makes patch attention linear. Only the pseudo timestamps are fed to the next layer, so layer sizes shrink exponentially; this is the triangular structure in the name, and it keeps a multi-layer model at linear complexity.

To give each variable its own parameters at low cost, a projection matrix is factorized into three matrices. The left and right matrices are shared by all variables, and the compact middle matrix is generated from a learnable memory vector that belongs to one variable. The paper reports experiments on four datasets from multiple domains. It is an extended version of a paper that was to appear in IJCAI 2022.

Key idea. Triformer introduces patch attention with linear complexity, stacked in a triangular structure whose layers shrink exponentially, and a light-weight way to give each variable its own projection parameters.

  • Triformer
  • Triangular Transformer
  • long sequence time series forecasting
  • multivariate time series forecasting
  • patch attention
  • linear complexity attention
  • variable-specific attention
  • time series transformer

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@article{triformer2022,
  title = {Triformer: Triangular, Variable-Specific Attentions for Long Sequence Multivariate Time Series Forecasting},
  author = {Razvan-Gabriel Cirstea and Chenjuan Guo and Bin Yang and Tung Kieu and Xuanyi Dong and Shirui Pan},
  year = {2022},
  journal = {IJCAI 2022},
  eprint = {2204.13767}
}