[论文解读] LILAC: Log Parsing using LLMs with Adaptive Parsing Cache
LILAC 是一种新颖的日志解析框架,利用大语言模型(LLMs)并结合自适应解析缓存,实现高精度且高效的日志解析。通过分层候选采样技术获取高质量的上下文学习示范,并动态缓存/刷新已解析的模板,LILAC 在最先进方法的基础上将 F1 分数提升 69.5%,同时将 LLM 查询次数减少数个数量级。
Log parsing transforms log messages into structured formats, serving as the prerequisite step for various log analysis tasks. Although a variety of log parsing approaches have been proposed, their performance on complicated log data remains compromised due to the use of human-crafted rules or learning-based models with limited training data. The recent emergence of powerful large language models (LLMs) demonstrates their vast pre-trained knowledge related to code and logging, making it promising to apply LLMs for log parsing. However, their lack of specialized log parsing capabilities currently hinders their accuracy in parsing. Moreover, the inherent inconsistent answers, as well as the substantial overhead, prevent the practical adoption of LLM-based log parsing. To address these challenges, we propose LILAC, the first practical log parsing framework using LLMs with adaptive parsing cache. To facilitate accurate and robust log parsing, LILAC leverages the in-context learning (ICL) capability of the LLM by performing a hierarchical candidate sampling algorithm and selecting high-quality demonstrations. Furthermore, LILAC incorporates a novel component, an adaptive parsing cache, to store and refine the templates generated by the LLM. It helps mitigate LLM's inefficiency issue by enabling rapid retrieval of previously processed log templates. In this process, LILAC adaptively updates the templates within the parsing cache to ensure the consistency of parsed results. The extensive evaluation on public large-scale datasets shows that LILAC outperforms state-of-the-art methods by 69.5% in terms of the average F1 score of template accuracy. In addition, LILAC reduces the query times to LLMs by several orders of magnitude, achieving a comparable efficiency to the fastest baseline.
研究动机与目标
- 解决基于大语言模型的日志解析在真实系统中准确率低和推理成本高的问题。
- 克服大语言模型在处理大规模、复杂日志数据时存在的不一致性和低效性问题。
- 通过仅需少量人工标注示范的高效上下文学习,减少对大规模标注数据的依赖。
- 通过一种新颖的自适应解析缓存机制,提升解析的鲁棒性和效率。
- 实现大语言模型在生产环境日志分析流水线中的实际部署。
提出的方法
- 通过分层候选采样算法选择高质量的日志消息示范,利用上下文学习(ICL)技术。
- 采用自适应解析缓存机制,存储并检索先前生成的日志模板,减少冗余的 LLM 查询。
- 引入缓存匹配机制,通过语义相似度将新日志消息与现有模板对齐,确保一致性。
- 应用自适应模板更新机制,随时间推移对缓存模板进行优化和演化,提升长期解析一致性。
- 使用少量手动标注的日志消息(例如 32 个)启动 ICL 过程,最大限度减少标注开销。
- 结合 LLM 推理与基于缓存的检索,平衡准确率与效率,实现接近基线的处理速度。
实验结果
研究问题
- RQ1在无需大量微调或大规模标注数据的前提下,大语言模型能否被有效且高效地用于日志解析?
- RQ2在重复推理过程中,如何缓解大语言模型在日志解析中固有的不一致性?
- RQ3自适应缓存机制在多大程度上可减少 LLM 查询量,同时保持高解析准确率?
- RQ4极小规模的标注样本集是否足以通过上下文学习实现高性能的日志解析?
- RQ5在真实世界数据集上,所提出的框架与最先进日志解析器相比,在准确率和效率方面表现如何?
主要发现
- LILAC 在公开的大规模数据集上,平均 F1 分数比最先进日志解析方法高出 69.5%。
- 该框架将 LLM 查询次数减少数个数量级,接近最快非 LLM 基线方法的效率。
- 仅使用 32 个标注日志消息,LILAC 即实现显著提升的解析准确率,证明了其 ICL 和缓存策略的有效性。
- 自适应解析缓存确保了在重复查询中模板生成的一致性,解决了基于大语言模型解析的关键局限。
- LILAC 在性能上优于现有基于大语言模型的方法(如 LogDiv 和 LLM-Parsing),后者缺乏缓存机制且面临高查询开销。
- 该框架在复杂的真实世界日志数据集上仍保持高准确率,展现出良好的鲁棒性和可扩展性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。