[论文解读] Robust and Transferable Anomaly Detection in Log Data using Pre-Trained Language Models
本文提出了一种即插即用的框架,利用预训练语言模型(如 BERT、GPT-2、XL-Net)生成语义感知的日志向量嵌入,实现鲁棒且可迁移的日志异常检测。通过利用迁移学习和上下文感知表示,该方法在应对因软件更新导致的日志消息变化时表现出高精度和强鲁棒性,相较于传统基于模板的方法,在准确率和跨演化系统日志的泛化能力方面表现更优。
Anomalies or failures in large computer systems, such as the cloud, have an impact on a large number of users that communicate, compute, and store information. Therefore, timely and accurate anomaly detection is necessary for reliability, security, safe operation, and mitigation of losses in these increasingly important systems. Recently, the evolution of the software industry opens up several problems that need to be tackled including (1) addressing the software evolution due software upgrades, and (2) solving the cold-start problem, where data from the system of interest is not available. In this paper, we propose a framework for anomaly detection in log data, as a major troubleshooting source of system information. To that end, we utilize pre-trained general-purpose language models to preserve the semantics of log messages and map them into log vector embeddings. The key idea is that these representations for the logs are robust and less invariant to changes in the logs, and therefore, result in a better generalization of the anomaly detection models. We perform several experiments on a cloud dataset evaluating different language models for obtaining numerical log representations such as BERT, GPT-2, and XL. The robustness is evaluated by gradually altering log messages, to simulate a change in semantics. Our results show that the proposed approach achieves high performance and robustness, which opens up possibilities for future research in this direction.
研究动机与目标
- 解决大规模系统在频繁软件更新和日志演化背景下日志异常检测的挑战。
- 克服基于模板和关键词匹配方法在日志语义变化或软件升级下失效的局限性。
- 通过利用预训练语言模型实现对未见日志模式的泛化,减轻异常检测中的冷启动问题。
- 评估不同预训练语言模型及学习目标(回归 vs. 分类)在日志表示学习中的有效性。
- 开发一种可迁移的框架,即使在系统更新或预处理噪声导致日志消息改变时,仍能保持高性能。
提出的方法
- 利用预训练的一般用途语言模型(BERT、GPT-2、XL-Net)将原始日志消息编码为密集的、语义感知的向量表示。
- 应用双向LSTM网络,利用学习到的嵌入表示建模日志序列中的顺序和上下文依赖关系。
- 采用两种学习目标训练异常检测模型:(1) 回归任务以重建日志嵌入,(2) 分类任务以区分正常与异常日志序列。
- 实施模型迁移策略,使框架能够复用先前日志数据的知识,以适应软件更新后的新型日志分布。
- 通过系统性地修改日志消息(如同义词替换、顺序重排)实施数据增强,以模拟真实世界的变化并评估鲁棒性。
- 使用数值指标(精确率、召回率、F1)评估在不同日志消息修改程度和学习目标下的性能表现。
实验结果
研究问题
- RQ1不同预训练语言模型(BERT、GPT-2、XL-Net)在生成用于异常检测的有效日志嵌入方面表现如何?
- RQ2在日志演化背景下,回归与分类哪种学习目标能带来更好的性能和鲁棒性?
- RQ3该框架在软件更新或日志消息修改后,对未见日志模式的泛化能力有多强?
- RQ4在日志消息修改程度不同的情况下(如15%语义变化),模型在精确率、召回率和F1分数上的表现如何?
- RQ5该框架能否在无新系统版本历史日志可用的冷启动场景下有效降低误报率?
主要发现
- BERT在两种学习目标下均优于GPT-2和XL-Net,尤其在日志消息发生显著变化时表现出更强的鲁棒性和泛化能力。
- 基于分类的学习目标获得更高的F1分数(最高达0.81),优于回归方法(最高F1为0.68),表明其能更好地区分正常与异常日志模式。
- 在B-similar修改场景(小幅度变化)下,BERT的F1分数保持在0.75(分类任务),而GPT-2下降至0.43,凸显BERT的稳定性。
- 在B-different场景(大语义变化)下,BERT在回归任务中F1得分为0.68,分类任务中达0.81,显著优于GPT-2和XL-Net。
- 模型迁移方法成功降低了软件更新后的误报率,BERT模型在各类修改后的日志分布中表现出最一致的性能。
- 该框架对日志消息修改表现出极强的鲁棒性,所有条件下F1分数均保持在0.6以上,证明其在真实部署场景中具备良好的可迁移性和鲁棒性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。