## 4 Construction of the UA-FedRL Method
### Predictive Weighted Average Aggregation  
PWA is designed to aggregate model updates from heterogeneous industrial IoT devices with different local epoch counts. The PWA method is responsible for assigning weights to each IoT device on the quality of each device's local model updates and combining weighted weights to update the global model. The PWA method first computes weight quality \(q_{i}\) for each device, which represents the degree of confidence in the accuracy of the model updates from device \(i\). We assume that the weight quality \(q_{i}\) can be calculated using the predictive log-likelihood of the local model on the validation set. We assume \(D_{i}^{\prime}\) is the validation set from device \(i\), and \(L^{\prime}(y_{j},f(x_{j};w))\) is the loss function that measures the discrepancy between the predicted output \(f(x_{j};w)\) and the true output \(y_{j}\) for the \(j\)th data point in \(D_{i}^{\prime}\). The total validation loss across all data points in the validation set can be expressed as follows,  
\[\Big{(}\Pi_{j\in D_{i}^{\prime}}L^{\prime}\Big{(}y_{j},f\Big{(}x_{j};w_{i}^{( e_{i})}\Big{)}\Big{)}\Big{)}. \tag{20}\]  
The above equation represents the cumulative error of the model's overall validation data points. The above equation is transformed into the logarithmic equation to simplify the product of the losses, which is computationally more stable and interpretable as follows,  
\[\log\Big{(}\Pi_{j\in D_{i}^{\prime}}L^{\prime}\Big{(}y_{j},f\Big{(}x_{j};w_{i }^{(e_{i})}\Big{)}\Big{)}\Big{)}. \tag{21}\]  
In order to translate the validation performance of each model into a weight, we use the negative exponential function. The negative exponential of the total validation loss ensures that models with lower losses get higher weights. Additionally, we introduce a hyperparameter \(\lambda\) to control the sensitivity of the weight to the validation performance. We can calculate the weight quality of the device \(i\) as  
\[q_{i}=\exp\Big{(}-\lambda*\log\Big{(}\Pi_{j\in D_{i}^{\prime}}L^{\prime} \Big{(}y_{j},f\Big{(}x_{j};w_{i}^{(e_{i})}\Big{)}\Big{)}\Big{)}\Big{)}, \tag{22}\]where \(\lambda\) is a hyperparameter that controls the strength of the weighting function. The higher weight quality indicates the local model updates are more accurate and reliable and will be given more weight during global model aggregation. The PWA method then combines the model updates from all devices by weighting them according to their quality measures. The updated global model parameter \(w_{(t+1)}\) is given by:  
\[w_{(t+1)}=(1/N)\sum_{i=1}^{N}q_{i}\times w_{(t+1,i)}. \tag{23}\]  
Therefore, the model updates from devices with higher-quality measures contribute more to the global model than those with lower-quality measures, resulting in a more accurate and robust global model. The weight adjustment in the PWA method is implemented to ensure the quality-based contribution and regularization with the hyperparameter \(\lambda\). The weight \(q_{i}\) reflects the predictive quality of the local model on device \(i\), based on its validation performance, ensuring that models with a lower validation loss contribute more to the global update. This is especially important in non-IID environments, where data distributions vary significantly across devices. The parameter \(\lambda\) serves as a regularizer, controlling the sensitivity of the weight adjustment. A larger \(\lambda\) increases the impact of high-performing devices by accentuating differences in their predictive performance, while a smaller\(\lambda\) smooths out the contributions from all devices, resulting in a more uniform aggregation. This balance helps prevent the global model from overly relying on any single device, improving generalization and robustness. The PWA method enhances overall model performance by improving convergence, reducing the heterogeneity gap, and increasing robustness.