LLMParser: An Exploratory Study on Using Large Language Models for Log Parsing
作者: Zeyang Ma, An Ran Chen, Dong Jae Kim, Tse-Hsun Chen, Shaowei Wang
分类: cs.SE, cs.AI
发布日期: 2024-04-27
💡 一句话要点
提出LLMParser以解决日志解析准确性问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 日志解析 大型语言模型 生成性模型 少量样本调优 软件开发 系统监控
📋 核心要点
- 现有日志解析方法在处理多样化日志格式时准确性不足,影响后续分析任务的效果。
- 论文提出LLMParser,利用大型语言模型和少量样本调优技术来提高日志解析的准确性。
- 实验结果显示,LLMParser在16个开源系统上实现了96%的平均解析准确率,优于现有解析器。
📝 摘要(中文)
日志在现代软件开发中扮演着重要角色,日志解析是许多基于日志的分析的第一步,涉及从非结构化日志数据中提取结构化信息。传统的日志解析器在解析日志时面临格式多样性带来的挑战,影响下游分析任务的性能。本文探讨了使用大型语言模型(LLMs)进行日志解析的潜力,提出了基于生成性LLMs和少量样本调优的LLMParser。通过对16个开源系统的评估,LLMParser的解析准确率显著高于现有最先进的解析器,平均达到96%。我们还进行了全面的实证分析,发现较小的LLMs在某些情况下可能比复杂的LLMs更有效,并指出使用其他系统日志预训练的LLMs并不总能提高解析准确性。
🔬 方法详解
问题定义:本论文旨在解决传统日志解析器在面对多样化日志格式时的准确性问题。现有方法往往无法有效提取结构化信息,导致下游分析任务性能下降。
核心思路:论文的核心思路是利用大型语言模型(LLMs)进行日志解析,通过生成性LLMs和少量样本调优来提升解析的准确性和效率。这样的设计旨在充分利用LLMs在自然语言处理中的优势,适应多样化的日志格式。
技术框架:LLMParser的整体架构包括数据预处理、模型选择、少量样本调优和解析结果生成等主要模块。通过对不同LLMs的比较,选择最适合的模型进行日志解析。
关键创新:最重要的技术创新点在于将LLMs应用于日志解析领域,并通过实证分析揭示了模型大小和预训练数据对解析准确性的影响。这与传统解析器的固定规则和模板方法有本质区别。
关键设计:在参数设置上,论文使用了Flan-T5-small、Flan-T5-base、LLaMA-7B和ChatGLM-6B等四种LLMs。实验中发现,较小的模型在某些情况下表现更佳,且预训练数据的选择对解析效果有显著影响。
🖼️ 关键图片
📊 实验亮点
实验结果表明,LLMParser在16个开源系统上的平均解析准确率达到96%,显著高于现有最先进的解析器。此外,研究发现Flan-T5-base在解析速度上优于LLaMA-7B,且使用预训练的Flan-T5-base能够提高准确性,而LLaMA的预训练则导致准确性下降近55%。
🎯 应用场景
该研究的潜在应用领域包括软件开发、系统监控和故障排查等场景。通过提高日志解析的准确性,LLMParser能够帮助开发者更有效地分析和处理日志数据,从而提升软件系统的可靠性和维护效率。未来,LLMParser的技术可以扩展到其他领域,如网络安全和大数据分析,具有广泛的实际价值。
📄 摘要(原文)
Logs are important in modern software development with runtime information. Log parsing is the first step in many log-based analyses, that involve extracting structured information from unstructured log data. Traditional log parsers face challenges in accurately parsing logs due to the diversity of log formats, which directly impacts the performance of downstream log-analysis tasks. In this paper, we explore the potential of using Large Language Models (LLMs) for log parsing and propose LLMParser, an LLM-based log parser based on generative LLMs and few-shot tuning. We leverage four LLMs, Flan-T5-small, Flan-T5-base, LLaMA-7B, and ChatGLM-6B in LLMParsers. Our evaluation of 16 open-source systems shows that LLMParser achieves statistically significantly higher parsing accuracy than state-of-the-art parsers (a 96% average parsing accuracy). We further conduct a comprehensive empirical analysis on the effect of training size, model size, and pre-training LLM on log parsing accuracy. We find that smaller LLMs may be more effective than more complex LLMs; for instance where Flan-T5-base achieves comparable results as LLaMA-7B with a shorter inference time. We also find that using LLMs pre-trained using logs from other systems does not always improve parsing accuracy. While using pre-trained Flan-T5-base shows an improvement in accuracy, pre-trained LLaMA results in a decrease (decrease by almost 55% in group accuracy). In short, our study provides empirical evidence for using LLMs for log parsing and highlights the limitations and future research direction of LLM-based log parsers.