## 3 Theoretical Background
### Graph Attention Network Classifier  
Graph Neural Networks (GNNs) are DL models that perform learning on data in a graph structure at the node, edge, or graph level [38]. Unlike traditional neural networks, GNNs extract features for each node by considering the topological relationships and contextual information between nodes and represent these nodes as vectors [39]. GNNs generally use the message-passing method [2]. In this method, each node receives information from its neighbors and combines it with its features to create an updated node representation. In recent years, GNNs have achieved significant performance gains in many tasks such as Graph Convolutional Networks (GCNs) [40], GraphSAGE [28], and GAT [41]. Therefore, many studies have started to rely on GNNs for malware analysis. GAT is an improved version of GNNs and dynamically determines the importance of neighbors by giving different weights to the information from the neighbors of each node [42]. Using the attention mechanism, GAT learns the importance of each node relationship and thus obtains better node representations [43]. GAT calculates an attention coefficient (\(e_{vu}\)) for each node v and its neighbor \(u\). This coefficient is calculated using the feature vectors (\(h_{v}\) and \(h_{u}\)) of node \(v\) and its neighbor \(u\) as follows:  
\[e_{vu}=\text{LeakyReLU}\Big{(}a^{T}\cdot[Wh_{v}\parallel Wh_{u}]\Big{)} \tag{7}\]  
where a is the learnable weight vector, \(W\) is the learnable weight matrix, \([Wh_{v}\parallel Wh_{u}]\) is the concatenation of the feature vectors of nodes \(v\) and \(u\). LeakyReLU is an activation function that provides a small slope for negative values. The attention coefficients are normalized by the softmax function, so that the sum of the attention coefficients among the neighbors of node \(v\) is 1:  
\[\alpha_{vu}=\frac{\exp(e_{vu})}{\sum_{k\in N(v)}\exp(e_{vk})} \tag{8}\]  
where \(\alpha_{vu}\) determines the influence of node u on node v. This normalization process expresses the relative importance of neighbors. Each node \(v\) creates a new node representation \(h_{v}\) by weighting the features from its neighbors with their normalized attention coefficients:  
\[h_{v}^{\prime}=\sigma\left(\sum_{u\in N(v)}\alpha_{vu}Wh_{u}\right) \tag{9}\]  
This formula allows the node to be updated by considering its neighbors' information. Thus, each node has richer information, not only about itself but also about its neighbors. GAT generally uses the multi-head attention mechanism. This mechanism learns the representation of a node using multiple independent attention heads and combines the results of these heads. The multi-head attention mechanism is formulated as:  
\[h_{v}^{\prime}=\left\|_{k-1}^{K}\sigma\Bigg{(}\sum_{u\in N(v)}\alpha_{vu}^{k} W^{k}h_{u}\Bigg{)}\right. \tag{10}\]  
where \(K\) denotes the number of attention heads and \(\left\|_{k-1}^{K}\right.\) denotes the concatenation of heads. This method allows capturing different relationships between nodes and creating a more robust node representation. All notations and explanations in the study are given in Table 1.  
The role of GAT has been evaluated both as a standalone classifier and feature extractor in different scenarios. In Experiment 2, GAT was used as a standalone classifier, and its performance was compared with the combinations of Node2 Vec + GAT and GraphSAGE + GAT. This experiment aims to examine the effectiveness of GAT in malware detection by directly exploiting the contextual relationships between nodes and neighbors. In Experiment 3, the node embeddings obtained using Node2 Vec and GraphSAGE were further improved with GAT, and these improved embeddings were evaluated with custom CNN-GRU-3 and ensemble learning models. This experiment aims to demonstrate the potential of GAT to improve classification performance by making node embeddings more contextual. Finally, in Experiment 4, GAT was used only as a feature extractor, and the embeddings obtained from graph data were fed to CNN-GRU-3 and ensemble learning models.