arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.03376cs.SE
收藏

使用具有自生成上下文学习和自校正能力的LLM进行日志解析

Log Parsing using LLMs with Self-Generated In-Context Learning and Self-Correction

Yifan Wu, Siyu Yu, Ying Li

AI总结:

针对LLM日志解析器模板不准及过度依赖历史数据的问题,提出AdaParser框架,通过自生成上下文学习与模板校正器实现自适应校正,在多数据集上显著提升了解析准确率。

摘要:

日志解析将日志消息转换为结构化格式,是日志分析的关键步骤。尽管已有多种日志解析器被提出,但由于依赖人工制定的规则或受限于训练数据的基于学习的模型,它们在不断演进的日志数据上的表现仍不令人满意。大型语言模型(LLMs)的近期出现展现了在理解自然语言和代码方面的强大能力,使得将LLMs应用于日志解析具有前景。因此,已有若干研究提出了基于LLM的日志解析器。然而,LLMs可能生成不准确的模板,而现有的基于LLM的日志解析器直接使用LLM生成的模板作为解析结果,阻碍了日志解析的准确性。此外,这些日志解析器严重依赖历史日志数据作为示例,这在处理稀缺的历史日志数据或不断演进的日志数据时对维持准确性构成了挑战。为了应对这些挑战,我们提出了AdaParser,一个有效且自适应的日志解析框架,使用具有自生成上下文学习(SG-ICL)和自校正能力的LLMs。为了促进准确的日志解析,AdaParser整合了一个新颖的组件——模板校正器,它利用LLM校正其生成的模板中潜在的解析错误。此外,AdaParser维护一个由先前生成的模板组成的动态候选集作为示例,以适应不断演进的日志数据。在公开的大规模数据集上的广泛实验表明,AdaParser在所有指标上均优于最先进的方法,甚至在零样本场景中也是如此。而且,当与不同的LLMs集成时,AdaParser始终大幅提升了所使用LLMs的性能。

英文摘要:

Log parsing transforms log messages into structured formats, serving as a crucial step for log analysis. Despite a variety of log parsers that have been proposed, their performance on evolving log data remains unsatisfactory due to reliance on human-crafted rules or learning-based models with limited training data. The recent emergence of large language models (LLMs) has demonstrated strong abilities in understanding natural language and code, making it promising to apply LLMs for log parsing. Consequently, several studies have proposed LLM-based log parsers. However, LLMs may produce inaccurate templates, and existing LLM-based log parsers directly use the template generated by the LLM as the parsing result, hindering the accuracy of log parsing. Furthermore, these log parsers depend heavily on historical log data as demonstrations, which poses challenges in maintaining accuracy when dealing with scarce historical log data or evolving log data. To address these challenges, we propose AdaParser, an effective and adaptive log parsing framework using LLMs with self-generated in-context learning (SG-ICL) and self-correction. To facilitate accurate log parsing, AdaParser incorporates a novel component, a template corrector, which utilizes the LLM to correct potential parsing errors in the templates it generates. In addition, AdaParser maintains a dynamic candidate set composed of previously generated templates as demonstrations to adapt evolving log data. Extensive experiments on public large-scale datasets indicate that AdaParser outperforms state-of-the-art methods across all metrics, even in zero-shot scenarios. Moreover, when integrated with different LLMs, AdaParser consistently enhances the performance of the utilized LLMs by a large margin.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