Seeing the Needle in the Haystack: Towards Weakly-Supervised Log Instance Anomaly Localization via Counterfactual Perturbation

Yutszyuk Wong, Wentai Wu, Yuen-Ying Yeung, Weiwei Lin

arXiv:2605.10988 · 2026-05-13 공개 · arXiv · PDF

weakly-supervised log-anomaly-detection prototype-guided counterfactual-perturbation security-assurance instance-localization log-data system-operations

Abstract

Log anomaly detection is a critical task for system operations and security assurance. However, in networked systems at scale, log data are generated at massive scale while instance-level annotations are prohibitively expensive, posing great difficulties to fine-grained anomaly localization. To address this challenge, we propose LogMILP (Log anomaly localization based on Multi-Instance Learning enhanced by prototypes and Perturbation), a weakly supervised framework that enables both bag-level anomaly detection and instance-level anomaly localization using only bag-level labels. Our method guides the model to pinpoint the critical log entries using prototype-guided structural modeling with counterfactual perturbation consistency regularization, thereby improving localization reliability and interpretability under coarse-grained supervision. Experimental results on three public datasets demonstrate that LogMILP achieves competitive detection performance while yielding significantly more reliable instance-level localization. Our code is open-sourced at https://github.com/YUK1207/LogMILP.

한국어 요약

📋 한 줄 요약

**[로그 이상탐지 / 약지도 학습]** 백 단위 라벨만으로 인스턴스 수준 로그 이상 위치 추정이 가능하도록, 프로토타입 기반 구조 모델링과 반사실적(counterfactual) 섭동 일관성 정규화를 결합한 LogMILP를 제안한다.

🎯 핵심 기여도

💡 핵심 아이디어

대규모 네트워크 시스템 로그에 일일이 라벨을 달기는 비현실적이므로, 백 라벨만으로 이상이 있다 vs 없다 정보를 받되 모델이 어떤 로그 엔트리가 결정적이었는지 짚도록 만들어야 한다. 프로토타입으로 "정상 패턴"의 구조를 표현하고, 반사실적 섭동을 가했을 때 예측이 어떻게 바뀌어야 하는지를 일관성 손실로 강제한다.

🔬 기술적 접근법

📊 주요 결과

💭 의의 및 한계

**의의**: 대규모 시스템 운영에서 라벨링 비용이라는 현실적 병목을 회피하면서도 운영자가 어느 로그를 봐야 하는지 짚어주는 실용적 접근으로, 이상탐지의 실배포 가용성을 크게 높인다. **한계**: 프로토타입 수와 섭동 설계가 데이터셋마다 튜닝이 필요하고, 새로운 로그 형식이나 분포 변화에 대한 일반화는 추가 검증이 필요하다.

🚀 실용적 활용