Year: 2020

Abstract:
Deep neural networks often have millions of parameters. This can hinder their deployment to low-end devices, not only due to high memory requirements but also because of increased latency at inference. We propose a novel model compression method that generates a sparse trained model without additional overhead: by allowing (i) dynamic allocation of the sparsity pattern and (ii) incorporating feedback signal to reactivate prematurely pruned weights we obtain a performant sparse model in one single training pass (retraining is not needed, but can further improve the performance). We evaluate our method on CIFAR-10 and ImageNet, and show that the obtained sparse models can reach the state-of-the-art performance of dense models. Moreover, their performance surpasses that of models generated by all previously proposed pruning schemes.

heading: 1 INTRODUCTION
text: Highly overparametrized deep neural networks show impressive results on machine learning tasks. However, with the increase in model size comes also the demand for memory and computer power at inference stage—two resources that are scarcely available on low-end devices. Pruning techniques have been successfully applied to remove a significant fraction of the network weights while preserving test accuracy attained by dense models. In some cases, the generalization of compressed networks has even been found to be better than with full models (Han et al., 2015; 2017; Mocanu et al., 2018).
The sparsity of a network is the number of weights that are identically zero, and can be obtained by applying a sparsity mask on the weights. There are several different approaches to find sparse models. For instance, one-shot pruning strategies find a suitable sparsity mask by inspecting the weights of a pretrained network (Mozer & Smolensky, 1989; LeCun et al., 1990; Han et al., 2017). While these algorithms achieve a substantial size reduction of the network with little degradation in accuracy, they are computationally expensive (training and refinement on the dense model), and they are outperformed by algorithms that explore different sparsity masks instead of a single one. In dynamic pruning methods, the sparsity mask is readjusted during training according to different criteria (Mostafa & Wang, 2019; Mocanu et al., 2018). However, these methods require fine-tuning of many hyperparameters.
We propose a new pruning approach to obtain sparse neural networks with state-of-the-art test accuracy. Our compression scheme uses a new saliency criterion that identifies important weights in the network throughout training to propose candidate masks. As a key feature, our algorithm not only evolves the pruned sparse model alone, but jointly also a (closely related) dense model that is used in a natural way to correct for pruning errors during training. This results in better generalization properties on a wide variety of tasks, since the simplicity of the scheme allows us further to study it from a theoretical point of view, and to provide further insights and interpretation. We do not require
tuning of additional hyperparameters, and no retraining of the sparse model is needed (though can further improve performance).

heading: Contributions.
text: • A novel dynamic pruning scheme, that incorporates an error feedback in a natural way Sec. 3
and finds a trained sparse model in one training pass. Sec. 5 • We demonstrate state-of-the-art performance (in accuracy and sparsity), Sec. 5
ourperforming all previously proposed pruning schemes. Sec. 5 • We complement our results by an ablation study that provides further insights. Sec. 6
and convergence analysis for convex and non-convex objectives. Sec. 4

