## 6 Discussion
### Discussion: RNNs vs. Transformer Families
The dataset in the experiment is divided into different parts: 70% for model training, 10% for validation and optimization of model parameters, and the remaining 20% for testing to measure various evaluation metrics. In the experiment, we manually set the learning rate to 0.001, batch size to 8, number of epochs for the training phase to 60, input time window to 108, and prediction lengths to 1, 3, and 6. Model training is conducted on the Windows 10 platform with a GTX 4090 GPU. PyTorch 1.8.0 is the chosen framework for model implementation. We train the ARIMA, SVR, LSTM, and informer models to predict passenger inflow and outflow. As shown in Table 4, the experimental results display the prediction performance of ARIMA, SVR, LSTM, and informer on this dataset. Compared to other models, LSTM demonstrates the best predictive performance, achieving the lowest RMSE and MAE. As a result, LSTM, as an RNN, sometimes has a better predictive effect than the transformer families' model. To more intuitively illustrate the predictive performance of each model in the comparative experiments, we visualized the prediction results for three types of typical stations, as shown in Figure 9. The three typical stations are Wuhe station, which is a residential-oriented station; Hi-Tech Park station, which is an employment-oriented station; and Houhai station, which is a transportation hub. According to the comparison illustrated in Figure 9, LSTM accurately captures patterns in passenger flow during early peak hours, significantly outperforming all other models, including informer. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Time Steps** & **RMSE** & **MAE** \\ \hline \multirow{5}{*}{ARIMA} & 1 & 34.18 & 17.71 \\  & 3 & 47.21 & 23.10 \\  & 6 & 66.60 & 30.94 \\  & 1 & 30.22 & 15.33 \\ SVR & 3 & 37.28 & 17.84 \\  & 6 & 46.17 & 20.97 \\  & 1 & 27.48 & 14.96 \\ Informer & 3 & 28.35 & 15.22 \\  & 6 & 28.55 & 15.25 \\  & 1 & 21.91 & 11.66 \\ LSTM & 3 & 23.78 & 12.47 \\  & 6 & 24.55 & 12.84 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The prediction results of the ARIMA, SVR, LSTM, and informer models. Here are some key considerations that might explain why LSTM outperformed informer in our metro passenger flow prediction task. 1. LSTMs are excellent at capturing local temporal patterns and short-term dependencies, which might be prevalent in our metro passenger flow data. Transformers are powerful in capturing long-range dependencies and complex patterns, which might be more useful in datasets with longer historical dependencies or more complex temporal interactions. 2. LSTMs tend to perform well with smaller datasets. They can overfit less easily than transformers if the data are limited. Transformers generally require larger datasets to  
Figure 9: Visualization of the forecast results of three types of typical stations during peak hours. (**a**) Wuhe station. (**b**) Hi-Tech Park station. (**c**) Houhai station. train effectively. They are data hungry and might not perform as well with smaller datasets due to their large number of parameters and high complexity. 3. LSTMs can sometimes handle noisy data better due to their gating mechanisms that control the flow of information. Transformers can be sensitive to noise, and their performance might degrade if the data are not clean or highly variable without sufficient training data to generalize well. 4. LSTMs have a simpler architecture compared to transformers, which might make them easier to train and tune, especially when computational resources are limited. Transformers, with their self-attention mechanisms and multi-head attention, are more complex and require more computational resources for training. This complexity can be a disadvantage if the computational infrastructure is not robust enough. 5. For tasks with clear and strong temporal dependencies, LSTMs can effectively leverage their ability to remember previous states.