## 4 Experiments
### Hyperparameter Selection  
To fine-tune the hyperparameters of an MALSTM model using the IGWO algorithm, we followed this strategy: the hyperparameters, including the time step, neuron count in the three LSTM layers, dropout rate, epochs, and batch size, were treated as decision variables. The IGWO algorithm started with a group of 7 grey wolves, and each wolf had a search range of 7. The fitness of each grey wolf was evaluated based on its hyperparameter values. The leading wolf was identified, and the grey wolves' positions were adjusted using their relationships and a set formula. These positions were then translated back into corresponding hyperparameter values, and the MALSTM model was reconstructed and trained using these values. This iterative process continued until a stopping condition was met. Finally, the best combination of hyperparameters, determined by the grey wolf individual with the highest fitness, was utilized to optimize the performance of the MALSTM model. To ensure efficient resource utilization during the search process, it was essential to establish a reasonable search range for the parameters. We conducted an analysis of several research papers focusing on MALSTM based stock market prediction in China, along with relevant literature. These investigations thoroughly adjusted and tested parameter values, producing results that met researchers' expectations. As a result, the parameters used in these studies provided valuable guidance for setting the search range of our parameters. Most of these studies maintained the number of neurons in each MALSTM layer below 100 and the time step below 10. Additionally, many studies set the number of epochs around 100 or 200, with few opting for higher values. Taking these considerations into account, we established the appropriate parameter search ranges as follows: the number of neurons in each LSTM layer between 30 and 100, the time step between 1 and 10, and the batch size between 9000 and 10,000. After numerous tests, we found that using more than 100 epochs did not significantly affect our experiments. Given the limitations of the experimental setup, we set the search range for epochs to [50; 100]. Within the defined search range for optimizing objective parameters, the IGWO algorithm was utilized to determine the optimal parameters. Figure 8 and Table 4 depict the  
Figure 7: Test functions. optimization process for each parameter. Analysis revealed that the algorithm's fitness value reached its minimum after the third iteration and remained unchanged thereafter. Similarly, the values of the objective parameters stabilized after the third iteration, indicating that IGWO had identified the optimal parameters for the model. Table 5 presents the optimal parameters derived by the IGWO for the MALSTM model. These parameters consist of a lookback value of 8, with the number of neurons in each of the three LSTM layers set to 98, 88, and 66, a dropout rate of 0.133489, a batch size of 9583, and an epoch value of 98. These optimal values were determined through the IGWO optimization process applied to a stock prediction model. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Algorithm** & **Look** & **Neuron1** & **Neuron2** & **Neuron3** & **Dropout** & **Batch\_Size** & **Epochs** & **Algorithm** \\
**Iterations** & **Back** & & & & & & & & \\ \hline
1 & 1 & 96 & 89 & 82 & 0.379 & 9227 & 84 & 1 \\
2 & 8 & 38 & 54 & 71 & 0.186 & 9289 & 85 & 2 \\
3 & 9 & 45 & 84 & 70 & 0.212 & 9012 & 52 & 3 \\
4 & 7 & 97 & 70 & 46 & 0.334 & 9294 & 88 & 4 \\
5 & 8 & 47 & 92 & 72 & 0.268 & 9606 & 74 & 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Optimization iterative process of IGWO-MALSTM. Figure 8: Optimization iterative process of IGWO-MALSTM. To ensure a fair and unbiased comparison, all baseline models--including CS-LSTM, PSO-LSTM, Transformer, and LSTM-Transformer--were subjected to systematic hyperparameter tuning.