How Important is Weight Symmetry in Backpropagation?
Qianli Liao, Joel Z. Leibo, Tomaso Poggio
Introduction
Deep Neural Networks (DNNs) have achieved remarkable performance in many domains [\citeauthoryearKrizhevsky, Sutskever, and Hinton2012, \citeauthoryearAbdel-Hamid et al.2012, \citeauthoryearHinton et al.2012, \citeauthoryearMikolov et al.2013, \citeauthoryearTaigman et al.2014, \citeauthoryearGraves, Wayne, and Danihelka2014]. The simple gradient backpropagation (BP) algorithm has been the essential “learning engine” powering most of this work.
Deep neural networks are universal function approximators [\citeauthoryearHornik, Stinchcombe, and White1989]. Thus it is not surprising that solutions to real-world problems exist within their configuration space. Rather, the real surprise is that such configurations can actually be discovered by gradient backpropagation.
The human brain may also be some form of DNN. Since BP is the most effective known method of adapting DNN parameters to large datasets, it becomes a priority to answer: could the brain somehow be implementing BP? Or some approximation to it?
For most of the past three decades since the invention of BP, it was generally believed that it could not be implemented by the brain [\citeauthoryearCrick1989, \citeauthoryearMazzoni, Andersen, and Jordan1991, \citeauthoryearO’Reilly1996, \citeauthoryearChinta and Tweed2012, \citeauthoryearBengio et al.2015]. BP seems to have three biologically implausible requirements: (1) feedback weights must be the same as feedforward weights (2) forward and backward passes require different computations, and (3) error gradients must somehow be stored separately from activations.
One biologically plausible way to satisfy requirements (2) and (3) is to posit a distinct “error network” with the same topology as the main (forward) network but used only for backpropagation of error signals. The main problem with such a model is that it makes requirement (1) implausible. There is no known biological way for the error network to know precisely the weights of the original network. This is known as the “weight transport problem” [\citeauthoryearGrossberg1987]. In this work we call it the “weight symmetry problem”. It is arguably the crux of BP’s biological implausibility.
In this report, we systematically relax BP’s weight symmetry requirement by manipulating the feedback weights. We find that some natural and biologically plausible schemes along these lines lead to exploding or vanishing gradients and render learning impossible. However, useful learning is restored if a simple and indeed more biologically plausible rule called Batch Manhattan (BM) is used to compute the weight updates. Another technique, called Batch Normalization (BN) [\citeauthoryearIoffe and Szegedy2015], is also shown effective. When combined together, these two techniques seem complementary and significantly improve the performance of our asymmetric version of backpropagation.
The results are somewhat surprising: if the aforementioned BM and/or BN operations are applied, the magnitudes of feedback weights turn out not to be important. A much-relaxed sign-concordance property is all that is needed to attain comparable performance to mini-batch SGD on a large number of tasks.
Furthermore, we tried going beyond sign concordant feedback. We systematically reduced the probability of feedforward and feedback weights having the same sign (the sign concordance probability). We found that the effectiveness of backpropagation is strongly dependent on high sign concordance probability. That said, completely random and fixed feedback still outperforms chance e.g., as in the recent work of Lillicrap et al. [\citeauthoryearLillicrap et al.2014].
Our results demonstrate that the perfect forward-backward weight symmetry requirement of backpropagation can be significantly relaxed and strong performance can still be achieved. To summarize, we have the following conclusions: (I) The magnitudes of feedback weights do not matter to performance. This surprising result suggests that our theoretical understanding of why backpropagation works may be far from complete. (II) Magnitudes of the weight updates also do not matter. (III) Normalization / stabilization methods such as Batch Normalization and Batch Manhattan are necessary for these asymmetric backpropagation algorithms to work. Note that this result was missed by previous work on random feedback weights [\citeauthoryearLillicrap et al.2014]. (IV) Asymmetric backpropagation algorithms evade the weight transport problem. Thus it is plausible that the brain could implement them. (V) These results indicate that sign-concordance is very important for achieving strong performance. However, even fixed random feedback weights with Batch Normalization significantly outperforms chance. This is intriguing and motivates further research. (VI) Additionally, we find Batch Manhattan to be a very simple but useful technique in general. When used with Batch Normalization, it often improves the performance. This is especially true for smaller training sets.
Asymmetric Backpropagations
A schematic representation of backpropagation is shown in Fig. 1. Let be the objective function. Let and denote the feedforward and feedback weight matrices respectively. Let denote the inputs and the outputs. and are the feedforward and feedback connections between the -th output and the -th input , respectively. and are the transfer function and its derivative. Let the derivative of the -th input with respect to the objective function be , the formulations of forward and back propagation are as follows:
The standard BP algorithm requires . We call that case symmetric backpropagation. In this work we systematically explore the case of asymmetric backpropagation where .
By varying , one can test various asymmetric BPs. Let denote the function that takes the sign (-1 or 1) of each element. Let indicate element-wise multiplication. are matrices of the same size as . is a matrix of uniform random numbers and is a matrix where each element is either with probability or with probability . We explored the following choices of feedback weights in this paper: 1. Uniform Sign-concordant Feedbacks (uSF): 2. Batchwise Random Magnitude Sign-concordant Feedbacks (brSF): , where is redrawn after each update of (i.e., each mini-batch). 3. Fixed Random Magnitude Sign-concordant Feedbacks (frSF): , where is initialized once and fixed throughout each experiment. 4. Batchwise Random Magnitude p-percent-sign-concordant Feedbacks (brSF-p): , where and is redrawn after each update of (i.e., each mini-batch). 5. Fixed Random Magnitude p-percent-sign-concordant Feedbacks (frSF-p): , where and is initialized once and fixed throughout each experiment. 6. Fixed Random Feedbacks (RndF): Each feedback weight is drawn from a zero-mean gaussian distribution and fixed throughout each experiment: , where was chosen to be 0.05 in all experiments.
The results are summarized in the Section 5. The performances of 1, 2 and 3, which we call strict sign-concordance cases, are shown in Experiment A. The performances of 4 and 5 with different choices of , which we call partial sign-concordance cases, are shown in Experiment B. The performances and control experiments about setting 6, which we call no concordance cases, are shown in Experiments C1 and C2.
Normalizations/stabilizations are necessary for “asymmetric” backpropagations
Batch Normalization (BN) Batch Normalization (BN) is a recent technique proposed by [\citeauthoryearIoffe and Szegedy2015] to reduce “internal covariate shift” [\citeauthoryearIoffe and Szegedy2015]. The technique consists of element-wise normalization to zero mean and unit standard deviation. Means and standard deviations are separately computed for each batch. Note that in [\citeauthoryearIoffe and Szegedy2015], the authors proposed the use of additional learnable parameters after the whitening. We found the effect of this operation to be negligible in most cases. Except for the “BN” and “BN+BM” entries (e.g., in Table 2), we did not use the learnable parameters of BN. Note that batch normalization may be related to the homeostatic plasticity mechanisms (e.g., Synaptic Scaling) in the brain [\citeauthoryearTurrigiano and Nelson2004, \citeauthoryearStellwagen and Malenka2006, \citeauthoryearTurrigiano2008].
Batch Manhattan (BM) We were first motivated by looking at how BP could tolerate noisy operations that could be seen as more easily implementable by the brain. We tried relaxing the weight updates by discarding the magnitudes of the gradients. Let the weight at time be , the update rule is:
We tested several settings of as follows: Setting 0 (SGD): Setting 1: Setting 2: Setting 3: where where and are momentum and weight decay rates respectively. means taking the sign (-1 or 1), is the objective function, and denotes the indices of samples in the mini-batch. Setting 0 is the SGD algorithm (by “SGD” in this paper, we always refer to the mini-batch version with momentum and weight decay). Setting 1 is same as 0 but rounding the accumulated gradients in a batch to its sign. Setting 2 takes an extra final sign after adding the gradient term with momentum and weight decay terms. Setting 3 is something in between 1 and 2, where an final sign is taken, but not accumulated in the momentum term.
We found these techniques to be surprisingly powerful in the sense that they did not lower performance in most cases (as long as learning rates were reasonable). In fact, sometimes they improved performance. This was especially true for smaller training sets. Recall that asymmetric BPs tend to have exploding/vanishing gradients, these techniques are immune to such problems since the magnitudes of gradients are discarded.
We also found that the performance of this technique was influenced by batch size on some experiments. In the cases of very small batch sizes, discarding the magnitudes of the weight updates was sometimes detrimental to performance.
This class of update rule is very similar to a technique called the Manhattan update rule, which can be considered as a simplified version of Rprop [\citeauthoryearRiedmiller and Braun1993]. We suggest calling it “Batch Manhattan” (BM) to distinguish it from the stochastic version [\citeauthoryearZamanidoost et al.2015]. By default, we used setting 1 for BM throughout the Experiments A, B, C1 and C2. The “miscellaneous experiment” at the end of the Section 5 demonstrates that settings 1, 2 and 3 give similar performances, so the conclusions we draw broadly apply to all of them.
Related Work
Since the invention of backpropagation (BP) [\citeauthoryearRumelhart, Hinton, and Williams1988], its biological plausibility has been a long-standing controversy. Several authors have argued that BP is not biologically plausible [\citeauthoryearCrick1989, \citeauthoryearMazzoni, Andersen, and Jordan1991, \citeauthoryearO’Reilly1996, \citeauthoryearChinta and Tweed2012, \citeauthoryearBengio et al.2015]. Various biologically plausible modifications have been proposed. Most involve bidirectional connections e.g. Restricted Boltzmann Machines [\citeauthoryearHinton and Salakhutdinov2006, \citeauthoryearSmolensky1986] and so-called recirculation algorithms [\citeauthoryearHinton and McClelland1988, \citeauthoryearO’Reilly1996] which despite their name provided, in the case of an autoencoder, an elegant early demonstration that adaptive backwards weight can work without being identical to the forward ones. Recently, there have also been BP-free auto-encoders [\citeauthoryearBengio2014] based on “target propagation” [\citeauthoryearLe Cun1986].
The most relevant work to ours is a recent paper by Lillicrap et al. [\citeauthoryearLillicrap et al.2014] of which we became aware after most of this work was done. Lillicrap et al. showed that fixed random feedback weights can support the learning of good representations for several simple tasks: (i) approximating a linear function, (ii) digit recognition on MNIST and (iii) approximating the outputs of a random 3 or 4 layer nonlinear neural network. Our work is very similar in spirit but rather different and perhaps complementary in its results, since we conclude that signs must be concordant between feedforward and corresponding feedback connections for consistent good performance, whereas the magnitudes do not matter, unlike Lilicrap et al. experiments in which both signs and magnitudes were random (but fixed). To explain the difference in our conclusions, it is useful to consider the following points: 1. We systematically explored performance of the algorithms using 15 different datasets because simple tasks like MNIST by themselves do not always reveal differences between algorithms. 2. We tested deeper networks, since the accuracy of asymmetric BP’s credit assignment may critically attenuate with depth (for task (i) and (ii) Lillicrap et al. used a 3-layer (1 hidden layer) fully-connected network, and for task (iii) they used a 3 or 4 layer fully-connected network, whereas in most of our experiments, we use deeper and larger CNNs as shown in Table 1). 3. We found that local normalizations/stabilizations is critical for making asymmetric BP algorithms work. As shown by our results in Table 4, the random feedbacks scheme (i.e. the “RndF” column) suggested by Lillicrap et al. seem to work well only on one or two tasks, performing close to chance on most of them. Only when combined with Batch Normalization (“RndF+BN” or “RndF+BN+BM” in Table 4), it appears to become competitive. 4. We investigated several variants of asymmetric BPs such as sign-concordance (Table 2 and 3), batchwise-random vs. fixed-random feedbacks (Table 3) and learning with clamped layers (Table 4 Exp. C2).
Experiments
We were interested in relative differences between algorithms, not absolute performance. Thus we used common values for most parameters across all datasets to facilitate comparison. Key to our approach was the development of software allowing us to easily evaluate the “cartesian product” of models (experimental conditions) and datasets (tasks). Each experiment was a {model,dataset} pair, which was run 5 times using different learning rates (reporting the best performance). We used MatConvNet [\citeauthoryearVedaldi and Lenc2015] to implement our models.
Datasets
We extensively test our algorithms on 15 datasets of 5 Categories as described below. No data augmentation (e.g., cropping, flip, etc.) is used in any of the experiments. Machine learning tasks: MNIST [\citeauthoryearLeCun, Cortes, and Burges], CIFAR-10 [\citeauthoryearKrizhevsky2009], CIFAR-100 [\citeauthoryearKrizhevsky2009], SVHN[\citeauthoryearNetzer et al.2011], STL10 [\citeauthoryearCoates, Ng, and Lee2011]. Standard training and testing splits were used. Basic-level categorization tasks: Caltech101 [\citeauthoryearFei-Fei, Fergus, and Perona2007]: 102 classes, 30 training and 10 testing samples per class. Caltech256-101 [\citeauthoryearGriffin, Holub, and Perona2007]: we train/test on a subset of randomly sampled 102 classes. 30 training and 10 testing per class. iCubWorld dataset [\citeauthoryearFanello et al.2013]: We followed the standard categorization protocol of this dataset. Fine-grained recognition tasks: Flowers17 [\citeauthoryearNilsback and Zisserman2006], Flowers102 [\citeauthoryearNilsback and Zisserman2008]. Standard training and testing splits were used. Face Identification: Pubfig83-ID [\citeauthoryearPinto et al.2011], SUFR-W-ID [\citeauthoryearLeibo, Liao, and Poggio2014], LFW-ID [\citeauthoryearHuang et al.2008] We did not follow the usual (verification) protocol of these datasets. Instead, we performed a 80-way face identification task on each dataset, where the 80 identities (IDs) were randomly sampled. Pubfig83: 85 training and 15 testing samples per ID. SUFR-W: 10 training and 5 testing per ID. LFW: 10 training and 5 testing per ID. Scene recognition: MIT-indoor67 [\citeauthoryearQuattoni and Torralba2009]: 67 classes, 80 training and 20 testing per class Non-visual task: TIMIT-80 [\citeauthoryearGarofolo et al.]: Phoneme recognition using a fully-connected network. There are 80 classes, 400 training and 100 testing samples per class.
Training Details
The network architectures for various experiments are listed in Table 1. The input sizes of networks are shown in the second row of the table. All images are resized to fit the network if necessary.
Momentum was used with hyperparameter 0.9 (a conventional setting). All experiments were run for 65 epochs. The base learning rate: 1 to 50 epochs , 51 to 60 epochs , and 61 to 65 epochs . All models were run 5 times on each dataset with base learning rate multiplied by 100, 10, 1, 0.1, 0.01 respectively. This is because different learning algorithms favor different magnitudes of learning rates. The best validation error among all epochs of 5 runs was recorded as each model’s final performance. The batch sizes were all set to 100 unless stated otherwise. All experiments used a softmax for classification and the cross-entropy loss function. For testing with batch normalization, we compute exponential moving averages (alpha=0.05) of training means and standard deviations over 20 mini batches after each training epoch.
Results
In this experiment, we show the performances of setting 1, 2 and 3 in Section 2, which we call strict sign-concordance cases: while keeping the signs of feedbacks the same as feedforward ones, the magnitudes of feedbacks are either randomized or set to uniform. The results are shown in Table 2 : Plus sign (+) denotes combination of methods. For example, uSF+BM means Batch Manhattan with uniform sign-concordant feedback. SGD: Stochastic gradient descent, the baseline algorithm. BM: SGD + Batch Manhattan. BN: SGD + Batch Normalization. BN+BM: SGD + Batch Normalization + Batch Manhattan. uSF: Uniform sign-concordant feedback. This condition often had exploding gradients. NuSF: same as uSF, but with feedback weights normalized by dividing the number of inputs of the feedforward filter (filter width * filter height * input feature number). This scheme avoids the exploding gradients but still suffers from vanishing gradients. uSF+BM: this setting is somewhat unstable for small batch sizes. Two training procedures were explored: (1) batch size 100 for all epochs (2) batch size 100 for 3 epochs and then batch size 500 for the remaining epochs. The best performance was reported. While this gives a little advantage to this model since more settings were tried, we believe it is informative to isolate the stability issue and show what can be achieved if the model converges well. Note that uSF+BM is the only entry with slightly different training procedures. All other models share exactly the same training procedure & parameters. uSF+BN, uSF+BN+BM, brSF+BN+BM, frSF+BN+BM: These are some combinations of uSF, brSF, frSF, BN and BM. The last three are the most robust, well-performing ,and biologically-plausible algorithms.
Experiment B: Violating Sign-Concordance with probability p
In this experiment, we test the effect of partial sign-concordance. That is, we test settings 4 and 5 as described in Section 2. In these cases, the feedback weight magnitudes were all random. Strict sign-concordance was relaxed by manipulating the probability of concordance between feedforward and feedback weight signs. Feedback weights depend on the matrix as defined in Section 2. Table 3 Part 1 reports results from setting 4, the case where a new and is sampled for each batch. Table 3 Part 2 reports results of setting 5, the case where and are fixed. The main observation from this experiment is that the performance declines as the level of sign-concordance decreases.
Experiment C1: Fixed Random Feedback
Results are shown in Table 4: RndF: fixed random feedbacks. RndF+BN, RndF+BN+BM: some combinations of RndF, BN and BM. uSF+BN+BM: one of our best algorithms, for reference. The “RndF” setting is the same as the one proposed by [\citeauthoryearLillicrap et al.2014]. Apparently it does not perform well on most datasets. However, combining it with Batch Normalization makes it significantly better. Although it remains somewhat worse than its sign concordant counterpart. Another observation is that random feedback does not work well with BM alone (but better with BN+BM).
Experiment C2: Control experiments for Experiment C1
The fact that random feedback weights can learn meaningful representations is somewhat surprising. We explore this phenomenon by running some control experiments, where we run two control models for each model of interest: 1. (.)Bottom: The model’s last layer is initialized randomly and clamped/frozen. All learning happens in the layers before the last layer. 2. (.)Top: The model’s layers before the last layer are initialized randomly and clamped/frozen. All learning happens in the last layer. Results are shown in Table 4.
There are some observations: (i) When only the last layer was allowed to adapt, all models behaved similarly. This was expected since the models only differed in the way they backpropagate errors. (ii) With the last layer is clamped, random feedback cannot learn meaningful representations. (iii) In contrast, the models with sign concordant feedback can learn surprisingly good representations even with the last layer locked. We can draw the following conclusions from such observations: sign concordant feedback ensures that meaningful error signals reach lower layers by itself, while random feedback is not sufficient. If all layers can learn, random feedback seems to work via a “mysterious co-adaptation” between the last layer and the layers before it. This “mysterious co-adaptation” was first observed by [\citeauthoryearLillicrap et al.2014], where it was called “feedback alignment” and some analyses were given. Note that our Experiment C shows that the effect is more significant if Batch Normalization is applied.
Miscellaneous Experiment: different settings of Batch Manhattan
We show that the 3 settings of BM (as described in Section 3) produce similar performances. This is the case for both symmetric and asymmetric BPs. Results are in Table 5.
Discussion
This work aims to establish that there exist variants of the gradient backpropagation algorithm that could plausibly be implemented in the brain. To that end we considered the question: how important is weight symmetry to backpropagation? Through a series of experiments with increasingly asymmetric backpropagation algorithms, our work complements a recent demonstration[\citeauthoryearLillicrap et al.2014] that perfect weight symmetry can be significantly relaxed while still retaining strong performance.
These results show that Batch Normalization and/or Batch Manhattan are crucial for asymmetric backpropagation to work. Furthermore, they are complementary operations that are better used together than individually. These results highlight the importance of sign-concordance to asymmetric backpropagation by systematically exploring how performance declines with its relaxation.
Finally, let us return to our original motivation. How does all this relate to the brain? Based on current neuroscientific understanding of cortical feedback, we cannot make any claim about whether such asymmetric BP algorithms are actually implemented by the brain. Nevertheless, this work shows that asymmetric BPs, while having less constraints, are not computationally inferior to standard BP. So if the brain were to implement one of them, it could obtain most of the benefits of the standard algorithm.
This work suggests a hypothesis that could be checked by empirical neuroscience research: if the brain does indeed implement an asymmetric BP algorithm, then there is likely to be a high degree of sign-concordance in cortical forward-backward connections.
These empirical observations concerning Batch Manhattan updating may shed light on the general issue of how synaptic plasticity may implement learning algorithms. They show that changes of synaptic strength can be rather noisy. That is, the sign of a long term accumulation of synaptic potentiation or depression, rather than precise magnitude, is what is important. This scheme seems biologically implementable.
Acknowledgements
We thank G. Hinton for useful comments. This work was supported by the Center for Brains, Minds and Machines (CBMM), funded by NSF STC award CCF – 1231216.