## 2 Methodology
### Guided Diffusion Model with Transformer
#### 2.2.1 Guided Diffusion Model  
Diffusion models are probabilistic frameworks that seek to model data distribution by iteratively refine a variable initialized with a normal distribution through a denoising process. This process involves establishing a Markov chain of diffusion steps, where systematic noise is gradually introduced to the input data during the forward diffusion process [71]. Considering the future time-frequency data as input \(z_{0}\), as shown in Equations (6) and (7), the forward diffusion process can be represented as a Markov chain with a length of \(T\):  
\[q(z_{t}|z_{t-1}):=N\Big{(}z_{t};\sqrt{1-\beta_{t}z_{t-1}},\beta_{t}I\Big{)};\; \beta_{t}\in(0,1);t\in\{1,\ldots,T\} \tag{6}\]  
\[q(z_{1:T}|z_{0}):=\prod_{t=1}^{T}q(z_{t}|z_{t-1});t\in\{1,\ldots,T\} \tag{7}\]  
where \(\beta_{t}\in(0,1)\) is the variance scheduler that regulates the step size of the noise added \(t\in\{1,\ldots,T\}\) is the \(t\) uniformly sampled from \(\{1,\ldots,T\}\).  
Our goal is to predict future time-frequency data from noise input \(z_{t}\approx N(0,I)\) given a condition (known data), with the trained guided diffusion model consisting of future data encoder \(\varepsilon\), predicted data decoder \(D\), and known data encoder \(\tau_{\theta}\), which paves the way to controlling the prediction process via known data \(y\). Given time-frequency data \(x\), the encoder \(\varepsilon\) encodes \(x\) into a latent representation \(z=\varepsilon(x)\), and the decoder \(D\) reconstructs the time-frequency data from the latent, giving \(\widetilde{x}=D(z)=D(\varepsilon(x))\).  
The data prediction can be achieved using a conditional denoising autoencoder \(\varepsilon_{\theta}(z_{t},t,\tau_{\theta}(y))\), the conditional denoising autoencoder can predict the future time-frequency data given known data conditions. With a U-Net backbone and cross-attention mechanism, the guided diffusion model excels at learning attention-based models from known data. To pre-process known data \(y\), we introduce an encoder \(\tau_{\theta}\) that projects \(y\) to an intermediate representation \(\tau_{\theta}(y)\in R^{M\times d_{\tau}}\), which is then mapped to the intermediate layers of the U-Net through a cross-attention layer that implements the attention \((Q,K,V)=softmax\Big{(}\frac{QK^{T}}{\sqrt{d}}\Big{)}\cdot V\), with \(Q=W_{Q}^{(i)}\cdot\varphi_{i}(z_{t})\), \(K=W_{K}^{(i)}\cdot\tau_{\theta}(y)\), and \(V=W_{V}^{(i)}\cdot\tau_{\theta}(y)\). Here, \(\varphi_{i}(z_{t})\in R^{N\times d_{\varepsilon}^{i}}\) denotes a (flattened) intermediate representation of the U-Net, which is used for implementing \(\varepsilon_{\theta}\), and \(W_{V}^{(i)}\in R^{d\times d_{\varepsilon}^{i}}\), \(W_{Q}^{(i)}\in R^{d\times d_{\tau}}\) &\(W_{K}^{(i)}\in R^{d\times d_{\tau}}\) are learnable projection matrices. See Figure 3 for a visual depiction. Based on known data-conditioning pairs, as shown in Equation (8), we subsequently learn the conditional \(L_{SDM}\) via:  
\[L_{SDM}:=E_{\varepsilon(x),y,\;\varepsilon\sim N(0,1),\;t)}\Big{[}\| \varepsilon-\varepsilon_{\theta}(z_{t},\;t,\tau_{\theta}(y))\|_{2}^{2}\Big{]};t \in\{1,\ldots,T\} \tag{8}\]  
where both \(\tau_{\theta}\) and \(\varepsilon_{\theta}\) are jointly optimized via Equation (8).