## 4 Experimental Results
### Transformer Model Performance  
To address the complexity of attack attribution in multi-adversary environments, we implemented a model based on the Transformer architecture, adapted to process alert sequences and capture long-range contextual dependencies. This subsection describes the specific configuration of the model and justifies its selection over traditional approaches. The Transformer model was designed to represent both IP addresses (victim and attacker) and alert identifiers using learned embeddings. The alert sequence was transformed into  
Figure 9: Confusion matrix of the MLP on the test set. Darker cells indicate higher classification counts. an embedding matrix, to which positional encoding was added to preserve temporal order. The core of the model was a multi-layer Transformer encoder, whose output was combined with the IP embeddings and fed into a dense layer for final classification. The specific configuration was as follows:  
* Alert embedding layer: 16 dimensions. * IP embedding layer: 16 dimensions for each IP (victim and attacker). * Positional encoding: applied to the alert sequence. * Transformer encoder: one or two layers, four attention heads, model dimension 16, dropout 0.1. * Input: sequences of lengths between 9 and 243 alerts, padded to the maximum length. * Loss function: cross-entropy with class weights inversely proportional to class frequency. * Optimizer: Adam, initial learning rate 0.001. * Training: early stopping, batch size 128, stratified cross-validation. Data split into 60% training, 20% validation, and 20% test. However, to ensure a more robust and unbiased evaluation, the experiments with the Transformer model employed a 5-fold stratified cross-validation scheme. In this setup, for each fold, 80% of the data was used for training, 10% for validation, and the remaining 10% for testing, ensuring that all samples were used for testing exactly once across the folds. Training and validation of the Transformer model required approximately 41 min per fold. Considering 5-fold cross-validation, the total time invested was about 206 min (around 3 h and 26 min) to complete the entire experimental process. This contrasted with the 25 min required by the MLP, reflecting the higher computational cost associated with more complex and robust models. Before analyzing the final performance on the test set, it was essential to observe how the Transformer model's ability to correctly attribute IPs evolved throughout the training and validation epochs. Figure 10 below presents the evolution of the main global metrics of the Transformer model during training and validation: loss, accuracy, weighted F1-score, and macro F1-score. Both the loss and performance metrics improved rapidly in the first epochs, stabilizing near their optimal values from epoch 6 onwards. The gap between the training and validation curves was minimal, indicating that the model did not exhibit significant overfitting and generalized well to unseen data. These curves reflect efficient and stable learning, with outstanding performance in both training and validation. Figure 11 shows the evolution of the F1-score for each IP. Most IPs achieved a perfect F1-score within a few epochs, indicating the model's rapid learning capacity for most classes. However, there was variability: some IPs required more epochs to reach optimal performance, as seen in the bottom right graph. This analysis helped identify possible difficult cases or minority classes that could require special attention or adjustments in the training strategy. This detailed analysis of per-IP evolution complemented the final  
Figure 10: Evolution of the global metrics of the Transformer model during training and validation: loss, accuracy, weighted F1-score, and macro F1-score. test evaluation, providing a more granular view of the learning dynamics and the model's robustness to attacker diversity.