## 5 Proposed Approach and System
### Local Computation  
Local computation comprises model updating, local training, normalization, and secret sharing. The processes of LocalComputation are outlined in Algorithm 1. Below, we elaborate on these components. 1. Model update: Device \(C_{i}\) retrieves the most recent global model \(\mathbf{w}^{(t-1)}\) from an edge node. Subsequently, the local model \(\mathbf{w}_{i}^{(t)}\) is updated using Equation (7), where \(\delta\) represents the local learning rate. If the devices' objective function converges, the training process concludes; otherwise, \(C_{i}\) proceeds to the next iteration. \[\mathbf{w}_{i}^{(t)}=\mathbf{w}^{(t-1)}-\delta\mathbf{g}_{i}^{(t-1)}.\] (11) The specifics of updating the local models are elucidated by invoking ModelUpdate, as defined in Algorithm 4. ```
```
Input: Global model \(\mathbf{w}\), local training dataset \(D\), batch size \(b\), local learning rate \(\delta\), number of local iterations \(r\)  
Output: Gradient \(\mathbf{g}_{i}^{(r)}\). ```
1:functionModelUpdate(\(\mathbf{w}\), \(D\), \(b\), \(\delta\), \(r\))
2:\(\mathbf{w}_{0}\leftarrow\mathbf{w}\)
3:for each \(l\in[1,r]\)do
4: Randomly sample a batch \(D_{b}\) from \(D\);
5:\(\mathbf{g}_{l}\leftarrow\tri L(D_{b},\mathbf{w}_{l-1})\)
6:\(\mathbf{w}_{l}\leftarrow\mathbf{w}_{l-1}-\delta\mathbf{g}_{l}\)
7:end
8:return\(\mathbf{g}_{l}^{(r)}\)
9:endfunction ```

**Algorithm 4**ModelUpdate

Local training: During the \(t^{\text{th}}\) iteration of training, each device \(C_{i}\) involved in FL leverages its local dataset \(D_{i}\) (\(i\in[1,N]\)) and local model \(\mathbf{w}_{i}^{(t)}\) to compute the local gradient \(\mathbf{g}_{i}^{(t)}\), as defined in Equation (12). \[\mathbf{g}_{i}^{(t)}=\tri\,L(\mathbf{w}_{i}^{(t)},D_{i}), \tag{12}\]

where \(L(\mathbf{w}_{i}^{(t)},D_{i})\) denotes the empirical loss function, with \(\tri\) representing the derivative operation. 3. Normalization and quantization: For device \(C_{i}\), we employ Equation (13) to normalize the local gradients as follows:

\[\widetilde{\mathbf{g}}_{i}^{(t)}=\frac{\mathbf{g}_{i}^{(t)}}{||\mathbf{g}_{i} ^{(t)}||}, \tag{13}\]

where \(\widetilde{\mathbf{g}}_{i}^{(t)}\) represents the unit vector. For any integer \(q\geq 1\), we introduce a stochastic rounding function, defined as:

\[Q_{q}(x)=\left\{ \begin{aligned} &\frac{|qx|}{q}\quad\text{ with prob. }1-(qx-\lfloor qx\rfloor)\\ &\frac{|qx|+1}{q}\quad\text{ with prob. }qx-\lfloor qx\rfloor \end{aligned} \right., \tag{14}\]

where \(\lfloor qx\rfloor\) denotes the largest integer less than or equal to \(x\). It is important to note that this function is unbiased; that is, \(\mathbb{E}_{Q}[Q_{q}(x)]=x\). The parameter \(q\) serves as atuning parameter corresponding to the quantization level. The variance of \(Q_{q}(x)\) diminishes with increasing \(q\). Subsequently, we define the quantized gradient as:

\[\bar{\mathbf{g}}_{i}^{(t)}:=\phi(q\cdot Q_{q}(\bar{\mathbf{g}}_{i}^{(t)})), \tag{15}\]

where the function \(Q_{q}\) from Equation (9) is applied element-wise and a mapping function \(\phi:\mathbb{R}\rightarrow\mathbb{F}_{p}\) is specified to represent a negative integer in the finite field using the two's complement representation. \[\phi(x)=\left\{ \begin{array}{cl}x&if\ x\geq 0\\ p-x&if\ x<0\end{array} \right.. \tag{16}\]
4. Secret sharing: Each device \(C_{i}\) within the range of \([1,N]\) produces secret shares of the quantized gradient \(\bar{\mathbf{g}}_{i}^{(t)}\) by creating a random polynomial \(f_{i}:\mathbb{F}_{p}\rightarrow\mathbb{F}_{p}^{d}\) of degree \(T\): \[f_{i}(\theta)=\bar{\mathbf{g}}_{i}^{(t)}+\sum_{m=1}^{T}\mathbf{r}_{im}\theta^ {m},\] (17) where the vectors \(\mathbf{r}_{im}\) are randomly generated from \(\mathbb{F}_{p}^{d}\) by device \(i\). Subsequently, device \(i\) transmits the secret shares: \[\llbracket\bar{\mathbf{g}}_{i}^{(t)}\rrbracket_{T}^{m}=f_{i}(\theta_{m})\] (18) to edge node \(m\) within the range of \([1,M]\).