itransformer
A Transformer that tokenizes each variate's whole series so attention runs across variates, not time.
Time series · 51 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
- 18.1K
- Operations
- 51
- Framework
- PyTorch
- Recurrent
- No
- Published
- ICLR (arXiv 2023)
- Cited by
- 3,920 (as of 26 November 2026)
- Authors
- Yong Liu, Tengge Hu, Haoran Zhang and others
- 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
- m11940
- Graph hash
- dfa85c438e2e7cce562defec3132a216a857cbfa95e060d1bdf57a03f8dbaa7c
- Skeleton hash
- 33dd78fb119b06287bc0f21b620db6a3a997b6de4836a584eb68ab53c77d08a3
- Architecture hash
- 24b158c4a721667a574b3aeb7df5548a32602cee244e787a150722d944329c3a
- Diagram SHA-256
- 8dbddef1ed3f8ed860f584bd83454339a071b211dd8a4311d17047b4d70fdf8f
- 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
iTransformer is a Transformer for multivariate time series forecasting that keeps every standard component and simply applies the attention and feed-forward network on the inverted dimensions. The complaint it answers: ordinary Transformer forecasters build each token from multiple variates of the same timestamp, which may fail in learning variate-centric representations and result in meaningless attention maps. The paper's stance is that it is not that Transformer is ineffective for time series forecasting, but rather it is improperly used.
Here the whole time series of each variate is embedded independently into a variate token, which the authors call the extreme case of Patching. Self-attention then runs across variate tokens to capture multivariate correlations, while the feed-forward network is applied to each variate token to learn nonlinear representations. Because the order of the sequence is implicitly stored in the neuron permutation of the feed-forward network, the position embedding of the vanilla Transformer is no longer needed. The model is encoder-only, and generating the predicted series is essentially delivered to linear layers. Since attention accepts any number of tokens, the token number can vary from training to inference and the model can be trained on arbitrary numbers of variates.
Experiments cover 7 real-world datasets, including ECL, ETT, Exchange, Traffic, Weather, Solar-Energy and PEMS. The authors find iTransformer particularly good at forecasting high-dimensional time series. PatchTST, the previous state-of-the-art, fails in many cases of PEMS, which the paper blames on patching losing focus on rapid fluctuation. Code is at github.com/thuml/iTransformer.
Key idea. Inverting the Transformer for time series: each variate's whole series becomes one token, so attention models correlations between variates and the feed-forward network learns each series' representation, with no change to the basic components.
- iTransformer
- inverted Transformer
- Inverted Transformers Are Effective for Time Series Forecasting
- time series forecasting
- multivariate forecasting
- variate token
- NeuralForecast iTransformer
- long-term forecasting
- thuml
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{liu2024itransformerinvertedtransformerseffective,
title={iTransformer: Inverted Transformers Are Effective for Time Series Forecasting},
author={Yong Liu and Tengge Hu and Haoran Zhang and Haixu Wu and Shiyu Wang and Lintao Ma and Mingsheng Long},
year={2024},
eprint={2310.06625},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2310.06625},
}