## 3 Materials and Methods
### Local Estnet
After obtaining \(\rho_{s_{i},s_{v}}^{m}\), the dynamic spatial representations output by the \(l^{th}\) layer are formally given as  
\[{}^{l}hs_{s_{i},l_{j}}^{m}=\sum_{r}^{n_{i}}\alpha_{s_{i},s_{i},l_{j}}^{m}f_{v} ^{m}\left(l^{-1}hs_{s_{i},l_{j}}\right), \tag{6}\]  
\[{}^{l}hs_{s_{i},l_{j}}=BN\left(\left[\underset{m=1}{\overset{l}{\prod}}{}^{l} hs_{s_{i},l_{j}}^{m}\right.\text{W}_{s}+l^{-1}hs_{s_{i},l_{j}}\right), \tag{7}\]  
where \(f_{v}^{m}\) is the formula (5) for obtaining the value vector in the \(m^{th}\) head. \(||\) and BN separately represent the concentration and batch normalization. \(M\) is the total number of heads. \(W_{s}\) denotes the learnable weights. By iterative \(L-\)layer operations utilizing Equations (3)-(7), the final output of spatial representations in the site \(s_{i}\) at timestep \(t_{j}\) is presented as \({}^{l}hs_{s_{i},l_{j}}\in\mathbb{R}^{d_{\text{model}}}\). We extend the above calculation to all \(n_{i}\) sites at historical \(P\) timesteps to acquire the spatial representations of the urban region \(i\), \({}^{L}HS\in\mathbb{R}^{P\times n_{i}\times d_{\text{model}}}\). _LSTM_: Since urban \(PM_{2.5}\) typically constitutes a time series, these data can be modeled under consideration of the dynamic temporal dependencies among different timesteps. In view of this, we employ long short-term memory (LSTM) to capture temporal dependencies [32] behind MHSA. Figure 2 indicates the specific structure of the LSTM. The LSTM is composed of multiple LSTM units, in which each unit has the same structure. A unit corresponds to processing data at a timestep, and there are connections among units. In detail, at the timestep \(t_{j}\), the LSTM unit contains one memory cell and three gates, e.g., a forget gate \(F_{t_{j}}\), input gate \(I_{t_{j}}\), and output gate \(O_{t_{j}}\). The contents of memory cell state \(C_{t_{j}}\) are controlled by \(F_{t_{j}}\) and \(I_{t_{j}}\). \(O_{t_{j}}\) can determine the amount of \(C_{t_{j}}\) to be projected into the current output \(HST_{t_{j}}\in\mathbb{R}^{n_{i}\times d_{\text{model}}}\) of the LSTM unit. The computation process of the LSTM unit at timestep \(t_{j}\) is as follows:  
Figure 2.0 Figure 2.1 Figure 2.2 Figure 2.3 Figure 2.4  
Figure 2.5 Multi-head self attention (MHSA) of the spatial dependencies among different sensors in the urban region \(i\). where \(W_{F}\), \(W_{I}\), \(W_{O}\), and \(W_{C}\) denote weight matrices for the input of dynamic spatial representations \({}^{L}HS_{t_{j}}\in\mathbb{R}^{n_{i}\times d_{\text{model}}}\) at timestep \(t_{j}\). \(U_{F}\), \(U_{I}\), \(U_{O}\), and \(U_{C}\) represent the weight matrices allocated to the state of the memory cell \(HST_{t_{j-1}}\) from the previous LSTM unit. \(b_{F}\), \(b_{I}\), \(b_{O}\), and \(b_{C}\) are bias vectors. To provide non-linearity, we leverage sigmoid functions as \(\sigma_{g}\). \(\odot\) is the element-wise product. Each LSTM unit outputs a feature matrix. Thus, the spatio-temporal representations \(HST\in\mathbb{R}^{n_{i}\times d_{\text{model}}}\) are acquired through summing them together, which formalizes as  
Figure 2.6  
_(4) Prediction Layer_ After th spatio-temporal learning layer, the prediction layer is utilized to generate output sequences. Specifically, in [33], a sequence-to-sequence (seq2 seq) architecture was developed. It was first applied to machine translation and later to the field of air pollution prediction. Seq2 seq consists of an encoder and a decoder. The encoder is leveraged to encode the input sequence to a semantic vector, and then the decoder decodes this vector to the target sequence. Each unit structure in the decoder remains consistent, and the semantic vector serves as the input for each prediction timestep of the decoder. Therefore, we utilize the decoder of Seq2 seq to generate the prediction sequence, where each unit employs an LSTM unit. Taking the future timestep \(t_{P+k}\) as an example, the output of the decoder at the \(t_{P+k}\) timestep is given by  
\[