Leader-Follower Neural Networks with Local Error Signals Inspired by
  Complex Collectives
The collective behavior of a network with heterogeneous, resource-limited
information processing units (e.g., group of fish, flock of birds, or network
of neurons) demonstrates high self-organization and complexity. These emergent
properties arise from simple interaction rules where certain individuals can
exhibit leadership-like behavior and influence the collective activity of the
group. Motivated by the intricacy of these collectives, we propose a neural
network (NN) architecture inspired by the rules observed in nature's collective
ensembles. This NN structure contains workers that encompass one or more
information processing units (e.g., neurons, filters, layers, or blocks of
layers). Workers are either leaders or followers, and we train a
leader-follower neural network (LFNN) by leveraging local error signals and
optionally incorporating backpropagation (BP) and global loss. We investigate
worker behavior and evaluate LFNNs through extensive experimentation. Our LFNNs
trained with local error signals achieve significantly lower error rates than
previous BP-free algorithms on MNIST and CIFAR-10 and even surpass BP-enabled
baselines. In the case of ImageNet, our LFNN-l demonstrates superior
scalability and outperforms previous BP-free algorithms by a significant
margin.
Chenzhong Yin, Mingxi Cheng, Xiongye Xiao, Xinghe Chen, Shahin Nazarian, Andrei Irimia, Paul Bogdan
# Leader-Follower Neural Networks with Local Error Signals Inspired by Complex Collectives

###### Abstract

The collective behavior of a network with heterogeneous, resource-limited information processing units (e.g., group of fish, flock of birds, or network of neurons) demonstrates high self-organization and complexity. These emergent properties arise from simple interaction rules where certain individuals can exhibit leadership-like behavior and influence the collective activity of the group. Motivated by the intricacy of these collectives, we propose a neural network (NN) architecture inspired by the rules observed in nature's collective ensembles. This NN structure contains _workers_ that encompass one or more information processing units (e.g., neurons, filters, layers, or blocks of layers). Workers are either leaders or followers, and we train a leader-follower neural network (LFNN) by leveraging local error signals and optionally incorporating backpropagation (BP) and global loss. We investigate worker behavior and evaluate LFNNs through extensive experimentation. Our LFNNs trained with local error signals achieve significantly lower error rates than previous BP-free algorithms on MNIST and CIFAR-10 and even surpass BP-enabled baselines. In the case of ImageNet, our LFNN-\(\ell\) demonstrates superior scalability and outperforms previous BP-free algorithms by a significant margin.

## 1 Introduction

Artificial neural networks (ANNs) typically employ global error signals for learning [1]. While ANNs draw inspiration from biological neural networks (BNNs), they are not exact replicas of their biological counterparts. ANNs consist of artificial neurons organized in a structured layered architecture [2]. Learning in such architectures commonly involves gradient descent algorithms [3] combined with backpropagation (BP) [4]. Conversely, BNNs exhibit more intricate self-organizing connections, relying on specific local connectivity [5] to enable emergent learning and generalization capabilities even with limited and noisy input data. Simplistically, we can conceptualize a group of
neurons as a collection of _workers_ wherein each worker receives partial information and generates an output, transmitting it to others so as to achieve a specific collective objective. This behavior can be observed in various biological systems, such as decision-making among a group of individuals [6], flocking behavior in birds to avoid predators and maintain flock health [7], or collective behavior in cells fighting infections or sustaining biological functions [8].

The study of collective behavior in networks of heterogeneous agents, ranging from neurons and cells to animals, has been a subject of research for several decades. In physical systems, interactions among numerous particles give rise to emergent and collective phenomena, such as stable magnetic orientations [9]. A system of highly interconnected McCulloch-Pitts neurons [10] has collective computational properties [9]. Networks of neurons with graded response (or sigmoid input-output relation) exhibit collective computational properties similar to those of networks with two-state neurons [11]. Recent studies focus on exploring collective behaviors in biological networks. This includes the examination of large sensory neuronal networks [12], the analysis of large-scale small-world neuronal networks [13], the investigation of heterogeneous NNs [14], and the study of hippocampal networks [15]. These studies aim to uncover the collective dynamics and computational abilities exhibited by such biological networks.

In biological networks such as the human brain, synaptic weight updates can occur through local learning, independent of the activities of neurons in other brain regions [16; 17]. Partly for this reason, local learning has been identified as effective means to reduce memory usage during training and to facilitate parallelism in deep learning architectures, thereby enabling faster training [18; 19].

Acknowledging the extensive research on collective behavior and local learning in biological networks and the existing computational disparities between ANNs and BNNs, we draw inspiration from complex collective systems by proposing a NN architecture with more complex capabilities observed in biological counterparts. We propose to divide a NN into layers of elementary _leader_ workers and _follower_ workers and follow the characteristics of collective motion to select the _leadership_. As in a flock of birds shown in Figure1, leaders are informed by and control the motion of the whole flock. In our _leader-follower neural network_ (LFNN) architecture, the leaders and followers differ in their access to information and learn through distinct error signals. Hence, LFNNs offer a biologically-plausible alternative to BP and facilitate training using local error signals.

