# xLSTM-Based Urban Traffic Flow Prediction for Intelligent Transportation Governance
## 2 Materials and Methods
### xLSTM Model Architecture and Training [8]
This makes it more appropriate for edge deployment environments such as police dispatch control centers or onboard intelligent transportation systems (ITSs), where real-time responsiveness is essential. Moreover, xLSTM demonstrates greater robustness under limited or noisy datasets, a frequent scenario when integrating heterogeneous traffic data streams from multiple municipal departments or legacy infrastructure. As such, xLSTM strikes an optimal balance between predictive accuracy, computational efficiency, and deployment feasibility--making it a practical solution for real-time, congestion-aware urban traffic governance. Figure 2: Architecture diagram of the gate/memory flow in xLSTM. Traditional dropout techniques--designed to prevent overfitting by randomly deactivating neurons during training--have proven effective in feedforward and standard recurrent neural networks. However, when applied directly to the xLSTM architecture, conventional dropout strategies introduced undesirable constraints that hindered performance consistency [29]. This prompted a re-evaluation of regularization mechanisms better aligned with the xLSTM's native structure. Rather than applying dropout externally, this study adopts a structural simplification strategy to achieve regularization effects through parameter minimization. Specifically, certain internal parameter matrices are discarded to reduce model complexity and computational overhead. This approach draws inspiration from the Gated Recurrent Unit (GRU), which achieves comparable performance to LSTM models while utilizing fewer trainable parameters. In line with this insight, the xLSTM design selectively eliminates redundant projection matrices while preserving core modeling capabilities. Assume that for all \(t\in[1,T]\), the hidden state \(h_{t-1}\in R^{h}\) represents the memory from the forward pass, which is defined as follows:  
\[x_{t}\mid x_{t-1},\ldots,x_{1}\sim\widetilde{x}_{t}\mid h_{t-1} \tag{1}\]  
\[\text{Forget gate}:\;f_{t}=\sigma\Big{(}W_{f}x_{t}+U_{f}h_{t-1}+b_{f}\Big{)} \tag{2}\]  
\[\text{Input gate}:\;i_{t}=\sigma(W_{i}x_{t}+U_{i}h_{t-1}+b_{i}) \tag{3}\]  
\[\text{Candidate activation}:\;z_{t}=\tanh(W_{z}x_{t}+U_{z}(h_{t-1}\odot i_{t})+b_{z}) \tag{4}\]  
\[h_{t}=(1-f_{t})\odot h_{t-1}+f_{t}\odot z_{t} \tag{5}\]  
\[G_{t}=\exp(W_{x}x_{t}+W_{h}h_{t-1}) \tag{6}\]  
To enhance clarity, we explicitly define all the symbols used in Equations (1)-(5) as follows:  
\(x_{t}\): input vector at time step \(t\);  
\(h_{t-1}\): hidden state from the previous time step;  
\(f_{t}\): forget gate output;  
\(i_{t}\): input gate output;  
\(\widetilde{\mathcal{C}}_{t}\): candidate cell state;  
\(C_{t}\): current cell (memory) state;  
\(o_{t}\): output gate;  
\(h_{t}\): current hidden state;  
\(W_{t}\), \(U_{t}\): trainable weight matrices;  
\(\odot\): element-wise multiplication;  
exp: exponential activation function used in gate computations. The final hidden state \(h_{t}\) is passed through a fully connected layer followed by a sigmoid activation to generate a congestion score \(s_{t}\in[0,1]\), which serves as the prediction target. The output of the xLSTM model is a continuous congestion score \(s_{t}\in[0,1]\), which represents the predicted severity of traffic conditions. To facilitate actionable interpretation, the score is discretized into four levels based on empirically determined thresholds, as follows:  
\[\text{Free flow} (s_{t}<0.2);\] \[\text{Normal traffic} (0.2\leq s_{t}<0.5);\] Figure 2:0 Figure 2:1These thresholds were calibrated using historical data distributions and validated through cross-validation experiments to align with operational dispatch needs. The corresponding color legend is illustrated at the bottom of Figure 3, visually mapping the congestion score to intuitive traffic severity levels. Additionally, this study explored the xGRU architecture, an extended version of GRU infused with key concepts from xLSTM, including exponential gating and matrix memory dynamics.