## 3 Materials and Method
### Proposed Method
#### 3.3.2 Multi-Scale Transformer Module (Revised)  
To capture dynamic patterns across different temporal resolutions, a multi-scale Transformer module is constructed consisting of three parallel encoder branches. As illustrated in Figure 3, each branch independently processes temporal input sequences of different lengths, corresponding to short-term (5 steps), mid-term (20 steps), and long-term (60 steps) segments. This architecture enables the simultaneous modeling of transient fluctuations and persistent trends.  
The full input sequence \(X\in\mathbb{R}^{T\times d}\) is first split into three sub-sequences: \(X_{s}\in\mathbb{R}^{5\times d}\) for short-term, \(X_{m}\in\mathbb{R}^{20\times d}\) for mid-term, and \(X_{l}\in\mathbb{R}^{60\times d}\) for long-term encoding. These are passed into three structurally identical Transformer encoder branches, each composed of two stacked Transformer layers. Each Transformer layer contains two subcomponents: a multi-head self-attention mechanism and a position-wise feedforward network, augmented with residual connections and LayerNorm for stability. For each time step \(t\), the input \(x_{t}\) is projected into three spaces: query (\(Q_{t}=W^{Q}x_{t}\)), key (\(K_{t}=W^{K}x_{t}\)), and value (\(V_{t}=W^{V}x_{t}\)), where \(W^{Q}\), \(W^{K}\), and \(W^{V}\) are learnable matrices. The attention score \(a_{ij}\) between time steps \(i\) and \(j\) is computed as  
\[a_{ij}=\frac{Q_{i}K_{j}^{T}}{\sqrt{a_{k}}},\quad\alpha_{ij}=\frac{\exp(a_{ij}) }{\sum_{k}\exp(a_{ik})}\]  
The normalized attention weights \(\alpha_{ij}\) are used to aggregate values:  
\[\text{Attention}_{i}=\sum_{j}\alpha_{ij}V_{j}\]  
This attention process is performed independently in all three branches. The outputs of each branch are then pooled via average pooling to obtain fixed-size temporal representations, denoted as \(h_{s}\) (short-term), \(h_{m}\) (mid-term), and \(h_{l}\) (long-term), respectively. These representations are then fused via a learnable gating mechanism to produce the final temporal encoding \(h_{\text{temporal}}\):  
\[h_{\text{temporal}}=\sigma(W_{s}h_{s}+W_{m}h_{m}+W_{l}h_{l}+b),\]  
Here, \(W_{s}\), \(W_{m}\), and \(W_{l}\) are learnable transformation matrices; \(b\) is a bias term; and \(\sigma\) denotes the ReLU activation function. This module offers two primary advantages. First, the use of three distinct temporal windows enables the extraction of behavioral features at multiple resolutions, addressing the fixed-window limitations of conventional Transformers. Second,  
Figure 3: The module consists of three parallel Transformer encoder branches, each dedicated to processing input sequences of different temporal lengths: short-term (5 steps), mid-term (20 steps), and long-term (60 steps). Each branch includes two stacked Transformer layers for extracting temporal features at its respective resolution. The internal computation of the multi-head self-attention mechanism is illustrated, including the linear transformations for query (Q), key (\(K\)), and value (\(V\)), and the computation of attention weights \(a_{ij}\). Outputs from the three branches are pooled into vectors \(h_{s}\), \(h_{m}\), and \(h_{l}\), which are then fused through a gating mechanism to form the final temporal representation \(h_{\text{temporal}}\).  
the gating mechanism adaptively weights each timescale's contribution based on the current input, enhancing the model's robustness to variations in temporal dynamics. The resulting \(h_{\text{temporal}}\) is subsequently concatenated with the structural and semantic representations for downstream prediction. This module significantly improves the capacity of the overall system to model non-stationary, multiscale temporal signals, particularly in environments exhibiting both volatility and persistent macro trends.