Skip to main content
QUICK REVIEW

[Paper Review] LLM meets ML: Data-efficient Anomaly Detection on Unstable Logs

Fatemeh Hadadi, Qinghua Xu|arXiv (Cornell University)|Jun 11, 2024
Anomaly Detection Techniques and ApplicationsComputer Science3 citations
TL;DR

This paper proposes fine-tuning GPT-3 for anomaly detection on unstable logs caused by software evolution, demonstrating superior performance over supervised baselines and prompt engineering. It shows that fine-tuned GPT-3 achieves an F1-score of 0.9895 on unstable logs and remains robust even when up to 30% of log sequences are altered.

ABSTRACT

Most log-based anomaly detectors assume logs are stable, though logs are often unstable due to software or environmental changes. Anomaly detection on unstable logs (ULAD) is therefore a more realistic, yet under-investigated challenge. Current approaches predominantly employ machine learning (ML) models, which often require extensive labeled data for training. To mitigate data insufficiency, we propose FlexLog, a novel hybrid approach for ULAD that combines ML models -- decision tree, k-nearest neighbors, and a feedforward neural network -- with a Large Language Model (Mistral) through ensemble learning. FlexLog also incorporates a cache and retrieval-augmented generation (RAG) to further enhance efficiency and effectiveness. To evaluate FlexLog, we configured four datasets for ask, namely ADFA-U, LOGEVOL-U, SynHDFS-U, and SYNEVOL-U. FlexLog outperforms all baselines by at least 1.2 percentage points (pp) in F1 score while using much less labeled data (62.87 pp reduction). When trained on the same amount of data as the baselines, FlexLog achieves up to a 13 pp increase in F1 score on ADFA-U across varying training dataset sizes. Additionally, FlexLog maintains inference time under one second per log sequence, making it suitable for most applications, except latency-sensitive systems. Further analysis reveals the positive impact of FlexLog's key components: cache, RAG and ensemble learning.

Motivation & Objective

  • Address the challenge of data insufficiency in anomaly detection on unstable logs due to software evolution.
  • Investigate whether Large Language Models (LLMs) can mitigate performance degradation caused by log changes during software evolution.
  • Compare fine-tuning GPT-3 with prompt engineering (using GPT-4) and traditional deep learning models for anomaly detection on unstable logs.
  • Evaluate the effectiveness of LLMs in low-data regimes common in newly deployed software versions.
  • Provide insights into the practical trade-offs between fine-tuning and prompt engineering for log anomaly detection.

Proposed method

  • Propose a general framework for fine-tuning LLMs on log sequences with corresponding anomaly labels for anomaly detection.
  • Fine-tune GPT-3 on a two-version Hadoop log dataset (LOGEVOL-Hadoop) with labeled anomalies to adapt it to unstable log patterns.
  • Implement prompt engineering using GPT-4 with zero-shot and few-shot prompts, including task descriptions, examples, and input-output formats.
  • Compare the performance of fine-tuned GPT-3 against nine traditional deep learning models (e.g., LSTM, Transformer, Autoencoder) and supervised baselines.
  • Use F1-score as the primary evaluation metric across stable and unstable log conditions, with varying degrees of log sequence changes.
  • Apply controlled perturbations to simulate software evolution, altering up to 30% of log sequences to assess robustness.
Figure 1 : Examples of log Message, Log Message Sequence, Log Template and Log Template Sequence.
Figure 1 : Examples of log Message, Log Message Sequence, Log Template and Log Template Sequence.

Experimental results

Research questions

  • RQ1RQ1: How does fine-tuned GPT-3 perform compared to traditional supervised, unsupervised, and semi-supervised deep learning models in anomaly detection on unstable logs?
  • RQ2RQ2: How does the performance of prompt engineering with GPT-4 compare to fine-tuned GPT-3 in detecting anomalies on unstable logs?
  • RQ3RQ3: How does the degree of log sequence changes (due to software evolution) affect the performance of different anomaly detection methods?
  • RQ4RQ4: Is the performance gain from fine-tuned GPT-3 practically significant compared to existing supervised baselines in real-world scenarios?
  • RQ5RQ5: What are the trade-offs between fine-tuning and prompt engineering in terms of accuracy, data efficiency, and computational cost for anomaly detection on unstable logs?

Key findings

  • Fine-tuned GPT-3 achieves an F1-score of 0.9895 on unstable logs, outperforming all traditional deep learning baselines.
  • The performance gap between fine-tuned GPT-3 and supervised baselines increases significantly as the degree of log changes rises, indicating better robustness to software evolution.
  • Fine-tuned GPT-3 maintains high performance even when up to 30% of log sequences are altered, with an F1-score above 0.93 under such conditions.
  • Prompt engineering with GPT-4 yields significantly lower performance than fine-tuned GPT-3, indicating that fine-tuning is more effective when labeled data is available.
  • The results suggest that fine-tuning is a preferable strategy over prompt engineering for anomaly detection on unstable logs when labeled data is accessible.
  • The performance gain from fine-tuned GPT-3 may not always be practically significant in all scenarios, raising questions about the cost-benefit trade-off of using large models.
Figure 2 : Overview of fine-tuning an LLM for ADUL
Figure 2 : Overview of fine-tuning an LLM for ADUL

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.