用大模型+检索增强实现未知恶意流量的自动识别,无需针对数据集调参。
MalRAG: A Retrieval-Augmented LLM Framework for Open-set Malicious Traffic Identification
- 构建多视角恶意流量库,从内容、结构、时间三方面挖掘知识
- 通过覆盖增强检索和自适应剪枝,提升正确证据的召回率
- 设计带上下文提示的智能引导,让大模型准确判断新旧攻击
精准识别安全系统标记的可疑流量对网络安全至关重要。随着网络威胁持续演进,发现新型恶意流量与识别已知类型同样关键。现有深度模型常依赖特定架构,迁移性差且需逐数据集调优。本文提出 MalRAG,首个基于大模型的检索增强框架,用于开放集恶意流量识别。该框架冻结大模型,通过多视角流量知识构建、自适应检索与提示工程实现推理。具体地,从内容、结构、时间三方面挖掘历史恶意流量,构建多视图数据库;提出覆盖增强检索算法,跨视图查询以筛选最可能候选;引入流量感知自适应剪枝,基于相似度动态选取子集,抑制错误匹配,提升检索可靠性;并设计集成任务指令、证据引用与决策引导的提示策略,强化大模型表现。在多个真实世界数据集与设置下,MalRAG 在已知类细粒度识别与新型攻击发现上均达当前最优性能。消融实验与深入分析表明,其有效利用大模型能力,且不依赖特定大模型即可实现开放集识别。
原文摘要 · Abstract (English)
Fine-grained identification of IDS-flagged suspicious traffic is crucial in cybersecurity. In practice, cyber threats evolve continuously, making the discovery of novel malicious traffic a critical necessity as well as the identification of known classes. Recent studies have advanced this goal with deep models, but they often rely on task-specific architectures that limit transferability and require per-dataset tuning. In this paper we introduce MalRAG, the first LLM driven retrieval-augmented framework for open-set malicious traffic identification. MalRAG freezes the LLM and operates via comprehensive traffic knowledge construction, adaptive retrieval, and prompt engineering. Concretely, we construct a multi-view traffic database by mining prior malicious traffic from content, structural, and temporal perspectives. Furthermore, we introduce a Coverage-Enhanced Retrieval Algorithm that queries across these views to assemble the most probable candidates, thereby improving the inclusion of correct evidence. We then employ Traffic-Aware Adaptive Pruning to select a variable subset of these candidates based on traffic-aware similarity scores, suppressing incorrect matches and yielding reliable retrieved evidence. Moreover, we develop a suite of guidance prompts where task instruction, evidence referencing, and decision guidance are integrated with the retrieved evidence to improve LLM performance. Across diverse real-world datasets and settings, MalRAG delivers state-of-the-art results in both fine-grained identification of known classes and novel malicious traffic discovery. Ablation and deep-dive analyses further show that MalRAG effective leverages LLM capabilities yet achieves open-set malicious traffic identification without relying on a specific LLM.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。