A transformer architecture processes sequences through learned attention and feed-forward components, typically separating representation learning in an encoder from prediction in a decoder. In time-series forecasting, embeddings represent the data, positional encoding preserves time order, and stacked layers learn dependencies before generating future values. section 1.2 section 1.2.3
Follow the forecasting path:
- Embed the input series into a representation the model can process, then add positional encoding so time-step order remains available. section 1.2
- Pass the representation through stacked encoder layers, where self-attention learns relationships among tokens and feed-forward layers transform the result. section 1.2.2
- Use multiheaded attention to learn different representations, such as trend-related and seasonal relationships. section 1.2.2
- Generate predictions with decoder layers: masked attention blocks access to future values, cross-attention uses encoder output, and linear projection returns the forecast dimension. section 1.2.3
- Feed each prediction back into the decoder until the complete forecast horizon is produced. section 1.2.3
Electricity demand and temperature
A transformer-based forecaster can use historical electricity demand together with temperature as an exogenous feature. Forecasting the next 24 hours requires the next 24 hours of temperature as well as past demand. section 3.2
Figure 1.2 Simplified transformer architecture from a time-series perspective. The raw series enters at the bottom-left portion of the figure and flows through an embedding layer and positional encoding before going into the decoder. Then the output comes from the decoder one value at a time until the entire horizon is predicted.
Trace the simplified time-series architecture from the raw series through embedding and positional encoding, then through prediction one value at a time. section 1.2



























