LLMShield: Zero-Shot and Semantically-Grounded Network Threat Triage via Large-Language-Model Reasoning and Retrieval-Augmented Flow Attention
DOI:
https://doi.org/10.31185/wjes.v14.i4.1003Keywords:
zero-shot learning, threat triage, Intrusion detectionAbstract
Supervised intrusion detection systems are closed set learners: they can only name attack families seen during training, cannot consume the textual threat intelligence that describes emerging families before any labeled traffic exists, and reduce triage to a label without severity or justification. LLMShield first converts raw flow statistics into dataset calibrated natural language through semantic serialization. A dense retriever then gathers similar historical flows, and a training-free retrieval-augmented flow attention (RAFA) mechanism weights this evidence, inducing a soft label prior and an interpretable audit trail. A frozen Llama-3.1-8B (8-billion-parameter) open-weights LLM then reasons over the attention-ranked evidence to emit a class, a five-level severity, and a feature-grounded rationale under schema-constrained decoding. The framework evaluated on CIC-IDS2017 under a strict zero-shot protocol in which held-out attack families are removed from the retrieval index and remain reachable only through threat-intelligence text. In the in-distribution evaluation, LLMShield achieved detection recall 97.5%, 12% of recall with unseen-class across six held-out attack families and 36% for DoS. The contribution is the demonstrated zero shot triage pathway; a retrieval-grounded, training-free route by which a frozen model names and reasons about attacks whose traffic it has never seen.
References
[1] A. L. Buczak and E. Guven, “A survey of data mining and machine learning methods for cyber security intrusion detection,”, IEEE Communications Surveys & Tutorials, vol. 18, no. 2, pp. 1153–1176, 2016
[2] B. E. Strom, A. Applebaum, D. P. Miller, K. C. Nickels, A. G. Pennington, and C. B. Thomas, “MITRE ATT&CK: Design and philosophy,”, The MITRE Corporation, 2018
[3] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, and others, “Language models are few-shot learners,”, in Advances in neural information processing systems (NeurIPS), 2020
[4] I. Sharafaldin, A. Habibi Lashkari, and A. A. Ghorbani, “Toward generating a new intrusion detection dataset and intrusion traffic characterization,”, in Proceedings of the 4th international conference on information systems security and privacy (ICISSP), pp. 108–116, 2018
[5] H. Kheddar, “Transformers and large language models for efficient intrusion detection systems: A comprehensive survey,”, arXiv preprint arXiv:2408.07583, 2024
[6] M. Sarhan, S. Layeghy, M. Gallagher, and M. Portmann, “From zero-shot machine learning to zero-day attack detection,”, International Journal of Information Security, vol. 22, no. 4, pp. 947–959, 2023
[7] S. Yang, X. Zheng, X. Zhang, J. Xu, J. Li, D. Xie, W. Long, and E. C. H. Ngai, “Large language models for network intrusion detection systems: Foundations, implementations, and future directions,”, arXiv preprint arXiv:2507.04752, 2025
[8] P. R. B. Houssel, P. Singh, S. Layeghy, and M. Portmann, “Towards explainable network intrusion detection using large language models,”, arXiv preprint arXiv:2408.04342, 2024
[9] P. R. B. Houssel, S. Layeghy, P. Singh, and M. Portmann, “eX-NIDS: A framework for explainable network intrusion detection leveraging large language models,”, arXiv preprint arXiv:2507.16241, 2025
[10] Y. Ginige, T. Dahanayaka, and S. Seneviratne, “TrafficGPT: An LLM approach for open-set encrypted traffic classification,”, in Proceedings of the 19th asian internet engineering conference (AINTEC), 2024
[11] P. Lewis, E. Perez, A. Piktus, F. Petroni, V. Karpukhin, N. Goyal, H. Küttler, M. Lewis, W. Yih, T. Rocktäschel, S. Riedel, and D. Kiela, “Retrieval-augmented generation for knowledge-intensive NLP tasks,”, in Advances in neural information processing systems (NeurIPS), 2020
[12] X. Luo, C. Liu, G. Xiong, C. Yang, G. Gou, Y. Ren, and Z. Li, “MalRAG: A retrieval-augmented LLM framework for open-set malicious traffic identification,”, arXiv preprint arXiv:2511.14129, 2025
[13] S. Xiao, Z. Liu, P. Zhang, and N. Muennighoff, “C-Pack: Packaged resources to advance general Chinese embedding,”, arXiv preprint arXiv:2309.07597, 2023
[14] J. Johnson, M. Douze, and H. Jégou, “Billion-scale similarity search with GPUs,”, IEEE Transactions on Big Data, vol. 7, no. 3, pp. 535–547, 2019
[15] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, “Attention is all you need,”, in Advances in neural information processing systems (NeurIPS), pp. 5998–6008, 2017
[16] A. Grattafiori, A. Dubey, A. Jauhri, and others, “The Llama 3 herd of models,”, arXiv preprint arXiv:2407.21783, 2024
[17] N. Moustafa and J. Slay, “UNSW-NB15: A comprehensive data set for network intrusion detection systems,”, in Military communications and information systems conference (MilCIS), pp. 1–6, 2015.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Ali Nafea

This work is licensed under a Creative Commons Attribution 4.0 International License.

