# ThreatFormer-IDS: Robust Transformer Intrusion Detection with Zero-Day Generalization and Explainable Attribution

arXiv: https://arxiv.org/abs/2603.00185 · HTML: https://mlsanity.com/paper/2603.00185/

## Key facts

- Cited by 2 papers in the map (data through 14 Oct 2026).
- Builds on 3 of its 16 references that are in the map.
- First posted on arXiv 26 Feb 2026.

## Builds on (most cited first, 3 of 3)

- [FlowTransformer: A Transformer Framework for Flow-based Network Intrusion Detection Systems](https://mlsanity.com/paper/2304.14746/) (2023)
- [Adversarial Challenges in Network Intrusion Detection Systems: Research Insights and Future Prospects](https://mlsanity.com/paper/2409.18736/) (2024)
- [An Adaptable Deep Learning-Based Intrusion Detection System to Zero-Day Attacks](https://mlsanity.com/paper/2108.09199/) (2021)

## Built on by (most cited first, 2 of 2)

- [Cyber-Financial Contagion: Modeling the Propagation of an AI Vendor Compromise Through the Banking System](https://mlsanity.com/paper/2609.10350/) (2026)
- [Graph-Transformer Fraud Detection with Self-Supervised Pretraining and Conformal Risk Control](https://mlsanity.com/paper/2609.14234/) (2026)

## Abstract (arXiv)

Intrusion detection in IoT and industrial networks requires models that can detect rare attacks at low false-positive rates while remaining reliable under evolving traffic and limited labels. Existing IDS solutions often report strong in-distribution accuracy, but they may degrade when evaluated on future traffic, unseen (zero-day) attack families, or adversarial feature manipulations, and many systems provide limited evidence to support analyst triage. To address these gaps, we propose ThreatFormer- IDS, a Transformer-based sequence modeling framework that converts flow records into time-ordered windows and learns contextual representations for robust intrusion screening. The method combines (i) weighted supervised learning for imbalanced detection, (ii) masked self-supervised learning to improve representation stability under drift and sparse labels, (iii) PGDbased adversarial training with scale-normalized perturbations to strengthen resilience against feature-level evasion, and (iv) Integrated Gradients attribution to highlight influential time steps and features for each alert. On the ToN IoT benchmark with chronological evaluation, ThreatFormer-IDS achieves AUCROC 0.994, AUC-PR 0.956, and Recall@1%FPR 0.910, outperforming strong tree-based and sequence baselines. Under a zero-day protocol with held-out attack families, it maintains superior generalization (AUC-PR 0.721, Recall@1%FPR 0.783). Robustness tests further show slower degradation in AUCPR as the adversarial budget increases, confirming improved stability under bounded perturbations. Overall, ThreatFormer- IDS provides a unified, deployment-oriented IDS pipeline that balances detection quality, zero-day behavior, robustness, and explainability.
