# Local Back-Propagation for Forward-Forward Networks: Independent Unsupervised Layer-Wise Training
## 3 Local Back-Propagation Algorithm
```
0: Input data \(x\), label \(y\), number of cells \(C\), learning rate \(\eta\), number of epochs \(T\)
0: Trained cell parameters \(\{\theta_{1},\ldots,\theta_{C}\}\) and classifier \(\theta_{\text{cls}}\)
1:for\(c=1\) to \(C\)do
2: Initialize parameters \(\theta_{c}\)
3:for\(t=1\) to \(T\)do
4:for all mini-batch \(x_{\text{batch}}\)do
5:if using noise then
6:\(x_{\text{batch}}\leftarrow x_{\text{batch}}+\epsilon\)\(\triangleright\) Add noise (e.g., Gaussian)
7:endif
8:\(x_{\text{batch}}\leftarrow\textsc{LayerNorm}(x_{\text{batch}})\)
9:\(z\leftarrow\textsc{Encoder}(x_{\text{batch}})\)
10:\(\hat{x}\leftarrow\textsc{Decoder}(\hat{z})\)
11:\(\mathcal{L}_{l}\leftarrow\|x_{\text{batch}}-\hat{x}\|^{2}\)\(\triangleright\) Reconstruction loss
12:\(\theta_{l}\leftarrow\theta_{l}-\eta\cdot\
abla_{\theta_{l}}\mathcal{L}_{l}\)
13:endfor
14:endfor
15: Store \(z\) as input for cell \(c+1\)
16:endfor
17: Concatenate all latent vectors \(z_{1},z_{2},\ldots,z_{C}\) into \(z_{\text{concat}}\)
18: Initialize classifier parameters \(\theta_{\text{cls}}\)
19:for\(t=1\) to \(T\)do
20:for all mini-batch \((z_{\text{batch}},y_{\text{batch}})\)do
21:\(\hat{y}\leftarrow\textsc{Classifier}(z_{\text{batch}})\)
22:\(\mathcal{L}_{\text{cls}}\leftarrow\textsc{CrossEntropy}(\hat{y},y_{\text{ batch}})\)
23:\(\theta_{\text{cls}}\leftarrow\theta_{\text{cls}}-\eta\cdot\
abla_{\theta_{ \text{cls}}}\mathcal{L}_{\text{cls}}\)
24:endfor
25:endfor
```  
**Algorithm 1** Local Back-Propagation (LBP) Training  
In the second phase (lines 14-21), once all cells have completed their unsupervised training, the latent representations produced by each cell are concatenated to form a combined feature vector. This combined representation is then used to train a supervised classifier. The classifier parameters are updated by minimizing a classification loss, such as the cross-entropy loss, using labeled training data. To help readers better understand the training procedure in Algorithm 1, we summarize the meaning of all mathematical symbols used in Table 1. This notation table provides concise definitions for the variables and parameters introduced in the LBP algorithm. \begin{table}
\begin{tabular}{l l} \hline \hline
**Symbol** & **Definition** \\ \hline \(x\) & Input data \\ \(y\) & Ground-truth label \\ \(\theta_{c}\) & Parameters of the \(c\)-th LBP cell (encoder and decoder) \\ \(\theta_{cls}\) & Parameters of the final classifier \\ \(\eta\) & Learning rate \\ \(T\) & Number of training epochs \\ \(z\) & Latent vector output from encoder \\ \(\hat{x}\) & Reconstructed input from decoder \\ \(L_{l}\) & Reconstruction loss of layer \(l\) (\(\|x-\hat{x}\|^{2}\)) \\ \(z_{\text{concat}}\) & Concatenation of all latent vectors \\ \(\hat{y}\) & Output prediction of classifier \\ \(L_{cls}\) & Classification loss (cross-entropy) \\ \(e\) & Added noise (e.g., Gaussian) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Symbol definitions used in Algorithm 1. A key benefit of our LBP approach is its memory efficiency. Because each cell can be trained individually without simultaneously loading the entire network into memory, the proposed method enables training deeper networks or networks with larger parameters, even in resource-limited settings.