Sensorformer: Cross-patch attention with global-patch compression is effective for high-dimensional multivariate time series forecasting

Liyang Qin, Xiaoli Wang, Chunhua Yang, Huaiwen Zou, Haochuan ZhangarXiv 2025 · DOI

Abstract

Among the existing Transformer-based multivariate time series forecasting methods, iTransformer, which treats each variable sequence as a token and only explicitly extracts cross-variable dependencies, and PatchTST, which adopts a channel-independent strategy and only explicitly extracts cross-time dependencies, both significantly outperform most Channel-Dependent Transformer that simultaneously extract cross-time and cross-variable dependencies. This indicates that existing Transformer-based multivariate time series forecasting methods still struggle to effectively fuse these two types of information. We attribute this issue to the dynamic time lags in the causal relationships between different variables. Therefore, we propose a new multivariate time series forecasting Transformer, Sensorformer, which first compresses the global patch information and then simultaneously extracts cross-variable and cross-time dependencies from the compressed representations. Sensorformer can effectively capture the correct inter-variable correlations and causal relationships, even in the presence of dynamic causal lags between variables, while also reducing the computational complexity of pure cross-patch self-attention from $O(D^2 \cdot Patch\_num^2 \cdot d\_model)$ to $O(D^2 \cdot Patch\_num \cdot d\_model)$. Extensive comparative and ablation experiments on 9 mainstream real-world multivariate time series forecasting datasets demonstrate the superiority of Sensorformer. The implementation of Sensorformer is publicly available at https://github.com/BigYellowTiger/Sensorformer.

Introduction: The Fusion Dilemma and Dynamic Causal Lags

In multivariate time series forecasting (MTSF), such as predicting power grid loads or traffic flow, models must capture two types of relationships: cross-time dependencies (how a single variable evolves) and cross-variable dependencies (how different variables influence each other).

Surprisingly, current state-of-the-art models usually prioritize only one. PatchTST focuses on temporal patterns by treating channels independently, while iTransformer prioritizes inter-variable relationships. Models that attempt to fuse both often perform worse. The authors identify a "hidden" culprit: dynamic time lags. In the real world, a change in one variable might affect another after a delay that is not constant. Standard Transformers try to fuse data from the same timestamp across all variables, which often forces the model to correlate causally unrelated data points, leading to poor generalization.

Dynamic causal lags between time series and their representation in a tensor format.

Methodology: The Sensor Attention Block

The core innovation of Sensorformer is the Sensor Attention Block, a two-stage process designed to replace standard self-attention and handle these lags efficiently:

  1. Stage 1: Global-Patch Compression. The model segments each variable into patches. It treats the last patch of each variable (the most recent history) as a "Query" to attend to all previous historical patches (Keys/Values). This compresses the entire history into a set of "Sensor" vectors—one per variable—that represent the most relevant historical causal information.
  2. Stage 2: Dependency Extraction. These "Sensor" vectors then act as the global knowledge base (Keys/Values) for all original patches (Queries). This allows every temporal patch to "talk" to the global context of all variables simultaneously.
The Sensorformer architecture, highlighting the Patching and Embedding layer and the two-stage Sensor Attention Block.

By using this "bottleneck" approach, the model avoids the $O(N^2)$ complexity (where $N$ is the number of patches) of pure cross-patch attention, reducing it to $O(N)$. This makes it feasible to run on high-dimensional datasets with hundreds of variables.

Experimental Evaluation

The authors evaluated Sensorformer on 9 mainstream real-world datasets, including ETT (Electricity Transformer Temperature), Weather (21 meteorological factors), ECL (Electricity consumption of 321 households), and Traffic (road occupancy from 862 sensors).

Key Results

  • Superior Accuracy: Sensorformer achieved the lowest or second-lowest error (MSE/MAE) in 64 out of the tested scenarios, outperforming both iTransformer and PatchTST.
  • Efficiency Gains: On the high-dimensional Traffic dataset, Sensorformer was significantly faster and used drastically less CUDA memory than pure cross-patch attention models.
  • Robustness: Ablation studies showed that removing either the compression stage or the extraction stage led to a significant drop in performance, confirming that the two-stage "Sensor" approach is the primary driver of its success.

Conclusion

Sensorformer addresses the "fusion dilemma" in multivariate time series forecasting by explicitly accounting for dynamic causal lags. By compressing global historical data into a compact "Sensor" representation, the model filters out causally irrelevant noise and focuses on the most significant inter-variable correlations. This approach provides a powerful inductive bias that improves both accuracy and computational efficiency, particularly for high-dimensional sensor data.

Source: Sensorformer: Cross-patch attention with global-patch compression is effective for high-dimensional multivariate time series forecasting (Qin et al., 2024)

Summary updated

BibTeX
@misc{qin2025sensorformer,
  author = {Liyang Qin and Xiaoli Wang and Chunhua Yang and Huaiwen Zou and Haochuan Zhang},
  title = {{Sensorformer: Cross-patch attention with global-patch compression is effective for high-dimensional multivariate time series forecasting}},
  year = {2025},
  eprint = {2501.03284},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.03284},
}
Figure