Skip to main content
QUICK REVIEW

[Paper Review] Interpretable Online Log Analysis Using Large Language Models with Prompt Strategies

Yilun Liu, Shimin Tao|arXiv (Cornell University)|Aug 15, 2023
Software System Performance and ReliabilityComputer Science3 citations
TL;DR

This paper proposes LogPrompt, a novel interpretable online log analysis framework that leverages large language models (LLMs) with advanced prompt strategies—self-prompt, chain-of-thought, and in-context prompting—to achieve state-of-the-art performance in log parsing and anomaly detection without requiring in-domain fine-tuning. LogPrompt improves LLM performance by up to 380.7% over simple prompts and outperforms existing methods trained on thousands of logs by up to 55.9%, while generating human-rated explanations with high readability and usefulness (4.42/5).

ABSTRACT

Automated log analysis is crucial in modern software-intensive systems for facilitating program comprehension throughout software maintenance and engineering life cycles. Existing methods perform tasks such as log parsing and log anomaly detection by providing a single prediction value without interpretation. However, given the increasing volume of system events, the limited interpretability of analysis results hinders analysts' comprehension of program status and their ability to take appropriate actions. Moreover, these methods require substantial in-domain training data, and their performance declines sharply (by up to 62.5%) in online scenarios involving unseen logs from new domains, a common occurrence due to rapid software updates. In this paper, we propose LogPrompt, a novel interpretable log analysis approach for online scenarios. LogPrompt employs large language models (LLMs) to perform online log analysis tasks via a suite of advanced prompt strategies tailored for log tasks, which enhances LLMs' performance by up to 380.7% compared with simple prompts. Experiments on nine publicly available evaluation datasets across two tasks demonstrate that LogPrompt, despite requiring no in-domain training, outperforms existing approaches trained on thousands of logs by up to 55.9%. We also conduct a human evaluation of LogPrompt's interpretability, with six practitioners possessing over 10 years of experience, who highly rated the generated content in terms of usefulness and readability (averagely 4.42/5). LogPrompt also exhibits remarkable compatibility with open-source and smaller-scale LLMs, making it flexible for practical deployment. Code of LogPrompt is available at https://github.com/lunyiliu/LogPrompt.

Motivation & Objective

  • Address the challenge of limited interpretability in automated log analysis, where existing methods provide only predictions without justifications.
  • Overcome the performance degradation of log analysis models in online scenarios with scarce or unseen logs from new domains.
  • Develop a highly adaptive, zero-shot log analysis approach that eliminates the need for in-domain fine-tuning, enabling immediate deployment on new services.
  • Enhance program comprehension and operational decision-making by generating human-readable, justifiable explanations for log analysis predictions.
  • Validate the effectiveness and interpretability of LLM-based log analysis through rigorous human evaluation with experienced practitioners.

Proposed method

  • Employ three specialized prompt strategies: self-prompt (self-generated task descriptions), chain-of-thought (step-by-step reasoning), and in-context prompting (few-shot demonstrations) to guide LLMs in log analysis tasks.
  • Apply the prompt strategies to both log parsing and log anomaly detection tasks, enabling the LLM to extract templates and variables or classify logs as normal/anomalous.
  • Design a prompt engineering pipeline that dynamically constructs context-aware prompts based on log content and task requirements.
  • Utilize zero-shot inference with LLMs, avoiding any in-domain fine-tuning, to ensure adaptability to new domains and unseen log types.
  • Integrate structured prompting to guide LLMs toward generating explanations that are both logically sound and semantically meaningful.
  • Ensure compatibility with open-source and smaller-scale LLMs by optimizing prompt design for efficiency and performance.

Experimental results

Research questions

  • RQ1Can advanced prompt strategies significantly improve the performance of LLMs in log parsing and anomaly detection without in-domain fine-tuning?
  • RQ2To what extent can LLM-based log analysis models generalize to online scenarios with unseen logs from new domains?
  • RQ3How effective are the generated explanations in enhancing interpretability and supporting program comprehension for experienced O&M engineers?
  • RQ4Can prompt engineering strategies like chain-of-thought and in-context learning improve the reliability and traceability of LLM predictions in log analysis?
  • RQ5How does the interpretability of LLM-generated explanations compare to traditional black-box log analysis models in real-world operational contexts?

Key findings

  • LogPrompt achieves state-of-the-art performance in both log parsing and anomaly detection tasks, outperforming existing methods trained on thousands of in-domain logs by up to 55.9%.
  • The performance of LLMs in log analysis improves by up to 380.7% when using advanced prompt strategies compared to simple prompting.
  • Human evaluation with six experienced practitioners shows that LogPrompt's generated explanations are highly useful and readable, scoring an average of 4.42 out of 5.
  • LogPrompt demonstrates strong generalization in online scenarios, maintaining high accuracy even when no in-domain training data is available.
  • The approach is compatible with open-source and smaller-scale LLMs, enabling practical deployment across diverse infrastructure environments.
  • The study confirms that interpretability through generated justifications significantly enhances operational decision-making, including root cause analysis and false alarm detection.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.