[Paper Review] LogGPT: Exploring ChatGPT for Log-Based Anomaly Detection
LogGPT proposes a novel framework leveraging ChatGPT for log-based anomaly detection by combining log preprocessing, task-specific prompt engineering, and response parsing. It achieves promising zero-shot and few-shot performance on BGL and Spirit datasets while offering high interpretability, though it faces challenges with false positives and prompt sensitivity.
The increasing volume of log data produced by software-intensive systems makes it impractical to analyze them manually. Many deep learning-based methods have been proposed for log-based anomaly detection. These methods face several challenges such as high-dimensional and noisy log data, class imbalance, generalization, and model interpretability. Recently, ChatGPT has shown promising results in various domains. However, there is still a lack of study on the application of ChatGPT for log-based anomaly detection. In this work, we proposed LogGPT, a log-based anomaly detection framework based on ChatGPT. By leveraging the ChatGPT's language interpretation capabilities, LogGPT aims to explore the transferability of knowledge from large-scale corpora to log-based anomaly detection. We conduct experiments to evaluate the performance of LogGPT and compare it with three deep learning-based methods on BGL and Spirit datasets. LogGPT shows promising results and has good interpretability. This study provides preliminary insights into prompt-based models, such as ChatGPT, for the log-based anomaly detection task.
Motivation & Objective
- To explore the feasibility and effectiveness of using large language models like ChatGPT for log-based anomaly detection.
- To address challenges in log anomaly detection such as high-dimensional data, class imbalance, and model interpretability.
- To design a prompt-based framework that transfers knowledge from general-domain LLMs to system log analysis.
- To evaluate LogGPT’s performance and interpretability against established deep learning baselines.
Proposed method
- Log preprocessing involves filtering, parsing, and grouping raw log messages into structured sequences for model input.
- Prompt construction uses tailored instructions and human knowledge injection (e.g., normal log examples) to guide ChatGPT’s anomaly detection behavior.
- The response parser extracts and interprets ChatGPT’s output to classify logs as normal or anomalous.
- The framework operates in a zero-shot or few-shot setting, relying on in-context learning without fine-tuning.
- Window size is used to control the context length of log sequences fed into the model.
- Performance is evaluated using standard metrics like F1-score and AUC on BGL and Spirit datasets.

Experimental results
Research questions
- RQ1What is the current capability of ChatGPT for log-based anomaly detection in zero-shot and few-shot settings?
- RQ2How does prompt design—particularly task description and injection of normal log examples—affect detection performance?
- RQ3How does window size influence the performance of the LogGPT framework?
- RQ4How interpretable are the anomalies detected by LogGPT, and can it provide actionable insights?
Key findings
- Prompt construction significantly impacts performance, with more specific task descriptions and inclusion of normal log examples improving detection accuracy.
- Larger window sizes generally lead to better performance, indicating that longer context improves anomaly detection capability.
- LogGPT achieves competitive performance compared to deep learning baselines such as DeepLog, LogAnomaly, and LogRobust on both BGL and Spirit datasets.
- LogGPT demonstrates strong interpretability by providing detailed explanations for detected anomalies, including root cause analysis and preventive suggestions.
- Despite strong performance, LogGPT exhibits a high false positive rate, often flagging normal log sequences as anomalous.
- The model is sensitive to prompt variations, and hallucination issues in ChatGPT can lead to unreliable or incorrect outputs.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.