# pFedBASC: Personalized Federated Learning with Blockchain-Assisted Semi-Centralized Framework
## 3 Preliminaries
### Problem Definition  
In traditional processes, FL consists of clients \(C_{i}\) where \(i\in\{1,2,...,N\}\) and a server responsible for aggregating parameters. Each \(C_{i}\) possesses a private sample dataset \(\mathcal{D}_{i}\). The objective of FL is to cooperatively solve an optimization problem. The objective function [2] is defined as follows:  
\[\underset{\mathbf{w}}{\text{argmin}}\left[F(\mathbf{w}):=\sum_{i=1}^{N}p_{i}F_{i}(\bm {w})\right] \tag{1}\]  
where \(\mathbf{w}\) denotes the model parameters and \(p_{i}\) represents the weight of \(C_{i}\) participating in aggregation, typically based on the rate of \(C_{i}\) data size in training. \(F_{i}(\mathbf{w})\) represents the local optimization objective function of \(C_{i}\), defined as follows:  
\[F_{i}(\mathbf{w})=\mathbb{E}_{(x,y)\in\mathcal{D}_{i}}L(\mathbf{w};(x,y)) \tag{2}\]  
where \(L(\mathbf{w};(x,y))\) is the loss function for each client. PFL allows each user to build personalized model to better adapt to local data features. Therefore, the goal of solving pFL in this paper can be transformed into proposing an automated method for generating model summaries to adaptively complete FL training under external conditions. We use the input  
Figure 2: The structure of a hypernetwork and its generated target network.  
embedding vector of HN to describe heterogeneous features of user data. These embedding vectors act as representation vectors, capturing the characteristics and differences between different user entities. For simplicity, we use \(h(\cdot)\) to denote model generation operation. In the \(t\)-th round, the HN of \(C_{i}\) is \(\mathbf{\varphi}_{i}^{t}\), and the TN is \(\mathbf{w}_{i}^{t}\). Following [31], we can use \(\mathbf{\varphi}_{i}^{t}\) and the _unique_ embedding vector \(\mathbf{v}_{i}\) to generate the parameters \(\mathbf{w}_{i}^{t}\) through the process (forward propagation):  
\[\mathbf{w}_{i}^{t}=h(\mathbf{v}_{i};\mathbf{\varphi}_{i}^{t}) \tag{3}\]  
For convenience, \(\mathbf{v}_{i}\) represents a set of embedding vectors for all features of \(C_{i}\), with each embedding vector having 400 parameters. Since HN of each client uses different embedding vectors, the generated TNs are personalized. After generating a TN, we train it on the local dataset to obtain the latest TN \(\mathbf{\hat{w}}_{i}^{t}\), which will be used to update the HN. Following [31], we can use the locally trained TN to perform a one-shot update (backward propagation) of HN, expressed as follows:  
\[\mathbf{\varphi}_{i}^{t}\leftarrow\mathbf{\varphi}_{i}^{t-1}-\eta\ \
abla_{\mathbf{\varphi}_{i} ^{t-1}}\Big{(}\mathbf{\hat{w}}_{i}^{t-1}\Big{)}^{T}\Delta\mathbf{w}_{i}^{t-1} \tag{4}\]  
where \(\
abla_{\mathbf{\varphi}_{i}^{t-1}}\Big{(}\mathbf{\hat{w}}_{i}^{t-1}\Big{)}^{T}\) is the derivative of the latest trained TN \(\mathbf{\hat{w}}_{i}^{t-1}\) with respect to the HN \(\mathbf{\varphi}_{i}^{t-1}\) in the \((t-1)\)-th round, and \(\Delta\mathbf{w}_{i}^{t-1}=\mathbf{\hat{w}}_{i}^{t-1}-\mathbf{w}_{i}^{t-1}\) represents the variation of generated \(\mathbf{w}_{i}^{t-1}\) before and after executing local training. Based on the above setup, the objective for pFL is adjusted to  
\[\underset{\mathbf{\varphi}}{\text{argmin}}\left[\sum_{i=1}^{N}p_{i}F_{i}(h(\mathbf{v} _{i};\mathbf{\varphi}))\right] \tag{5}\]  
The logic behind our training approach is as follows: we use the embedding vectors to represent local features of user's data, iteratively update HN parameters, and finally obtain a global optimal pFL model set \(\mathbf{\varphi}^{*}\) and \(\mathbf{w}^{*}=\{\mathbf{w}_{1},\mathbf{w}_{2},...,\mathbf{w}_{N}\}\) that satisfies the training goal.