arXiv:2606.11098cs.CRcs.LG2026-06

Transformer在真实序列上表现不错,但多数高分结果源于数据泄露。

Do Transformers Actually Help Intrusion Detection? A Temporal Sequence Evaluation on CIC-IDS2017

论文配图:Do Transformers Actually Help Intrusion Detection? A Temporal Sequence Evaluation on CIC-IDS2017
图 1 · 摘自论文原文
  • 用真实网络会话构建有序数据流,避免数据泄露
  • Transformer在无填充序列中宏平均F1达0.89,优于其他模型
  • 填充方式误导性能评估,适合关注方法严谨性的研究者

近年来,网络入侵检测的深度学习方法越来越多地采用循环网络和Transformer等时序架构,常在CIC-IDS2017数据集上报告接近完美的性能。然而,许多现有研究未提供真实的序列输入,也未在无数据泄露条件下评估,难以判断性能提升是否真正来自序列建模能力。本文通过从网络会话中构建有序流量序列,将CIC-IDS2017重构为时序入侵检测任务,对九种经典与深度学习模型在随机划分、两种无泄露划分及填充方案消融实验下进行基准测试。核心发现是:填充方式而非模型架构决定Transformer性能——在真实序列(非填充)窗口中,Transformer取得最高宏平均F1(0.89),但在零填充+掩码评估下性能显著下降,而LSTM、GRU和1D-CNN保持稳定;类平衡随机森林整体最稳健。相同重复尾部填充导致Transformer误报率增加67倍,仅在无泄露评估中暴露。评估方法——特别是填充方式和划分协议——对报告性能的影响远超模型选择。我们建议未来研究采用无泄露划分、明确披露填充策略及序列感知基准测试。代码与实现细节见:https://github.com/zachmocz/temporal-ids-bench。

原文摘要 · Abstract (English)

Recent deep learning approaches for network intrusion detection increasingly incorporate temporal architectures such as recurrent networks and Transformers, often reporting near-perfect performance on CIC-IDS2017. However, many existing studies neither supply their temporal modules with genuine sequence inputs nor evaluate under realistic, leakage-free conditions, making it unclear whether reported gains arise from true sequence-modelling capability. In this work, we reformulate CIC-IDS2017 as a temporal intrusion-detection task by constructing ordered flow sequences from network conversations and benchmarking nine classical and deep learning architectures under a random split, two leakage-free splits, and a padding-scheme ablation. The central finding is that padding convention, not architecture, determines the Transformer's performance: on genuinely sequential (non-padded) windows the Transformer achieves the highest macro-F1 of any model in the experiment ($0.89$), yet under zero-pad+mask evaluation it drops markedly while LSTM, GRU, and 1D-CNN remain stable and a class-balanced Random Forest is the most robust model overall. The same repeat-last padding cue masks a $67\times$ increase in the Transformer's false-alarm rate that only leakage-free evaluation reveals. Evaluation methodology -- specifically padding convention and split protocol -- thus has a larger effect on reported performance than architectural choice. We advocate for leakage-free splits, explicit padding disclosure, and sequence-aware benchmarking as standard practice in future IDS research. Our code and implementation details are available here: https://github.com/zachmocz/temporal-ids-bench.

入侵检测Transformer时序建模数据泄露

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。