Temporal Logical Attention Network for Log-Based Anomaly Detection in Distributed Systems

Yang Liu, Shaolei Ren, Xuran Wang, Mengjie ZhouSensors 2024 · DOI

TL;DR

This paper introduces TLAN, a novel deep learning framework for anomaly detection in distributed systems. TLAN uniquely combines temporal sequence modeling with logical dependency analysis to capture complex system behaviors, leading to significant improvements in anomaly detection accuracy and a reduction in false alarms.

What Problem Does This Paper Address?

Modern distributed systems, like those powering cloud computing and microservices, are incredibly complex and dynamic. They generate vast amounts of log data that are crucial for monitoring and maintenance. However, detecting anomalies in these logs is a major challenge due to:

  • Complex Temporal Dependencies: Log events don't just happen in sequence; their timing and order are critical.
  • Diverse System States: Anomalies can manifest in many ways, making them hard to define.
  • Intricate Causal Relationships: Anomalies often arise from the interplay between different components, not just a single faulty part.
  • Dynamic Environments: System loads and component interactions change constantly, making static detection methods ineffective.

Traditional methods often struggle to capture these nuances, leading to missed anomalies or excessive false alarms. Existing deep learning approaches tend to focus on either temporal patterns or component relationships, but rarely both effectively, and often lack adaptability.

Methods

TLAN tackles these challenges with a novel, four-component architecture:

  1. Multi-Scale Feature Extraction: This module processes log sequences at different temporal granularities simultaneously using parallel convolutional streams with varying kernel sizes (3, 5, and 7). This allows it to capture both immediate interactions and longer-term trends.
  2. Temporal-Logical Modeling: This is the core innovation. It uses a bi-directional LSTM to model temporal patterns and Graph Attention Networks (GATs) to model logical dependencies between components. Crucially, it integrates these through a specialized temporal logical attention mechanism that explicitly models the interplay between time-series patterns and component interactions.
  3. Cross-Component Correlation Analysis: This module constructs a correlation matrix to capture relationships between temporal and logical features, further refined by a self-attention mechanism. This helps identify anomalies that manifest across multiple components.
  4. Adaptive Anomaly Detection: Instead of fixed thresholds, TLAN uses a gating mechanism and an adaptive Gaussian Mixture Model (GMM) to dynamically adjust detection sensitivity based on system load and component interactions. This makes it robust to changing system dynamics.

The model is trained using a multi-objective strategy combining supervised, reconstruction, and contrastive losses to ensure robust and transferable representations.

Datasets

The paper evaluates TLAN on:

  • A large-scale synthetic distributed system log dataset: This dataset simulates real-world production environments with five anomaly types (System Crash, Memory Leak, Network Delay, CPU Overload, I/O Error) and includes ground truth labels.
  • Four real-world distributed system log datasets:
    • HDFS (Hadoop Distributed File System)
    • Spark
    • Kubernetes
    • OpenStack

Key Insights and Ideas

  • The synergy of temporal and logical modeling is crucial: Anomalies in distributed systems rarely stem from a single cause. TLAN's success highlights that effectively combining how events unfold over time with how components interact is key to robust detection.
  • Multi-scale analysis is essential for capturing diverse anomalies: Different anomalies manifest at different time scales. TLAN's ability to process logs at multiple granularities simultaneously allows it to catch both rapid glitches and slow degradations.
  • Adaptability is paramount: Static detection methods fail in dynamic distributed environments. TLAN's adaptive threshold mechanism is vital for maintaining performance and reducing false alarms as system conditions change.
  • Interpretability matters: The attention weights learned by TLAN not only aid detection but also provide insights into why an anomaly is flagged, helping with root cause analysis.

Key Results

  • Synthetic Dataset: TLAN achieved a 9.4% improvement in F1-score and a 15.3% reduction in false alarm rate compared to state-of-the-art methods. It also demonstrated low detection latency (1.63s).
  • Real-World Datasets: TLAN consistently outperformed baselines across HDFS, Spark, Kubernetes, and OpenStack datasets, showing improvements in F1-score ranging from 1.8% to 2.1%.
  • Anomaly Type Performance: TLAN showed particularly strong performance in detecting memory leaks and system crashes (F1-scores of 0.925 and 0.918, respectively).
  • Early Detection: TLAN detected 90% of anomalies within 2.1 seconds, significantly outperforming traditional approaches.
  • Robustness: TLAN maintained strong performance under high system load, noisy logs, and with missing data.
  • Scalability: The model demonstrated efficient handling of large-scale data streams, processing up to 10,000 logs per second.

Limitations and Future Work

  • Network Anomaly Detection: While TLAN outperforms baselines, there's room for improvement in modeling distributed communication patterns. Future work could incorporate network topology and traffic flow data.
  • Computational Overhead: For extremely large-scale deployments, further optimization of the temporal-logical modeling component could reduce computational overhead.
  • Future Directions:
    • Transfer Learning: Pre-training TLAN on generic logs and fine-tuning on specific datasets.
  • Online Learning: Developing mechanisms for continuous model updates with new log data.
  • Multi-modal Data Fusion: Integrating logs with other data sources like metrics and traces.
  • Domain Adaptation: Adapting TLAN for security monitoring by incorporating security-specific features and objectives.

Summary updated

Abstract

Detecting anomalies in distributed systems through log analysis remains challenging due to the complex temporal dependencies between log events, the diverse manifestation of system states, and the intricate causal relationships across distributed components. This paper introduces a TLAN (Temporal Logical Attention Network), a novel deep learning framework that integrates temporal sequence modeling with logical dependency analysis for robust anomaly detection in distributed system logs. Our approach makes three key contributions: (1) a temporal logical attention mechanism that explicitly models both time-series patterns and logical dependencies between log events across distributed components, (2) a multi-scale feature extraction module that captures system behaviors at different temporal granularities while preserving causal relationships, and (3) an adaptive threshold strategy that dynamically adjusts detection sensitivity based on system load and component interactions. Extensive experiments on a large-scale synthetic distributed system log dataset show that TLAN outperforms existing methods by achieving a 9.4% improvement in F1-score and reducing false alarms by 15.3% while maintaining low latency in real-time detection. The framework demonstrates particular effectiveness in identifying complex anomalies that involve multiple interacting components and cascading failures. Through comprehensive empirical analysis and case studies, we validate that TLAN can effectively capture both temporal patterns and logical correlations in log sequences, making it especially suitable for modern distributed architectures. Our approach also shows strong generalization capability across different system scales and deployment scenarios, supported by thorough ablation studies and performance evaluations.
BibTeX
@inproceedings{liu2024temporal,
  author = {Yang Liu and Shaolei Ren and Xuran Wang and Mengjie Zhou},
  title = {{Temporal Logical Attention Network for Log-Based Anomaly Detection in Distributed Systems}},
  booktitle = {Sensors},
  year = {2024},
  doi = {10.3390/s24247949},
}
Figure