## 3 Methodology
### Gradient Weighting for Cross-Lingual Learning  
In CLOF, we define two primary client datasets: high-resource client (\(D_{\text{HR}}\)) and low-resource client (\(D_{\text{LR}}\)). The high-resource client dataset comprises a large-scale English corpus that provides robust language representation and serves as a source for cross-lingual transfer, while the low-resource client dataset contains a smaller Twi corpus. CLOF assigns a higher aggregation weight (\(\alpha_{\text{LR}}\)) to updates from this client, ensuring that Twi signals are  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Category** & **Details** \\ \hline Model & T5-Small (Text-to-Text Transfer Transformer) \\ Number of Encoder Layers & 6 \\ Number of Decoder Layers & 6 \\ Hidden Dimension & 512 \\ Attention Heads & 8 per layer \\ Total Parameters & Approximately 60 million \\ Optimization Algorithm & AdamW optimizer, with a weight decay of 0.01 for regularization \\ Gradient Clipping & Applied gradient clipping with a maximum norm of 1.0 \\  & to prevent exploding gradients during training. \\ Tokenizer & Sentence-Piece Tokenizer (shared vocabulary across source and target languages) \\ Pretrained Model & T5-Small (Text-to-Text Transfer Transformer) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Model configuration.  
amplified during gradient aggregation. At each client, local updates are computed using the loss function \(\mathcal{L}_{\text{c}}\), specific to the client's data, as follows:  
\[\Delta M_{c}^{r}=-\eta\cdot\
abla\mathcal{L}_{c}(M^{r},D_{c}) \tag{11}\]  
where \(\eta\) is the learning rate. The aggregation step balances the gradients to maximize the contribution of \(D_{\text{LR}}\):  
\[M^{r+1}=M^{r}+\frac{\alpha_{\text{HR}}\cdot\Delta M_{\text{HR}}^{r}+\alpha_{ \text{LR}}\cdot\Delta M_{\text{LR}}^{r}}{\alpha_{\text{HR}}+\alpha_{\text{LR}}} \tag{12}\]  
Dynamic adjustment of \(\alpha_{c}\) allows the framework to adapt as the training progresses, ensuring that the low-resource dataset continues to receive adequate attention. This equation illustrates how the model aggregates the gradients from both high-resource and low-resource clients, with the weights \(\alpha_{\text{HR}}\) and \(\alpha_{\text{HR}}\) controlling the contribution from each dataset. The dynamic adjustment of these weights throughout training ensures that the low-resource language dataset continues to have sufficient influence on model learning, enabling better translation quality for Twi. This scheme is crucial for improving the performance of low-resource languages because it adjusts the weight for each dataset as training progresses, ensuring that the low-resource language receives adequate focus during training. This is comprehensively laid out below (see Algorithm 1) for better understanding.  
```
Input: Pretrained model \(M_{\text{pretrained}}\), \(D_{\text{HR}}\), \(D_{\text{LR}}\), \(R\), \(C\), \(\alpha_{\text{HR}}\), \(\alpha_{\text{LR}}\) Output: Fine-tuned model \(M_{\text{CLOF}}\)  Initialize global model \(M^{0}\gets M_{\text{pretrained}}\)  Assign datasets to clients: \(\text{HR}\to D_{\text{HR}}\), \(\text{LR}\to D_{\text{LR}}\)  Assign initial gradient weights \(\alpha_{\text{HR}}=1.0\), \(\alpha_{\text{LR}}=2.0\)  For each global round \(r=1\) to \(R\) do:  Broadcast \(M^{r}\) to all clients  For each client \(c\) in \(\{\text{HR},\text{LR}\}\) do:  Compute local updates \(\Delta M_{c}^{r}\) using \(D_{\text{c}}\)  Send \(\Delta M_{c}^{r}\) to the server  Aggregate updates at server: - \(\Delta M^{r}=\frac{\sum\left(\alpha_{c}\Delta M_{c}\right)}{\sum\left(\alpha_{ c}\right)}\)  Update global model: - \(M^{r+1}=M^{r}+\Delta M^{r}\)  Adjust \(\alpha\) dynamically based on client performance  Evaluate \(M_{\text{CLOF}}\) on \(D_{\text{test}}\) using SpBLEU, WER, and ROUGE  Return \(M_{\text{CLOF}}\)
```  
**Algorithm 1**CLOF for low-resource machine translation