From Few-Label to Zero-Label: An Approach for Cross-System Log-Based Anomaly Detection with Meta-Learning

Xinlong Zhao, Tong Jia, Minghua He, Yihan Wu, Ying Li, Gang Huang

TL;DR

This paper introduces FreeLog, a novel meta-learning approach for log-based anomaly detection that works even when the target system has zero labeled logs. By leveraging domain-invariant features and meta-learning, FreeLog achieves performance comparable to methods that require some labeled target data, significantly advancing the state-of-the-art in cross-system anomaly detection.

What Problem Does This Paper Address?

Modern software systems generate vast amounts of log data, which are crucial for identifying anomalies and ensuring system stability. Traditional anomaly detection methods often require a substantial amount of labeled data, which is expensive and time-consuming to obtain, especially for new or complex systems. While cross-system transfer learning has shown promise by leveraging labeled data from a source system to help with a target system, it still relies on a small number of labeled logs in the target system. This creates a "cold-start" problem: when labeled target logs are insufficient or entirely absent, these methods struggle. This paper tackles this challenge by proposing a solution for zero-label cross-system log anomaly detection, where the target system has no labeled logs whatsoever.

Methods

The core of FreeLog is a system-agnostic representation meta-learning method. Here's a breakdown of the key components:

  • Log Parsing and Semantic Embedding: Raw logs are first parsed into structured log events. These events are then converted into semantic embeddings, which capture their meaning more effectively than simple indexing. This step is standard in modern log analysis.
  • System-Agnostic Representation Learning (Unsupervised Domain Adaptation): To learn features that are transferable across systems, FreeLog employs unsupervised domain adaptation (UDA) techniques. This involves an adversarial training process between a feature extractor and a domain classifier. The goal is to train the feature extractor to produce representations that are indistinguishable by the domain classifier, meaning they are invariant to the source or target domain. This allows the model to learn generalizable features from labeled source logs and unlabeled target logs.
  • Meta-Learning for Adaptation: To further enhance generalization to the target system, FreeLog uses meta-learning. This involves training the model to "learn to learn." During meta-training, the model is exposed to multiple "meta-tasks," each consisting of a small support set (for training within the task) and a query set (for evaluating adaptation). The model learns to quickly adapt its learned system-agnostic features to perform anomaly classification on the target system with minimal updates. This is achieved through an outer-loop optimization that fine-tunes the feature extractor to perform well on the query sets of various meta-tasks.
  • Anomaly Classifier: A dedicated classifier is trained to distinguish between normal and anomalous log events using the learned system-agnostic features.

The overall objective is a min-max optimization problem that simultaneously learns domain-invariant features and effective anomaly classification.

Datasets

The experiments were conducted on three publicly available log datasets:

  • HDFS [28]
  • BGL (Blue Gene/L) [22]
  • OpenStack [3]

The paper uses four cross-system combinations for evaluation: HDFS to BGL, BGL to HDFS, OpenStack to HDFS, and OpenStack to BGL. These datasets represent different types of software systems, allowing for a robust evaluation of cross-system generalization.

Key Insights and Ideas

  • The "Zero-Label" Frontier: The paper boldly pushes the boundary of cross-system anomaly detection into the zero-label setting, a significant step beyond existing few-label approaches. This addresses a critical real-world constraint where labeled data is often unavailable.
  • Domain Invariance is Key: The success of FreeLog hinges on its ability to learn features that are not specific to any single system. By using adversarial domain adaptation, it effectively "washes out" system-specific biases, making the learned representations more universal.
  • Meta-Learning for Rapid Adaptation: Meta-learning provides the mechanism for FreeLog to quickly adapt its general representations to the specific nuances of a target system, even without any prior labeled examples from that system. This is crucial for achieving good performance in the zero-label scenario.
  • Comparable Performance to Labeled Methods: Perhaps the most striking insight is that FreeLog, operating under a zero-label constraint, achieves performance comparable to state-of-the-art methods that do utilize some labeled target data. This highlights the power of the proposed approach.

Key Results

  • FreeLog achieves an F1-score exceeding 80% in zero-label cross-system anomaly detection scenarios.
  • The performance of FreeLog is comparable to state-of-the-art methods that rely on a small amount of labeled data from the target system.
  • FreeLog outperforms unsupervised methods and even surpasses some semi-supervised methods trained with scarce target labels in many cases.
  • Specifically, in Table 1, FreeLog consistently shows strong F1-scores across various cross-domain transfer tasks, often outperforming or matching methods like MetaLog [32] which uses labeled target data. For instance, in the HDFS to BGL task, FreeLog achieves an F1-score of 86.01%, while MetaLog achieves 92.93% but requires labeled target data.

Limitations and Future Work

  • Limitations: The paper acknowledges that while FreeLog achieves comparable performance to methods with labeled data, there might still be a performance gap in certain complex scenarios. The reliance on meta-learning can also introduce computational overhead during training.
  • Future Work: The authors suggest further testing FreeLog on a wider variety of log datasets to assess its generalization capabilities across more diverse software systems. They also plan to explore its practical applicability in real-world deployment scenarios.

Summary updated

Abstract

Log anomaly detection plays a critical role in ensuring the stability and reliability of software systems. However, existing approaches rely on large amounts of labeled log data, which poses significant challenges in real-world applications. To address this issue, cross-system transfer has been identified as a key research direction. State-of-the-art cross-system approaches achieve promising performance with only a few labels from the target system. However, their reliance on labeled target logs makes them susceptible to the cold-start problem when labeled logs are insufficient. To overcome this limitation, we explore a novel yet underexplored setting: zero-label cross-system log anomaly detection, where the target system logs are entirely unlabeled. To this end, we propose FreeLog, a system-agnostic representation meta-learning method that eliminates the need for labeled target system logs, enabling cross-system log anomaly detection under zero-label conditions. Experimental results on three public log datasets demonstrate that FreeLog achieves performance comparable to state-of-the-art methods that rely on a small amount of labeled data from the target system.
BibTeX
@inproceedings{zhao2025from,
  author = {Xinlong Zhao and Tong Jia and Minghua He and Yihan Wu and Ying Li and Gang Huang},
  title = {{From Few-Label to Zero-Label: An Approach for Cross-System Log-Based Anomaly Detection with Meta-Learning}},
  booktitle = {SIGSOFT FSE Companion},
  year = {2025},
  url = {https://openreview.net/forum?id=PHrWBsxrIH},
}
Figure