## 3 Materials and Method
### Proposed Method
#### 3.3.3 Synchronous Attention Mechanism  
The synchronous attention mechanism comprises two main parts, namely, intra-block attention and inter-block attention. These components work together to enable the model to simultaneously consider the association information with other data blocks while processing a single data block, such as text segments or image areas, as illustrated in Figure 5.  
Figure 5: The depiction elaborates on the structure of the synchronized attention mechanism proposed in this paper, including the information processing flows within (intra-) and across (inter-)blocks. It demonstrates how the combination of self-attention operations within internal blocks and synchronized strategies across blocks enables the model to capture the characteristics of a single data block while integrating information from other blocks, thereby optimizing the detection performance of network attack behaviors. **Intra-block** attention is primarily focused on the processing of information within a single data block. This mechanism employs a traditional self-attention mechanism to analyze and understand the relationships of features within the data block. Each data block is considered a subset of the input data, where the intra-block mechanism determines the importance of each element for the output by calculating the interactions among the elements within the data block. This usually involves calculating the dot product of the query and the key followed by normalization using the softmax function. This mechanism aids in capturing complex internal features such as local semantic relationships in textual data. The mathematical expression can be described as follows:  
\[\text{Intra-Attention}(Q,K,V)=\text{softmax}\bigg{(}\frac{QK^{T}}{\sqrt{d_{k} }}\bigg{)}V \tag{14}\]  
where \(Q\), \(K\), and \(V\) respectively represent the query, key, and value matrices and \(d_{k}\) is the dimension of the key vectors. **Inter-block** attention, unlike intra-block attention, is designed to enable the model to consider information from other data blocks while processing a particular data block. This mechanism assumes that there may be associations between different data blocks; if these associations are effectively utilized, they can greatly enhance the model's information processing capacity and decision accuracy. Inter-block mechanisms achieve this by transferring and synchronizing information between different data blocks, such as by weighted merging of feature representations from different blocks. The mathematical expression can be described as follows:  
\[\text{Inter-Attention}(Q,K,V)=\text{softmax}\bigg{(}\frac{Q(K+S)^{T}}{\sqrt{d _{k}}}\bigg{)}V \tag{15}\]  
where \(S\) represents the synchronization signal from other data blocks, which can be the feature representation of another block or specially processed information. Such attention mechanisms have the following advantages:  
1. They enhance the model's global understanding ability. By synchronizing information between different data blocks, the model can achieve a more in-depth understanding on a global level, especially for processing cross-modal or cross-domain data, significantly improving the model's comprehensive performance. 2. They enhance the model's ability to capture complex data patterns. Complex cyberattack behaviors often involve multiple types of data and interactions at various levels. The synchronous attention mechanism helps the model to capture these complex data patterns and relationships, improving detection accuracy. 3. They improve the model's adaptability and flexibility. The mechanism allows the model to flexibly adjust the focus of attention and optimize the information processing flow based on task requirements and data characteristics, enhancing the model's adaptability and applicability in different scenarios. **Single block and parameter design:** In the specific network design, the basic processing unit for each data block is implemented through a multi-layer stacked transformer network structure.