Transformer-based Multivariate Time Series Anomaly Localization

Charalampos Shimillas, Kleanthis Malialis, Konstantinos Fokianos, Marios M. Polycarpou · DOI

Abstract

Identifying the root cause of failures in complex Cyber-Physical Systems (CPS) remains a significant challenge in time series analysis. While Transformer-based models excel at capturing temporal and inter-sensor dependencies for anomaly detection, their self-attention mechanisms often lead to a "bleeding" effect, where an anomaly in one sensor distorts the reconstructed signals of healthy sensors. This paper presents a novel framework for multivariate time series (MTS) anomaly localization. By introducing the Space-Time Anomaly Score (STAS) and the Statistical Feature Anomaly Score (SFAS), the proposed method effectively isolates the source of anomalies from their correlated "echoes." Experimental results on synthetic and real-world datasets demonstrate up to a 55% improvement in localization accuracy over state-of-the-art methods.

Introduction

In modern industrial environments, such as power grids, server clusters, and manufacturing plants, multivariate time series (MTS) data are continuously monitored to ensure system health. While detecting the presence of an anomaly is critical, pinpointing the specific sensor or variable responsible—known as anomaly localization—is essential for rapid troubleshooting and maintenance.

Recent advances in deep learning, particularly Transformers, have improved anomaly detection by modeling complex dependencies across time and variables. However, these models face a fundamental hurdle in localization: the "bleeding" effect. Because self-attention mechanisms link all variables in a latent space, a fault in a single component often propagates through the network, causing the model to report errors across multiple healthy sensors. This paper addresses this limitation by analyzing the mathematical relationship between Transformers and spatial statistics to develop a more precise diagnostic tool.

The Problem: The "Bleeding" Effect in Transformers

The core of the localization challenge lies in how Transformers process information. The authors demonstrate that because of the "Value" matrix in self-attention, an anomaly in one series ($x^a$) directly impacts the latent representation ($z^j$) of all other series. This inter-dependency means that standard reconstruction-based localization, which relies on simple per-sensor error thresholds, often fails to distinguish the true driver of an anomaly from its correlated effects.

Proposed Methodology

The authors propose a multi-stage unsupervised framework designed to "unmask" the true culprit of a system failure.

1. Representation Learning Module (RLM)

The foundation of the framework is a Transformer-based encoder-decoder model. To ensure the model learns robust patterns rather than overfitting to anomalies in the training data, the authors employ a specialized loss function. This function combines standard reconstruction error with a "distribution divergence" term, regularizing the latent space to better represent normal system behavior.

2. Space-Time Anomaly Score (STAS)

STAS is the primary innovation for localization. Drawing inspiration from Space-Time Autoregressive (STAR) models and spatial statistics (such as Local Indicators of Spatial Association, or LISA), STAS treats the MTS as a spatial-temporal field.

The framework calculates a localization score by systematically "masking" a specific time series during inference and measuring the resulting change in the total system reconstruction error. By weighting these changes according to the learned correlations between series, STAS can isolate which variable's absence most significantly reduces the system-wide error, thereby identifying it as the root cause.

3. Statistical Feature Anomaly Score (SFAS)

To further refine the results and reduce false positives, the authors introduce SFAS. This module acts as a statistical "sanity check." It extracts high-level features—including trend strength, curvature, and seasonality—from data windows before and during a suspected anomaly. If the statistical profile of a sensor remains stable despite a high STAS score, the framework may reclassify the event as a correlation artifact rather than a true fault.

4. Decision Algorithm

The final diagnosis is reached through an iterative process. STAS provides the initial classification of potential anomaly sources, which are then filtered through SFAS to minimize false alarms and ensure high-precision localization.

Experimental Evaluation

The model was evaluated against several benchmarks, including the synthetic Waves (WVS) dataset and two real-world datasets: the Server Machine Dataset (SMD) and the Application Server Dataset (ASD).

Key Results

  • Localization Accuracy: The framework significantly outperformed existing state-of-the-art (SOTA) models like OmniAnomaly and InterFusion. On the ASD dataset, the model achieved a 55% improvement in localization performance.
  • Precision and Robustness: On the SMD dataset, the model showed a 9% improvement in time-step-wise localization. The combination of STAS and SFAS consistently yielded higher F1-scores and Interpretation Scores (IPS) across various window lengths, demonstrating the effectiveness of the statistical filtering layer.
  • Theoretical Validation: The authors successfully established a mathematical bridge showing that Transformer latent representations function as high-dimensional versions of STAR models, providing a theoretical grounding for applying spatial statistics to deep learning architectures.

Discussion and Limitations

While the proposed framework represents a significant step forward, several challenges remain. The current STAS metric assumes static correlations between sensors, whereas real-world systems often exhibit non-stationary, dynamic relationships. Additionally, the effectiveness of the localization is sensitive to the choice of window length, which may require domain-specific tuning. Finally, while the model is efficient for dozens of sensors, its scalability to massive IoT deployments with thousands of variables remains an area for future research.

Conclusion

By combining the representational power of Transformers with the precision of space-time statistics, this research provides a robust solution to the "bleeding" effect in anomaly localization. The introduction of STAS and SFAS allows for more accurate root-cause analysis in complex multivariate systems, offering a path toward more reliable and interpretable automated monitoring in Cyber-Physical Systems.

Summary updated

BibTeX
@misc{shimillas2025transformer,
  author = {Charalampos Shimillas and Kleanthis Malialis and Konstantinos Fokianos and Marios M. Polycarpou},
  title = {{Transformer-based Multivariate Time Series Anomaly Localization}},
  year = {2025},
  eprint = {2501.08628},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.08628},
}
Figure