K 4 : Online Log Anomaly Detection Via Unsupervised Typicality Learning

Weicong Chen * , Vikash Singh * , Zahra Rahmani, Debargha Ganguly, Mohsen Hariri, Vipin Chaudhary Case Western Reserve University, Cleveland, OH, USA {weicong, vikash, zahra, debargha, mxh1029, vipin}@case.edu · 2025

Read K 4 : Online Log Anomaly Detection Via Unsupervised Typicality Learning by Weicong Chen * , Vikash Singh * , Zahra Rahmani, Debargha Ganguly, Mohsen Hariri, Vipin Chaudhary Case Western Reserve University, Cleveland, OH, USA {weicong, vikash, zahra, debargha, mxh1029, vipin}@case.edu (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-20051.txt.

Introduction

Weicong Chen and co-authors present a fast guard that spots odd entries in computer logs as they stream in, in a 2025 paper. Logs are the diary of a system, and odd lines can mark attacks or failures. Older spotters are slow, lean on brittle text parsing, or are tested in ways no live system faces. Their framework, K4, skips parsing entirely and works from raw text embeddings.

Each log line is squeezed into four summary numbers drawn from its nearest neighbors: precision, recall, density, and coverage, the names the authors give them. Small detectors then score those numbers for oddness, with no retraining needed per site. Under a live-style test protocol, the method set new accuracy marks and ran orders of magnitude faster than rivals, with training under four seconds. The authors pitch it for always-on system watch.

Catalog record

CREATORWeicong Chen * , Vikash Singh * , Zahra Rahmani, Debargha Ganguly, Mohsen Hariri, Vipin Chaudhary Case Western Reserve University, Cleveland, OH, USA {weicong, vikash, zahra, debargha, mxh1029, vipin}@case.edu
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE50 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2507-20051

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

K 4 : Online Log Anomaly Detection Via Unsupervised Typicality Learning Thanks: This work was supported in part by the NSF research grant #2137603, #2112606, #2117439, and #2320952. Weicong Chen * , Vikash Singh * , Zahra Rahmani, Debargha Ganguly, Mohsen Hariri, Vipin Chaudhary Case Western Reserve University, Cleveland, OH, USA {weicong, vikash, zahra, debargha, mxh1029, vipin}@case.edu Abstract Log anomaly detection (LogAD) is crucial for identifying failures and threats in large-scale computing and cyberinfrastructure systems. However, most existing LogAD approaches suffer from key limitations: they depend on slow and error-prone log parsing, employ tightly coupled end-to-end pipelines, often require supervision for improved detection performance, and rely on flawed single-pass evaluation protocols that fail to reflect the temporal dynamics of real-world online detection. These issues significantly hinder scalability, adaptability, and the practical deployment of solutions. To address these limitations, we introduce K 4 ( K nowing the Un k nown by K nowing only the K nown), a fully unsupervised, parser-independent, and representation-agnostic LogAD framework designed for high-performance online detection. At its core, K 4 is grounded in a novel formulation based on representation-level typicality estimation , which transforms arbitrary log embeddings into compact and interpretable four-dimensional descriptors: Precision, Recall, Density, and Coverage (PRDC), which are swiftly computed via GPU-acceleration into geometric k k -nearest neighbor statistics. These descriptors inform lightweight, modular detectors, including KDE, GMM, OCSVM, and a new adaptation of DeepSVDD, which enables efficient and accurate anomaly scoring without relying on structured formats or log representation retraining. To support realistic deployment scenarios, we also propose a principled chunk-based evaluation protocol that mimics online log ingestion, alleviates the performance overestimation and dataset undercoverage issues of prior single-pass evaluations, and enables reproducible benchmarking across datasets with varying anomaly densities. Using this setup, we conduct over 125,000 experiments across three real-world datasets (HDFS, BGL, Thunderbird), six pre-trained embedding models, four detectors, and multiple training and log sampling configurations. Compared to six representative baseline methods spanning supervised, semi-supervised, self-supervised, and unsupervised paradigms, K 4 consistently sets new state-of-the-art results (AUROC: 0.995–0.999, F1: 0.989–0.992) and outperforms all baselines by large margins, while keeping detector training under 4 seconds and per-sample inference latency as low as 4 μ \mu s, which are orders of magnitude faster than the most competitive alternatives. * * footnotetext: These authors contributed equally to this work. I Introduction Logs are essential artifacts in computing systems, recording the operational behavior of applications, kernels, and user activities. In large-scale environments such as high-performance computing (HPC) systems, cloud infrastructures, and edge platforms, automated log anomaly detection (LogAD) is vital for prompt error recovery, root-cause diagnosis, and proactive system management [ 1 , 2 , 3 ] . With the recent surge in language models and generative AI, a growing body of work [ 4 , 5 , 6 , 7 , 8 , 9 ] has begun leveraging AI techniques to capture semantic patterns in log sequences, aiming to enable more effective LogAD. These methods typically follow a structured pipeline consisting of four stages: (1) Log parsing, where raw logs are converted into structured templates by masking variable fields (e.g., timestamps, node IDs); (2) Log grouping, where templates are assembled into fixed-size or session-based sequences; (3) Representation generation, which uses learned or pre-trained encoding models (e.g., LSTM [ 4 ] , FastText [ 7 ] , Transformers [ 6 , 8 ] ) to encode log sequences into either sequential, quantitative, or semantic embeddings; and (4) Classification model(s), which model representations and discriminate anomalous logs or log sequences from normal ones through supervised, semi-supervised, or unsupervised objectives. Real-World LogAD – Needs and Gaps: Real-world LogAD systems must satisfy several operational requirements. First, they should not merely excel in post hoc analyses of static datasets, but instead deliver accurate detection in online , continuously streaming log environments. Second, they should not wait for large volumes of historical data to accumulate, but rather support fast cold-start using minimal initial logs. Third, they should not require labeled data, but operate in a fully autonomous manner. Fourth, they must not impose heavy runtime burdens, but remain computationally efficient , as LogAD is expected to be a ubiquitous and persistent task across system modules. Despite extensive research, existing LogAD approaches fall short of these practical requirements. As illustrated in the dashed enclosure of Figure 1 , we identify four critical gaps: (1) Better Detection Only Comes With Supervision: As highlighted in prior studies [ 10 , 8 , 11 ] , supervised and semi-supervised LogAD methods consistently outperform self-supervised and unsupervised approaches due to their ability to learn discriminative features from labeled anomaly examples. However, their reliance on labeled data misaligns with real-world deployment needs. Achieving, or even surpassing, supervised-level accuracy without labeled data remains a key challenge for practical, online LogAD. (2) Widespread Reliance on Log Parsers: A large body of LogAD studies [ 4 , 5 , 6 , 7 , 10 , 8 , 11 , 9 ] necessitates structured templates generated by log parsers such as Drain [ 12 ] , Spell [ 13 ] , or FT-Tree [ 14 ] . These tools require global knowledge of log formats and thus typically rely on access to large offline corpora. In online detection environments, parser errors and format drift inject structural noise that degrades downstream detection quality [ 10 ] . (3) Rigid and Inefficient Coupling of Representation Models and Detection Architectures: Many deep learning-based LogAD systems [ 6 , 4 , 5 , 7 , 9 ] rigidly couple encoders (e.g., LSTM, BERT) with specific detectors via joint training, limiting modularity and generalization. These pipelines thus force detectors to infer from high-dimensional embeddings, resulting in high computational cost. More recent works [ 8 , 15 ] frame detection as supervised classification with large decoder-only LLMs, further increasing inference overhead and abandoning modular detection altogether. (4) Flawed Single-pass Evaluation Protocols: Most LogAD studies evaluate public log datasets in a single pass, where each dataset typically contains millions to hundreds of millions of log lines [ 16 ] . Some studies [ 5 , 7 , 10 , 11 , 8 ] use the majority portion of the dataset (up to 80%) for training, which contradicts the objective of fast cold-start and leads to overly optimistic estimates of detection performance. Others [ 4 , 6 , 9 ] use a smaller chronological fraction (1–10%), which, despite still involving a substantial volume of logs, fails to capture the inherent variability within each dataset. Contributions: Motivated by these significant gaps in existing LogAD solutions, we introduce K 4 ( K nowing the Un k nown by K nowing only the K nown) , a novel framework that offers high-performance, modular, and robust anomaly detection that meets stringent real-world deployment needs. As shown following the red arrows in Figure 1 , our contributions include: Fig. 1 : K 4 ’s Novelty, Architecture, and Performance Highlights. K 4 addresses key limitations in prior LogAD systems: supervision vs. performance trade-offs, parser reliance, rigid pipelines, and unrealistic evaluation. It introduces a novel representation-level anomaly scoring framework using geometric typicality statistics (PRDC), computed via kNN manifold estimation (Detailed in Section III ). The modular design enables flexible embeddings (e.g., TF-IDF, Qwen3-Embedding) and

Read the complete text