Enhanced Log Anomaly Detection with Contrastive Learning and BERT Embeddings
Mengmeng Cui, Tong Gao, Haolong Xiang, Xiaolong Xu, Changyan Lu, Junqun Xiong, Shengjun Xue · 2024
In modern software systems, log anomaly detection is a key technology to ensure system stability and reliability. The existing log-based anomaly detection methods have make significant development, but they fail to provide high detection accuracy when processing semantic information, especially in terms of semantic noise and the need for task-specific semantic embeddings. To address these issues, we propose a novel anomaly detection method called Contrast-Enhanced Log Anomaly Detection (CELA). The CELA model first enriches the content of log events using large language models and further optimizes the pretrained BERT model through contrastive learning techniques, ensuring that the event representations extracted from logs more accurately reflect potential anomalous patterns. On this basis, we have developed an anomaly detection model based on LSTM, which can effectively learn and identify anomalies from rich event representations. Evaluated on two public log datasets, the CELA model demonstrated superior performance compared to existing methods.