arXiv:2505.13496cs.AIcs.CL2025-05ICML被引 7

用自注意力语言模型检测日志异常,无需标注数据和解析

ADALog: Adaptive Unsupervised Anomaly detection in Logs with Self-attention Masked Language Model

  • 基于Transformer的掩码语言建模,捕捉日志内部语义关系
  • 通过重构概率生成日志级分数,自适应百分位阈值提升泛化能力
  • 适合真实环境日志异常检测,尤其适用于无标签场景

现代软件系统产生大量异构、动态格式的日志数据,具有碎片化事件序列和多变的时间模式,使异常检测既关键又具挑战。为应对这些复杂性,我们提出ADALog,一种自适应的无监督异常检测框架,适用于多样化的实际环境。与依赖日志解析、严格序列依赖或标注数据的传统方法不同,ADALog直接处理未结构化日志,提取日志内上下文关系,并对正常数据进行自适应阈值设定。该方法采用基于Transformer的预训练双向编码器,通过掩码语言建模任务微调正常日志,以捕捉领域特定的句法和语义模式,用于精准异常检测。异常通过词元级重构概率聚合为日志级得分,并采用仅基于正常数据校准的自适应百分位阈值,使模型能动态适应系统行为变化,避免传统系统中僵化的启发式阈值。我们在BGL、Thunderbird和Spirit基准数据集上评估了ADALog,结果显示其具备强泛化能力,性能优于现有先进有监督和无监督方法。消融实验进一步分析了掩码策略、微调和词元位置对模型行为与可解释性的影响。

原文摘要 · Abstract (English)

Modern software systems generate extensive heterogeneous log data with dynamic formats, fragmented event sequences, and varying temporal patterns, making anomaly detection both crucial and challenging. To address these complexities, we propose ADALog, an adaptive, unsupervised anomaly detection framework designed for practical applicability across diverse real-world environments. Unlike traditional methods reliant on log parsing, strict sequence dependencies, or labeled data, ADALog operates on individual unstructured logs, extracts intra-log contextual relationships, and performs adaptive thresholding on normal data. The proposed approach utilizes a transformer-based, pretrained bidirectional encoder with a masked language modeling task, fine-tuned on normal logs to capture domain-specific syntactic and semantic patterns essential for accurate anomaly detection. Anomalies are identified via token-level reconstruction probabilities, aggregated into log-level scores, with adaptive percentile-based thresholding calibrated only on normal data. This allows the model to dynamically adapt to evolving system behaviors while avoiding rigid, heuristic-based thresholds common in traditional systems. We evaluate ADALog on benchmark datasets BGL, Thunderbird, and Spirit, showing strong generalization and competitive performance compared to state-of-the-art supervised and unsupervised methods. Additional ablation studies examine the effects of masking, fine-tuning, and token positioning on model behavior and interpretability.

日志异常检测自注意力无监督学习Transformer

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。