[论文解读] Pinpointing Anomaly Events in Logs from Stability Testing -- N-Grams vs. Deep-Learning
本文提出并比较了一种N-gram模型和一种基于LSTM的深度学习模型,用于在稳定性测试中对单个日志事件进行异常程度评分。仅在正常日志序列上进行训练,N-gram模型在HDFS数据集上的准确率接近LSTM模型(0.904 vs. 0.900),在Android日志上的准确率也相近(0.848 vs. 0.865),但计算效率却高得多(分别仅需4–13秒 vs. 16分钟至近4小时),因此在工业级日志根本原因分析中更适合作为首选方案。
As stability testing execution logs can be very long, software engineers need help in locating anomalous events. We develop and evaluate two models for scoring individual log-events for anomalousness, namely an N-Gram model and a Deep Learning model with LSTM (Long short-term memory). Both are trained on normal log sequences only. We evaluate the models with long log sequences of Android stability testing in our company case and with short log sequences from HDFS (Hadoop Distributed File System) public dataset. We evaluate next event prediction accuracy and computational efficiency. The LSTM model is more accurate in stability testing logs (0.848 vs 0.865), whereas in HDFS logs the N-Gram is slightly more accurate (0.904 vs 0.900). The N-Gram model has far superior computational efficiency compared to the Deep model (4 to 13 seconds vs 16 minutes to nearly 4 hours), making it the preferred choice for our case company. Scoring individual log events for anomalousness seems like a good aid for root cause analysis of failing test cases, and our case company plans to add it to its online services. Despite the recent surge in using deep learning in software system anomaly detection, we found limited benefits in doing so. However, future work should consider whether our finding holds with different LSTM-model hyper-parameters, other datasets, and with other deep-learning approaches that promise better accuracy and computational efficiency than LSTM based models.
研究动机与目标
- 为解决在长期运行的稳定性测试中识别异常日志事件的挑战,此类故障发展缓慢且难以复现。
- 评估深度学习相较于经典N-gram模型在软件可靠性测试日志异常检测中是否具有显著优势。
- 通过提供事件级别的异常程度评分,支持根本原因分析,帮助工程师识别可疑日志条目。
- 在工业环境中处理大规模日志数据的约束下,优先考虑计算效率与准确率的平衡。
提出的方法
- 仅使用正常日志序列对N-gram和LSTM模型进行训练,以学习上下文相关的模式。
- 基于前序上下文对每个日志事件进行评分:概率越低,表示异常程度越高。
- 利用n-gram频次统计估算在前n-1个事件给定条件下,下一个事件的概率。
- 采用长短期记忆(LSTM)网络建模序列依赖关系,并预测序列中的下一个事件。
- 将下一个事件预测的准确率作为异常检测性能的代理指标。
- 通过评分后的日志序列可视化异常事件,以支持根本原因调查。
实验结果
研究问题
- RQ1RQ1:在检测异常日志事件方面,N-gram模型与LSTM模型哪个表现更优?
- RQ2RQ2:在日志序列异常检测中,N-gram模型的最优配置(如n值)是什么?
- RQ3RQ3:在考虑两个数据集的情况下,哪种模型在所有配置中整体准确率更高?
- RQ4RQ4:如何有效衡量并可视化单个事件的异常程度,以支持调试工作?
主要发现
- 在HDFS数据集上,N-gram模型在下一个事件预测中的准确率略高于LSTM模型(0.904 vs. 0.900)。
- 在Android稳定性测试日志中,LSTM模型在下一个事件预测中的准确率略高于N-gram模型(0.865 vs. 0.848)。
- N-gram模型在计算效率方面显著优于LSTM模型,完成相同任务所需时间仅为4–13秒,而LSTM模型则需16分钟至近4小时。
- 计算效率的差距极大有利于N-gram模型,使其在处理时间至关重要的工业部署中更具适用性。
- 尽管近年来异常检测领域趋向使用深度学习,但本研究发现,与N-gram相比,使用LSTM在软件日志中带来的实际收益有限,因为准确率提升微乎其微,而计算成本却极高。
- 公司计划将其在线稳定性测试服务中集成事件级别的异常程度评分功能,凸显其在根本原因分析中的实际价值。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。