We evaluated our LFNN and its BP-free version trained with local loss (LFNN-\(\ell\)) on MNIST, CIFAR-10, and ImageNet datasets. Our LFNN and LFNN-\(\ell\) outperformed other biologically plausible BP-free algorithms and achieved comparable results to BP-enabled baselines. Notably, our algorithm demonstrated superior performance on ImageNet compared to all other BP-free baselines. This study, which introduces complex collectives to deep learning, provides valuable insights into biologically plausible NN research and opens up avenues for future work.

**Related work.** Efforts have been made to bridge the gaps in computational efficiency that continue to exist between ANNs and BNNs [20]. One popular approach is the replacement of global loss with local error signals [21]. Researchers have proposed to remove BP to address backward locking problems [22], mimic the local connection properties of neuronal networks [23] and incorporate local plasticity rules to enhance ANN's biological plausibility [24]. A research topic closely related to our work is supervised deep learning with local loss. It has been noticed that training NNs with BP is biologically implausible because BNNs in the human brain do not transmit error signals at a global scale [25; 26; 27]. Several studies have proposed training NNs with local error signals, such as layer-wise learning [21; 28], block-wise learning [23; 29], gated linear network family [30], etc.

Figure 1: **a-b.** A flock of birds where leaders are informed and lead the flock. **c.** An abstracted network from the flock. **d.** A leader-follower neural network architecture.
Mostafa et al. generate local error signals in each NN layer using fixed, random auxiliary classifiers [21], where a hidden layer is trained using local errors generated by a random fixed classifier. This is similar to an approach called feedback alignment training, where random fixed weights are used to back-propagate the error layer by layer [31]. In [29], the authors split a NN into a stack of gradient-isolated modules, and each module is trained to maximally preserve the information of its inputs. A more recent work by Ren et al. [32] proposed a local greedy forward gradient algorithm by enabling the use of forward gradient learning in supervised deep learning tasks. Their biologically plausible BP-free algorithm outperforms the forward gradient and feedback alignment family of algorithms significantly. Our LFNN-\(\ell\) shares some similarities with the above work in the sense that the LFNN-\(\ell\) is trained with loss signals generated locally without BP. In contradistinction to the state-of-the-art, we do not require extra memory blocks to generate an error signal. Hence, the number of trainable parameters can be kept identical to that of NNs without an LF hierarchy.

## 2 LFNNs Inspired by Complex Collectives

Collective motion refers to ordered movement in systems consisting of self-propelled particles, such as flocking [7] or swarming behavior [33]. The main feature of such behavior is that an individual particle is dominated by the influence of others and thus behaves entirely differently from how it might behave on its own [34]. A classic collective motion model, the Vicsek model [35], describes the trajectory of an individual using its velocity and location, and uses stochastic differential/ difference equations to update this agent's location and velocity as a function of its interaction strength with its neighbors. Inspired by collective motion seen in nature, we explore whether these minimal mathematical relations can be exploited in deep learning.

**LF hierarchy in fully connected layers.** In a fully-connected (FC) layer containing multiple neurons, we define _workers_ as structures containing one or more neurons grouped together. In contradistinction to classic NNs where the neuron is the basic computational unit, LFNN workers serve as basic units. By adapting the Vicsek model terms to deep learning, a worker's behavior is dominated by that of neighbors in the same layer. In addition, we consider _leadership_ relations inside the group. According to collective motion, "leadership" involves "the initiation of new directions of locomotion by one or more individuals, which are then readily followed by other group members" [36]. Thus, in FC layers, one or more workers are selected as leaders, and the rest are "followers" as shown in Figure 2b.

**LF hierarchy extended in convolutional layers.** Given a convolutional layer with multiple filters (or kernels), workers can be defined as one or more filters grouped together to form _filter-wise workers_. For a more coarsely-grained formulation, given a NN with multiple convolutional layers, a set of convolutional layers can be grouped naturally as a block (such as in VGG [37], ResNet [38], Inception [39] architectures). Our definition of the worker can be easily adapted to encompass _block-wise workers_ to reflect this architecture where a block of convolutional layers work together as a single, block-wise worker. Similarly, if a block contains one layer, it becomes a _layer-wise worker_.

More formally, we consider a NN with \(\mathcal{M}\) hidden layers, and a hidden layer contains \(\mathcal{N}\) workers. A worker can contain one or more individual working components, which can be neurons, filters in

