CLAD: Efficient Log Anomaly Detection Directly on Compressed Representations
Organizations: Guangzhou University
Abstract
The explosive growth of system logs makes streaming compression essential, yet existing log anomaly detection (LAD) methods incur severe pre-processing overhead by requiring full decompression and parsing. We introduce CLAD, the first deep learning framework to perform LAD directly on compressed byte streams. CLAD bypasses these bottlenecks by exploiting a key insight: normal logs compress into regular byte patterns, while anomalies systematically disrupt them. To extract these multi-scale deviations from opaque bytes, we propose a purpose-built architecture integrating a dilated convolutional byte encoder, a hybrid Transformer--mLSTM, and four-way aggregation pooling. This is coupled with a two-stage training strategy of masked pre-training and focal-contrastive fine-tuning to effectively handle severe class imbalance. Evaluated across five datasets, CLAD achieves a state-of-the-art average F1-score of 0.9909 and outperforms the best baseline by 2.72 percentage points. It delivers superior accuracy while completely eliminating decompression and parsing overheads, offering a robust solution that generalizes to structured streaming compressors.
Figures & tables
| Dataset | Size | #Msg. | #Seq. | #Anom. |
|---|---|---|---|---|
| BGL | 0.69 GB | 4,747,963 | 47,479 | 4,802 |
| Thunderbird | 1.40 GB | 10,000,000 | 100,000 | 12,889 |
| Liberty | 1.11 GB | 10,000,000 | 100,000 | 66,438 |
| Spirit | 1.37 GB | 10,000,000 | 100,000 | 72,283 |
| HDFS | 1.47 GB | 11,175,629 | 575,061 | 16,838 |
| BGL | Thunderbird | Liberty | Spirit | HDFS | Avg. | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | Parser | Prec. | Rec. | F1 | Prec. | Rec. | F1 | Prec. | Rec. | F1 | Prec. | Rec. | F1 | Prec. | Rec. | F1 | F1 |
| CNN ( Lu et al., 2018 ) | ✔ | 0.9530 | 0.9564 | 0.9547 | 0.9986 | 0.9968 | 0.9977 | 0.9478 | 0.9990 | 0.9728 | 0.9837 | 0.9996 | 0.9916 | 0.8932 | 0.9101 | 0.9016 | 0.9637 |
| LogRobust ( Zhang et al., 2019 ) | ✔ | 0.9261 | 0.9489 | 0.9373 | 0.7385 | 0.9991 | 0.8492 | 0.9463 | 0.9994 | 0.9721 | 0.9988 | 0.9992 | 0.9990 | 0.9242 | 0.9541 | 0.9389 | 0.9393 |
| NeuralLog ( Le and Zhang, 2021 ) | ✘ | 0.9022 | 0.8250 | 0.8619 | 0.9994 | 0.9658 | 0.9823 | 0.9957 | 0.9595 | 0.9772 | 0.9874 | 0.9996 | 0.9934 | 0.9901 | 0.9967 | 0.9933 | 0.9616 |
| CLAD (Ours) | ✘ | 0.9768 | 0.9530 | 0.9645 | 0.9997 | 0.9986 | 0.9991 | 0.9970 | 0.9971 | 0.9970 | 0.9996 | 0.9999 | 0.9998 | 0.9906 | 0.9974 | 0.9940 | 0.9909 |
Anomaly Detection
Anomaly detection finds rare or unexpected patterns in data, from defective products and system faults to fraud and security threats.
See all 652 papers