mlsanityData to 7 Oct 2026

ContraLog: Log File Anomaly Detection with Contrastive Learning and Masked Language Modeling

arXiv 2602.03678 ↗First posted 3 Feb 2026cs.LG cs.AIcited by 0

Not on the map. Why?

Abstract (arXiv)

Log files record computational events that reflect system state and behavior, making them a primary source of operational insights in modern computer systems. Automated anomaly detection on logs is therefore critical, yet most established methods rely on log parsers that collapse messages into discrete templates, discarding variable values and semantic content. We propose ContraLog, a parser-free and self-supervised method that reframes log anomaly detection as predicting continuous message embeddings rather than discrete template IDs. ContraLog combines a message encoder that produces rich embeddings for individual log messages with a sequence encoder to model temporal dependencies within sequences. The model is trained with a combination of masked language modeling and contrastive learning to predict masked message embeddings based on the surrounding context. Experiments on the HDFS, BGL, and Thunderbird benchmark datasets empirically demonstrate effectiveness on complex datasets with diverse log messages. Additionally, we find that message embeddings generated by ContraLog carry meaningful information and are predictive of anomalies even without sequence context. These results highlight embedding-level prediction as an approach for log anomaly detection, with potential applicability to other event sequences.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 15 of its 37 references that are in the map. First posted on arXiv 3 Feb 2026.

Builds on

15 of 37 references.

References · 15

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
  4. 2015Neural Machine Translation of Rare Words with Subword Unitscited by 2,898
  5. 2018UMAP: Uniform Manifold Approximation and Projection for Dimension Reductioncited by 2,841
  6. 2021SimCSE: Simple Contrastive Learning of Sentence Embeddingscited by 2,168
  7. 2023Self-Supervised Learning from Images with a Joint-Embedding Predictive Architecturecited by 982
  8. 2020A Unifying Review of Deep and Shallow Anomaly Detectioncited by 423
  9. 2021LogBERT: Log Anomaly Detection via BERTcited by 114
  10. 2020Loghub: A Large Collection of System Log Datasets for AI-driven Log Analyticscited by 68
  11. 2021Log-based Anomaly Detection Without Log Parsingcited by 59
  12. 2022Log-based Anomaly Detection with Deep Learning: How Far Are We?cited by 56
3 more
  1. 2022Deep Learning for Anomaly Detection in Log Data: A Surveycited by 27
  2. 2021A Taxonomy of Anomalies in Log Datacited by 5
  3. 2024LogELECTRA: Self-supervised Anomaly Detection for Unstructured Logscited by 4

Built on by

Not cited yet.