Figure 2: **Weight updates of LFNN.****a.** BP in classic deep neural network (DNN) training. Global prediction loss is back-propagated through layers. **b.** An LF hierarchy in a DNN. Within a layer, neurons are grouped as (leader and follower) workers. **c.** Weight update of follower workers. **d.** Weight update of leader workers with BP. **e.** BP-free weight update of leader workers.
convolutional layers, or blocks of NN layers, and each individual working component is parametrized by a set of trainable parameters \(\mathcal{W}\). During training, at each time step \(t\), leader workers \(\mathcal{N}_{\bar{s}}\) are dynamically selected and the remaining workers are labeled as followers (denoted as \(\mathcal{N}_{\bar{s}}\)) at time step \(t\). Following the same notation, leader and follower workers are parameterized by matrices \(\mathcal{\widetilde{W}}_{\bar{s}}\) and \(\mathcal{\widetilde{W}}_{\bar{s}}\), respectively. The output of leader and follower workers in a hidden layer reads \(f(\vec{x},|\mathcal{\widetilde{W}}_{\delta},\mathcal{\widetilde{W}}_{\bar{s}}|)\), where \(\vec{x}\) is the input to the current hidden layer and \(f(\cdot)\) is a mapping function.

**Error signals in LFNN.** In human groups, one key difference between leaders and followers is that leaders are _informed_ individuals that can guide the whole group, while followers are uninformed and their instructions differ from treatment to treatment [40]. Adapting this concept to deep learning, LFNN leaders are informed that they receive error signals generated from the global or local prediction loss functions, whereas followers do not have this information. Specifically, assume that we train an LFNN with BP and a global prediction loss function \(\mathcal{L}_{g}\). Only leaders \(\mathcal{N}_{\delta}\) and output neurons receive information on gradients as error signals to update weights. This is similar to classic NN training, so we denote these pieces of information as _global error signals_. In addition, a local prediction error \(\mathcal{L}_{l}^{\delta}\) is optionally provided to leaders to encourage them to make meaningful predictions independently.

By contrast to leaders, followers \(\mathcal{N}_{\bar{s}}\) do not receive error signals generated in BP. Instead, they align with their neighboring leaders. Inspired by collective biological systems, we propose an "alignment" algorithm for followers and demonstrate its application in an FC layer as follows: Consider an FC layer where the input to a worker is represented by \(\vec{x}\), and the worker is parameterized by \(\mathcal{\widetilde{W}}\) (i.e., the parameters of all neurons in this worker). The output of a worker is given by \(\vec{y}=f(\mathcal{\widetilde{W}}\cdot\vec{x})\). In this context, we denote the outputs of a leader and a follower as \(\vec{y}_{\delta}\) and \(\vec{y}_{\delta}\), respectively. To bring the followers closer to the leaders, a local error signal is applied to the followers, denoted as \(\mathcal{L}_{l}^{\bar{s}}=\mathcal{D}(\vec{y}_{\delta},\vec{y}_{\bar{\delta}})\), where \(\mathcal{D}(a,b)\)1 measures the distance between \(a\) and \(b\). In summary, the loss function of our LFNN is defined as follows:

Footnote 1: In our experimentation, we utilize mean squared error loss.

\[\mathcal{L}=\mathcal{L}_{g}+\lambda_{1}\mathcal{L}_{l}^{\delta}+\lambda_{2} \mathcal{L}_{l}^{\bar{s}}, \tag{1}\]

where the first term of the loss function applies to the output neurons and leader workers. The second and third terms apply to the leader and follower workers, as illustrated in Figure 1(c) and d. The hyper-parameters \(\lambda_{1}\) and \(\lambda_{2}\) are used to balance the contributions of the global and local loss components. It is important to note that the local loss \(\mathcal{L}_{l}^{\delta}\) and \(\mathcal{L}_{l}^{\bar{s}}\) are specific to each layer, filter, or block and do not propagate gradients through all hidden layers.

**BP-free version (LFNN-\(\ell\)).** To address the limitations of BP such as backward locking, we propose a BP-free version of LFNN. The approach is as follows: In Eq. 1, it can be observed that the weight updates for followers are already local and do not propagate through layers. Based on this observation, we modify LFNN to train in a BP-free manner by removing the BP for global prediction loss. Instead, we calculate leader-specific local prediction loss (\(\mathcal{L}_{l}^{\delta}\)) for all leaders. This modification means that the global prediction loss calculated at the output layer, denoted as \(\mathcal{L}_{g}^{o}\) (where \(o\) stands for output), is only used to update the weights of the output layer. In other words, this prediction loss serves as a local loss for the weight update of the output layer only. The total loss function of the BP-free LFNN-\(\ell\) is given as follows:

\[\mathcal{L}=\mathcal{L}_{g}^{o}+\mathcal{L}_{l}^{\delta}+\lambda\mathcal{L}_{ l}^{\bar{s}}. \tag{2}\]

