Multi-head attention runs several attention mechanisms in parallel, allowing a model to learn different relationships and representations from the same sequence. In time-series forecasting, one head might emphasize trends while another identifies seasonal patterns. The mechanism is described conceptually rather than mathematically. section 1.2.2
Within transformer forecasting architectures, multi-head attention supports several distinct operations:
- Encoder heads relate the current token to other tokens in the known historical sequence, potentially assigning greater weight to nearby time steps. section 1.2.2
- Decoder self-attention is masked so predictions use previous data without accessing future values. section 1.2.3
- A decoder's second attention layer uses the encoder representation, after which projections convert the deep representation into forecast values. section 1.2.3
- Decoder-only forecasting models can stack many layers using multi-head attention; TimesFM also masks input patches during training. section 7.1.1
Figure 1.8 Visualizing the decoder in detail. We see that the output of the encoder is fed to the second attention layer of the decoder; the decoder generates predictions using information learned from the encoder.
Trace how encoder output enters the decoder's second attention layer and contributes to prediction generation. section 1.2.3













