## 3 Proposed Joint Traffic Prediction and Handover Design Framework
### Lstm\(-\)Enabled Traffic Prediction  
LSTM networks, with their ability to model sequential data and capture long\(-\)term dependencies, are well\(-\)suited for predicting TTG traffic demand, enabling optimized satellite communication performance. To leverage LSTM for traffic prediction, we model the historical traffic data of each TTG as a time series with dimensions \([T_{l},F_{l}]\), where \(T_{l}\) denotes the number of historical time slots used for prediction, and \(F_{l}\) represents the number of channels for each TTG's traffic data. As illustrated in Figure 3, data from each  
Figure 2: An illustration of the workflow of the proposed ARTHF.  
TTG is processed independently by a two\(-\)layer stacked LSTM architecture. Within this architecture, the first LSTM layer sequentially processes the input feature vector \(\mathbf{x}^{t}\in\mathbb{R}^{F_{l}}\) for each time slot \(t\), leveraging its previous hidden state \(\mathbf{h}_{(1)}^{t-1}\) to generate current hidden states \(\mathbf{h}_{(1)}^{t}\). These outputs are then fed into the second LSTM layer, which further refines them to produce \(\mathbf{h}_{(2)}^{t}\). Once all inputs have been processed by the stacked LSTM layers, the final hidden states \(\mathbf{h}_{(2)}^{t}\) from the second LSTM layer are stacked and passed through a series of fully connected layers with ReLU activation to generate traffic predictions \(d_{k,pre}^{t}\) for each TTG.  
Each LSTM layer employs forget, input, and output gates to regulate the information flow, maintaining a memory cell that selectively retains or discards information to capture temporal dependencies. For each time slot \(t\) in the first layer, the LSTM processes the input feature vector \(\mathbf{x}^{t}\in\mathbb{R}^{F_{l}}\) and the previous hidden state \(\mathbf{h}_{(1)}^{t-1}\). First, the forget gate discards irrelevant information from the previous cell state \(\mathbf{c}_{(1)}^{t-1}\), expressed as  
\[\mathbf{f}^{t}=\sigma\Big{(}\mathbf{W}_{f,(1)}\cdot\Big{[}\mathbf{h}_{(1)}^{t -1},\mathbf{x}^{t}\Big{]}+\mathbf{b}_{f,(1)}\Big{)}, \tag{20}\]  
where \(\mathbf{W}_{f,(1)}\) is the forget gate's weight matrix, \(\mathbf{b}_{f,(1)}\) is its bias vector, and \(\sigma\) denotes the sigmoid function. The input gate then decides what new information to store, which is calculated by  
\[\mathbf{i}^{t}=\sigma\Big{(}\mathbf{W}_{i,(1)}\cdot\Big{[}\mathbf{h}_{(1)}^{t -1},\mathbf{x}^{t}\Big{]}+\mathbf{b}_{i,(1)}\Big{)}, \tag{21}\]  
Figure 3: An illustration of the detailed architecture of the stacked LSTM network for time series traffic prediction.  
where \(\mathbf{W}_{i,(1)}\) is the input gate's weight matrix, and \(\mathbf{b}_{i,(1)}\) is the bias vector. Concurrently, a candidate cell state is computed using  
\[\widehat{\mathbf{c}}^{t}=\tanh\Bigl{(}\mathbf{W}_{c,(1)}\cdot\Bigl{[}\mathbf{h }_{(1)}^{t-1},\mathbf{x}^{t}\Bigr{]}+\mathbf{b}_{c,(1)}\Bigr{)}, \tag{22}\]  
where \(\mathbf{W}_{c,(1)}\) is the candidate state's weight matrix, and \(\mathbf{b}_{c,(1)}\) is its bias vector. Then, the cell state is updated using  
\[\mathbf{c}_{(1)}^{t}=\mathbf{f}^{t}\odot\mathbf{c}_{(1)}^{t-1}+\mathbf{i}^{t} \odot\widehat{\mathbf{c}}^{t}, \tag{23}\]  
combining retained and new information. Finally, the output gate produces the hidden state  
\[\mathbf{h}_{(1)}^{t}=\mathbf{o}^{t}\odot\tanh(\mathbf{c}_{(1)}^{t}), \tag{24}\]  
where \(\mathbf{o}^{t}=\sigma(\mathbf{W}_{o,(1)}\cdot[\mathbf{h}_{(1)}^{t-1},\mathbf{ x}^{t}]+\mathbf{b}_{o,(1)})\), with \(\mathbf{W}_{o,(1)}\) as the output gate's weight matrix and \(\mathbf{b}_{o,(1)}\) as its bias vector. The second LSTM layer applies identical gated operations with its own weight matrices \((\mathbf{W}_{f,(2)},\mathbf{W}_{i,(2)},\mathbf{W}_{c,(2)},\mathbf{W}_{o,(2)})\) and bias vectors \((\mathbf{b}_{f,(2)},\mathbf{b}_{i,(2)},\mathbf{b}_{c,(2)},\mathbf{b}_{o,(2)})\) to produce its hidden state \(\mathbf{h}_{(2)}^{t}\).