Log-based Anomaly Detection with Deep Learning: How Far Are We?

Van-Hoang Le, Hongyu ZhangICSE 2022 · DOI

TL;DR

Recent deep learning models claim near-perfect accuracy at detecting system anomalies from logs, but this paper reveals those claims are often built on flawed evaluation setups. By systematically re-evaluating five state-of-the-art models, the authors show that issues like data leakage, extreme class imbalance, and log parsing noise significantly degrade real-world performance, proving that log-based anomaly detection is still far from solved.

What Problem Does This Paper Address?

Modern, large-scale software systems generate massive volumes of unstructured console logs. When a system fails, engineers rely on these logs to troubleshoot. To automate this tedious process, researchers have proposed various deep learning (DL) models that claim incredible performance (often reporting F-measures above 0.90).

However, the authors of this paper noticed a glaring gap: these models are typically evaluated under idealized laboratory conditions. In the real world, log data arrives chronologically, anomalies are incredibly rare (highly imbalanced classes), and the data is noisy due to upstream log parsing errors or human mislabeling. This paper aims to answer a critical question: Are deep learning-based log anomaly detection methods actually as good as they claim when subjected to real-world constraints?

Methods

The authors conducted a rigorous, controlled evaluation of five representative state-of-the-art DL models, categorizing them into two main approaches:

  • Forecasting-based models: DeepLog (uses an LSTM to predict the next log event) and LogAnomaly (uses an LSTM combined with a custom word embedding method called template2vec).
  • Classification-based models: PLELog (uses an attention-based GRU), LogRobust (uses an attention-based Bi-LSTM with FastText embeddings), and a standard CNN architecture.

Instead of just replicating the original papers' setups, the authors systematically varied five experimental dimensions: training data selection strategy (random vs. chronological splitting), log grouping methods (fixed, sliding, or session windows), class imbalance ratios, data noise levels (mislabeled logs and parsing errors), and online early-detection capabilities.

Datasets

The evaluation spans four widely used public system log datasets from Loghub:

  • HDFS: Hadoop Distributed File System logs (11.1M messages), grouped by execution path (block_id).
  • BGL: Blue Gene/L supercomputer logs (4.7M messages), manually labeled line-by-line.
  • Spirit: Supercomputing system logs (sampled first 5M lines).
  • Thunderbird: Supercomputing system logs (sampled 10M continuous lines).

To test specific hypotheses, the authors also generated synthetic variations of these datasets to simulate different levels of class imbalance (from 0.1% to 15% anomaly ratios) and training noise (1% to 10% mislabeled data).

Key Insights and Ideas

  • The Danger of Random Splitting: Many SOTA papers shuffle log sequences randomly before splitting them into training and testing sets. This causes severe data leakage, allowing models to look into the "future" to predict the past. Real-world deployments must use chronological splitting.
  • Fragility to Noise: Supervised models are incredibly fragile to labeling errors. Even a tiny 1% noise rate in the training labels causes a massive drop in performance.
  • Windowing Matters: Grouping logs by fixed time windows (e.g., 1 hour) makes model performance highly unstable. Grouping logs by explicit execution identifiers (session windows, like block_id in HDFS) yields far superior and more robust results because it preserves the logical flow of a program.
  • The Illusion of the F-Measure: In highly imbalanced datasets, standard metrics like Precision, Recall, and F-measure can paint an overly optimistic picture. The authors argue that Specificity (the ability to correctly identify normal sequences) must be reported to accurately measure the rate of exhausting false alarms.

Key Results

  • Performance Drops Under Real Conditions: When switching from random to chronological data splitting on the BGL dataset, DeepLog’s F-measure plummeted from 0.927 to 0.426.
  • The Impact of 1% Noise: On the HDFS dataset, introducing just 1% of mislabeled logs caused the F-measures of LogRobust and CNN to drop drastically by 37.2% and 36.2%, respectively.
  • Early Detection Trade-offs: Forecasting-based models (DeepLog and LogAnomaly) excel at early detection. In a 100-log window, DeepLog raised an anomaly alert after examining an average of just 14.3 logs, whereas classification-based models like PLELog required 64 logs before triggering an alarm.
[Timeline for Anomaly Detection in a 100-Log Window]
Beginning ───────────────────────────────────────────────────────────► End
   │          │                                         │
   ▼          ▼                                         ▼
DeepLog   LogAnomaly                                  PLELog
(11 logs) (15 logs)                                 (64 logs)

Limitations and Future Work

While comprehensive, this study only evaluated five models with publicly available source code and relied on older, static datasets.

The authors point out several critical directions for future research:

  1. Semantic Understanding of Evolving Logs: Software updates constantly change log print statements. Future models need to understand the semantic meaning of entire log messages rather than relying on rigid, pre-parsed log templates.
  2. Unsupervised/Semi-Supervised Learning: Because manual labeling is too expensive and supervised models are highly sensitive to noise, we need better unsupervised techniques that don't sacrifice accuracy.
  3. Graph-based Relationships: Instead of treating logs as simple linear sequences, future work should explore structural, logical, and concurrent relationships between different logging components.

Summary updated

BibTeX
@inproceedings{le2022log,
  author = {Van-Hoang Le and Hongyu Zhang},
  title = {{Log-based Anomaly Detection with Deep Learning: How Far Are We?}},
  booktitle = {ICSE},
  year = {2022},
  doi = {10.1145/3510003.3510155},
}
Figure