By eliminating the backpropagation of the global prediction loss to hidden layers, the weight update of leader workers in LFNN is solely driven by the local prediction loss, as depicted in Figure 1(e). It's important to note that the weight update of follower workers remains unchanged, regardless of whether backpropagation is employed or not, as shown in Figure 1(c).

_Dynamic leadership selection._ In our LF hierarchy, the selection of leadership is dynamic and occurs in each training epoch based on the local prediction loss. In a layer with \(\mathcal{N}\) workers, each worker can contain one or more neurons, enabling it to handle binary or multi-class classification or regression problems on a case-by-case basis. This unique characteristic allows a worker, even if it is located in hidden layers, to make predictions \(\vec{y}\). This represents a significant design distinction between our LFNN and a traditional neural network. Consequently, all workers in a hidden layer receive their respective prediction error signal, denoted as \(\mathcal{L}_{l}^{\delta}(\vec{y},\hat{y})\). Here, \(\mathcal{L}_{l}(\cdot,\cdot)\) represents the prediction error function, the superscript \(\delta\) indicates that it is calculated over the leaders, \(\hat{y}\) denotes the true label, and the top \(\delta\) (\(0\leq\delta\leq 100\%\)) workers with the lowest prediction error are selected as leaders.
_Implementation details._ To enable workers in hidden layers to generate valid predictions, we apply the same activation function used in the output layer to each worker. For instance, in the case of a neural network designed for \(K\)-class classification, we typically include \(K\) output neurons in the output layer and apply the softmax function. In our LFNN, each worker is composed of \(K\) neurons, and the softmax function is applied accordingly. In order to align the followers with the leaders, we adopt a simplified approach by selecting the best-performing leader as the reference for computing \(\mathcal{L}_{l}^{S}\). While other strategies such as random selection from the \(\delta\) leaders were also tested, they did not yield satisfactory performance. Therefore, for the sake of simplicity and better performance, we choose the best-performing leader as the reference for the followers' loss computation.

_Practical benefits and overheads._ In contrast to conventional neural networks trained with BP and a global loss, our LFNN-\(\ell\) computes worker-wise loss and gradients locally. This approach effectively eliminates backward locking issues, albeit with a slight overhead in local loss calculation. One significant advantage of the BP-free version is that local error signals can be computed in parallel, enabling potential speed-up in the weight update process through parallel implementation.

## 3 Experiments

In Section 3.1, we focus on studying the leadership size, conducting an ablation study of loss terms in Eq. 1, and analyzing the worker's activity. To facilitate demonstration and visualization, we utilize DNNs in this subsection. In Section 3.2, we present our main experimental results, where we evaluate LFNNs and LFNN-\(\ell\)s using CNNs on three datasets (i.e., MNIST, CIFAR-10, and ImageNet) and compare with a set of baseline algorithms.

### Leader-Follower Neural Networks (LFNNs)

Experimental setup.To assess the performance of LFNN for online classification, we conduct experiments on the pixel-permuted MNIST dataset [41]. Following the approach in [30], we construct a one-vs-all classifier using a simple neural network architecture consisting of one hidden FC layer. In our experiments, we vary the network architecture to examine the relationship between network performance and leadership size. We consider network configurations with 32, 64, 128, 256, and 512 workers, where each worker corresponds to a single neuron. We systematically vary the percentage of workers assigned as leaders from 10% to 100%. For each network configuration, we utilize the sigmoid activation function for each worker and train the model using the Adam optimizer with a learning rate of 5e-3. The objective is to investigate how different leadership sizes impact the classification performance in the online setting. In our experiments, we employ the binary cross-entropy loss for both the global prediction loss (\(\mathcal{L}_{g}\)) and the local prediction loss for leaders (\(\hat{\mathcal{L}}_{l}^{\delta}\)). For the local error signal of followers (\(\hat{\mathcal{L}}_{l}^{\delta}\)), we use the mean squared error loss. The hyperparameters \(\lambda_{1}\) and \(\lambda_{2}\) are both set to 1 in this section to balance the global and local loss terms. In the ablation study of loss terms and the worker activity study, we focus on a 32-worker LFNN with 30% leadership.

Figure 3: **a. Network performance results when varying leadership size from 10% to 100%. b. Ablation study results from four different loss functions.**
**Leadership size and performance.** In a study on the collective motion of inanimate objects, such as radio-controlled boats, it was observed that to effectively control the direction of the entire group, only a small percentage (5%-10%) of the boats needed to act as leaders [42]. This finding aligns with similar studies conducted on living collectives, such as fish schools and bird flocks, where a small subset of leaders were found to have a substantial impact on the behavior of the larger group. In our experiment, we investigate the relationship between network performance and the size of the leadership group. The results shown in Figure 3a indicate that our LFNN achieves high performance on the permuted MNIST classification task after just one pass of training data. When using a higher percentage of leadership, such as 90% or 100%, the LFNN achieves comparable performance to a DNN trained with BP. Even with a lower percentage of leadership, ranging from 10% to 30%, the LFNN still achieves decent performance on this task. It is worth noting that for more challenging datasets like ImageNet, higher percentages of leadership are preferred. These findings highlight both the similarities and differences between natural collectives and LFNNs in the field of deep learning.

