R EVISITING L OCALLY S UPERVISED L EARNING : AN A LTERNATIVE TO E ND - TO - END T RAINING
Anonymous authors
Paper under double-blind review
A BSTRACT
Due to the need to store the intermediate activations for back-propagation, endto-end (E2E) training of deep networks usually suffers from high GPUs memory footprint.
This paper aims to address this problem by revisiting the locally supervised learning, where a network is split into gradient-isolated modules and trained with local supervision.
We experimentally show that simply training local modules with E2E loss tends to collapse task-relevant information at early layers, and hence hurts the performance of the full model.
To avoid this issue, we propose an information propagation (InfoPro) loss, which encourages local modules to preserve as much useful information as possible, while progressively discard task-irrelevant information.
As InfoPro loss is difﬁcult to compute in its original form, we derive a feasible upper bound as a surrogate optimization objective, yielding a simple but effective algorithm.
In fact, we show that the proposed method boils down to minimizing the combination of a reconstruction loss and a normal cross-entropy/contrastive term.
Extensive empirical results on ﬁve datasets (i.e.,
CIFAR, SVHN, STL-10, ImageNet and Cityscapes) validate that InfoPro is capable of achieving competitive performance with less than 40% memory footprint compared to E2E training, while allowing using training data with higher-resolution or larger batch sizes under the same GPU memory constraint.
Our method also enables training local modules asynchronously for potential training acceleration.
I NTRODUCTION
End-to-end (E2E) back-propagation has become a standard paradigm to train deep networks (Krizhevsky et al., 2012; Simonyan & Zisserman, 2014; Szegedy et al., 2015;
He et al., 2016;
Huang et al., 2019).
Typically, a training loss is computed at the ﬁnal layer, and then the gradients are propagated backward layer-by-layer to update the weights.
Although being effective, this procedure may suffer from memory/computation inefﬁciencies.
First, the entire computational graph as well as the activations of most, if not all, layers need to be stored, resulting in intensive memory consumption.
The GPU memory constraint is usually a bottleneck that inhibits the training of state-of-the-art models with high-resolution inputs and sufﬁcient batch sizes, which arises in many realistic scenarios, such as 2D/3D object detection in autonomous driving, tissue segmentation in medical imaging and object recognition from remote sensing data.
Existing work has addressed this issue via gradient checkpointing technique (Salimans & Bulatov, 2017; Chen et al., 2016) or special architecture design (Gomez et al., 2017), while they both come at the cost of signiﬁcantly increased computation.
Second,
E2E training is a sequential process that impedes model parallelization (Belilovsky et al., 2020; L¨owe et al., 2019), as earlier layers need to wait for their successors for error signals.
As an alternative to E2E training, the locally supervised learning paradigm (Hinton et al., 2006;
Bengio et al., 2007; Nøkland & Eidnes, 2019; Belilovsky et al., 2019; 2020) by design enjoys higher memory efﬁciency and allows for model parallelization.
In speciﬁc, it divides a deep network into several gradient-isolated modules and trains them separately under local supervision (see Figure(b)).
Since back-propagation is performed only within local modules, one does not need to store all intermediate activations at the same time.
Consequently, the memory footprint during training is reduced without involving signiﬁcant computational overhead.
Moreover, by removing the demands for obtaining error signals from later layers, different local modules can potentially be trained in parallel.
This approach is also considered more biologically plausible, given that brains are highly modular and predominantly learn from local signals (Crick, 1989; Dan & Poo, 2004; Bengio et al.,
[Figure]
[Table]
/2369V6rS6POS1YhVCl4tmLNlY+0TG1KCKXcgpIUUgZZJ9sSvEekUV1iqE7oR50CSRP1hX1qQLbHCgFhA1tF78dfB0V2hDfzJmKtQsvPv4SWJq0CZsIuAQyezNlPRdm1s7j7gkn7+0c/52CK4A2o1NoF9kNkJe141gyatOOxOAhplg0HJ1bsOSSFd65ORJVBoYYOpZbWE8gu2I5yLMpNqnEzrm1Zf2PIFnL326BzelvaXQOWLkilf+KhH36UqUzyBq/BQtzBD+ffx/dwtxt2IdjzPrdFM5U8rQDXgesnAW2My+syqI8RdV1TjlH7RHuoYchxpddd0sZc8FN8owzpuAJYKkr3KA39Erqq/0wayYdEIKzrEIR3q70hQPErL3H2E2EuJR0uCcZ4Yps0Xuw2hIR+zULFt0/i3p+mNlZPh2ZP7biHXIftqAdTIZ5MWk8vWW+QjkZuCq6k2f54hkPCstsilv3AM+LRU9omx5DUnIe1Ur8BuKX8zaoSH/K7yQmgm0i88ndsniqLnumlCF9SBydJ1i9o6tZlKEDOTszOWd4esuww9h5Dx9LsSn0Duri4TuXqStDnxXMGr84c1eJS98fizmHN8N8ZIweb4u2IxMELO5Oa/KmnBaa2zWrXrNeP63uPi9u0VV6QA/
pEXr2Ge3SS9rDCeHSO/pMX+ir8c34bvwwfmro8lJhc5/GHuP3P1HJjwE=</latexit>
Final Feature
End
[Figure]
to
[Figure]
end Supervised Learning
[Figure]
However, a major drawback of local learning is that they usually lead to inferior performance compared to E2E training (Mostafa et al., 2018; Belilovsky et al., 2019; 2020).
In this paper, we revisit locally supervised training and analyse its drawbacks from the informationtheoretic perspective.
We ﬁnd that directly adopting an E2E loss function (i.e., cross-entropy) to train local modules produces more discriminative intermediate features at earlier layers, while it collapses task-relevant information from the inputs and leads to inferior ﬁnal performance.
In other words, locally supervised learning tends to be short sighted, and learns features that only beneﬁt local modules, while ignoring the demands of the rest layers.
Once task-relevant information is washed out in earlier modules, later layers cannot take full advantage of their capacity to learn more powerful representations.
Based on the above observations, we hypothesize that a less greedy training procedure that preserves more information about the inputs might be a rescue for locally supervised training.
Therefore, we propose a less greedy information propagation (InfoPro) loss that aims to encourage local modules to propagate forward as much information from the inputs as possible, while progressively abandon task-irrelevant parts (formulated by an additional random variable named nuisance), as shown in
Figure 1 (c).
The proposed method differentiates itself from existing algorithms (Nøkland & Eidnes, 2019; Belilovsky et al., 2019; 2020) on that it allows intermediate features to retain a certain amount of information which may hurt the short-term performance, but can potentially be leveraged by later modules.
In practice, as the InfoPro loss is difﬁcult to estimate in its exact form, we derive a tractable upper bound, leading to surrogate losses, e.g., cross-entropy loss and contrastive loss.
Empirically, we show that InfoPro loss effectively prevents collapsing task-relevant information at local modules, and yields favorable results on ﬁve widely used benchmarks (i.e., CIFAR, SVHN,
STL-10, ImageNet and Cityscapes).
For instance, it achieves comparable accuracy as E2E training using 40% or less GPU memory, while allows using a 50% larger batch size or a 33% larger input resolution with the same memory constraints.
Additionally, our method enables training different local modules asynchronously (even in parallel).
W HY LOCALLY SUPERVISED LEARNING UNDERPERFORMS E2E TRAINING ?
[Table]
We start by considering a local learning setting where a deep network is split into multiple successively stacked modules, each with the same depth.
The inputs are fed forward in an ordinary way, while the gradients are produced at the end of every module and back-propagated until reaching an earlier module.
To generate supervision signals, a straightforward solution is to train all the local modules as independent networks, e g., in classiﬁcation tasks, attaching a classiﬁer to each module, and computing the local classiﬁcation loss such as cross-entropy.
However,
16 LayerIndex
T e s t E rr o r( % )
LinearSeparabilityofIntermediateFeatures(inTestErrors) K =
K =2 K =4 K =
K =     10 12 14 16 LayerIndex 0 .0 .0 .0 .0 .0 .0 .0 .
E s t i m a t
e s o f
I ( h , x )
MutualInformationbetweenFeatures h andInputs x K =
K =2 K =4 K =
K =     10 12 14 16 LayerIndex 0 .0 .0 .0 .0 .0 .0 .0 .
E s t i m a t
e s o f
I ( h , y )
MutualInformationbetweenFeatures h
andLabel y
K =1 K =2 K =
K =8 K = such a greedy version of the standard supervised learning algorithm leads to inferior performance of the whole network.
For instance, in Table 1, we present the test error of a ResNet-32 (He et al., 2016) on CIFAR-10 (Krizhevsky et al., 2009) when it is greedily trained with K modules.
One can observe a severe degradation (even more than 15% ) with K growing larger.
Plausible as this phenomenon seems, it remains unclear whether it is inherent for local learning and how to alleviate this problem.
In this section, we investigate the performance degradation issue of the greedy local training from an information-theoretic perspective, laying the basis for the algorithm proposed in the next section.
Linear separability of intermediate features.
In the common case that greedy SL operates directly on the features output by internal layers, a natural intuition is to investigate how these locally learned features differ from their E2E learned counterparts in task-relevant behaviors.
To this end, we ﬁx the networks in Table 1, and train a linear classiﬁer using the features from each layer.
The test errors of these classiﬁers are presented in the left plot of Figure 2, where the horizontal axis denotes the indices of layers.
The plot shows an intriguing trend: greedy SL contributes to dramatically more discriminative features with the ﬁrst one (or few) local module, but is only able to slightly improve the performance with all the consequent modules.
In contrast, the E2E learned network progressively boosts the linear separability of features throughout the whole network with even more signiﬁcant effects in the later layers, surpassing greedy SL eventually.
This raises an interesting question: why does the full network achieve inferior performance in greedy SL compared to the E2E counterpart, even though the former is based on more discriminative earlier features?
This observation appears incompatible with prior works like deeply-supervised nets (Lee et al., 2015a).
Information in features.
Since we use the same training conﬁguration for both greedy SL and E2E learning, we conjecture that the answer to the above question might lie in the differences of features apart from merely separability.
To test that, we look into the information captured by the intermediate features.
In speciﬁc, given intermediate feature h corresponding to the input data x and the label y
(all of them are treated as random variables), we use the mutual information
I ( h , x ) and I ( h , y ) to measure the amount of all retained information and task-relevant information in h , respectively.
As these metrics cannot be directly computed, we estimate the former by training a decoder with binary cross-entropy loss to reconstruct x from h .
For the latter, we train a CNN using h as inputs to correctly classify x , and estimate I ( h , y ) with its performance.
Details are deferred to Appendix G.
The estimates of I ( h , x ) and I ( h , y ) at different layers are shown in the middle and right plots of Figure 2.
We note that in E2E learned networks, I ( h , y ) remains unchanged when the features pass through all the layers, while I ( h , x ) reduces gradually, revealing that the models progressively discard task-irrelevant information.
However, greedily trained networks collapse both I ( h , x ) and
I ( h , y ) in their ﬁrst few modules.
We attribute this to the short sighted optimization objective of earlier modules, which have relatively small capacity compared with full networks and are not capable of extracting and leveraging all the task-relevant information in x , as the E2E learned networks do.
As a consequence, later modules, even though introducing additional parameters and increased capacity, lack necessary information about the target y to construct more discriminative features.
Information collapse hypothesis.
The above observations suggest that greedy SL induces local modules to collapse some of the task-relevant information that may be useless for short-term performance.
However, the information is useful for the full model.
In addition, we postulate that, although E2E training is incapable of extracting all task-relevant information at earlier layers as well, it alleviates this phenomenon by allowing a larger amount of task-irrelevant information to be kept, even though it may not be ideal for short-term performance.
More empirical validation of our hypothesis is provided in Appendix A.
I NFORMATION P ROPAGATION (I NFO P RO ) L OSS
In this section, we propose an information propagation (InfoPro) loss to address the issue of information collapse in locally supervised training.
The key idea is to enforce local modules to retain as much information about the input as possible, while progressively discard task-irrelevant parts.
As it is difﬁcult to estimate InfoPro loss in its exact form, we derive an easy-to-compute upper bound as the surrogate loss, and analyze its tightness.
3. L EARNING TO D ISCARD U SELESS I NFORMATION
Nuisance.
We ﬁrst model the task-irrelevant information in the input data x by introducing the concept of nuisance.
A nuisance is deﬁned as an arbitrary random variable that affects x but provides no helpful information for the task of interest (Achille & Soatto, 2018).
Take recognizing a car in the wild for example.
The random variables determining the weather and the background are both nuisances.
Formally, given a nuisance r , we have I ( r, x ) >
and I ( r, y ) = 0 , where y is the label.
Without loss of generality, we suppose that y , r , x and h form the Markov chain ( y, r ) → x → h , namely p ( h | x , y, r ) =
p ( h | x ) .
As a consequence, for the intermediate feature h from any layer, we obviously have I ( r, x ) ≥ I ( r, h ) .
Nevertheless, we postulate that max r I ( r, h ) > 0 .
This assumption is mild since it does not hold only when h strictly contains no task-irrelevant information.
Information Propagation (InfoPro) Loss.
Thus far, we have been ready to introduce
the proposed
InfoPro loss.
Instead of overly emphasizing on learning highly discriminative features at local modules, we also pay attention to preventing collapsing useful information in the feed-forward process.
A simple solution to achieve this is maximizing the mutual information
I ( h , x ) .
Ideally, if there is no information loss, all useful information will be retained.
However, it goes to another extreme case where the local modules do not learn any task-relevant feature, and is obviously dispensable.
By contrast, in E2E training, intermediate layers progressively discard useless (taskirrelevant) information as well as shown above.
Therefore, to model both effects simultaneously, we propose the following combined loss function:
[Equation]
where the nuisance r ∗ is formulated to capture as much task-irrelevant information in h as possible, and the coefﬁcient β controls the amount of useful information that is propagated forward (ﬁrst term) and task-irrelevant information that is discarded (second term).
Notably, we assume that the ﬁnal module is always trained using the normal E2E loss (e.g. softmax cross-entropy for classiﬁcation) weighted by the constant 1, such that α is essential to balance the intermediate loss and the ﬁnal one.
In addition, L InfoPro ( h ) is used to train the local module outputting h , whose inputs are not required to be x .
The module may stack over another local module trained with the same form of L InfoPro ( h ) but (possibly) different α and β .
Our method differs from existing works (Nøkland & Eidnes, 2019; Belilovsky et al., 2019; 2020) in that it is a non-greedy approach.
The major effect of minimizing L InfoPro ( h ) can be described as maximally discarding the task-irrelevant information under the goal of retaining as much information of the input as possible.
Obtaining high short-term performance is not necessarily required.
As we explicitly facilitate information propagation, we refer to L InfoPro ( h ) as the InfoPro loss.
3. U PPER B OUND OF L InfoPro
The objective function in Eq.(1) is difﬁcult to be directly optimized, since it is usually intractable to estimate r ∗ , which is equivalent to disentangling all task-irrelevant information from intermediate features.
Therefore, we derive an easy-to-compute upper bound of L InfoPro as an surrogate loss.
Our result is summarized in Proposition 1, with the proof in Appendix B.
Proposition 1.
Suppose that the Markov chain ( y, r ) → x → h holds.
Then an upper bound of
L InfoPro is given by
[Equation]
where λ 1 = α (1 − β ) , λ 2 = αβ .
For simplicity, we integrate α and β into two mutually independent hyper-parameters, λ 1 and λ 2 .
Although we do not explicitly restrict λ 1 ≥ 0 , we ﬁnd in experiments that the performance of networks is signiﬁcantly degraded with λ 1 → 0 + (see: Figure 6), or say, β → 1 − , where models tend to reach local minima by trivially minimizing I ( r ∗ , h ) in Eq.
Thus, we assume λ 1 , λ 2 ≥ 0 .
With Proposition 1, we can optimize the upper bound ¯ L InfoPro as an approximation, circumventing dealing with the intractable term I ( r ∗ , h ) in L InfoPro .
To ensure that the approximation is accurate, the gap between the two should be reasonably small.
Below we present an analysis of the tightness of ¯
L InfoPro in Proposition 2, (proof given in Appendix C).
We also empirically check it in Appendix H.
Proposition 2 provides a useful tool to examine the discrepancy between L InfoPro and its upper bound.
Proposition 2.
Given that r ∗ = argmax r, I ( r, x ) > 0 , I ( r,y )=
I ( r, h ) and that y is a deterministic function with respect to x , the gap (cid:15) =
¯ L InfoPro − L InfoPro is upper bounded by
[Equation]
3. M UTUAL I NFORMATION E STIMATION
In the following, we describe the speciﬁc techniques we use to obtain the mutual information
I ( h , x ) and I ( h , y ) in ¯ L InfoPro .
Both of them are estimated using small auxiliary networks.
However, we note that the involved additional computational costs are minimal or even negligible (see Tables 3, 4).
Estimating I ( h , x ) .
Assume that R ( x | h ) denotes the expected error for reconstructing x from h .
It has been widely known that R ( x | h ) follows I ( h , x )
=
H ( x ) − H ( x | h ) ≥ H ( x ) −R ( x | h ) , where H ( x ) denotes the marginal entropy of x , as a constant (Vincent et al., 2008; Rifai et al., 2012; Kingma & Welling, 2013; Makhzani et al., 2015; Hjelm et al., 2019).
Therefore, we estimate
I ( h , x ) by training a decoder parameterized by w to obtain the minimal reconstruction loss, namely
I
[Equation]
| h )] .
In practice, we use the binary cross-entropy loss for R w ( x | h ) .
Estimating I ( h , y ) .
We propose two ways to estimate I ( h , y ) .
Since I ( h , y ) =
H ( y ) −
H ( y | h ) =
H ( y ) − E
( h ,y )
[ − log p ( y | h )] , a straightforward approach is to train an auxiliary classiﬁer q ψ ( y | h ) with parameters ψ to approximate p ( y | h ) , such that we have I ( h , y )
≈ max ψ { H ( y ) − E h
[ (cid:80) y − p
( y | h ) log q ψ ( y | h )] } .
Note that this approximate equation will become an equation if and only if q ψ ( y | h ) ≡ p ( y | h ) (according to the Gibbs’ inequality).
Finally, we estimate the expectation on h using the samples { ( x i , h i , y i ) } Ni =1 , namely I ( h , y )
≈ max ψ { H ( y ) − 1 N [ (cid:80)
Ni =1 − log q ψ ( y i |
h i )] } .
Consequently, q ψ ( y | h ) can be trained in a regular classiﬁcation fashion with the cross-entropy loss.
In addition, motivated by recent advances in contrastive representation learning (Chen et al., 2020;
Khosla et al., 2020; He et al., 2020), we formulate a contrastive style loss function L contrast , and prove in Appendix D that minimizing L contrast is equivalent to maximizing a lower bound of I ( h , y ) .
Empirical results indicate that adopting L contrast leads to better performance if a large batch size is available.
In speciﬁc, considering a mini-batch of intermediate features { h 1 , . . .
, h N } corresponding to the labels { y 1 , . . .
, y N } , L contrast is given by:
[Equation]
Herein, 1 A ∈ { 0 , 1 } returns 1 only when A is true, τ > 0 is a pre-deﬁned hyper-parameter, temperature, and f φ is a projection head parameterized by φ that maps the feature
h
i to a representation vector z
i (this design follows Chen et al.
Khosla et al.
Implementation details.
We defer the details on the network architecture of w , ψ and φ to Appendix
E. Brieﬂy, w is a two layer decoder with up-sampled inputs (if not otherwise noted), with ψ and φ sharing the same architecture consisting of a single convolutional layer followed by two fullyconnected layers.
On ImageNet and Cityscapes, we use relatively larger auxiliary nets, but they are very small compared with the primary network.
Empirically, we ﬁnd that these simple architectures are capable of achieving competitive performance consistently.
Moreover, in implementation, we train w , ψ and φ collaboratively with the main network.
Formally, let θ denote the parameters of the local module to be trained, and then the ﬁnal optimization objective of our method is minimize θ , w , ψ
[Equation]
which corresponds to using the cross-entropy and contrast loss to estimate I ( h , y ) , respectively.
Such an approximation is acceptable as we do not need to acquire the exact approximation of mutual information, and empirically it performs well in various experimental settings.
E XPERIMENTS
Setups.
Our experiments are based on ﬁve widely used datasets (i.e., CIFAR-10 (Krizhevsky et al., 2009), SVHN (Netzer et al., 2011), STL-10 (Coates et al., 2011), ImageNet (Deng et al., 2009) and Cityscapes (Cordts et al., 2016)) and two popular network architectures (i.e., ResNet (He et al., 2016) and DenseNet (Huang et al., 2019)) with varying depth.
We split each network into K local modules with the same (or approximately the same) number of layers, where the ﬁrst K −modules are trained using ¯ L InfoPro , and the last module is trained using the standard E2E loss, as aforementioned.
Due to spatial limitation, details on data pre-processing, training conﬁgurations and local module splitting are deferred to Appendix F.
The hyper-parameters λ
and λ 2 are selected from { 0 , 0 . 1 , 0 . 5 , 1 , 2 , 5 , 10 , 20 } .
Notably, to avoid involving too many tunable hyper-parameters when K is large (e.g., K =16 ), we assume that λ 1 and λ 2 change linearly from 1 st to ( K − 1) th local module, and thus we merely tune λ 1 and λ 2 for these two modules.
We always use τ =0 .
07 in L contrast .
Two training modes are considered: (1) simultaneous training , where the back-propagation process of all local modules is sequentially triggered with every mini-batch of training data; and (2) asynchronous training , where local modules are isolatedly learned given cached outputs from completely trained earlier modules.
Both modes enjoy high memory efﬁciency since only the activations within a single module require to be stored at a time.
The second mode removes the dependence of local modules on their predecessors, enabling the fully decoupled training of network components.
The experiments using asynchronous training are referred to as “Asy-InfoPro”, while all other results are based on simultaneous training.
4. M AIN R ESULTS
[Figure]
Comparisons with other local learning methods.
We ﬁrst compare the proposed
InfoPro method with three recently proposed algorithms, decoupled greedy learning (Belilovsky et al., 2020) (DGL), BoostResNet (Huang et al., 2018) and deep incremental boosting (Mosca & Magoulas, 2017) (DIB) in Figure 3.
Our method yields the lowest test errors with all values of K .
Notably, DGL can be viewed as a special case of InfoPro where λ 1 =0 .
Hence, we use the same architecture of auxiliary networks as us in DGL for fair comparison.
In addition
[Figure]
we present the estimates of mutual information between intermediate features and labels in the right plot of Figure 3.
One can observe that DGL suffers from a severe collapse of task-relevant information at early modules, since it optimizes local modules greedily for merely short-term performance.
By contrast, our method effectively alleviates this problem, retaining a larger amount of task-relevant information within intermediate features.
Results on various image classiﬁcation benchmarks are presented in Table 2.
We also report the result of DGL (Belilovsky et al., 2020) in our implementation.
It can be observed that InfoPro outperforms greedy SL by large margins consistently across different networks, especially when K is large.
For example, on CIFAR-10, InfoPro achieves a test error of 12 .
75% with K =16 , surpassing greedy SL by 11 .
For ResNet-110, we note that our method performs on par with E2E training with K =2 , while degrading the performance by up to 0 .
8% with K =4 .
Moreover, InfoPro is shown to compare favorably against DGL under most settings.
In addition, given that our method introduces auxiliary networks, we increase the depth of networks with greedy SL to match the computational cost of ours, named as greedy SL + .
However, this only slightly ameliorates the performance since the problem of information collapse still exists.
Another interesting phenomenon is that InfoPro (Contrast) achieves better performance than InfoPro (Softmax) on CIFAR-10 and SVHN, yet fail to do so on STL-10.
We attribute this to the larger batch size we use on the former two datasets, a detailed analysis is given in Section 4.2.
Asynchronous and parallel training.
The results of asynchronous training are presented in Tableas “Asy-InfoPro”, and it appears to slightly hurt the performance.
Asy-InfoPro differentiates itself from InfoPro on that it adopts the cached outputs from completely trained earlier modules as the inputs of later modules.
Therefore, the degradation of performance might be ascribed to lacking regularizing effects from the noisy outputs of earlier modules during training (L¨owe et al., 2019).
However,
Asy-InfoPro is still considerably better than greedy SL and approaching E2E training.
Besides, we note that asynchronous training can be easily extended to training different local modules in parallel
[Table]
[Table] [Table]
by dynamically caching the outputs of the earlier module.
To this end
[Table]
we preliminarily test training two local modules parallelly on 2 GPUs when K = 2 , using the same experimental protocols as Huo et al.
(train ResNet-110 with a batch size of 128 on CIFAR-10) and their public code.
Our method gives a 1.5 × speedup over the standard parallel paradigm of E2E training (the DataParallel toolkit in Pytorch).
Note that parallel training has the same performance as simultaneous training (i
[Table]
e., “InfoPro” in Table 2) since their training processes are identical except for the parallelism.
Reducing GPUs memory requirements.
Here we split the network into local modules to ensure each module consumes a similar amount of GPU memory during training.
Note that this is different from splitting the model into modules with the same number of layers.
We denote the results in this setting by InfoPro ∗ , and the trade-off between memory consumption and test errors is presented in
Table 3.
The contrastive and softmax loss are used in InfoPro ∗ on CIFAR-10 and STL-10, respectively.
One can observe that our method signiﬁcantly improves the memory efﬁciency of CNNs.
For instance, on STL-10, InfoPro ∗ ( K = 4 ) outperforms the E2E baseline by 1 .
05% with 37.9% of the GPUs memory requirements.
The computational overhead is presented in both the theoretical results and the practical wall time.
Due to implementation issues, we ﬁnd that the latter is slightly larger than the former for InfoPro ∗ .
Compared to the gradient checkpointing technique (Chen et al., 2016), our method achieves competitive performance with signiﬁcantly reduced computational and time cost.
Results on ImageNet are reported in Table 4.
The softmax loss is used in InfoPro ∗ since the batch size is relatively small.
The proposed method reduces the memory cost by 40%, and achieves slightly better performance.
Notably, our method enables training these large networks using 16 GB GPUs.
[Table]
[Figure]
[Figure] [Figure]
[Table] [Table]
[Table] [Table]
Results of semantic segmentation on Cityscapes are presented in Table 5.
We split the 5,000 ﬁnely annotated images into 2,975/500/1,525 for training, validation and testing.
Here InfoPro ∗ uses an
ASPP head (Chen et al., 2017a) as ψ and the same decoder w as on ImageNet.
Our method boosts the performance of the DeepLab-V3 (Chen et al., 2017b) network and allows training the model with 50% larger batch sizes (2 → 3 per GPU) under the same memory constraints.
This contributes to more accurate statistics for batch normalization, which is a practical requirement for tasks with high resolution inputs.
In addition, InfoPro ∗ enables using larger crop sizes ( 769 × 769 → 1024 × 1024 ) during training without enlarging GPUs memory footprint, which signiﬁcantly improves the mIoU.
Note that this does not increase the inference cost, and that this improvement cannot be achieved by trivially training with small crop sizes for more iterations.
4. H YPER - PARAMETER S ENSITIVITY AND ABLATION STUDY
Size and architecture of w and φ .
We ﬁrst investigate how the selection of the decoder w and the projection head φ inﬂuences the performance of the proposed method.
In speciﬁc, we start by scaling their width with a certain factor (which equals 1 for our original design), and show the results in
Figure 4.
It can be observed that using larger w and φ both improve the performance, but the effects are less signiﬁcant.
On the other hand, their sizes can be shrunk by up to 2 times without severely degrading the accuracy.
We also test other architectures for φ in Table 6, where “Conv” and “Linear” refer to convolutional and linear layers, respectively.
We ﬁnd that involving at least one conv layer and a following MLP instead of a simple linear layer are both important design.
In addition, although adding more conv layers further boosts the performance, we observe that this comes at a considerably increased computational overhead.
Temperature τ .
In Figure 5, we change the temperature τ for InfoPro (Contrast).
One can observe that our method is generally robust to τ when τ ≤ 0 . 1 .
Nevertheless, we ﬁnd the training process tends to be unstable when τ < 0 .
Batch size .
For a comprehensive comparison of InfoPro (Softmax) and InfoPro (Contrast), we vary the batch sizes for the SGD optimizer, and present the results in Table 7.
It is shown that training models with small mini-batches for sufﬁcient epochs is beneﬁcial for InfoPro (Softmax), but produces limited positive effects on InfoPro (Contrast).
We also note that using small mini-batches usually prolongs the practical training time as they cannot make full use of even a single GPU (Nvidia Titan Xp).
Besides, when considering a short schedule with the same number of updates (iterations), adopting small mini-batches signiﬁcantly hurts the performance of InfoPro (Contrast).
This observation is consistent with previous works (Chen et al., 2020;
He et al., 2020; Khosla et al., 2020).
[Table]
[Figure]
The coefﬁcient λ 1 and λ 2 .
To study how λand λ 2 affect the performance, we change them for the 1 st and 3 rd local modules of a
ResNet-32 trained using InfoPro (Contrast),
K = 4 , with the results shown in Figure
We ﬁnd that the earlier module beneﬁts from small λ 2 to propagate more information forward, while larger λ 2 helps the later module to boost the ﬁnal accuracy.
This is compatible with previous works showing that removing earlier layers in ResNets has a minimal impact on performance (Veit et al., 2016).
[Table]
Ablation study .
For ablation, we test directly removing the decoder w or replacing the contrastive head φ by the linear classiﬁer used in greedy SL, as shown in Table 8.
R ELATED W ORK
Greedy training of deep networks is initially proposed to learn unsupervised deep generative models, or to obtain a proper initialization for E2E supervised training (Hinton et al., 2006; Bengio et al., 2007).
However, later advances reveal that this initialization is indeed unnecessary (He et al., 2016; Huang et al., 2019).
Some earlier contributions (Kulkarni & Karande, 2017; Malach & Shalev-Shwartz, 2018; Marquez et al., 2018; Huang et al., 2018) also attempt to learn supervised models greedily, but they mainly focus on the theoretical analysis.
More recently, several works have pointed out the inefﬁciencies of back-propagation and revisited this problem in deep learning (Nøkland & Eidnes, 2019; Belilovsky et al., 2019; 2020).
These methods mostly train local modules with a greedy objective, and hence suffer from the information collapse issue we have discussed in this paper.
Alternatives of back-propagation have been widely studied in recent years.
Some biologicallymotivated algorithms including target propagation (Lee et al., 2015b; Bartunov et al., 2018) and feedback alignment (Lillicrap et al., 2014; Nøkland, 2016) avoid back-propagation by directly propagating backward optimal activations or error signals with auxiliary networks.
Decoupled Neural
Interfaces (DNI) (Jaderberg et al., 2017) learn auxiliary networks to produce synthetic gradients.
Nevertheless, these methods differ from us fundamentally as they are explicitly or implicitly designed for optimizing a global objective, while we exclusively consider local objectives.
Information-theoretic analysis in deep learning has received increasingly more attention in the past few years.
Shwartz-Ziv & Tishby (2017) and Saxe et al.
(2019) study the information bottleneck (IB) principle (Tishby et al., 2000) to explain the training dynamics of deep networks.
Achille &
Soatto (2018) decompose the cross-entropy loss and propose a novel IB for weights.
There are also efforts towards fulﬁlling efﬁcient training with IB (Alemi et al., 2016).
In the context of unsupervised learning, a variety of methods have been proposed based on mutual information maximization (Oord et al., 2018; Tian et al., 2020; Hjelm et al., 2019; Chen et al., 2020; He et al., 2020).
C ONCLUSION
This work studied locally supervised deep learning from the information-theoretic perspective.
We demonstrated that training local modules greedily results in collapsing task-relevant information at earlier layers, degrading the ﬁnal performance.
To address this issue, we proposed an information propagation (InfoPro) loss that encourages local modules to preserve more information about the input, while progressively discard task-irrelevant information.
Extensive experiments validated that
InfoPro signiﬁcantly reduced GPUs memory footprint during training without sacriﬁcing accuracy.
It also enabled model parallelization in an asynchronous fashion.
InfoPro may open new avenues for developing more efﬁcient and biologically plausible deep learning algorithms.
A PPENDIX
[Table]
+aPrXiH3IdtaAeTYV5MGk9vla9ITgauStHJs3zxjIelpZ7iLnqA58Wmp7RFTyApOY8aFX5D8ct5G1TkfMrvJCaGbSrzyd2yeKoue6ZUIQNIHJ0v2GJHV7OoQodydmo5Z3h6q7DD2HkPHyuxGfQu6uLjO5epq0KflswFfnHmrhJXcX8s5hzeDPORCXq8I9quTBCwuDvtyZtyWtjbathWw37zvN5slrfoKj2kR/QYPfuCmvSKdnBCeIjrM32hr8Y347vxw/hZQJeXSpsHNPYYv/8BrTaNew==</latexit> :
To further validate the proposed information collapse hypothesis, we visualize the “information ﬂow” within deep networks using a toy example.
First, we establish a MNIST-STL10 dataset via placing
MNIST digits on a certain position (randomly selected from 64 candidates) of a background image from STL-10.
Then, three speciﬁc tasks can be deﬁned on MNIST-STL10, namely classifying digits, backgrounds and positions of numbers.
We refer to the labels of them as y 1 , y 2 and y 3 , respectively, as illustrated by Figure 7.
We train ResNet-32 networks for the three tasks with greedy SL ( K = 4 ) and end-to-end training.
The estimates of mutual information I ( h , y 1 ) , I ( h , y 2 ) and I ( h , y 3 ) are shown in Figure 8, with the same estimating approach as Figure 2 (details in Appendix G).
Note that when one label (take y 1 for example) is adopted for training, the information related to other labels ( I ( h , y 2 ) and I ( h , y 3 ) ) is taskirrelevant.
From the plots, one can clearly observe that end-to-end training retains all task-relevant information throughout the feed-forward process, while greedy SL usually yields less informative intermediate representations in terms of the task of interest.
This phenomenon conﬁrms the proposed information collapse hypothesis empirically.
In addition, we postulate that the end-to-end learned early layers prevent collapsing task-relevant information by being allowed to keep larger amount of task-irrelevant information, which, however, may lead to the inferior classiﬁcation performance of intermediate features, and thus cannot be achieved by greedy SL.
[Figure] [Figure]
B P ROOF OF PROPOSITION
Proposition 1.
Suppose that the Markov chain ( y, r ) → x → h holds.
Then an upper bound of
L InfoPro is given by
[Equation] [Equation]
where λ 1 = α (1 − β ) , λ 2 = αβ .
Proof .
Note that, L InfoPro is given by
[Equation]
Due to the Markov chain ( y, r ) → x → h , we have I ( h , ( y, r ∗ ))
≤
I ( h , x ) .
Given that
[Equation]
8) we have
[Equation]
By the deﬁnition of nuisance, we note that r ∗ and y are mutually independent, and thus we obtain
[Equation]
Combining Eqs.
(9) and (10), we have
[Equation]
Finally, Proposition 1 is proved by combining Eq.
(7) and Inequality (11).
C P ROOF OF PROPOSITION
We ﬁrst introduce a Lemma proven by Achille & Soatto (2018).
Lemma 1.
Given a joint distribution p ( x , y ) , where y is a discrete random variable, we can always ﬁnd a random variable r independent of y such that x = f ( y, r ) , for some deterministic function f .
Proposition 2.
Given that r ∗ = argmax r, I ( r, x ) > 0 , I ( r,y )=
I ( r, h ) and that y is a deterministic function with respect to x , the gap (cid:15) =
¯ L InfoPro − L InfoPro is upper bounded by
[Equation] [Equation]
Proof .
Let ˜ r be the random variable in Lemma 1, and then, since we can ﬁnd a deterministic function that maps x to y , we have
[Equation]
Assume ζ =
[ I ( h , x ) − I ( h , y )] − I ( h , r ∗ ) , in terms that r ∗ = argmax r, I ( r, x ) > 0 , I ( r,y )
=
I ( r, h ) , we obtain
[Equation]
Since y and ˜ r are mutually independent, namely H ( y | ˜ r )
=
H ( y ) , we have
[Equation]
When considering y as a deterministic function with regards to x , we obtain H ( y | x ) = 0 , and therefore
[Equation]
Given that (cid:15) =
¯ L InfoPro − L InfoPro =
λ 2 ζ , we have
[Equation]
(17) for which we have proven Proposition 2.
D W HY MINIMIZING THE CONTRASTIVE LOSS MAXIMIZES THE LOWER BOUND OF TASK - RELEVANT INFORMATION ?
In this section, we show that minimizing the proposed contrastive loss, namely
[Equation]
actually maximizes an lower bound of task-relevant information
I ( h , y ) .
We start by considering a simpliﬁed but equivalent situation.
Suppose that we have a query sample z + , together with a set
X = { z 1 , . . .
, z N } consisting of N samples with one positive sample z p from the same class as z + deﬁnitely, and other negative samples are randomly sampled,
namely X =
{ z + } ∪ X neg .
Then, the expectation of L contrast can be written as
[Equation]
Eq.
(19) can be viewed as a categorical cross-entropy loss of classifying the positive sample z p correctly.
Hence, we deﬁne the optimal probability of this classiﬁcation problem as P pos ( z i | X ) , which denotes the true probability of z i being the positive sample.
Assuming that the label of z p is y , the positive and negative samples can be viewed as being sampled from the true distributions p ( z | y ) and p ( z ) , respectively.
As a consequence, P pos ( z i | X ) can be derived as
[Equation]
which indicates that an optimal value for exp ( z + (cid:62) z p /τ ) is p ( z p | y ) p ( z p ) .
Therefore, by assuming that z + is uniformly sampled from all classes, we have
[Equation]
In the above, Inequality (24) follows from Oord et al.
(2018), which quickly becomes more accurate when N increases.
Inequality (27) follows from the data processing inequality Shwartz-Ziv & Tishby (2017).
Finally, we have E
[ L contrast ] ≥ log ( N − 1) − I ( h , y ) , and thus minimizing L contrast under the stochastic gradient descent framework maximizes a lower bound of I ( h , y ) .
E A RCHITECTURE OF AUXILIARY NETWORKS
Here, we introduce the network architectures of w , ψ and φ we use in our experiments.
Note that, w is a decoder that aims to reconstruct the input images from deep features, while ψ and φ share the same architecture except for the last layer.
The architectures used on CIFAR, SVHN and STL-10 are shown in Table 9 and Table 10.
Architectures on ImageNet are shown in Table 11 and Table 12.
Note that, for the semantic segmentation experiments on Cityscapes, we use an ASPP head (Chen et al., 2017a) as ψ and the same decoder w as on ImageNet (except for the size of feature maps).
F D ETAILS OF E XPERIMENTS
Datasets.
The CIFAR-10 (Krizhevsky et al., 2009) dataset consists of 60,000 32x32 colored images of 10 classes, 50,000 for training and 10,000 for test.
We normalize the images with channel
[Table] [Table]
[Table] [Table]
means and standard deviations for pre-processing.
Then data augmentation is performed by 4x random translation followed by random horizontal ﬂip (He et al., 2016; Huang et al., 2019; Wang et al., 2019).
(2) SVHN (Netzer et al., 2011) consists of 32x32 colored images of digits.
73, images for training and 26,032 images for test are provided.
Following Tarvainen & Valpola (2017), we perform random 2x2 translation to augment the training set.
(3) STL-10 (Coates et al., 2011) contains 5,000 training examples divided into 10 predeﬁned folds with 1000 examples each, and 8,000 images for test.
We use all the labeled images for training and test the performance on the provided test set.
Data augmentation is performed by 4x4 random translation followed by random horizontal ﬂip.
(4) ImageNet is a 1,000-class dataset from ILSVRC2012 (Deng et al., 2009), with 1. million images for training and 50,000 images for validation.
We adopt the same data augmentation and pre-processing conﬁgurations as Huang et al.
; Yang et al.
(5) Cityscapes dataset
Cordts et al.
(2016) contains 5,000 1024x2048 pixel-level ﬁnely annotated images (2,975/500/1, for training, validation and testing) and 20,000 coarsely annotated images from 50 different cities.
Each pixel of the image is categorized among 19 classes.
Following Chen et al.
(2017b)
, we conduct our experiments on the ﬁnely annotated dataset and report the performance on the validation set.
The training images are augmented by randomly scaling (from 0.75 to 2.0) followed by randomly cropping high-resolution patches (769 × 769 or 1024 × 1024).
Networks and training hyper-parameters.
Our experiments on CIAFR-10, SVHN and STL-10 are based on three popular networks, namely ResNet-32/110 (He et al., 2016) and DenseNet-BC-100-
[Figure]
(Huang et al., 2019).
The networks are trained using a SGD optimizer with a Nesterov momentum of 0.9 for 160 epochs.
The L2 weight decay ratio is set to 1e-4.
For ResNets, the batch size is set to 1024 and 128 for CIFAR-10/SVHN and STL-10, associated with an initial learning rate of 0.
and 0.1, respectively.
For DenseNets, we use a batch size of 256 and an initial learning rate of 0.2.
The cosine learning rate annealing is adopted.
Note that, the results of greedy supervised learning presented in Table 1 follows exactly the same experimental conﬁgurations stated here.
On ImageNet, we train ResNet-101 and ResNet-152 with a batch size of 1024 and an initial learning rate of 0.4.
For
ResNeXt-101, 32 × 8d, we use a batch size of 512 and an initial learning rate of 0.2.
The number of training epochs is set to 90.
Other hyper-parameters are the same as CIAFR-10.
For the DeepLab-V model used in semantic segmentation, we follow the training conﬁgurations of Huang et al.
(2020), except for using an initial learning rate of 0.015 when setting the batch size to 12 in InfoPro ∗ , K = 2 .
Local module splitting.
Since ResNets consist of a cascade of residual blocks, which naturally should not be further divided into smaller parts, we view each residual block as a minimal indivisible unit, or say, a basic layer (distinguished from a single convolutional layer).
Particularly, the ﬁrst convolutional layer of the network is individually viewed as a basic layer.
As a consequence, ResNet32 has 16 basic layers, and ResNet-110 has 55 basic layers.
If ResNet-32 is split into K = 8 local modules, then each module will have 2 basic layers.
In the cases where the number of basic layers is not divisible by K , we assign one less basic layer to earlier modules.
For example, if ResNetis split into K = 4 modules, the corresponding numbers of basic layers will be { 13 , 14 , 14 , 14 } .
If ResNet-110 is split into K = 16 modules, the corresponding numbers of basic layers will be { 3 } × 9 modules + { 4 } × 7 modules.
For DenseNet-BC, similarly, we view each dense layer (the composite function BN-ReLU- × 1Conv-BN-ReLU-3 × 3Conv) as a basic layer following their paper (Huang et al., 2019).
The ﬁrst convolutional layer and the transition layers are viewed as individual basic layers.
The splitting criteria is the same as ResNets.
Notably, for InfoPro ∗ , the networks are divided to make sure that each local module has the same memory consumption during training, and hence the aforementioned splitting criteria based on the same numbers of basic layers is not applicable, as we discuss in Section 4.1.
G D ETAILS OF M UTUAL I NFORMATION E STIMATION
In this section, we describe the details on obtaining the estimates of I ( h , x ) and I ( h , y ) we present in Figures 2, 3 and 8.
As we have discussed in Section 3.3, the expected reconstruction error R ( x | h ) follows I ( h , x )=
H ( x ) − H ( x | h ) ≥ H ( x ) −R ( x | h ) (Vincent et al., 2008; Rifai et al., 2012; Kingma & Welling, 2013; Makhzani et al., 2015; Hjelm et al., 2019).
Therefore, similar to Section 3.3, we estimate
I ( h , x ) by training a decoder parameterized by w to obtain the minimal reconstruction loss, namely
I ( h , x ) ≈ max w [ H ( x ) − R w ( x | h )] .
Note that, ideally, this bound can be arbitrarily tight provided that w has sufﬁcient capacity.
In speciﬁc, we use the same network architecture as Table 9, and train it for 10 epochs to minimize the averaged binary cross-entropy reconstruction loss of each pixel.
An adam (Kingma & Ba, 2014) optimizer with default hyper-parameters (lr=0.001, betas=(0.9, 0.999), eps=1e-08, weight decay=0) is adopted.
Naive as this procedure might seems, for one thing, we ﬁnd that it is sufﬁcient to reconstruct the input images well given enough information, and meanwhile distinguish different values of I ( h , x ) via the quality of reconstructed images, as shown in Figure 9.
For another, we are primarily concerned with the comparisons of I ( h , x ) between end-to-end training and various cases of greedy supervised learning rather than obtaining the exact values of
I ( h , x ) .
The same training process is applied to all the intermediate features h , and hence the comparisons are fair.
Finally, since H ( x ) is a constant, for the ease of understanding, we simply present 1 − AverageBinaryCrossEntropyLoss ( x | h ) as the estimates of I ( h , x ) , equivalent to adding the constant 1 − H ( x ) to the real estimates of I ( h , x ) .
For I ( h , y ) , as we have discussed in Section 3.3 as well, since I ( h , y )
=
H ( y ) − H
( y | h ) =
H ( y ) − E
( h ,y )
[ − log p ( y | h )] , we train an auxiliary classiﬁer q ψ ( y | h ) with parameters ψ to approximate p ( y | h ) , such that we have I ( h , y )
≈ max ψ { H ( y ) − 1 N [ (cid:80)
Ni =1 − log q ψ ( y i |
h i )] } .
Here we simply adopt the test accuracy of q ψ ( y | h ) as the estimates of I ( h , y ) , which is highly correlated to the value of − 1 N [ (cid:80) Ni =1 − log q ψ ( y i | h i )] } (or say, the cross-entropy loss).
This can be viewed as the highest generation performance that a classiﬁer based on h is able to reach.
Notably, we use a ResNet-32 as q ψ .
For the inputs of q ψ , we up-sample h to 32 × 32 and map h to 16 channels at the ﬁrst layer.
All training hyper-parameters of the ResNet-32 are the same as Appendix F.
H E MPIRICAL STUDY ON THE TIGHTNESS OF THE UPPER BOUND
[Figure]
s t
i m a t
[Figure]
s o f
I
[Figure]
I
[Figure]
In this section, we empirically study the gap between of the upper bound ¯ L InfoPro and L InfoPro .
Since the gap (cid:15) = ¯
L InfoPro − L InfoPro is upper bounded by (cid:15) ≤ λ
[ I ( x , y ) − I ( h , y )] , we sim- ply need to check the gap between I ( x , y ) and
I ( h , y ) .
To this end, we consider training a
ResNet-110 on CIFAR-10 using InfoPro (Contrast) with K = 2 , and estimate the mutual information
I ( h , y ) between the outputs of the ﬁrst local module and the label.
In addition, to obtain a comparable estimate of I ( x , y ) , we assume that in end-to-end learned networks, the intermediate features retain all the task-relevant information within the original inputs (which is empirically observed in this paper).
Hence, we can estimate I ( x , y ) by training the network in an end-to-end fashion, and estimating the mutual information
I ( h , y ) in the same position as the end of the ﬁrst module.
The comparisons between the estimates of I ( x , y ) and I ( h , y ) are presented in Figure 10.
One can observe that the gap (cid:15) shrinks gradually during the training process
[Table]
I M ORE R ESULTS
[Table]
Results with VGG are presented in Table 13.
Obviously, similar observations to Table 2 can be obtained.
InfoPro achieves competitive performance wit E2E training, while outperforms DGL.
Transferability.
To verify the transferability of the models trained by the proposed method, we initialize the backbone of Faster-RCNN (Ren et al., 2015) using ResNet-101 trained by E2E training
[Table]
and InfoPro ∗ , K = 2 on ImageNet, and train it for the MS COCO (Lin et al., 2014) object detection task.
The training process adopts the default conﬁguration of MMDetection (Chen et al., 2019) with feature pyramid networks (FPN)
(Lin et al., 2017).
The results are reported in Table 14.
It can be observed that the locally learned backbone using InfoPro ∗ outperforms its E2E counterpart in terms of average precision (AP).
This result is consistent with the accuracy on ImageNet.
J A DDITIONAL D ISCUSSIONS AND F UTURE W ORK
Applying InfoPro to regression tasks.
Although this paper mainly focuses on implementing InfoPro in the context of classiﬁcation based tasks (i.e., image classiﬁcation and semantic segmentation), the formulation of L InfoPro and ¯ L InfoPro is general and ﬂexible.
As long as the mutual information
I ( h , x ) and I ( h , y ) can be estimated, InfoPro is able to be used in more tasks.
In vision tasks,
I ( h , x ) can usually be estimated with a decoder, as we introduced in Section 3.3, while for estimating
I ( h , y ) , the technique we discussed may be easily extended to the regression tasks (e.g., depth estimation, bounding box regression in object detection).
For example, consider a target value y i ∈ [0 , 1] corresponding to the sample x i and the hidden representation h i .
It can be viewed as a Bernoulli distribution where P ( y = 1) =
y i , such that we have I ( h , y )
≈ max ψ { H ( y ) −
N [ (cid:80) Ni =1 − y
i log q ψ ( y = 1 | h i ) − (1 − y i ) log q ψ ( y =
| h i )] } .
As a result, the auxiliary network q ψ ( y | h ) can be trained with the binary cross-entropy loss.
This might also be approximated by the mean-square loss as it has the same minima as the binary cross-entropy loss.
In the future, we will focus on applying InfoPro to more complex tasks, such 2D/3D detection, instance segmentation and video recognition.