cs.LGApr 14, 2026

LLM-Enhanced Log Anomaly Detection: A Comprehensive Benchmark of Large Language Models for Automated System Diagnostics

Authors: Disha Patel

Organizations: Department of Computer Science, California State University, Fullerton

Abstract

System log anomaly detection is critical for maintaining the reliability of large-scale software systems, yet traditional methods struggle with the heterogeneous and evolving nature of modern log data. Recent advances in Large Language Models (LLMs) offer promising new approaches to log understanding, but a systematic comparison of LLM-based methods against established techniques remains lacking. In this paper, we present a comprehensive benchmark study evaluating both LLM-based and traditional approaches for log anomaly detection across four widely-used public datasets: HDFS, BGL, Thunderbird, and Spirit. We evaluate three categories of methods: (1) classical log parsers (Drain, Spell, AEL) combined with machine learning classifiers, (2) fine-tuned transformer models (BERT, RoBERTa), and (3) prompt-based LLM approaches (GPT-3.5, GPT-4, LLaMA-3) in zero-shot and few-shot settings. Our experiments reveal that while fine-tuned transformers achieve the highest F1-scores (0.96-0.99), prompt-based LLMs demonstrate remarkablezero-shot capabilities (F1: 0.82-0.91) without requiring any labeled training data -- a significant advantage for real-world deployment where labeled anomalies are scarce. We further analyze the cost-accuracy trade-offs, latency characteristics, and failure modes of each approach. Our findings provide actionable guidelines for practitioners choosing log anomaly detection methods based on their specific constraints regarding accuracy, latency, cost, and label availability. All code and experimental configurations are publicly available to facilitate reproducibility.

Figures & tables

Explore similar work

CardsList
  1. Towards Understanding LLM-Based Log Anomaly Detection: An Empirical Study of Performance, Efficiency, and Robustness

    Sep 25, 2026Bin Li, Dongdong Wang, Siyang LuLanguage Model RobustnessLLM Inference Efficiency

  2. From Noise to Signal: Improving Security Log Anomaly Detection Using LLMs with Endpoint-Specific Logs

    Aug 20, 2026Christopher Henshaw, Gour KarmakarAnomaly DetectionLLMs for Cybersecurity

  3. FAME: Failure-Aware Mixture-of-Experts for Message-Level Log Anomaly Detection

    May 21, 2026Huanchi Wang, Zihang Huang, Yifang Tian +3Fault DetectionMixture-of-Experts Models