**Ablation study of loss terms.** In our investigation of LFNN training using Eq. 1, we aim to evaluate the effectiveness of the local loss terms and examine the following aspects in this section: (a) whether global loss alone with BP is adequate for training LFNNs, and (b) how the inclusion of local losses contributes to training and network performance in terms of accuracy. To address these questions, we consider four variations of the loss function, as depicted in Figure 4: (i) \(\mathcal{L}_{1}=\mathcal{L}_{g}+\mathcal{L}_{l}^{\delta}+\mathcal{L}_{l}^{\delta}\): This variant includes the global loss as well as all local losses. (ii) \(\mathcal{L}_{2}=\mathcal{L}_{g}+\mathcal{L}_{l}^{\delta}\): Here, the global loss is combined with the local leader loss. (iii) \(\mathcal{L}_{3}=\mathcal{L}_{g}+\mathcal{L}_{l}^{\delta}\): This variant utilizes the global loss along with the local follower loss. (iv) \(\mathcal{L}_{4}=\mathcal{L}_{g}\): In this case, only the global loss is employed.

After training LFNNs with the four different loss functions mentioned earlier, we observe the one-pass results in Figure 3b. It is evident that using only the global prediction loss (\(\mathcal{L}_{4}\)) with backpropagation leads to the worst performance. The network's accuracy does not improve significantly when adding the local follower loss (\(\mathcal{L}_{3}\)) because the leader workers, which the followers rely on for weight updates, do not perform well. As a result, the overall network accuracy remains low. However, when we incorporate the local leader loss (\(\mathcal{L}_{2}\)), we notice a significant improvement in the network's performance after 100 training steps. The local leader loss plays a crucial role in this improvement. Despite updating only 30% of the workers at each step, it is sufficient to guide the entire network towards effective learning. Moreover, when we further include the local follower loss (\(\mathcal{L}_{1}\)) to update the weights of followers based on strong leaders, the overall network performance improves even further. As a result, the network achieves high accuracy with just one pass of training data. These results highlight the importance of incorporating both local leader and local follower losses in LFNN training. The presence of strong leaders positively influences the performance of followers, leading to improved network accuracy.

**Worker activity in an LFNN.** Collective motion in a group of particles is easily identifiable through visualization. Since our LFNN's weight update rules are inspired by a collective motion model, we visualize the worker activities and explore the existence of collective motion patterns in the network during training. Following our weight update rule, we select 30% of the leaders from the 32 workers in each training step and update their weight dynamics based on global and local prediction loss. Consequently, the leader workers receive individual error signals and update their activity accordingly. Conversely, the remaining 70% of workers act as followers and update their weight dynamics by mimicking the best-performing leader through local error signals. In essence, all followers align themselves with a single leader, resulting in similar and patterned activity in each training step.

Figure 4: **Loss variation demonstration.****a.** Global prediction loss and both local losses, \(\mathcal{L}_{1}\). **b.** Without local follower loss, \(\mathcal{L}_{2}\). **c.** Without local leader loss, \(\mathcal{L}_{3}\). **d.** Global prediction loss alone, \(\mathcal{L}_{4}\).
To visualize the activities of all workers, we utilize the neuron output \(\vec{y}\) before and after the weight update at each time step, and the difference between them represents the worker activity. The results in Figure 5a demonstrate that in each time step, the follower workers (represented by blue lines) move in unison to align themselves with the leaders. During the initial training period (steps 0 to 1000), both leaders and followers exhibit significant movement and rapid learning, resulting in relatively larger step sizes. As the learning process stabilizes and approaches saturation, the workers' movement becomes less pronounced as the weights undergo less drastic changes in the well-learned network. Overall, we observe a patterned movement in worker activity in LFNNs, akin to the collective motion observed in the classic Vicsek model [35].

**Leadership development.** In order to investigate how leadership is developed during training, we conduct a study using batch training, where leaders are re-selected in each batch. To provide a clearer demonstration, we focus solely on local losses in this study, thereby eliminating the effect of the global error signal and BP. We utilize an LFNN-\(\ell\) with two hidden FC layers, each containing 32 workers. The leadership rate is fixed at 20%, resulting in approximately 6 leaders being selected in each layer at every training step. The neural network is trained for 300 steps in each epoch, and the visualization of the leadership dynamics during the first 5 epochs is presented in Figure 6. In Figure 6, the visualization depicts the development of leadership during training. Each dot's color and size indicate the number of times a worker is selected as a leader. In the initial epoch (Epoch 0), we observe that several workers in each layer have already emerged as leaders, being selected most of the time. As training progresses, exactly six workers in each layer are consistently developed as leaders, while the remaining workers are no longer selected. By the fifth epoch, the leadership structure becomes nearly fixed, remaining relatively unchanged throughout the training process.

