arXiv:2610.30222cs.CROct 2026

Manuscript Offprint

arXiv:2610.30222

Parameters efficient language model with latent cross-attention for IoT intrusion detection

Frederic Adjewa, Moez Esseghir, Leila Merghem-Boulahia, Cheikh Kacfah

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Frédéric Adjewa*†, Moez Esseghir*, Leila Merghem-Boulahia*, Cheikh Kacfah†

  • University of Technology of Troyes, LIST3N, France

† Computer Science Department, Institut Universitaire Saint Jean du Cameroun, Cameroon

Email: {frederic.adjewa, moez.esseghir, leila.merghem_boulahia}@utt.fr, cheikh.kacfah@saintjeaningenieur.org

Abstract—Language models have shown strong potential for intrusion detection, but their high memory and computational demands make them difficult to deploy in resource-constrained IoT environments. In this work, we propose a compact Transformer-based architecture that compresses the input into a small latent space before processing it with a minimal Transformer core. We analyze nine compression configurations, compare parameter sharing with layer stacking, and evaluate our approach against SecurityBERT on two IoT intrusion detection datasets, Edge-IIoTset and CICIoT2023. With only 306k non-embedding parameters and 1.6 M parameters in total (6 MB), our model is about 7× smaller than SecurityBERT (11.2 M parameters, 45 MB). With the same privacy-preserving encoding, it outperforms SecurityBERT by about 2 points of macro F1-score on Edge-IIoTset and is within 0.7 points on CICIoT2023. It is also about 89× faster on a simulated edge device. We further show that a single Transformer layer is sufficient, and that parameter sharing matches layer stacking with up to 66% fewer parameters. These findings show that lightweight Transformer-based architectures can provide a practical and accurate solution for intrusion detection in resource-constrained IoT settings. 1^{1}.

Index Terms—Intrusion detection, Internet of Things, Cybersecurity, Language models, Model compression, Parameters sharing.

I. INTRODUCTION

Intrusion detection is no longer an optional component of modern digital infrastructures; it has become a critical requirement. This is especially true in the context of the Internet of Things (IoT), whose rapid expansion is reshaping many sectors of the society [1] As IoT ecosystems continue to grow, securing them becomes increasingly important, since these environments support massive volumes of heterogeneous interactions between connected devices. At the same time, the attack surface expands accordingly, and the threat landscape evolves at a comparable, if not faster, pace. In this context, intrusion detection systems (IDSs) play a central role in protecting the confidentiality, integrity, and availability of networks. They often constitute the first line of defense in IoT and Industrial IoT (IIoT) environments by identifying, reporting, and sometimes reacting to malicious or abnormal activities observed in network traffic [10]. A wide range of intrusion detection approaches has been proposed in the literature, including anomaly-based intrusion detection systems, which aim to identify deviations from normal network behavior. These approaches have benefited considerably from advances in machine learning and deep learning [5]. More recently, language-model-based methods have emerged as a promising direction for improving intrusion detection, since network logs, packets, and related telemetry can often be represented as text-like sequences. However, despite their strong modeling capacity, large language models remain difficult to deploy in IoT environments because of their substantial computational and memory requirements. Several studies have therefore explored ways to reduce this burden, for example, by reducing the number of Transformer blocks [16, 2] or by offloading heavy processing to more resourceful edge or cloud devices [4, 12].

While these strategies are effective to some extent, they raise an important question: is it really necessary to rely on large pretrained language models originally optimized for text data when dealing with network traffic? More specifically, can a compact Transformer-inspired model be designed to learn directly from network data, without requiring pretrained weights, while still achieving competitive intrusion detection performance?

To address this question, we propose an architecture tailored to resource-constrained environments 2^{2}. Our model first compresses the input sequence through a cross-attention mechanism into a learnable latent space, allowing the retention of most of the relevant information while reducing the influence of less useful input components. The resulting compressed representation is then processed by a Transformer module operating in the latent space, implemented either as a stack of Transformer blocks or through recursive parameters sharing. This design yields a more compact and memory-efficient architecture while maintaining strong detection performance. To evaluate the effectiveness of the proposed approach, we address the following research questions:

• RQ1: Which compression configuration provides the best trade-off between performance and efficiency?

• RQ2: What are the trade-offs between parameters sharing and Transformer stacking?

1^{1}Preprint. Under preparation for journal submission.

2^{2}https://github.com/freddyAdjh/pelm-iot-ids

  • RQ3: Can a compact model match the detection performance of a larger Transformer-based IDS while requiring substantially fewer computational resources?

The main contributions of this paper are threefold.

  1. We introduce a compact cross-attention-based architecture for intrusion detection that avoids reliance on large pretrained language models and is specifically designed for constrained IoT deployment;

  2. We provide a systematic analysis of the effects of latent-space size, Transformer depth, and parameters-sharing strategies on model performance, complexity, and runtime efficiency;

  3. We show experimentally that the proposed architecture achieves competitive performance relative to a much larger BERT-based baseline while requiring substantially fewer parameters and offering faster inference, particularly in IoT settings

The remainder of this paper is organized as follows. Section II reviews related work. Section III presents the proposed architecture and methodology. Section IV describes the experimental setup. Section V reports and discusses the results with respect to the research questions. Finally, Section VI concludes the paper and outlines future directions.

References (33)