Skip to main content
QUICK REVIEW

[Paper Review] Self-Attentive Classification-Based Anomaly Detection in Unstructured Logs

Sasho Nedelkoski, Jasmin Bogatinovski|arXiv (Cornell University)|Aug 21, 2020
Software System Performance and ReliabilityComputer Science31 references5 citations
TL;DR

Logsy proposes a self-attentive, classification-based anomaly detection method for unstructured system logs by training a neural network to distinguish between normal logs from a target system and anomaly logs from diverse, publicly available auxiliary datasets. Using a novel hyperspherical loss function, it learns compact, semantically rich log representations that improve generalization and achieve a 0.25 F1-score improvement over prior methods.

ABSTRACT

The detection of anomalies is essential mining task for the security and reliability in computer systems. Logs are a common and major data source for anomaly detection methods in almost every computer system. They collect a range of significant events describing the runtime system status. Recent studies have focused predominantly on one-class deep learning methods on predefined non-learnable numerical log representations. The main limitation is that these models are not able to learn log representations describing the semantic differences between normal and anomaly logs, leading to a poor generalization of unseen logs. We propose Logsy, a classification-based method to learn log representations in a way to distinguish between normal data from the system of interest and anomaly samples from auxiliary log datasets, easily accessible via the internet. The idea behind such an approach to anomaly detection is that the auxiliary dataset is sufficiently informative to enhance the representation of the normal data, yet diverse to regularize against overfitting and improve generalization. We propose an attention-based encoder model with a new hyperspherical loss function. This enables learning compact log representations capturing the intrinsic differences between normal and anomaly logs. Empirically, we show an average improvement of 0.25 in the F1 score, compared to the previous methods. To investigate the properties of Logsy, we perform additional experiments including evaluation of the effect of the auxiliary data size, the influence of expert knowledge, and the quality of the learned log representations. The results show that the learned representation boost the performance of the previous methods such as PCA with a relative improvement of 28.2%.

Motivation & Objective

  • Address the poor generalization of existing one-class deep learning methods in log anomaly detection due to rigid, non-semantic log representations.
  • Overcome limitations of log parsing and template-based models that fail on unseen log messages.
  • Improve model robustness and generalization by leveraging diverse, easily accessible auxiliary log datasets as a regularizer.
  • Develop a representation learning method that captures semantic differences between normal and anomalous logs without requiring extensive expert labeling.
  • Demonstrate that learned log embeddings can enhance not only Logsy but also traditional methods like PCA, increasing their performance.

Proposed method

  • Train a self-attentive encoder network to map raw log messages into dense vector representations using a contrastive classification objective.
  • Use a hyperspherical loss function that encourages normal log embeddings to cluster tightly around the origin in a hypersphere, while anomaly embeddings are pushed to the periphery.
  • Train on a combination of target system logs (normal) and logs from diverse auxiliary datasets (anomalous), treating the task as a binary classification.
  • Leverage pre-trained transformer-style attention mechanisms to capture long-range dependencies and semantic structure in unstructured log sequences.
  • Apply T-SNE visualization to analyze the geometric structure of learned embeddings, confirming that normal logs cluster centrally and anomalies disperse outward.
  • Extract learned log embeddings and reapply them to baseline methods (e.g., PCA) to evaluate their general utility across different anomaly detection pipelines.

Experimental results

Research questions

  • RQ1Can a classification-based approach using auxiliary log datasets improve generalization in log anomaly detection compared to one-class learning?
  • RQ2How effective is the proposed hyperspherical loss function in learning compact, discriminative log representations?
  • RQ3To what extent does incorporating even a small amount of labeled anomaly data from the target system improve detection performance?
  • RQ4Can the learned log embeddings be transferred to and improve the performance of existing, non-deep learning methods like PCA?
  • RQ5How does the size and diversity of the auxiliary dataset affect the robustness and generalization of the learned representations?

Key findings

  • Logsy achieves an average F1-score improvement of 0.25 over previous state-of-the-art methods in log anomaly detection.
  • Even a single auxiliary log sample is sufficient to regularize the hyperspherical loss and prevent trivial solutions, indicating strong inductive bias from the loss function.
  • Including as little as 2% labeled anomalies from the target system boosts the F1-score to 0.8, demonstrating high sample efficiency of the method.
  • The learned log embeddings significantly enhance traditional methods: replacing TF-IDF with Logsy embeddings improves PCA’s F1-score by 28.2% on average.
  • T-SNE visualization confirms that normal logs are tightly clustered near the center of the hypersphere, while anomalies are dispersed outward, validating the geometric intent of the hyperspherical loss.
  • The method generalizes well to unseen logs, as evidenced by consistent performance gains across multiple benchmark datasets including Blue Gene/L, Thunderbird, and Spirit.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.