- Introduced by
- Yong Liu et al.
- Year
- 2024
- Type
- Inverted-attention sequence model
- Family
- Time-series forecasting
What does it do?
iTransformer is a deep-learning architecture for multivariate time-series forecasting, introduced by Liu et al. at ICLR 2024.
It inverts the usual Transformer tokenisation: rather than one token per time step, each variate (sensor channel or feature series) becomes a single token whose embedding is built from its full look-back window. Self-attention then operates across variates to model inter-series dependencies, while a feed-forward network applied to each variate token handles that series' temporal patterns.
The intuition behind the method
A standard Transformer for time series slices the input into time-step tokens, so attention relates moments in time to one another. iTransformer changes the unit of attention: each channel's entire history is one token, and attention asks how one channel relates to another. Temporal structure within each channel is handled by the feed-forward network applied to that channel's token. The division is therefore attention for inter-variate relations and feed-forward for intra-variate patterns, which is the design choice the name refers to.
History
The method was introduced by Liu et al. (Y. Liu, T. Hu, H. Zhang, H. Wu, S. Wang, L. Ma and M. Long) and published at ICLR 2024. Its core change is to invert the token axis of a Transformer so that attention runs over variates rather than time steps. The benchmark scope (datasets and forecasting horizons) and the reported results are not described on this page. Consult the paper for the evaluated settings before judging whether its results transfer to a new dataset.
When to use it
Choose iTransformer for multivariate forecasting where several channels are plausibly related and where those relations may help predict each other, because the attention step is the component that uses them. Each variate needs enough look-back history to form a meaningful token, and the method assumes that inter-variate relations are reasonably stable over the training period. Avoid it for univariate series, where the attention step has only one token to work with, and when the number of variates is very small. For univariate work, the related PatchTST entry is a more natural starting point; the related Crossformer and Transformer entries cover other attention designs.
Limitations and considerations
- In a univariate setting there is a single variate token, so the attention step has nothing to compare and the inversion offers no structural benefit.
- Each variate is compressed into one embedding of its whole look-back window. The mechanics contain no separate per-time-step position component, so fine-grained temporal order must be carried by the embedding and feed-forward layers.
- The learned attention weights reflect inter-variate relations as they appear in the training data. If these relations change over time, the learned dependencies may not hold in the forecast period.
- Because attention runs over variates, a dataset with very many variates produces a large N×N attention matrix, so attention memory and compute grow with the square of the variate count.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Attention is applied directly across variates, so inter-series dependencies are learned from the data rather than specified by a hand-built channel-mixing step.
- Attention is computed over an N×N matrix of variate tokens, so its cost depends on the number of variates N rather than the number of time steps T. The feed-forward sub-layer operates on d_model-dimensional tokens, so its cost scales with N and d_model. The look-back length T enters through the input embedding of each variate, which the mechanics do not spell out. The attention comparison favours this design over time-step attention mainly when N is smaller than T.
- Temporal structure within each variate is still modelled by the feed-forward network inside its token, so the inversion does not remove within-series learning.
- The change is confined to tokenisation. The attention, feed-forward and projection components keep the standard Transformer form given in the mechanics, which makes the architecture straightforward to implement and to compare with a standard Transformer baseline.
Applications
- Forecasting electricity consumption or traffic flow across many metered or monitored locations.
- Weather and climate variable prediction across multiple monitoring stations.
- Industrial sensor-network forecasting, where many correlated signals must be predicted jointly.
How it works
How it works
The input matrix of shape T×N (time steps by variates) is rearranged so that each of the N variates becomes a token vector of length T. As a result, the sequence length seen by attention is N, the number of variates, rather than T, the number of time steps. This changes what the attention mechanism models.
Formula
\text{Given input } \mathbf{X} \in \mathbb{R}^{T \times N}, \text{ each variate (column) is treated as a token: } \mathbf{x}_n \in \mathbb{R}^{T}, \; n=1,\ldots,NSelf-attention is computed over the N variate tokens, with query, key and value matrices of size N×d_k as in the scaled dot-product formula. The attention weights therefore express learned dependencies between pairs of variates, and the attention matrix is N×N.
Formula
\text{Self-attention operates over variates: } \text{Attn}(\mathbf{Q},\mathbf{K},\mathbf{V}) = \text{softmax}\!\left(\frac{\mathbf{Q}\mathbf{K}^\top}{\sqrt{d_k}}\right)\mathbf{V}, \quad \mathbf{Q},\mathbf{K},\mathbf{V} \in \mathbb{R}^{N \times d_k}After attention mixes information across variates, a feed-forward network is applied to each token separately, using the same network for every variate. Because each token embeds one variate's look-back window, this sub-layer is where that variate's own temporal patterns are modelled. The mechanics do not include a separate temporal module.
Formula
\text{A feed-forward network processes each variate token independently, learning temporal patterns: } \mathbf{h}_n = \text{FFN}(\mathbf{z}_n), \; \mathbf{z}_n \in \mathbb{R}^{d_{\text{model}}}A linear projection maps each variate's final representation to the H future steps, giving a forecast matrix of shape H×N. The same projection weights are applied to every variate, so the output layer does not itself model cross-variate structure.
Formula
\text{A linear projection maps each variate representation to future horizon } H: \hat{\mathbf{x}}_n = \mathbf{W}_{\text{proj}}\,\mathbf{h}_n + \mathbf{b}, \quad \hat{\mathbf{X}} \in \mathbb{R}^{H \times N}Common pitfalls
- With very few variates, the N×N attention matrix contains little cross-variate information, so gains over a model that treats each series separately are unlikely.
- A short look-back window gives each variate token few values to embed, which weakens the per-variate representation that the feed-forward network operates on.
- Each variate enters with its own raw scale, so the input may need per-variate normalisation before embedding. The mechanics do not specify a normalisation step, so this is an open implementation choice. Read the paper's preprocessing description before comparing results with reported figures, and check the effect on the target data.
- Layer count, model dimension and look-back length are task-dependent. Settings chosen for one benchmark should be re-tuned on the target data rather than assumed to transfer.
Frequently asked questions
What makes iTransformer different from a standard Transformer applied to time series?
A standard Transformer for time series tokenises time steps, so attention relates moments in time. iTransformer tokenises variates, so attention relates channels to one another, and temporal structure within each channel is handled by the feed-forward network applied to that channel's token. The feed-forward network and the linear projection head are still present, so the change concerns what a token represents rather than the list of components.
Is iTransformer suitable for univariate forecasting?
Not in its standard form. The attention step compares variate tokens, so with a single variate there is only one token and attention has nothing to relate it to. For univariate problems, the related PatchTST entry is a more natural starting point.
Does iTransformer require special preprocessing or normalisation?
The mechanics do not specify a normalisation step, so normalisation is an implementation choice rather than a documented requirement. Because variates can have different scales, the paper's preprocessing description should be read before comparing results with reported figures.
Related methods
Sources
Liu, Y., Hu, T., Zhang, H., Wu, H., Wang, S., Ma, L., & Long, M. (2024). iTransformer: Inverted transformers are effective for time series forecasting. ICLR.
Open publication reference