用大模型分析日志,自动发现系统异常,效果优于传统方法。
LogLLM: Log-based Anomaly Detection Using Large Language Models
- 结合BERT与Llama,通过语义向量对齐提升日志理解能力。
- 在4个公开数据集上超越现有方法,对不规则日志仍具高精度。
- 无需日志模板解析,直接用正则预处理,流程更简洁高效。
软件系统常通过日志记录运行时信息以辅助排错。基于日志的异常检测已成为关键研究方向,旨在通过日志数据识别系统问题,提升软件可靠性。传统深度学习方法难以捕捉日志中嵌入的自然语言语义信息。本文提出LogLLM,一种基于大语言模型(LLM)的日志异常检测框架。该框架采用BERT提取日志消息的语义向量,利用Llama(基于Transformer解码器的模型)对日志序列进行分类,并引入投影器对齐BERT与Llama的向量表示空间,实现对日志语义的一致理解。与需日志解析提取模板的传统方法不同,LogLLM直接使用正则表达式预处理日志消息,简化流程。框架通过创新的三阶段训练策略提升性能与适应性。在四个公开数据集上的实验结果表明,LogLLM显著优于当前最优方法,即使面对不稳定日志也能准确捕捉语义并检测异常。
原文摘要 · Abstract (English)
Software systems often record important runtime information in logs to help with troubleshooting. Log-based anomaly detection has become a key research area that aims to identify system issues through log data, ultimately enhancing the reliability of software systems. Traditional deep learning methods often struggle to capture the semantic information embedded in log data, which is typically organized in natural language. In this paper, we propose LogLLM, a log-based anomaly detection framework that leverages large language models (LLMs). LogLLM employs BERT for extracting semantic vectors from log messages, while utilizing Llama, a transformer decoder-based model, for classifying log sequences. Additionally, we introduce a projector to align the vector representation spaces of BERT and Llama, ensuring a cohesive understanding of log semantics. Unlike conventional methods that require log parsers to extract templates, LogLLM preprocesses log messages with regular expressions, streamlining the entire process. Our framework is trained through a novel three-stage procedure designed to enhance performance and adaptability. Experimental results across four public datasets demonstrate that LogLLM outperforms state-of-the-art methods. Even when handling unstable logs, it effectively captures the semantic meaning of log messages and detects anomalies accurately.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。