heading: 2 RELATED WORK
text: Previous works on obtaining pruned networks can (loosely) be divided into three main categories.
Pruning after training. Training approaches to obtain sparse networks usually include a three stage pipeline—training of a dense model, one-shot pruning and fine-tuning—e.g., (Han et al., 2015). Their results (i.e., moderate sparsity level with minor quality loss) made them the standard method for network pruning and led to several variations (Guo et al., 2016; Carreira-Perpinán & Idelbayev, 2018).
Pruning during training. Zhu & Gupta (2017) propose the use of magnitude-based pruning and to gradually increase the sparsity ratio while training the model from scratch. A pruning schedule determines when the new masks are computed (extending and simplifying (Narang et al., 2017)). He et al. (2018) (SFP) prune entire filters of the model at the end of each epoch, but allow the pruned filters to be updated when training the model. Deep Rewiring (DeepR) (Bellec et al., 2018) allows for even more adaptivity by performing pruning and regrowth decisions periodically. This approach is computationally expensive and challenging to apply to large networks and datasets. Sparse evolutionary training (SET) (Mocanu et al., 2018) simplifies prune–regrowth cycles by using heuristics for random growth at the end of each training epoch and NeST (Dai et al., 2019) by inspecting gradient magnitudes.
Dynamic Sparse Reparameterization (DSR) (Mostafa & Wang, 2019) implements a prune– redistribute–regrowth cycle where target sparsity levels are redistributed among layers, based on loss gradients (in contrast to SET, which uses fixed, manually configured, sparsity levels). Sparse Momentum (SM) (Dettmers & Zettlemoyer, 2019) follows the same cycle but instead using the mean momentum magnitude of each layer during the redistribute phase. SM outperforms DSR on ImageNet for unstructured pruning by a small margin but has no performance difference on CIFAR experiments. Our approach also falls in the dynamic category but we use error compensation mechanisms instead of hand crafted redistribute–regrowth cycles.
Pruning before training. Recently—spurred by the lottery ticket hypothesis (LT) (Frankle & Carbin, 2019)—methods which try to find a sparse mask that can be trained from scratch have attracted increased interest. For instance, Lee et al. (2019) propose SNIP to find a pruning mask by inspecting connection sensitivities and identifying structurally important connections in the network for a given task. Pruning is applied at initialization, and the sparsity mask remains fixed throughout training.
Note that Frankle & Carbin (2019); Frankle et al. (2019) do not propose an efficient pruning scheme to find the mask, instead they rely on iterative pruning, repeated for several full training passes.
Further Approaches. Srinivas et al. (2017); Louizos et al. (2018) learn gating variables (e.g. through `0 regularization) that minimize the number of nonzero weights, recent parallel work studies filter pruning for pre-trained models (You et al., 2019). Gal et al. (2017); Neklyudov et al. (2017); Molchanov et al. (2017) prune from Bayesian perspectives to learn dropout probabilities during training to prune and sparsify networks as dropout weight probabilities reach 1. Gale et al. (2019) extensively study recent unstructured pruning methods on large-scale learning tasks, and find that complex techniques (Molchanov et al., 2017; Louizos et al., 2018) perform inconsistently. Simple magnitude pruning approaches achieve comparable or better results (Zhu & Gupta, 2017).

heading: 3 METHOD
text: We consider the training of a non-convex loss function f : Rd → R. We assume for a weight vector w ∈ Rd to have access to a stochastic gradient g(w) ∈ Rd such that E[g(w)] = ∇f(w). This corresponds to the standard machine learning setting with g(w) representing a (mini-batch) gradient of one (or several) components of the loss function. Stochastic Gradient Descent (SGD) computes a sequence of iterates by the update rule
wt+1 := wt − γtg(wt) , (SGD)
for some learning rate γt. To obtain a sparse model, a general approach is to prune some of the weights of wt, i.e., to set them to zero. Such pruning can be implemented by applying a mask m ∈ {0, 1}d to the weights, resulting in a sparse model w̃t := m wt, where denotes the entry-wise (Hadamard) product. The mask could potentially depend on the weights wt (e.g., smallest magnitude pruning), or depend on t (e.g., the sparsity is incremented over time).
Before we introduce our proposed dynamic pruning scheme, we formalize the three main existing types of pruning methodologies (summarized in Figure 1). These approaches differ in the way the mask is computed, and the moment when it is applied.1
Pruning before training. A mask m0 (depending on e.g. the initialization w0 or the network architecture of f ) is applied and (SGD) is used for training on the resulting subnetwork f̃(w) := f(m0 w) with the advantage that only pruned weights need to be stored and updated2, and that by training with SGD a local minimum of the subnetwork f̃ (but not of f—the original training target) can be reached. In practice however, it remains a challenge to efficiently determine a good mask m0 and a wrongly chosen mask at the beginning strongly impacts the performance.
1The method introduced in Section 2 typically follow one of these broad themes loosely, with slight variations in detail. For the sake of clarity we omit a too technical and detailed discussion here.
2When training on f̃(w), it suffices to access stochastic gradients of f̃(w), denoted by g̃(w), which can potentially be cheaper be computed than by naively applying the mask to g(w) (note g̃(w) = m0 g(w)).
Pruning after training (one-shot pruning). A dense model is trained, and pruning is applied to the trained model wT . As the pruned model w̃T = mT wT is very likely not at a local optimum of f , fine-tuning (retraining with the fixed mask mT ) is necessary to improve performance.
Pruning during training (incremental and dynamic pruning). Dynamic schemes change the mask mt every (few) iterations based on observations during training (i.e. by observing the weights and stochastic gradients). Incremental schemes monotonically increase the sparsity pattern, fully dynamic schemes can also reactivate previously pruned weights. In contrast to previous dynamic schemes that relied on elaborated heuristics to adapt the mask mt, we propose a simpler approach:
Dynamic pruning with feedback (DPF, Algorithm 1). Our scheme evaluates a stochastic gradient at the pruned model w̃t = mt wt and applies it to the (simultaneously maintained) dense model wt:
wt+1 := wt − γtg(mt wt) = wt − γtg(w̃t) . (DPF)
Applying the gradient to the full model allows to recover from “errors”, i.e. prematurely masking out important weights: when the accumulated gradient updates from the following steps drastically change a specific weight, it can become activated again (in contrast to incremental pruning approaches that have to stick to sub-optimal decisions). For illustration, observe that (DPF) can equivalently be written as wt+1 = wt − γtg(wt + et), where et := w̃t −wt is the error produced by the compression. This provides a different intuition of the behavior of (DPF), and connects it with the concept of error-feedback (Stich et al., 2018; Karimireddy et al., 2019).3 We illustrate this principle in Figure 2 and give detailed pseudocode and further implementation details in Appendix A.1. The DPF scheme can also be seen as an instance of a more general class of schemes that apply (arbitrary) perturbed gradient updates to the dense model. For instance straight-through gradient estimators (Bengio et al., 2013) that are used to empirically simplify the backpropagation can be seen as such perturbations. Our stronger assumptions on the structure of the perturbation allow to derive non-asymptotic convergence rates in the next section, though our analysis could also be extended to the setting in (Yin et al., 2019) if the perturbations can be bounded.

heading: 4 CONVERGENCE ANALYSIS
text: We now present convergence guarantees for (DPF). For the purposes of deriving theoretical guarantees, we assume that the training objective is smooth, that is ‖∇f(w)−∇f(v)‖ ≤ L ‖w − v‖, ∀w,v ∈ Rd, for a constant L > 0, and that the stochastic gradients are bounded E ‖g(w̃t)‖2 ≤ G2 for every pruned model w̃t = mt(wt) wt. The quality of this pruning is defined as the parameter δt ∈ [0, 1] such that
δt := ‖wt − w̃t‖2 / ‖wt‖2 . (1)
Pruning without information loss corresponds to w̃t = wt, i.e., δt = 0, and in general δt ≤ 1. Convergence on Convex functions. We first consider the case when f is in addition µ-strongly convex, that is 〈∇f(v),w − v〉 ≤ f(w) − f(v) − µ2 ‖w − v‖
2, ∀w,v ∈ Rd. While it is clear that this assumption does not apply to neural networks, it eases the presentation as strongly convex functions have a unique (global) minimizer w? := arg minw∈Rd f(w).
Theorem 4.1. Let f be µ-strongly convex and learning rates given as γt = 4µ(t+2) . Then for a randomly chosen pruned model ũ of the iterates {w̃0, . . . , w̃T } of DPF, concretely ũ = w̃t with probability pt = 2(t+1) (T+1)(T+2) , it holds that—in expectation over the stochasticity and the selection of ũ:
Ef(ũ)− f(w?) = O ( G2
µT + LE
[ δt ‖wt‖2 ]) . (2)
The rightmost term in (2) measures the average quality of the pruning. However, unless δt → 0 or ‖wt‖ → 0 for t→∞, the error term never completely vanishes, meaning that the method converges only to a neighborhood of the optimal solution (this not only holds for the pruned model, but also for
3Our variable wt corresponds to x̃t in the notation of Karimireddy et al. (2019). Their error-fixed SGD algorithm evaluates gradients at perturbed iterates xt := x̃t + et, which correspond precisely to w̃t = wt + et in our notation. This shows the connection of these two methods.
the jointly maintained dense model, as we will show in the appendix). This behavior is expected, as the global optimal model w? might be dense and cannot be approximated well by a sparse model.
For one-shot methods that only prune the final (SGD) iterate wT at the end, we have instead: Ef(w̃t)− f(w?) ≤ 2E (f(wT )− f(w?)) + LδTE ‖wT ‖2 = O ( LG2
µ2T + LE
[ δT ‖wT ‖2 ]) ,
as we show in the appendix. First, we see from this expression that the estimate is very sensitive to δT and wT , i.e. the quality of the pruning the final model. This could be better or worse than the average of the pruning quality of all iterates. Moreover, one looses also a factor of the condition number Lµ in the asymptotically decreasing term, compared to (2). This is due to the fact that standard convergence analysis only achieves optimal rates for an average of the iterates (but not the last one). This shows a slight theoretical advantage of DPF over rounding at the end.
Convergence on Non-Convex Functions to Stationary Points. Secondly, we consider the case when f is a non-convex function and show convergence (to a neighborhood) of a stationary point.
Theorem 4.2. Let learning rate be given as γ = c√ T
, for c = √
f(w0)−f(w?) LG2 . Then for pruned
model ũ chosen uniformly at random from the iterates {w̃0, . . . , w̃T } of DPF, concretely ũ := w̃t with probability pt = 1T+1 , it holds—in expectation over the stochasticity and the selection of ũ:
E ‖∇f(ũ)‖2 = O (√ L(f(w0)− f(w?))G√
T + L2E
[ δt ‖wt‖2 ]) . (3)
Extension to Other Compression Schemes. So far we put our focus on simple mask pruning schemes to achieve high model sparsity. However, the pruning scheme in Algorithm 1 could be replaced by an arbitrary compressor C : Rd → Rd, i.e., w̃t = C(wt). Our analysis extends to compressors as e.g. defined in (Karimireddy et al., 2019; Stich & Karimireddy, 2019), whose quality is also measured in terms of the δt parameters as in (1). For example, if our objective was not to obtain a sparse model, but to produce a quantized neural network where inference could be computed faster on low-precision numbers, then we could define C as a quantized compressor. One variant of this approach is implemented in the Binary Connect algorithm (BC) (Courbariaux et al., 2015) with prominent results, see also (Li et al., 2017) for further insights and discussion.

heading: 5 EXPERIMENTS
text: We evaluated DPF together with its competitors on a wide range of neural architectures and sparsity levels. DPF exhibits consistent and noticeable performance benefits over its competitors.

heading: 5.1 EXPERIMENTAL SETUP
text: Datasets. We evaluated DPF on two image classification benchmarks: (1) CIFAR-10 (Krizhevsky & Hinton, 2009) (50K/10K training/test samples with 10 classes), and (2) ImageNet (Russakovsky et al., 2015) (1.28M/50K training/validation samples with 1000 classes). We adopted the standard data augmentation and preprocessing scheme from He et al. (2016a); Huang et al. (2016); for further details refer to Appendix A.2.
Models. Following the common experimental setting in related work on network pruning (Liu et al., 2019; Gale et al., 2019; Dettmers & Zettlemoyer, 2019; Mostafa & Wang, 2019), our main experiments focus on ResNet (He et al., 2016a) and WideResNet (Zagoruyko & Komodakis, 2016). However, DPF can be effectively extended to other neural architectures, e.g., VGG (Simonyan & Zisserman, 2015), DenseNet (Huang et al., 2017). We followed the common definition in He et al. (2016a); Zagoruyko & Komodakis (2016) and used ResNet-a, WideResNet-a-b to represent neural network with a layers and width factor b.
Baselines. We considered the state-of-the-art model compression methods presented in the table below as our strongest competitors. We omit the comparison to other dynamic reparameterization methods, as DSR can outperform DeepR (Bellec et al., 2018) and SET (Mocanu et al., 2018) by a noticeable margin (Mostafa & Wang, 2019). Implementation of DPF. Compared to other dynamic reparameterization methods (e.g. DSR and SM) that introduced many extra hyperparameters, our method has trivial hyperparameter tuning
Scheme Reference Pruning How the mask(s) are found Lottery Ticket (LT) 2019, FDRC before training 10-30 successive rounds of (full training + pruning).SNIP 2019, LAT By inspecting properties/sensitivity of the network.
One-shot + fine-tuning (One-shot P+FT) 2015, HPDT after training Saliency criterion (prunes smallest weights).
Incremental pruning + fine-tuning (Incremental) 2017, ZG incremental Saliency criterion. Sparsity is gradually incremented.
Dynamic Sparse Reparameterization (DSR) 2019, MW dynamic Prune–redistribute–regrowth cycle. Sparse Momentum (SM) 2019, DZ Prune–redistribute–regrowth + mean momentum. DPF ours Reparameterization via error feedback.
overhead. We perform pruning across all neural network layers (no layer-wise pruning) using magnitude-based unstructured weight pruning (inherited from Han et al. (2015)). We found the best preformance when updating the mask every 16 iterations (see also Table 11) and we keep this value fixed for all experiments (independent of the architecture or task).
Unlike our competitors that may ignore some layers (e.g. the first convolution and downsampling layers in DSR), we applied DPF (as well as the One-shot P+FT and Incremental baselines) to all convolutional layers while keeping the last fully-connected layer4, biases and batch normalization layers dense. Lastly, our algorithm gradually increases the sparsity st of the mask from 0 to the desired sparsity using the same scheduling as in (Zhu & Gupta, 2017); see Appendix A.2.
Training schedules. For all competitors, we adapted their open-sourced code and applied a consistent (and standard) training scheme over different methods to ensure a fair comparison. Following the standard training setup for CIFAR-10, we trained ResNet-a for 300 epochs and decayed the learning rate by 10 when accessing 50% and 75% of the total training samples (He et al., 2016a; Huang et al., 2017); and we trained WideResNet-a-b as Zagoruyko & Komodakis (2016) for 200 epochs and decayed the learning rate by 5 when accessing 30%, 60% and 80% of the total training samples. For ImageNet training, we used the training scheme in (Goyal et al., 2017) for 90 epochs and decayed learning rate by 10 at 30, 60, 80 epochs. For all datasets and models, we used mini-batch SGD with Nesterov momentum (factor 0.9) with fine-tuned learning rate for DPF. We reused the tuned (or recommended) hyperparameters for our baselines (DSR and SM), and fine-tuned the optimizer and learning rate for One-shot P+FT, Incremental and SNIP. The mini-batch size is fixed to 128 for CIFAR-10 and 1024 for ImageNet regardless of datasets, models and methods.

heading: 5.2 EXPERIMENT RESULTS
text: CIFAR-10. Figure 3 shows a comparison of different methods for WideResNet-28-2. For low sparsity level (e.g. 50%), DPF outperforms even the dense baseline, which is in line with regularization properties of network pruning. Furthermore, DPF can prune the model up to a very high level (e.g. 99%), and still exhibit viable performance. This observation is also present in Table 1, where the results of training different state-of-the-art DNN architectures with higher sparsities are depicted. DPF shows reasonable performance even with extremely high sparsity level on large models (e.g. WideResNet-28-8 with sparsity ratio 99.9%), while other methods either suffer from significant quality loss or even fail to converge.
Because simple model pruning techniques sometimes show better performance than complex techniques (Gale et al., 2019), we further consider these simple models in Table 2. While DPF outperforms them in almost all settings, it faces difficulties pruning smaller models to extremely high sparsity ratios (e.g. ResNet-20 with sparsity ratio 95%).This seems however to be an artifact of fine-tuning, as DPF with extra fine-tuning convincingly outperforms all other methods regardless of the network size. This comes to no surprise as schemes like One-shot P+FT and Incremental do not benefit from extra fine-tuning, since it is already incorporated in their training procedure and they might become stuck in local minima. On the other hand, dynamic pruning methods, and in particular DPF, work on a different paradigm, and can still heavily benefit from fine-tuning.5
Figure 13 (in Appendix A.3.4) depicts another interesting property of DPF. When we search for a subnetwork with a (small) predefined number of parameters for a fixed task, it is much better to run
4The last fully-connected layer normally makes up only a very small faction of the total MACs, e.g. 0.05% for ResNet-50 on ImageNet and 0.0006% for WideResNet-28-2 on CIFAR-10.
5Besides that a large fraction of the mask elements already converge during training (see e.g. Figure 4 below), not all mask elements converge. Thus DPF can still benefit from fine-tuning on the fixed sparsity mask.
DPF on a large model (e.g. WideResNet-28-8) than on a smaller one (e.g. WideResNet-28-2). That is, DPF performs structural exploration more efficiently in larger parametric spaces.
ImageNet. We compared DPF to other dynamic reparameterization methods as well as the strong Incremental baseline in Table 3. For both sparsity levels (80% and 90%), DPF shows a significant improvement of top-1 test accuracy with fewer or equal number of parameters.

heading: 6 DISCUSSION
text: Besides the theoretical guarantees, a straightforward benefit of DPF over one-shot pruning in practice is its fine-tuning free training process. Figure 12 in the appendix (Section A.3.3) demonstrates the trivial computational overhead (considering the dynamic reparameterization cost) of involving DPF to train the model from scratch. Small number of hyperparameters compared to other dynamic reparameterization methods (e.g. DSR and SM) is another advantage of DPF and Figure 11 further studies how different setups of DPF impact the final performance. Notice also that for DPF, inference is done only at sparse models, an aspect that could be leveraged for more efficient computations.
Empirical difference between one-shot pruning and DPF. From the Figure 2 one can see that DPF tends to oscillate among several local minima, whereas one-shot pruning, even with fine tuning, converges to a single solution, which is not necessarily close to the optimum. We believe that the wider exploration of DPF helps to find a better local minima (which can be even further improved by fine-tuning, as shown in Table 2). We empirically analyzed how drastically the mask changes between each reparameterization step, and how likely it is for some pruned weight to become non-zero in the later stages of training. Figure 4 shows at what stage of the training each element of the final mask becomes fixed. For each epoch, we report how many mask elements were flipped starting from this epoch. As an example, we see that for sparsity ratio 95%, after epoch 157 (i.e. for 43 epochs left), only 5% of the mask elements were changing. This suggests that, except for a small percentage of weights that keep oscillating, the mask has converged early in the training. In the final epochs, the algorithm keeps improving accuracy, but the masks are only being fine-tuned. A similar mask convergence behavior can be found in Appendix (Figure 7) for training ResNet-20 on CIFAR-10.
DPF does not find a lottery ticket. The LT hypothesis (Frankle & Carbin, 2019) conjectures that for every desired sparsity level there exists a sparse submodel that can be trained to the same or better performance as the dense model. In Figure 5 we show that the mask found by DPF is not a LT, i.e., training the obtained sparse model from scratch does not recover the same performance. The (expensive) procedure proposed in Frankle & Carbin (2019); Frankle et al. (2019) finds different masks and achieves the same performance as DPF for mild sparsity levels, but DPF is much better for extremely sparse models (99% sparsity).
Extension to structured pruning. The current state-of-the-art dynamic reparameterization methods only consider unstructured weight pruning. Structured filter pruning6 is either ignored (Bellec et al., 2018; Mocanu et al., 2018; Dettmers & Zettlemoyer, 2019) or shown to be challenging (Mostafa & Wang, 2019) even for the CIFAR dataset. In Figure 6 below we presented some preliminary results on CIFAR-10 to show that our DPF can also be applied to structured filter pruning schemes. DPF outperforms the current filter-norm based state-of-the-art method for structured pruning (e.g. SFP (He et al., 2018)) by a noticeable margin. Figure 16 in Appendix A.4.3 displays the transition procedure of the sparsity pattern (of different layers) for WideResNet-28-2 with different sparsity levels. DPF can be seen as a particular neural architecture search method, as it gradually learns to prune entire layers under the guidance of the feedback signal.
We followed the common experimental setup as mentioned in Section 5 with `2 norm based filter selection criteria for structured pruning extension on CIFAR-10. We do believe a better filter selection scheme (Ye et al., 2018; He et al., 2019; Lym et al., 2019) could further improve the results but we leave this exploration for the future work.
6Lym et al. (2019) consider structured filter pruning and reconfigure the large (but sparse) model to small (but dense) model during the training for better training efficiency. Note that they perform model update on a gradually reduced model space, and it is completely different from the dynamic reparameterization methods (e.g. DSR, SM and our scheme) that perform reparameterization under original (full) model space.

heading: ACKNOWLEDGEMENTS
text: We acknowledge funding from SNSF grant 200021_175796, as well as a Google Focused Research Award.

heading: A APPENDIX

heading: A.1 ALGORITHM
text: Algorithm 1 The detailed training procedure of DPF. input: uncompressed model weights w ∈ Rd, pruned weights: w̃, mask: m ∈ {0, 1}d; reparametrization
period: p; training iterations: T . 1: for t = 0, . . . , T do 2: if p | t then . trigger mask update, per default every p = 16 iterations 3: compute mask m←mt(wt) . by arbitrary pruning scheme (e.g. unstructured magnitude pruning) 4: end if 5: w̃t ←m wt . apply (precomputed) mask 6: compute (mini-batch) gradient g(w̃) . forward/backward pass with pruned weights w̃t 7: wt+1 ← gradient update g(w̃) to wt . via arbitrary optimizer (e.g. SGD with momentum) 8: end for
output: wT and w̃T
We trigger the mask update every p = 16 iterations (see also Figure 11) and we keep this parameter fixed throughout all experiments, independent of architecture or task.
We perform pruning across all neural network layers (no layer-wise pruning) using magnitude-based unstructured weight pruning (inherited from Han et al. (2015)). Pruning is applied to all convolutional layers while keeping the last fully-connected layer, biases and batch normalization layers dense.
We gradually increases the sparsity st of the mask from 0 to the desired sparsity using the same scheduling as in Zhu & Gupta (2017); see Appendix A.2 below.
A.2 IMPLEMENTATION DETAILS
We implemented our DPF in PyTorch (Paszke et al., 2017). All experiments were run on NVIDIA Tesla V100 GPUs. Sparse tensors in our implementation are respresented as the dense tenors multiplied by the corresponding binary masks.
Datasets We evaluate all methods on the following standard image classification tasks:
• Image classification for CIFAR-10 (Krizhevsky & Hinton, 2009). Dataset consists of a training set of 50K and a test set of 10K color images of 32× 32 pixels, as well as 10 target classes. We adopt the standard data augmentation and preprocessing scheme (He et al., 2016a; Huang et al., 2016).
• Image classification for ImageNet (Russakovsky et al., 2015). The ILSVRC 2012 classification dataset consists of 1.28 million images for training, and 50K for validation, with 1K target classes. We use ImageNet-1k (Deng et al., 2009) and adopt the same data preprocessing and augmentation scheme as in He et al. (2016a;b); Simonyan & Zisserman (2015).
Gradual Pruning Scheme For Incremental baseline, we tuned their automated gradual pruning scheme st = sf + (si − sf ) ( 1− t−t0n∆t )3 to gradually adjust the pruning sparsity ratio st for t ∈ {t0, . . . , t0 + n∆t}. That is, in our setup, we increased from an initial sparsity ratio si = 0 to the desired target model sparsity ratio sf over the epoch (n) when performing the second learning rate decay, from the training epoch t0 = 0 and with pruning frequency ∆t = 1 epoch. In our experiments, we used this gradual pruning scheme over different methods, except One-shot P+FT, SNIP, and the methods (DSR, SM) that have their own fine-tuned gradual pruning scheme.
Hyper-parameters tuning procedure We grid-searched the optimal learning rate, starting from the range of {0.05, 0.10, 0.15, 0.20}. More precisely, we will evaluate a linear-spaced grid of learning rates. If the best performance was ever at one of the extremes of the grid, we would try new grid points so that the best performance was contained in the middle of the parameters.
We trained most of the methods by using mini-batch SGD with Nesterov momentum. For baselines involving fine-tuning procedure (e.g. Table 2), we grid-searched the optimal results by tuning the optimizers (i.e. mini-batch SGD with Nesterov momentum, or Adam) and the learning rates.
The optimal hyper-parameters for DPF The mini-batch size is fixed to 128 for CIFAR-10 and 1024 for ImageNet regardless of datasets and models.
For CIFAR-10, we trained ResNet-a and VGG for 300 epochs and decayed the learning rate by 10 when accessing 50% and 75% of the total training samples (He et al., 2016a; Huang et al., 2017); and we trained WideResNet-a-b as Zagoruyko & Komodakis (2016) for 200 epochs and decayed the learning rate by 5 when accessing 30%, 60% and 80% of the total training samples. The optimal learning rate for ResNet-a, WideResNet-a-b and VGG are 0.2, 0.1 and 0.2 respectively; the corresponding weight decays are 1e−4, 5e−4 and 1e−4 respectively. For ImageNet training, we used the training scheme in Goyal et al. (2017) for 90 epochs, where we gradually warmup the learning rate from 0.1 to 0.4 and decayed learning rate by 10 at 30; 60; 80 epochs. The used weight decay is 1e−4.

heading: A.3 ADDITIONAL RESULTS FOR UNSTRUCTURED PRUNING

heading: A.3.1 COMPLETE RESULTS OF UNSTRUCTURED PRUNING ON CIFAR-10
text: Table 4 details the numerical results for training SOTA DNNs on CIFAR-10. Some results of it reconstruct the Table 1 and Figure 3.

heading: A.3.2 UNDERSTANDING THE TRAINING DYNAMICS AND LOTTERY TICKET EFFECT
text: Figure 7 and Figure 8 complements Figure 4, and details the training dynamics (e.g. the converge of δ and masks) of DPF from the other aspect. Figure 9 compares the training dynamics between DPF
and Incremental (Zhu & Gupta, 2017), demonstrating the fact that our scheme enables a drastical reparameterization over the dense parameter space for better generalization performance.
Figure 10 in addition to the Figure 5 (in the main text) further studies the lottery ticket hypothesis under different training budgets (same epochs or same total flops). The results of DPF also demonstrate the importance of training-time structural exploration as well as the corresponding implicit regularization effects. Note that we do not want to question the importance of the weight initialization or the existence of the lottery ticket. Instead, our DPF can provide an alternative training scheme to compress the model to an extremely high compression ratio without sacrificing the test accuracy, where most of the existing methods still meet severe quality loss (including Frankle & Carbin (2019); Liu et al. (2019); Frankle et al. (2019)).

heading: A.3.3 COMPUTATIONAL OVERHEAD AND THE IMPACT OF HYPER-PARAMETERS
text: In Figure 11, we evaluated the top-1 test accuracy of a compressed model trained by DPF under different setups, e.g., different reparameterization period p, different sparsity ratios, different mini-batch
sizes, as well as whether layer-wise pruning or not. We can witness that the optimal reparameterization (i.e p = 16) is quite consistent over different sparsity ratios and different mini-batch sizes, and we used it in all our experiments. The global-wise unstructured weight pruning (instead of layer-wise weight pruning) allows our DPF more flexible to perform dynamic parameter reallocation, and thus can provide better results especially for more aggressive pruning sparsity ratios. However, we also need to note that, for the same number of compressed parameters (layerwise or globalwise unstructured weight pruning), using global-wise pruning leads to a slight increase in the amount of MACs, as illustrated Table 5.
0.5 0.6 0.7 0.8 0.9 0.95 Sparsity
1 2
4 8
16 32 64R ep ar am
et er
iz at
io n
fre qu
en cy -0.05 -0.04 -0.16 -0.26 -0.03 -0.42
-0.04 -0.17 -0.01 -0.08 -0.09 -0.51
0.00 -0.05 -0.18 -0.18 -0.20 -0.45
-0.08 -0.04 -0.08 -0.18 -0.10 -0.02
-0.09 0.00 -0.04 0.00 0.00 0.00
-0.15 -0.14 0.00 -0.11 -0.15 -0.44
-0.06 -0.12 -0.02 -0.11 -0.30 -1.03 1.0
0.8
0.6
0.4
0.2
0.0
(a) Reparameterization period vs. sparsity ratio. The heatmap value is the test accuracy minus the best accuracy of the corresponding sparsity. We use mini-batch size 128 w/o layerwise reparameterization.
128 256 512 1024 Batch size
1 2
4 8
16 32R ep ar
am et
er iz
at io
n fre
qu en
cy 91.95 92.01 92.04 91.74
92.13 92.06 91.97 91.81
92.03 91.95 92.02 91.76
92.03 92.12 92.03 91.88
92.21 92.32 91.98 91.90 92.10 92.13 92.05 91.62 91.75
91.90
92.05
92.20
(b) Reparameterization period vs. mini-batch size. The heatmap displays the test accuracy. We use sparsify ratio 0.80.
0.5 0.6 0.7 0.8 0.9 0.95 Sparsity
Fa ls e Tr
ue La ye rw
is e
re pa
ra m
et er
iz at
io n
92.51 92.62 92.41 92.21 90.96 88.21
92.54 92.45 92.11 91.63 89.71 83.35
84
86
88
90
92
(c) Reparameterization scheme (whether layerwise) vs. sparsity ratio. The heatmap displays the test accuracy. We use mini-batch size 128 w/ reparameterization period p = 16.
Figure 11: Investigate how the reparameterization period/scheme and mini-batch size impact the generalization performance (test top-1 accuracy), for dynamically training (and reparameterizing) a compressed model from scratch (ResNet-20 with CIFAR-10).
Figure 12 demonstrates the trivial computational overhead of involving DPF to gradually train a compressed model (ResNet-50) from scratch (on ImageNet). Note that we evaluated the introduced reparameterization cost for dynamic pruning, which is independent of (potential) significant system speedup brought by the extreme high model sparsity. Even though our work did not estimate the practical speedup, we do believe we can have a similar training efficiency as the values reported in Dettmers & Zettlemoyer (2019).
A.3.4 IMPLICIT NEURAL ARCHITECTURE SEARCH
DPF can provide effective training-time structural exploration or even implicit neural network search. Figure 13 below demonstrates that for the same pruned model size (i.e. any point in the x-axis), we can always perform “architecture search” to get a better (in terms of generalization) pruned model, from a larger network (e.g. WideResNet-28-8) rather than the one searched from a relatively small network (e.g. WideResNet-28-4).

heading: A.4 ADDITIONAL RESULTS FOR STRUCTURED PRUNING

heading: A.4.1 GENERALIZATION PERFORMANCE FOR CIFAR-10
text: Figure 14 complements the results of structured pruning in the main text (Figure 6), and Table 6 details the numerical results presented in both of Figure 6 and Figure 14.

heading: A.4.2 UNDERSTANDING THE LOTTERY TICKET EFFECT
text: Similar to the observations in Section 6 (for unstructured pruning), Figure 15 instead considers structured pruning and again we found DPF does not find a lottery ticket. The superior generalization performance of DPF cannot be explained by the found mask or the weight initialization scheme.

heading: A.4.3 MODEL SPARSITY VISUALIZATION
text: Figure 16 below visualizes the model sparsity transition patterns for different model sparsity levels under the structured pruning. We can witness that due to the presence of residual connection, DPF gradually learns to prune the entire residual blocks.

heading: B MISSING PROOFS
text: In this section we present the proofs for the claims in Section 4.
First, we give the proof for the stongly convex case. Here we follow Lacoste-Julien et al. (2012) for the general structure, combined with estimates from the error-feedback framework (Stich et al., 2018; Stich & Karimireddy, 2019) to control the pruning errors.
Proof of Theorem 4.1. By definition of (DPF), wt+1 = wt − γtg(w̃t), hence, E [ ‖wt+1 −w?‖2 | wt ] = ‖wt −w?‖2 − 2γt 〈wt −w?,Eg(w̃t)〉+ γ2t E ‖g(w̃t)‖ 2
≤ ‖wt −w?‖2 − 2γt 〈wt −w?,∇f(w̃t)〉+ γ2tG2
= ‖wt −w?‖2 − 2γt 〈w̃t −w?,∇f(w̃t)〉+ γ2tG2
+ 2γt 〈w̃t −wt,∇f(w̃t)〉 . By strong convexity,
−2 〈w̃t −w?,∇f(w̃t)〉 ≤ −µ ‖w̃t −w?‖2 − 2 (f(w̃t)− f(w?)) , and with ‖a + b‖2 ≤ 2 ‖a‖2 + 2 ‖b‖2 further
−‖w̃t −w?‖2 ≤ − 1
2 ‖wt −w?‖2 + ‖wt − w̃t‖2
and with 〈a,b〉 ≤ 12α ‖a‖ 2 + α2 ‖b‖ 2 for a,b ∈ Rd and α > 0,
2 〈w̃t −wt,∇f(w̃t)〉 ≤ 2L ‖w̃t −wt‖2 + 1
2L ‖∇f(w̃t)‖2
= 2L ‖w̃t −wt‖2 + 1
2L ‖∇f(w̃t)−∇f(w?)‖2
≤ 2L ‖w̃t −wt‖2 + f(w̃t)− f(w?) , where the last inequality is a consequence of L-smoothness. Combining all these inequalities yields
E [ ‖wt+1 −w?‖2 | wt ] ≤ (
1− µγt 2
) ‖wt −w?‖2 − γt (f(w̃t)− f(w?)) + γ2tG2
+ γt(2L+ µ) ‖w̃t −wt‖2 ≤ (
1− µγt 2
) ‖wt −w?‖2 − γt (f(w̃t)− f(w?)) + γ2tG2
+ 3γtL ‖w̃t −wt‖2 . as µ ≤ L. Hence, by rearranging and multiplying with a weight λt > 0:
λtE (f(w̃t)− f(w?)) ≤ λt(1− µγt/2)
γt E ‖wt −w?‖2 − λt γt E ‖wt+1 −w?‖2 + γtλtG2
+ 3λtLE ‖w̃t −wt‖2 . By plugging in the learning rate, γt = 4µ(t+2) and setting λt = (t+ 1) we obtain
λtE (f(w̃t)− f(w?)) ≤ µ
4
[ t(t+ 1)E ‖wt −w?‖2 − (t+ 1)(t+ 2)E ‖wt+1 −w?‖2 ] + 4(t+ 1)
µ(t+ 2) G2 + 3(t+ 1)LE ‖w̃t −wt‖2 .
By summing from t = 0 to t = T these λt-weighted inequalities, we obtain a telescoping sum: T∑ t=0 λtE (f(w̃t)− f(w?)) ≤ µ 4 [ 0− (T + 1)(T + 2)E ‖wt+1 −w?‖2 ] + 4(T + 1) µ G2
+ 3L T∑ t=0 λtE ‖w̃t −wt‖2
≤ 4(T + 1) µ G2 + 3L T∑ t=0 λtE ‖w̃t −wt‖2 .
Hence, for ΛT := ∑T t=0 λt = (T+1)(T+2) 2 ,
1
ΛT T∑ t=0 λtE (f(w̃t)− f(w?)) ≤ 4(T + 1) µΛT G2 + 3L ΛT T∑ t=0 λtE ‖w̃t −wt‖2
= O
( G2
µT +
L
ΛT T∑ t=0
λtE ‖w̃t −wt‖2 ) .
Finally, using ‖w̃t −wt‖2 = δt ‖wt‖2 by (1), shows the theorem.
Before giving the proof of Theorem 4.2, we first give a justification for the remark just below Theorem 4.1 on the one-shot pruning of the final iterate.
We have by L-smoothness and 〈a,b〉 ≤ 12α ‖a‖ 2 + α2 ‖b‖ 2 for a,b ∈ Rd and α > 0 for any iterate wt:
f(w̃t)− f(w?) ≤ f(wt)− f(w?) + 〈∇f(wt), w̃t −wt〉+ L
2 ‖w̃t −wt‖2
≤ f(wt)− f(w?) + 1
2L ‖∇f(wt)‖2 + L ‖w̃t −wt‖2
≤ 2(f(wt)− f(w?)) + δtL ‖wt‖2 . (4) Furthermore, again by L-smoothness,
f(wT )− f(w?) ≤ L
2 ‖wT −w?‖2 = O
( LG2
µ2T ) as standard SGD analysis gives the estimate E ‖wT −w?‖2 = O ( G2
µ2T
) , see e.g. Lacoste-Julien
et al. (2012). Combining these two estimates (with wt = wT ) shows the claim.
Furthermore, we also claimed that also the dense model converges to a neighborhood of optimal solution. This follows by L-smoothness and (4): For any fixed model wt we have the estimate (4), hence for a randomly chosen (dense) model u (from the same distribution as the sparse model in Theorem 4.1) we have
Ef(u)− f(w?) (4) ≤ 2E [f(ũ)− f(w?)] + LE [ δt ‖wt‖2 ] (Thm 4.1) = O ( G2
µT + LE
[ δt ‖wt‖2 ]) .
Lastly, we give the proof of Theorem 4.2, following Karimireddy et al. (2019).
Proof of Theorem 4.2. By smoothness, and 〈a,b〉 ≤ 12 ‖a‖ 2 + 12 ‖b‖ 2 for a,b ∈ Rd,
E [f(wt+1) | wt] ≤ f(wt)− γ 〈∇f(wt),Eg(w̃t)〉+ γ2 L
2 E ‖g(w̃t)‖2
≤ f(wt)− γ 〈∇f(wt),∇f(w̃t)〉+ γ2 LG2
2
= f(wt)− γ 〈∇f(w̃t),∇f(w̃t)〉+ γ2 LG2
2 + γ 〈∇f(w̃t)−∇f(wt),∇f(w̃t)〉
≤ f(wt)− γ ‖∇f(w̃t)‖2 + γ2 LG2
2
+ γ
2 ‖∇f(w̃t)−∇f(wt)‖2 +
γ 2 ‖∇f(w̃t)‖2
≤ f(wt)− γ
2 ‖∇f(w̃t)‖2 + γ2
LG2 2 + γL2 2 ‖wt − w̃t‖2 ,
and by rearranging
E ‖∇f(w̃t)‖2 ≤ 2
γ [Ef(wt)− Ef(wt+1)] + γLG2 + L2E ‖wt − w̃t‖2 .
Summing these inequalities from t = 0 to t = T gives
1
T + 1 T∑ t=0 E ‖∇f(w̃t)‖2 ≤ 2 γ(T + 1) T∑ t=0 (E [f(wt)]− E [f(wt+1)]) + γLG2
+ L2
T + 1 T∑ t=0 E ‖wt − w̃t‖2
≤ 2 (f(w0)− f(w ?))
γ(T + 1) + LγG2 +
L2
T + 1 T∑ t=0 E ‖et‖2 .
Finally, using ‖w̃t −wt‖2 = δt ‖wt‖2 by (1), and plugging in the stepsize γ that minimizes the right hand side shows the claim.

Review summaries:
This work proposes a simple pruning method that dynamically sparsifies the network during training. This is achieved by performing at fixed intervals magnitude based pruning for either individual weights or entire neurons. While similar methods have been explored before, this work proposes a slight twist; instead of updating the weights of the model by following the gradient of the parameters of the dense model, they update the parameters of the dense model according to the gradients of the sparse model. Essentially, this corresponds to a variant of the straight-through estimator [1], where in the forward pass we evaluate the compressed model, but in the backward pass we update the model as if the compression didn’t take place. The authors argue that this process allows for ``feedback” in the pruning mechanism, as the pruned weights still receive gradient updates hence they can be ``re-activated” at later stages of training. They then provide a convergence analysis about the optimization procedure with such a gradient, and show that for strongly convex functions the method converges in the vicinity of the global optimum, whereas for non-convex functions it converges to the neighbourhood of a stationary point. Finally, the authors perform extensive experimental evaluation and show that their method is better than the baselines that they considered.

In this paper, the authors proposed a novel model compression method that uses error feedbacks to dynamically allocates sparsity patterns during training. The authors provided a systematic overview of a good number of existing model compression algorithms depending on the relative order of pruning and training processes. The effectiveness of the proposed algorithm is illustrated by comparing its generalization performance with 6 existing algorithms (and their variants) with two standard datasets and various networks of standard structures. The authors also showed the convergence rate and the fundamental limit of the proposed algorithm with two theorems.