paperbot · PL 论文追踪

全部论文 待读 收藏

P2 DivLog: Log Parsing with Prompt Enhanced In-Context Learning

DivLog:基于提示增强上下文学习的日志解析
ICSE Proceedings of the IEEE/ACM 46th International Conference on Software Engineering2024匹配度 3/10 · 论文用 LLM 的上下文学习与提示工程做日志解析,属于 LLM 用于软件工程/日志分析,但并非静态分析、形式化验证、浮点程序分析或贝叶斯程序分析,与用户研究方向的核心交叉点较远。引用 69 inbox
Junjielong Xu, Ruichun Yang, Yintong Huo, Chengyu Zhang, Pinjia He
crossref: 2026-09-12

AI 速览

一句话:提出 DivLog,用大模型上下文学习与多样性示例选择实现免训练、高精度日志模板解析。

日志解析从半结构化日志中抽取模板以生成结构化日志,是自动化日志分析的关键第一步。现有方法或依赖启发式与手工特征,难以适应不同系统日志;或依赖有监督模型调参,受固定训练样本限制,跨日志源效果次优。本文提出 DivLog,利用大语言模型的上下文学习能力:先按多样性采样少量离线日志作为候选,解析时为每个目标日志选取5个有标注候选构造提示,以无需训练方式生成模板,并设计简洁有效的提示格式提升模板质量。在16个公开数据集上,DivLog 平均达到98.1%解析准确率、92.1%精确模板准确率和92.9%召回模板准确率,取得最优性能。

问题
现有日志解析器受限于启发式/手工特征泛化差,或有监督解析器依赖固定训练样本与调参,难以在多样系统日志上保持良好效果。
方法
提出 DivLog,基于大语言模型上下文学习:按多样性采样离线候选日志,并为每个目标日志选取5个有标注示例构造提示,以无需训练方式生成日志模板。
评估
在16个广泛使用的公开数据集上评估,平均解析准确率98.1%、精确模板准确率92.1%、召回模板准确率92.9%,达到当前最优性能。
原文摘要(Abstract)

Log parsing, which involves log template extraction from semi-structured logs to produce structured logs, is the first and the most critical step in automated log analysis. However, current log parsers suffer from limited effectiveness for two reasons. First, traditional data-driven log parsers solely rely on heuristics or handcrafted features designed by domain experts, which may not consistently perform well on logs from diverse systems. Second, existing supervised log parsers require model tuning, which is often limited to fixed training samples and causes sub-optimal performance across the entire log source. To address this limitation, we propose DivLog, an effective log parsing framework based on the in-context learning (ICL) ability of large language models (LLMs). Specifically, before log parsing, DivLog samples a small amount of offline logs as candidates by maximizing their diversity. Then, during log parsing, DivLog selects five appropriate labeled candidates as examples for each target log and constructs them into a prompt. By mining the semantics of examples in the prompt, DivLog generates a target log template in a training-free manner. In addition, we design a straightforward yet effective prompt format to extract the output and enhance the quality of the generated log templates. We conducted experiments on 16 widely-used public datasets. The results show that DivLog achieves (1) 98.1% Parsing Accuracy, (2) 92.1% Precision Template Accuracy, and (3) 92.9% Recall Template Accuracy on average, exhibiting state-of-the-art performance.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot11389,
  title = {DivLog: Log Parsing with Prompt Enhanced In-Context Learning},
  author = {Junjielong Xu and Ruichun Yang and Yintong Huo and Chengyu Zhang and Pinjia He},
  booktitle = {ICSE},
  year = {2024},
  doi = {10.1145/3597503.3639155}
}