arXiv · 2610.17725
Beyond Model Scaling: Rethinking Sequence Construction for Transformer-based Network Intrusion Detection
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.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Zeeshan Zulkifl Shah, Muhammad Ikram, Dali Kaafar, Yipeng Zhou. 2026-10-13. Beyond Model Scaling: Rethinking Sequence Construction for Transformer-based Network Intrusion Detection. https://arxiv.org/abs/2610.17725
Cite the original work for its findings. Save a collection to share your selection of sources.