Linear Transformers as VAR Models: Aligning Autoregressive Attention Mechanisms with Autoregressive Forecasting

Jiecheng Lu, Shihao Yang

Abstract

Traditional Time Series Forecasting (TSF) relies heavily on Vector Autoregression (VAR), while modern deep learning favors Transformer architectures. This paper bridges the gap by demonstrating that Linear Transformers are mathematically equivalent to dynamic VAR models. We introduce SAMoVAR (Structural Aligned Mixture of VAR), a model that reorganizes Transformer layers to align with VAR structures. SAMoVAR achieves state-of-the-art performance across 12 real-world benchmarks, offering linear computational complexity and enhanced interpretability through temporal influence paths.

1. Introduction

The rise of Transformers in sequence modeling has led to their widespread adoption in Time Series Forecasting (TSF). However, a fundamental "structural mismatch" persists. While classical econometrics utilizes Vector Autoregression (VAR) to explicitly model linear dependencies between past and future observations, standard Transformers—designed for natural language—often obscure these relationships within complex residual streams and multi-layer perceptron (MLP) blocks. This "black box" nature limits the interpretability and generalization of Transformers in temporal domains.

This research addresses this misalignment by proving that linear attention mechanisms can be viewed as dynamic VAR models. By explicitly structuring a Transformer to mirror the generative logic of VAR, the authors propose SAMoVAR, a "glass box" architecture for high-performance forecasting.

2. Bridging Linear Attention and VAR

The core theoretical contribution of this work is the interpretation of linear attention as a "fast weight programmer." In a single linear attention layer, the relationship between queries and keys dynamically generates a set of weights that are applied to the values. Mathematically, this process is equivalent to a VAR model where the coefficients evolve over time based on the input context.

To leverage this equivalence, the researchers introduced the Structural Aligned Mixture of VAR (SAMoVAR). Unlike standard architectures that treat stacked layers as independent processors, SAMoVAR reorganizes the Transformer block to represent a "temporal influence path." This ensures that even as the model grows in depth, it maintains a valid VAR structure, allowing it to capture complex, multi-step dependencies without losing the underlying autoregressive logic.

3. Architectural Innovations

SAMoVAR incorporates several key components to ensure stability and performance:

  • Structural VAR via LU Factorization: To model instantaneous relationships between variables in a multivariate series, the model uses an invertible matrix decomposed through LU factorization. This mimics a "Structural VAR" (SVAR), providing a more nuanced understanding of cross-variable dynamics.
  • Robust Path Pruning: Stacking multiple layers can lead to numerical instability. SAMoVAR employs RMSNorm on queries and values. By leveraging the geometric properties of high-dimensional spaces—where random vectors tend toward orthogonality—the model naturally "prunes" less significant influence paths, preventing gradient explosions.
  • ARX Tokenization: The model utilizes a patch-based tokenization strategy that distinguishes between the target autoregressive series and exogenous (external) factors. This "ARX" (Autoregressive with Exogenous variables) approach improves the handling of multi-variable dependencies.

4. Empirical Evaluation

The researchers evaluated SAMoVAR against state-of-the-art models, including PatchTST, iTransformer, and CATS, across 12 real-world benchmarks (e.g., Weather, Electricity, Traffic, and PEMS) and synthetic VAR(p) data.

4.1 Performance and Generalization

SAMoVAR consistently outperformed competing models. Notably, on datasets with stable long-term patterns like Solar and PEMS, the model achieved performance gains exceeding 30%. In synthetic tests, SAMoVAR demonstrated superior generalization; it could accurately predict data from a VAR(5) process even when trained only on VAR(1-3) processes, suggesting that its structural alignment allows it to learn the underlying data-generating mechanism rather than just memorizing patterns.

4.2 Efficiency and Interpretability

By utilizing linear attention, SAMoVAR maintains $O(L)$ computational complexity, where $L$ is the sequence length. This makes it significantly more efficient than vanilla Transformers ($O(L^2)$) for long-horizon forecasting. Furthermore, because the model is aligned with VAR logic, it offers a high degree of interpretability. Analysts can visualize "temporal influence paths" to see exactly how specific past observations contribute to future predictions, making the model's decision-making process transparent.

5. Conclusion and Future Work

SAMoVAR represents a significant step toward interpretable and efficient time series forecasting. By aligning the Transformer architecture with the mathematical foundations of VAR models, the authors provide a framework that excels in both accuracy and transparency.

Future research will explore the scalability of SAMoVAR within the context of large-scale "Foundation Models" and investigate whether this VAR-centric alignment provides benefits for non-temporal sequences, such as genomic data or natural language. While the current model offers improved interpretability, developing tools to simplify the visualization of complex "mixtures of paths" remains a priority for human-centric AI analysis.

Summary updated

BibTeX
@inproceedings{lu2025linear,
  author = {Jiecheng Lu and Shihao Yang},
  title = {{Linear Transformers as VAR Models: Aligning Autoregressive Attention Mechanisms with Autoregressive Forecasting}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=SxJUV9mnyt},
}
Figure