From the results obtained, leadership in LFNN-\(\ell\) is developed in the early stages of training and becomes fixed thereafter. The performance of the entire network relies on these leaders. Although this aspect is not the primary focus of the current work, one promising future direction involves the development of an intelligent dynamic leader selection algorithm. Additionally, we also investigated the performance of the best-performing leaders in each layer and compared the performance between leaders and followers in the supplementary materials.

### BP-free Leader-Follower Neural Networks (LFNN-\(\ell\)s)

In this section, we conduct a comparative analysis between LFNN-\(\ell\)s and several alternative approaches, with the option of engaging BP. We evaluate their performance on the MNIST, CIFAR-10, and ImageNet datasets to showcase the capabilities of LFNN-\(\ell\)s and further study the impact of leadership size. All LFNN-\(\ell\)s and LFNNs in this section consist of FC and convolutional layers. LFNNs are trained using a combination of BP, global loss, and local losses, while BP-free LFNN-\(\ell\)s are trained solely with local losses.

Figure 5: **a.** Worker activity visualization in an LFNN. At each time step, the followers (blue lines) align themselves with leaders (red lines). **b.** Patterned collective motion produced by the classic Vicsek model [35].

Figure 6: Leadership in workers during training. The color and size of thedots represent the times a worker is selected as leader. A worker can be selected as a leader up to 300 times in each epoch.
**Datasets.** Both MNIST and CIFAR-10 are obtained from the TensorFlow datasets [45]. MNIST [41] contains 70,000 images, each of size \(28\times 28\). CIFAR-10 [46] consists of 60,000 images, each of size \(32\times 32\). Tiny ImageNet [47] consists of a dataset of \(100,000\) images distributed across 200 classes, with 500 images per class for training, and an additional set of \(10,000\) images for testing. All images in the dataset are resized to \(64\times 64\) pixels. ImageNet subset (1pct) [48, 49] is a subset of ImageNet [50]. It shares the same validation set as ImageNet and includes a total of 12,811 images sampled from the ImageNet dataset. These images are resized to \(224\times 224\) pixels for training.

**MNIST and CIFAR-10.** We compare our LFNNs and LFNN-\(\ell\)s with BP, local greedy backdrop (LG-BP) [43], Feedback Alignment (FA) [31], weight-perturbed forward gradient (FG-W) [44], activity perturbation forward gradient (FG-A) [32], local greedy forward gradient weight / activity-perturbed (LG-FG-W and LG-FG-A) [32] on MNIST, CIFAR-10, and ImageNet datasets. To ensure a fair comparison, we make slight modifications to our model architectures to match the number of parameters of the models presented in [32].

Table 1 presents the image classification results for the MNIST and CIFAR-10 datasets using various BP and BP-free algorithms. The table displays the test and train errors as percentages for each dataset and network size. When comparing to BP-enabled algorithms, LFNN shows similar performance to standard BP algorithms and outperforms the LG-BP algorithm on both the MNIST and CIFAR-10 datasets. In the case of BP-free algorithms, LFNN-\(\ell\) achieves lower test errors for both MNIST and CIFAR-10 datasets. Specifically, in MNIST, our LFNN-\(\ell\) achieves test error rates of 2.04% and 1.20%, whereas the best-performing baseline models achieve 2.82% and 2.55%, respectively. For the CIFAR-10 dataset, LFNN-\(\ell\) outperforms all other BP-free algorithms with a test error rate of 20.85%, representing a significant improvement compared to the best-performing LG-FG-A algorithm, which achieves a test error rate of 30.68%.

In previous sections, we observed that both larger and smaller leadership sizes deliver good performance on simple tasks. This observation holds true for MNIST and CIFAR-10 datasets as shown in Table 2. In MNIST, LFNN and LFNN-\(\ell\) with different leadership sizes achieve similar test error rates.

