# Dynamic Weighted CNN-LSTM with Sliding Window Fusion for RFFE Final Test Yield Prediction
## 2 Materials and Methods
### Building a Fusion Model
#### 2.3.1 Dynamic Prediction and Incremental Training Mechanism  
To adapt to the constantly changing process conditions and environmental factors during the production testing of RFFE chips, we have introduced a multilevel dynamic prediction and incremental training mechanism in the model design. This not only ensures that the model can capture the latest data dynamics in real time but also continuously enhances prediction performance and generalization capabilities through multidimensional adjustment strategies. 1. Dynamic prediction mechanism with uncertainty quantification  
In order to capture real-time data dynamics and adapt the model accordingly, we first quantify the uncertainty of each prediction. We employ a Monte Carlo dropout method, where each input sample x is processed through the model M times with dropout activated. For each forward pass, a predicted yield \(y^{(i)}\) is obtained, leading to a set of predictions \(\left\{y^{(1)},y^{(2)},...,y^{(M)}\right\}\). The predictive mean \(\overline{y}\) and uncertainty (variance) \(\sigma^{2}y\) are then computed as follows:  
\[\overline{y}=\frac{1}{M}\sum_{i=1}^{M}y^{(i)} \tag{7}\]\[\sigma^{2}y=\frac{1}{\text{M}-1}\sum_{i=1}^{M}\left(y^{(i)}-\overline{y}\right)^{2} \tag{8}\]  
If the uncertainty \(\sigma_{y}\) exceeds a predefined threshold, the system automatically triggers a localized retraining process or readjusts the fusion weights to account for low-confidence predictions. Adaptive learning rate adjustment  
To ensure that the model swiftly adapts to new data during incremental training while maintaining stability, an adaptive learning rate schedule is used. One effective approach is to apply an exponential decay to the learning rate:  
\[\eta_{t}=\eta_{0}\text{-}\textit{exp}(-\lambda t) \tag{9}\]  
where \(\eta_{0}\) is the initial learning rate, \(t\) denotes the current training iteration, and \(\lambda\) is the decay rate controlling how rapidly the learning rate decreases. Alternatively, we incorporate adaptive optimization algorithms such as Adam, which update model parameters \(\theta\) using the following rule:  
\[\theta_{t+1}=\theta_{t}-\eta_{t}\frac{m_{t}}{\sqrt{v_{t}}+\in} \tag{10}\]  
where \(m_{t}\) and \(v_{t}\) as estimates of the first and second moments and \(\in\) is a small constant to avoid division by zero. This adaptive strategy ensures that the model remains responsive to rapid changes in the data while preventing instability due to overly aggressive updates. Time-decay sample weighting strategy  
To better capture the most recent trends in the data during incremental training, we assign weights to training samples based on their recency. Specifically, the weight \(w_{i}\) for sample \(i\) collected at time \(t_{i}\) (with the current time denoted by \(T\)) is given by:  
\[w_{i}=e^{(-\lambda(T-t_{i}))} \tag{11}\]  
where \(\lambda\) is a decay constant that determines how quickly the influence of older samples diminishes. This time-decay weighting strategy ensures that the most recent samples contribute more significantly to the model update, thus enhancing the model's ability to track the latest yield trends and process parameter changes. Multistrategy Model Weighted Fusion  
Our model leverages multiple submodels to predict yield, including:  
1. Model A: A CNN-LSTM model for historical yield prediction. 2. Model B: A CNN-LSTM model incorporating multifeatured inputs (electrical and RF parameters). 3. Model C: A sliding window averaging model. Each submodel produces a prediction denoted by \(Y_{A}\), \(Y_{B}\), and \(Y_{C}\) respectively. These outputs are fused through learnable weights \(\alpha_{A}\), \(\alpha_{B}\), and \(\alpha_{C}\):  
\[Y_{fused}=\alpha_{A}Y_{A}+\alpha_{B}Y_{B}+\alpha_{C}Y_{C} \tag{12}\]In addition to output level fusion, we enforce consistency among the feature representations \(F_{A}\), \(F_{B}\), and \(F_{C}\) extracted by each submodel.