Log-based Anomaly Detection based on EVT Theory with feedback

Jinyang Liu, Junjie Huang, Yintong Huo, Zhihan Jiang, Jiazhen Gu, Zhuangbin Chen, Cong Feng, Minzhi Yan, Michael R. Lyu · DOI

Abstract

System logs play a critical role in maintaining the reliability of software systems. Fruitful studies have explored automatic log-based anomaly detection and achieved notable accuracy on benchmark datasets. However, when applied to large-scale cloud systems, these solutions face limitations due to high resource consumption and lack of adaptability to evolving logs. In this paper, we present an accurate, lightweight, and adaptive log-based anomaly detection framework, referred to as SeaLog. Our method introduces a Trie-based Detection Agent (TDA) that employs a lightweight, dynamically-growing trie structure for real-time anomaly detection. To enhance TDA's accuracy in response to evolving log data, we enable it to receive feedback from experts. Interestingly, our findings suggest that contemporary large language models, such as ChatGPT, can provide feedback with a level of consistency comparable to human experts, which can potentially reduce manual verification efforts. We extensively evaluate SeaLog on two public datasets and an industrial dataset. The results show that SeaLog outperforms all baseline methods in terms of effectiveness, runs 2X to 10X faster and only consumes 5% to 41% of the memory resource.

Introduction

Modern cloud systems generate billions of log messages daily across millions of instances. Monitoring these logs for anomalies is vital for system reliability, but existing solutions face a "triple threat" of challenges:

  1. Resource Constraints: Cloud instances are often packed with customer applications, leaving very little overhead (sometimes just one CPU core and 200MB of RAM) for monitoring tools.
  2. Log Evolution: Software updates are frequent. In industrial settings like Huawei Cloud, roughly 14.5% of log templates are brand new every month. Static models trained on historical data quickly become obsolete.
  3. Semantic Diversity: Unlike natural language, logs are highly structured and diverse. Observations show that 85% of log message pairs share almost no semantic similarity, making traditional word-embedding approaches less effective.

Current deep learning models (like LSTMs or Transformers) are often too "heavy" for local deployment and struggle to adapt to new log types without expensive retraining. SeaLog addresses these issues by providing a lightweight, adaptive framework.

Methodology

Trie-based Detection Agent (TDA)

Instead of using a heavy neural network, SeaLog uses a Trie (prefix tree) to store and parse logs in a streaming fashion. This approach integrates parsing and detection into a single structure, avoiding the I/O and computational overhead of traditional two-step pipelines.

The architecture of the Trie-based Detection Agent (TDA), illustrating the flow from log preprocessing to anomaly scoring via a trie structure.

The TDA utilizes traversal heuristics where logs move through the Trie based on domain knowledge (e.g., log levels), token frequency, and prefix tokens. This allows the system to group similar logs into "clusters" without needing a separate, compute-intensive parsing step.

Extreme Value Theory (EVT)

To identify anomalies, the system applies the Generalized Extreme Value (GEV) distribution to the occurrence counts of log templates. Since anomalies are, by definition, rare "extreme" events, EVT provides a mathematically robust way to flag them using only three parameters ($\mu, \sigma, \xi$), making it incredibly memory-efficient.

Expert Feedback Loop

To handle the "cold start" problem of new log templates and the continuous evolution of logs, SeaLog incorporates an expert feedback loop. When a new log type appears, it might initially receive a high anomaly score. An expert—either a human engineer or an AI—provides a label and a confidence score, which SeaLog incorporates to refine its future detections.

The expert feedback loop involving LLMs (ChatGPT), on-call engineers, and a shared knowledge base.

One of the most striking findings is that Large Language Models (LLMs) like ChatGPT can provide feedback nearly as well as human experts. In a case study of 200 logs, ChatGPT achieved an F1 score of 0.816, suggesting it can significantly reduce the manual workload for on-call engineers.

Evaluation

The researchers evaluated SeaLog on three datasets: the public BGL (Blue Gene/L) and Thunderbird (Sandia National Labs) datasets, and a proprietary Industry Dataset from Huawei Cloud containing 1.5 million lines of logs and 60 types of real-world system problems.

Key Results

SeaLog consistently outperformed both traditional machine learning (SVM, Decision Trees) and modern deep learning (DeepLog, LogAnomaly, NeuralLog) baselines:

  • Effectiveness: It achieved F1 scores between 0.908 and 0.990 across all datasets.
  • Speed: It runs 2x to 10x faster than state-of-the-art deep learning methods.
  • Memory Footprint: It consumes only 5% to 41% of the memory required by deep learning models, fitting comfortably within the 200MB limit found in many production instances.
  • Online Stability: In "online" tests where logs evolve over time, SeaLog maintained high accuracy while other models' performance degraded significantly.

Conclusion and Future Work

SeaLog demonstrates that a combination of efficient data structures (Tries), robust statistical theory (EVT), and modern AI feedback (LLMs) can solve the challenges of large-scale log monitoring.

However, some limitations remain. For instance, "burst anomalies"—where a specific error occurs thousands of times in a short burst—might eventually be classified as "normal" by the EVT model. Future work will focus on integrating other system metrics (like heartbeats) to catch these failures and refining LLM prompt engineering to further improve the AI's role as a proxy expert.

Summary updated

BibTeX
@misc{liu2023log,
  author = {Jinyang Liu and Junjie Huang and Yintong Huo and Zhihan Jiang and Jiazhen Gu and Zhuangbin Chen and Cong Feng and Minzhi Yan and Michael R. Lyu},
  title = {{Log-based Anomaly Detection based on EVT Theory with feedback}},
  year = {2023},
  eprint = {2306.05032},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.05032},
}
Figure