\begin{table}
\begin{tabular}{c c|c|c|c|c} \hline \hline \multicolumn{2}{c|}{**Dataset**} & \multicolumn{1}{c|}{**MNIST**} & \multicolumn{1}{c|}{**MNIST**} & \multicolumn{1}{c|}{**CIFAR-10**} & \multicolumn{1}{c}{**ImageNet**} \\ \multicolumn{2}{c|}{Metric} & Test / Train Err. (\(\downarrow\)) & Test / Train Err. (\(\downarrow\)) & Test / Train Err. (\(\downarrow\)) & Test / Train Err. (\(\downarrow\)) & Test / Train Err. (\(\downarrow\)) \\ \hline \multirow{3}{*}{**BP-enabled**} & BP & 2.01 / 0.00 & 1.88 / 0.00 & 20.90 / 0.00 & 35.24 / 19.14 \\  & LG-BP [43] & 2.43 / 0.00 & 2.81 / 0.00 & 33.84 / 0.05 & 54.37 / 39.66 \\  & **LFNN** & 1.18 / 1.15 & 2.14 / 1.49 & 19.21 / 3.57 & 57.75 / 20.94 \\ \hline \multirow{3}{*}{**BP-free**} & FA [31] & 2.82 / 0.00 & 2.90 / 0.00 & 39.94 / 28.44 & 94.55 / 94.13 \\  & FG-W [44] & 9.25 / 8.93 & 8.56 / 8.64 & 55.95 / 54.28 & 97.71 / 97.58 \\  & FG-A [32] & 3.24 / 1.53 & 3.76 / 1.75 & 59.72 / 41.27 & 98.83 / 98.80 \\  & LG-FG-W [32] & 9.25 / 8.93 & 5.66 / 4.59 & 52.70 / 51.71 & 97.39 / 97.29 \\  & LG-FG-A [32] & 3.24 / 1.53 & 2.55 / 0.00 & 30.68 / 19.39 & 58.37 / 47.86 \\  & **LFNN-\(\ell\)** & **1.49** / 0.04 & **1.20** / 1.15 & **20.85** / 4.69 & **55.88** / 36.13 \\ \hline \multicolumn{2}{c|}{**Number of Parameters**} & 272K\(\sim\)275K & 429K\(\sim\)438K & 876K\(\sim\)919K & 17.3M\(\sim\)36.8M \\ \hline \hline \end{tabular}
\end{table}
Table 1: Comparison between the proposed model and a set of BP-enabled and BP-free algorithms under MNIST, CIFAR-10, and ImageNet. The best test errors (%) are highlighted in **bold**. Leadership size is set to \(70\%\) for all the LFNNs and LFNN-\(\ell\)s.

\begin{table}
\begin{tabular}{c c c|c c c c c c c c c} \hline \hline \multicolumn{2}{c|}{**Dataset**} & \multicolumn{1}{c|}{**Model**} & \multicolumn{1}{c}{**Leadership Percentage**} & \multicolumn{1}{c}{**Model**} & \multicolumn
Further details on the relationship between leadership size and model performance will be discussed in the next subsection.

**Scaling up to ImageNet.** Traditional BP-free algorithms have shown limited scalability when applied to larger datasets such as ImageNet [20]. To assess the scalability of LFNN and LFNN-\(\ell\), we conduct experiments on ImageNet subset and Tiny ImageNet2. The results in Table 1 compare the train / test error rates of LFNN and LFNN-\(\ell\) with other baseline models using BP and BP-free algorithms on the ImageNet dataset. In the ImageNet experiments, LFNN achieves competitive test errors compared to BP and LG-BP, achieving a test error rate of 57.75% compared to 35.24% and 54.37% respectively. Notably, when compared to BP-free algorithms, LFNN-\(\ell\) outperforms all baseline models and achieves a test error rate 2.49% lower than the best-performing LG-FG-A. Furthermore, LFNN-\(\ell\) demonstrates an improvement over LFNN on ImageNet. These results suggest that the use of local loss in LFNN-\(\ell\) yields better performance compared to global loss, particularly when dealing with challenging tasks such as ImageNet.

Footnote 2: More ImageNet results can be found in the supplementary materials.

To further investigate the generalizability of LFNN and LFNN-\(\ell\), we conduct experiments on ImageNet variants and increase the model size by doubling the number of parameters to approximately 37M. Additionally, we explore the impact of leadership size on model performance. The results of the error rates for Tiny ImageNet and ImageNet subset with varying leadership percentages are presented in Table 3. For Tiny ImageNet, we observe that using a leadership percentage of 90% yields the lowest test error rates, with LFNN achieving 35.21% and LFNN-\(\ell\) achieving 36.06%. These results are surprisingly comparable to other BP-enabled deep learning models tested on Tiny ImageNet, such as UPANets (test error rate \(=32.33\%\)) [51], PreActRest (test error rate \(=36.52\%\)) [52], DLME (test error rate \(=55.10\%\)) [53], and MMA (test error rate \(=35.59\%\)) [54].

In the ImageNet subset experiments, we follow the methodology of [48] and leverage the ResNet-50 architecture as the base encoder, combining it with LFNN and LFNN-\(\ell\). LFNN and LFNN-\(\ell\) with 90% leadership achieve the lowest test error rates of 57.37% and 53.82%, respectively. These results surpass all baseline models in Table 1 and are even comparable to the test error rates of BP-enabled algorithms reported in [48], which is 50.6%. This observation further demonstrates the effectiveness of our proposed algorithm in transfer learning scenarios. It is worth mentioning that we observed even better results than those in Table 3 when further increasing the number of parameters. From Figure 2(a) and Table 2, we recall that for simple tasks like MNIST or CIFAR-10 classification, small leadership sizes can achieve decent results. In Table 3, we observe a clearer trend that for difficult datasets like ImageNet, a higher leadership percentage is required to achieve better results. This presents an interesting avenue for future exploration, particularly in understanding the relationship between network / leadership size and dataset complexity.

