一句话:通过熵基样本选择、对比学习与推理优化,使小型 PLM 的日志解析效果媲美甚至超越 LLM 方法且更高效。
日志解析是将控制台日志消息归纳为日志模板的关键预处理步骤,也是自动化日志分析的前提。近期工作多采用小型预训练语言模型(如 RoBERTa)在少量标注样本上微调进行语义日志解析,但随着大语言模型流行,基于 ChatGPT 等 LLM 的上下文学习被报道取得了更好效果。本文指出小型 PLM 其实可以取得与最先进 LLM 日志解析模型相当甚至更优的性能,同时更高效、成本更低。作者提出 Unleash,包含三种增强手段:(1)基于熵的排序方法,挑选信息量最大的日志样本;(2)对比学习方法,强化微调过程;(3)推理优化方法,提升解析表现。作者在多个大规模公开日志数据集上评估,实验表明 Unleash 相较当前最先进的日志解析器既有效又高效。
Software-intensive systems often produce console logs for troubleshooting purposes. Log parsing, which aims at parsing a log message into a specific log template, typically serves as the first step toward automated log analytics. To better comprehend the semantic information of log messages, many semantic-based log parsers have been proposed. These log parsers fine-tune a small pre-trained language model (PLM) such as RoBERTa on a few labelled log samples. With the increasing popularity of large language models (LLMs), some recent studies also propose to leverage LLMs such as ChatGPT through in-context learning for automated log parsing and obtain better results than previous semantic-based log parsers with small PLMs. In this paper, we show that semantic-based log parsers with small PLMs can actually achieve better or comparable performance to state-of-the-art LLM-based log parsing models while being more efficient and cost-effective. We propose Unleash, a novel semantic-based log parsing approach, which incorporates three enhancement methods to boost the performance of PLMs for log parsing, including (1) an entropy-based ranking method to select the most informative log samples; (2) a contrastive learning method to enhance the fine-tuning process; and (3) an inference optimization method to improve the log parsing performance. We evaluate Unleash on a set of large-scale, public log datasets and the experimental results show that Unleash is effective and efficient compared to state-of-the-art log parsers.