# Beyond Model Scaling: Rethinking Sequence Construction for Transformer-based Network Intrusion Detection

DevFeed: [Beyond Model Scaling: Rethinking Sequence Construction for Transformer-based Network Intrusion Detection](<https://devfeed.tech/articles/beyond-model-scaling-rethinking-sequence-construction-for-transformer-based-network-intrusion-detection-126784.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.17725>)

Author: Zeeshan Zulkifl Shah, Muhammad Ikram, Dali Kaafar, Yipeng Zhou

Published: 2026-11-10T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Cryptography and Security](<https://devfeed.tech/sources/arxiv-cryptography-and-security.md>), [arXiv: Networking](<https://devfeed.tech/sources/arxiv-networking.md>)

Topics: [threat detection](<https://devfeed.tech/topics/threat-detection.md>), [Transformer](<https://devfeed.tech/topics/transformer.md>), [Detection engineering](<https://devfeed.tech/topics/detection-engineering.md>)

Tags: [coherent](<https://devfeed.tech/tags/coherent.md>), [communication](<https://devfeed.tech/tags/communication.md>), [construction](<https://devfeed.tech/tags/construction.md>), [context](<https://devfeed.tech/tags/context.md>), [cost](<https://devfeed.tech/tags/cost.md>), [cs-cr](<https://devfeed.tech/tags/cs-cr.md>), [cs-ni](<https://devfeed.tech/tags/cs-ni.md>), [cyberattacks](<https://devfeed.tech/tags/cyberattacks.md>), [datasets](<https://devfeed.tech/tags/datasets.md>), [design](<https://devfeed.tech/tags/design.md>), [evaluation](<https://devfeed.tech/tags/evaluation.md>), [flow](<https://devfeed.tech/tags/flow.md>), [fragments](<https://devfeed.tech/tags/fragments.md>), [inference](<https://devfeed.tech/tags/inference.md>), [input](<https://devfeed.tech/tags/input.md>), [intrusion-detection](<https://devfeed.tech/tags/intrusion-detection.md>), [lightweight](<https://devfeed.tech/tags/lightweight.md>), [models](<https://devfeed.tech/tags/models.md>), [network](<https://devfeed.tech/tags/network.md>), [scaling](<https://devfeed.tech/tags/scaling.md>), [sequence](<https://devfeed.tech/tags/sequence.md>), [transformer](<https://devfeed.tech/tags/transformer.md>)

## AI overview

The study finds that how network traffic is sequenced matters more for transformer-based intrusion detection than model size. Its session-coherent temporalization groups flows by communication session rather than fixed timestamp windows, which can fragment related attacks and combine unrelated traffic. Across three datasets, this approach more than doubled Macro-F1 over timestamp windowing and enabled lightweight transformers to reach up to 0.95 Macro-F1 with higher inference throughput than pretrained models. Increasing model size from 0.65M to 3.38M parameters brought no measurable accuracy gain despite higher computational cost; zero-shot cross-dataset gains under domain shift were modest.

## Source excerpt

arXiv:2610.17725v2 Announce Type: replace-cross 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.