LogICL: 通过蒸馏大语言模型推理来弥合跨域日志异常检测中的语义鸿沟
LogICL: Demonstration Retrieval to Bridge the Semantic Gap in Cross-Domain Log Anomaly Detection
AI总结:
LogICL通过蒸馏大语言模型推理,提升跨域日志异常检测的语义理解与泛化能力,实现更准确的检测与解释。
摘要:
有效日志异常检测对于维持大规模IT基础设施的可靠性至关重要。基于Transformer的模型需要大量的资源和标注数据,加剧了目标领域中的冷启动问题,因为日志稀缺。现有的跨域方法利用源日志,但因依赖表面词汇相似性而难以泛化,无法在结构差异中捕捉到潜在的语义等价性。为此,我们提出了LogICL,一个将大语言模型(LLM)推理蒸馏到轻量级编码器中的框架,用于跨域异常检测。在训练过程中,LogICL构建了一个delta矩阵,衡量通过最大边际相关性选择的演示的效用相对于零样本推理。编码器通过包含ICL引导项、最大均值差异和监督对比损失的多目标损失进行优化。在推理过程中,优化的编码器通过语义相似性和delta分数检索具有推理意识的演示,使冻结的LLM在上下文学习中使用思维链进行准确且可解释的检测。在少量样本和零样本跨域基准测试中,LogICL在异构系统中实现了最先进的性能。进一步通过可视化和案例研究分析确认,LogICL超越了表面词汇相似性,有效捕捉了潜在语义等价性,为快速部署提供了有效支持。
英文摘要:
Effective log anomaly detection is critical to sustaining reliability in large-scale IT infrastructures. Transformer-based language models have advanced the field but require substantial computational resources and labeled data, exacerbating the cold-start problem in target domains with scarce logs. Cross-domain methods alleviate data scarcity by leveraging source-domain logs, but their reliance on surface lexical similarity limits generalization when structural and terminological differences obscure semantic equivalence. We propose LogICL, a demonstration-retrieval framework for cross-domain log anomaly detection. During training, LogICL constructs a sparse delta matrix by measuring the signed change in a frozen LLM's prediction error between zero-shot and one-shot inference for selected query-demonstration pairs. This outcome-level feedback supervises a lightweight encoder through a demonstration-utility loss, while maximum mean discrepancy and supervised contrastive losses promote domain alignment and anomaly discrimination. At inference, the encoder retrieves similarity-based anchors and expands them with candidates having the highest scores aggregated over precomputed positive delta relations. Thus, LogICL retrieves high-utility demonstrations without candidate-wise LLM evaluation and provides them to a frozen LLM for in-context anomaly prediction. Experiments on few-shot and target-domain zero-shot transfer benchmarks demonstrate strong performance across heterogeneous log systems. In the few-shot setting, LogICL outperforms Random-ICL and kNN-ICL in three of four transfers under the fixed split, while the benefit remains setting-dependent. Further analysis shows that LogICL can identify demonstrations with positive predictive utility despite low surface lexical similarity, helping bridge the semantic gap across logging systems.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。