Beyond Model Scaling: Rethinking Sequence Construction for Transformer-based Network Intrusion Detection
Zeeshan Zulkifl Shah, Muhammad Ikram, Dali Kaafar, Yipeng Zhou
Abstract
Transformer-based network intrusion detection systems (NIDS) have shown strong potential for detecting multi-stage cyberattacks, yet most methods construct input sequences using fixed temporalization schemes rather than treating sequence construction as a systems design decision. In flow-based intrusion detection, timestamp-based windowing often fragments related attack activities while merging unrelated communications, reducing the behavioral context available to transformers. We present a unified pipeline abstraction that decomposes transformer-based NIDS into four design dimensions (traffic representation, temporalization, transformer backbone, and prediction aggregation) and propose session-coherent temporalization, which constructs sequences from communication sessions instead of fixed time windows. Experiments on three complementary intrusion detection datasets show that temporalization is the dominant factor governing transformer performance: session-coherent temporalization more than doubles Macro-F1 over timestamp-based windowing, enabling lightweight transformers to achieve up to 0.95 Macro-F1 at substantially higher inference throughput than pretrained models. We further vary the transformer size from 0.65M to 3.38M parameters and find that larger transformer models provide no measurable accuracy improvement despite substantially higher computational cost, while zero-shot cross-dataset evaluation shows only modest gains under domain shift. These results indicate that preserving communication-session semantics, rather than scaling transformer capacity, is the key to accurate and efficient transformer-based intrusion detection.
Create a lesson
Metadata
- Categories
- cs.CR, cs.NI
- Comments
- 11 pages, 8 figures, 5 tables. Reproducibility artifact: https://github.com/ZeeshanZulkiflShah/sequence-construction-nids-artifact/tree/arxiv-v1-artifact
Related papers
Bytes to Threats: Byte-Sequence Transformer For Malware Detection
Shared title terminologycs.CRAbdelrahman Yassin Eljamal, Abdeltawab Hendawi
An LLM-Assisted Multi-Objective AutoML Framework for Efficient Network Intrusion Detection
Shared title terminologycs.CRAilin Barzegar, Khalil El-Khatib, Li Yang
Enhancing Metaverse Security using Explainable AI-based Intrusion Detection Framework
Shared title terminologycs.CREsha Kuppanda, Shalaka Mahadik, Pranav M. Pawar et al.
Recording-Aware Evaluation of Multimodal OT Intrusion Detection
Shared title terminologycs.CRMustafa Umut Ozbek, Khalil El-Khatib, Li Yang
ACE: An AI-Orchestrated Intrusion Detection and Compliance Mapping Engine
Shared title terminologycs.CRAbdoulie Ceesay, Rishikesh Sahay, Md Rasel Al Mamun et al.
My Credentials, Please: Detecting Filesystem Capability Laundering in MCP Servers at Scale
Shared title terminologycs.CRZeqian Huang, Mingyue Tang, Aonan Guan et al.