## 4 Conclusion

In this work, we have presented a novel learning algorithm, LFNN, inspired by collective behavior observed in nature. By introducing a leader-follower hierarchy within neural networks, we have demonstrated its effectiveness across various network architectures. Our comprehensive study of LFNN aligns with observations and theoretical foundations in both the biological and deep learning domains. In addition, we have proposed LFNN-\(\ell\), a BP-free variant that utilizes local error signals

\begin{table}
\begin{tabular}{c c|c|c c c c c c c c c} \hline \hline \multirow{2}{*}{**Dataset**} & \multirow{2}{*}{**Model**} & \multicolumn{1}{c}{\multirow{2}{*}{10\%}} & \multicolumn{1}{c}{\multicolumn{1}{c}{\multirow{2}{*}{20\%}}} & \multicolumn{1}{c}{\multicolumn{1}{c}{\multirow{2}{*}{30\%}}} & \multicolumn{1}{c}{\multicolumn{1}{c}{\multirow{2}{*}{40\%}}} & \multicolumn{1}{c}{\multicolumn{1}{c}{\multirow{2}{*}{50\%}}} & \multicolumn{1}{c}{\multirow{2}{*}{60\%}} & \multicolumn{1}{c}{\multirow{2}{*}{70\%}} & \multicolumn{1}{c}{\multirow{2}{*}{80\%}} & \multicolumn{1}{c}{\multirow{2}{*}{90\%}} & \multicolumn{1}{c}{\multirow{2}{*}{100\%}} \\ \hline \multirow{4}{*}{**Tiny ImageNet**} & \multirow{2}{*}{LFNN-\(\ell\)} & Test & 73.98 & 63.09 & 54.24 & 49.63 & 44.87 & 40.96 & 37.17 & 38.05 & **36.06** & 39.56 \\  & & Train & 71.47 & 57.29 & 43.69 & 38.57 & 30.53 & 22.04 & 19.50 & 19.38 & 16.00 & 32.33 \\  & & Test & 39.85 & 40.12 & 39.34 & 39.18 & 39.33 & 39.41 & 39.42 & 38.63 & **35.21** & 39.56 \\  & & Train & 36.50 & 35.76 & 32.71 & 32.16 & 32.02 & 32.36 & 32.70 & 31.91 & 32.59 & 32.33 \\ \hline \multirow{4}{*}{**ImageNet Subset**} & \multirow{2}{*}{LFNN-\(\ell\)} & Test & 90.57 & 84.83 & 78.75 & 73.65 & 68.61 & 64.25 & 59.53 & 56.54 & **53.82** & 54.44 \\  & & Train & 68.96 & 51.89 & 39.49 & 27.78 & 22.68 & 13.37 & 9.23 & 54.1 & 5.58 & 6.40 \\ \cline{1-1}  & & Test & 79.37 & 78.83 & 69.87 & 61.80 & 60.05 & 59.10 & 57.46 & 58.01 & **57.37** & 57.75 \\ \cline{1-1}  & & Train & 53.13 & 52.18 & 38.38 & 26.26 & 25.21 & 20.35 & 18.42 & 18.40 & 16.70 & 17.94 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Error rate (% \(\downarrow\)) results of LFNNs and LFNN-\(\ell\)s (with different leadership percentage) on Tiny ImageNet and ImageNet subset. We also trained CNN counterparts (without LF hierarchy) with BP and global loss for reference. The test error rates of BP-enabled CNNs under Tiny ImageNet and ImageNet subset are 35.76% and 51.62%, respectively.
instead of traditional backpropagation. We have shown that LFNN-\(\ell\), trained without a global loss, achieves superior performance compared to a set of BP-free algorithms. Through extensive experiments on MNIST, CIFAR-10, and ImageNet datasets, we have validated the efficacy of LFNN with and without BP. LFNN-\(\ell\) not only outperforms other state-of-the-art BP-free algorithms on all tested datasets but also achieves competitive results when compared to BP-enabled baselines in certain cases. Our work is unique as it is the first to introduce collective motion-inspired models for deep learning architectures, opening up new directions for the development of local error signals and alternatives to BP. The proposed algorithm is straightforward yet highly effective, holding potential for practical applications across various domains. We believe that this early study provides valuable insights into fundamental challenges in deep learning, including neural network architecture design and the development of biologically plausible decentralized learning algorithms.