MalRAG: A Retrieval-Augmented LLM Framework for Open-set Malicious Traffic Identification
On the map: Retrieval-augmented generation → Privacy and security of RAG
Abstract (arXiv)
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.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Privacy and security of RAG, one of 15 directions in Retrieval-augmented generation. Builds on 4 of its 52 references that are in the map. First posted on arXiv 18 Nov 2025.
Builds on
4 of 52 references.
References · 4
- 2023GPT-4 Technical Reportcited by 18,132
- 2023NetGPT: Generative Pretrained Transformer for Network Trafficcited by 31
- 2024TrafficGPT: Breaking the Token Barrier for Efficient Long Traffic Analysis and Generationcited by 15
- 2025TrafficLLM: Enhancing Large Language Models for Network Traffic Analysis with Generic Traffic Representationcited by 15
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Retrieval-Augmented LLMs for Security Incident Analysis
- 2025ReGAIN: Retrieval-Grounded AI Framework for Network Traffic Analysis
- 2026RuleAutoPilot: Synthesizing Deployable Suricata Rules from Network Traffic ↗
- 2026AsmRAG: LLM-Driven Malware Detection by Retrieving Functionally Similar Assembly Code
- 2026Defending Retrieval-Augmented Intrusion Detection Against Knowledge Poisoning and Prompt Injection
- 2026From Detection to Response: A Deep Learning and Retrieval-Augmented Generation Framework for Network Intrusion Mitigation
- 2026Multimodal Reasoning with LLM for Encrypted Traffic Interpretation: A Benchmark
- 2025XGen-Q: An Explainable Domain-Adaptive LLM Framework with Retrieval-Augmented Generation for Software Security