## 4 RNN Structures Used for Traffic Prediction
### GRUs  
The GRU, as another prominent gated structure, was initially proposed by [PERSON] et al. [68]. The GRU was proposed primarily to optimize the complexity and computational cost of LSTMs. While LSTMs are powerful, their structure includes three gates and a cell state, making the model complex and parameter heavy. The GRU simplifies the model structure by merging the forget gate and input gate into a single update gate, reducing the number of parameters and improving computational efficiency. Additionally, the GRU does not have a separate cell state; it operates directly on the hidden state, simplifying the flow of information and memory management. These improvements enable the GRU to efficiently handle tasks requiring capturing long-term dependencies while remaining a powerful model choice. The propagation formulas of the GRU are as follows:  
\[\begin{array}{l}\mathbf{z_{t}}=\sigma(W_{z}[\mathbf{h_{t-1}},\mathbf{x_{t}}]+\mathbf{b_{z}}) \\ \mathbf{r_{t}}=\sigma(W_{r}[\mathbf{h_{t-1}},\mathbf{x_{t}}]+\mathbf{b_{r}})\\ \mathbf{C_{t}}=\tanh(W_{\text{C}}[\mathbf{r_{t}}\cdot\mathbf{h_{t-1}},\mathbf{x_{t}}]+\mathbf{b_{c}}) \\ \mathbf{h_{t}}=\mathbf{z_{t}}\cdot\mathbf{h_{t-1}}+(\mathbf{1}-\mathbf{z_{t}})\cdot\mathbf{C_{t}}\end{array} \tag{4}\]  
Here, \(\mathbf{z_{t}}\) is the output of the update gate and \(\mathbf{r_{t}}\) is the output of the reset gate. \(W_{z}\), \(W_{r}\), and \(W_{\text{C}}\) are the weight matrices for the update gate, reset gate, and candidate layer. \(\mathbf{b_{z}}\), \(\mathbf{b_{r}}\), and \(\mathbf{b_{c}}\) are the bias vectors for the update gate, reset gate, and candidate layer.  
The GRU operates by effectively balancing the retention and introduction of new information in time series data. The update gate output \(\mathbf{z_{t}}\) controls the extent to which the previous hidden state \(\mathbf{h_{t-1}}\) is retained. The reset gate output \(\mathbf{r_{t}}\) dictates the influence of \(\mathbf{h_{t-1}}\) on the candidate's hidden state \(\mathbf{C_{t}}\). The candidate's hidden state \(\mathbf{C_{t}}\) is obtained by applying the tanh activation function tanh to the linear combination of the reset gate-adjusted previous hidden state and the current input. The final hidden state \(\mathbf{h_{t}}\) results from a linear combination of the previous hidden state, controlled by the output of the update gate, and the new candidate hidden state. The weight matrix \(W_{C}\) is used to generate the candidate state, while the bias \(\mathbf{b_{c}}\) adjusts its bias. Thus, the GRU can effectively update its state, capturing long-term dependencies in time series data.  
Figure 5 shows a comparison between the structures of the RNN and its variants. The RNN represents the simplest form, showing a single recurrent layer; the distinction of the LSTM lies in the introduction of three types of gates (input, forget, and output gates), which allow the network to selectively remember or forget information and a cell state that helps maintain long-term dependencies, aiming to overcome the common problem of vanishing gradients seen in simple RNNs. The GRU merges the LSTM's input and forget gates into a single update gate and combines the cell state and hidden state into a unified mechanism. Overall, this diagram clearly explains how different RNNs and their variants process information to handle sequential data.