summaries: The paper proposes a novel generalisation measure, i.e., measurement that indicates how well the network generalises, based on pruning. The idea is to measure the fraction of the weights that can be pruned (either randomly, or based on the norms) without hurting the training loss of the model. The paper provides thorough discussion of the related methods and motivates the measure in multiple ways. Further, the authors show empirical evidence for the correlation of the pruning robustness to the generalisation ability of networks, based on the paper by Jiang et al., 2019 and dataset (updated with additional models) provided in the paper. In order to understand why deep networks generalize well, this paper proposes "prunability" as an empirical measure that can be predictive of the generalization. Prunability is roughly the smallest _fraction_ (i.e., $\in [0,1]$) of parameters that can be retained, while zeroing out everything else, without increasing the model's training loss by too much. The authors experimentally demonstrate the predictive ability of this measure in three ways. In the present work, the authors tackle the highly debated (and sometimes confusing) problem of finding a good simplicity/complexity measure able to predict generalization performance of deep networks. A novel measure called 'prunability' is introduced and compared with some of the many alternatives in the literature. This property measures how networks are able to retain low training loss when a fraction of the weights is set to zero, and is clearly related to common training practices (e.g. dropout) that seems to yield better generalization performance in practice. The experimental settings and the evaluation methods for this new metric are inspired by recent extensive studies on deep networks performance. The authors are able to show that prunability is in fact associated with good generalization and seems able to capture some non-trivial phenomena (double-descent), but they also find it to be inferior to pre-existing (margin based) measures. Moreover, the close relationship to perturbation robustness and flatness measures is investigated, but the results are not fully conclusive.
abstractText: Why over-parameterized neural networks generalize as well as they do is a central concern of theoretical analysis in machine learning today. Following Occam’s razor, it has long been suggested that simpler networks generalize better than more complex ones. Successfully quantifying this principle has proved difficult given that many measures of simplicity, such as parameter norms, grow with the size of the network and thus fail to capture the observation that larger networks tend to generalize better in practice. In this paper, we introduce a new, theoretically motivated measure of a network’s simplicity: the smallest fraction of the network’s parameters that can be kept while pruning without adversely affecting its training loss. We show that this measure is highly predictive of a model’s generalization performance across a large set of convolutional networks trained on CIFAR-10. Lastly, we study the mutual information between the predictions of our new measure and strong existing measures based on models’ margin, flatness of minima and optimization speed. We show that our new measure is similar to – but more predictive than – existing flatness-based measures.
references.authors: Zeyuan Allen-Zhu Yuanzhi Li Yingyu Liang
references.title: Learning and generalization in overparameterized neural networks, going beyond two layers
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Sanjeev Arora Rong Ge Behnam Neyshabur Yi Zhang
references.title: Stronger generalization bounds for deep nets via a compression approach
references.venue: Proceedings of Machine Learning Research,
references.authors: Peter L Bartlett Dylan J Foster Matus J Telgarsky
references.title: Spectrally-normalized margin bounds for neural networks
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Mikhail Belkin Daniel Hsu Siyuan Ma Soumik Mandal
references.title: Reconciling modern machinelearning practice and the classical bias–variance trade-off
references.venue: Proceedings of the National Academy of Sciences, 116:201903070,
references.authors: Davis Blalock Jose Javier Gonzalez Ortiz Jonathan Frankle John Guttag
references.title: What is the state of neural network pruning
references.venue: In Proceedings of 3rd MLSys Conference,
references.authors: Gintare Karolina Dziugaite Daniel M Roy
references.title: Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data
references.venue: In Proceedings of the Thirty-Third Conference on Uncertainty in Artificial Intelligence,
references.authors: Jonathan Frankle Michael Carbin
references.title: The lottery ticket hypothesis: Finding sparse, trainable neural networks
references.venue: In International Conference on Learning Representations,
references.authors: Trevor Gale Erich Elsen Sara Hooker
references.title: The state of sparsity in deep neural networks
references.venue: arXiv preprint arXiv:1902.09574,
references.authors: Song Han Jeff Pool John Tran William Dally
references.title: Learning both weights and connections for efficient neural network
references.venue: In Advances in neural information processing systems,
references.authors: Kaiming He Xiangyu Zhang Shaoqing Ren Jian Sun
references.title: Identity mappings in deep residual networks
references.venue: In European conference on computer vision,
references.authors: Geoffrey Hinton Drew Van Camp
references.title: Keeping neural networks simple by minimizing the description length of the weights
references.venue: In in Proc. of the 6th Ann. ACM Conf. on Computational Learning Theory. Citeseer,
references.authors: Pavel Izmailov Dmitrii Podoprikhin Timur Garipov Dmitry Vetrov Andrew Gordon Wilson
references.title: Averaging weights leads to wider optima and better generalization
references.venue: In Proceedings of Conference on Uncertainty in Artificial Intelligence,
references.authors: Yiding Jiang Dilip Krishnan Hossein Mobahi Samy Bengio
references.title: Predicting the generalization gap in deep networks with margin distributions
references.venue: In International Conference on Learning Representations,
references.authors: Yiding Jiang Behnam Neyshabur Hossein Mobahi Dilip Krishnan Samy Bengio
references.title: Fantastic generalization measures and where to find them
references.venue: In International Conference on Learning Representations,
references.authors: Alex Krizhevsky Vinod Nair Geoffrey Hinton
references.title: Cifar-10 and cifar-100 datasets
references.venue: URl: https://www. cs. toronto. edu/kriz/cifar. html,
references.authors: Namhoon Lee Thalaiyasingam Ajanthan Philip Torr
references.title: SNIP: SINGLE-SHOT NETWORK PRUNING BASED ON CONNECTION SENSITIVITY
references.venue: In International Conference on Learning Representations,
references.authors: Wesley J. Maddox Gregory Benton Andrew Gordon Wilson
references.title: Rethinking parameter counting in deep models: Effective dimensionality revisited, 2020
references.venue: URL https://arxiv.org/pdf/ 2003.02139.pdf
references.authors: David McAllester
references.title: A pac-bayesian tutorial with a dropout
references.venue: URL https://arxiv. org/pdf/1307.2118.pdf
references.authors: David A McAllester
references.title: Pac-bayesian model averaging
references.venue: In Proceedings of the twelfth annual conference on Computational learning theory, pp
references.authors: Ari S Morcos David GT Barrett Neil C Rabinowitz Matthew Botvinick
references.title: On the importance of single directions for generalization
references.venue: In International Conference on Learning Representations,
references.authors: Preetum Nakkiran Gal Kaplun Yamini Bansal Tristan Yang Boaz Barak Ilya Sutskever
references.title: Deep double descent: Where bigger models and more data hurt
references.venue: In International Conference on Learning Representations,
references.authors: Behnam Neyshabur Ryota Tomioka Nathan Srebro
references.title: Norm-based capacity control in neural networks. volume
references.venue: Proceedings of Machine Learning Research, pp. 1376–1401,
references.authors: Behnam Neyshabur Srinadh Bhojanapalli David McAllester Nati Srebro
references.title: Exploring generalization in deep learning
references.venue: In Advances in Neural Information Processing Systems,
references.authors: Alex Renda Jonathan Frankle Michael Carbin
references.title: Comparing rewinding and fine-tuning in neural network pruning
references.venue: In International Conference on Learning Representations,
references.authors: Jorma Rissanen
references.title: Stochastic complexity and modeling
references.venue: The annals of statistics,
references.authors: Binxin Ru Clare Lyle Lisa Schut Mark van der Wilk Yarin Gal
references.title: Revisiting the train loss: an efficient performance estimator for neural architecture search
references.venue: arXiv preprint arXiv:2006.04492,
references.authors: Nitish Srivastava Geoffrey Hinton Alex Krizhevsky Ilya Sutskever Ruslan Salakhutdinov
references.title: Dropout: a simple way to prevent neural networks from overfitting
references.venue: The journal of machine learning research,
references.authors: Hans Henrik Thodberg
references.title: Improving generalization of neural networks through pruning
references.venue: International Journal of Neural Systems,
references.authors: Thomas Verma Judea Pearl
references.title: Equivalence and synthesis of causal models
references.venue: UCLA, Computer Science Department,
references.authors: Chaoqi Wang Guodong Zhang Roger Grosse
references.title: Picking winning tickets before training by preserving gradient flow
references.venue: In International Conference on Learning Representations,
references.authors: Chiyuan Zhang Samy Bengio Moritz Hardt Benjamin Recht Oriol Vinyals
references.title: Understanding deep learning requires rethinking generalization
references.venue: In International Conference on Learning Representations,
references.authors: Wenda Zhou Victor Veitch Morgane Austern Ryan P Adams Peter Orbanz
references.title: Non-vacuous generalization bounds at the imagenet scale: a pac-bayesian compression approach
references.venue: In International Conference on Learning Representations,
references.authors: Michael H. Zhu Suyog Gupta
references.title: To prune, or not to prune: Exploring the efficacy of pruning for model compression
references.venue: In International Conference on Learning Representations (Workshop),
references.authors: Jiang
references.title: 2020) and only consider models that are trained using batch normalization
references.venue: We extend the DEMOGEN data
references.authors: Jiang
references.title: 2019) in the DEMOGEN data set which is very similar to the architecture
references.venue: We train the networks on CIFAR-10 (Krizhevsky et al.,
references.title: DOUBLE DESCENT For our double descent experiments we use the models and baselines used by Maddox et al. (2020) which are available on: https://github.com/g-benton/hessian-eff-dim
references.venue: In particular,
sections.heading: 1 INTRODUCTION
sections.text: The gap between learning-theoretic generalization bounds for highly overparameterized neural networks and their empirical generalization performance remains a fundamental mystery to the field (Zhang et al., 2016; Jiang et al., 2020; Allen-Zhu et al., 2019). While these models are already being successfully used in many applications, improving our understanding of how neural networks perform on unseen data is crucial for safety-critical use cases. By understanding which factors drive generalization in neural networks we may further be able to develop more efficient and performant network architectures and training methods.
  Numerous theoretically and empirically motivated attempts have been made to identify generalization measures, that is, properties of the trained model, training procedure and training data that distinguish models that generalize well from those that do not (Jiang et al., 2020). A number of generalization measures have attempted to quantify Occam’s razor, i.e. the principle that simpler models generalize better than complex ones (Neyshabur et al., 2015; Bartlett et al., 2017). This has proven to be non-trivial, as many measures, particularly norm-based measures, grow with the size of the model and thus incorrectly predict that larger networks generalize worse than smaller networks. Other approaches have tried to establish a connection between model compression and generalization (Arora et al., 2018; Zhou et al., 2019). While both of these approaches are theoretically elegant and yield tighter bounds than bounds that are based on the size of uncompressed networks, they nonetheless grow with the size of the original network. Recent empirical studies (Jiang et al., 2020; 2019), on the other hand, identify three classes of generalization measures that do seem predictive of generalization: measures that estimate the flatness of local minima, the speed of the optimization, and the margin of training samples to decision boundaries. While these measures are correlated with generalization, their failure to fully explain the test performance of the model demonstrate a need for other notions of model simplicity to explain generalization in neural networks.
  In this paper, we leverage the empirical observation that large fractions of trained neural networks’ parameters can be pruned – that is, set to 0 – without hurting the models’ performance (Gale et al., 2019; Zhu & Gupta, 2018; Han et al., 2015). Based on this insight, we introduce a new measure of
  a model’s simplicity which we call prunability: the smallest fraction of weights we can keep while pruning a network without hurting its training loss.
  In a range of empirical studies, we demonstrate that a model’s prunability is indeed highly informative of its generalization. In particular, we find that the larger the fraction of parameters that can be pruned without hurting a model’s training loss, the better the model will generalize. Overall, we show that the smaller the fraction of parameters a model actually “uses” - the simpler it is - the better the network’s generalization performance.
  In summary, our main contributions are thus the following:
  1. We introduce a new generalization measure called prunability that captures a model’s simplicity (Sec. 4) and show that across a large set of models this measure is highly informative of a network’s generalization performance (Sec. 5.4.1).
  2. We show that even in a particularly challenging setting in which we observe a test loss double descent (Nakkiran et al., 2020; He et al., 2016), prunability is informative of models’ test performance and is competitive with an existing strong generalization measures (Sec. 5.4.2).
  3. Lastly, we investigate whether the success of prunability can be explained by its relationship to flat local minima. We find that while prunability makes similar predictions to some existing measures that estimate the flatness of minima, it differs from them in important ways, in particular exhibiting a stronger correlation with generalization performance than these flatness-based measures (Sec. 5.4.1 and 5.4.3).
sections.heading: 2 RELATED WORK
sections.text: Zhang et al. (2016) demonstrate that neural networks can perfectly memorize randomly labeled data while still attaining good test set performance on correctly labeled data, a phenomenon that complexity measures such as the VC-Dimension and Rademacher complexity fail to explain. More recently, increasing the parameter count of models has been shown to improve their generalization performance, yielding ‘double descent’ curves in which the test loss first decreases, then increases and then decreases again as the parameter count is increased (He et al., 2016; Nakkiran et al., 2020; Belkin et al., 2019). In contrast, many existing generalization measures grow monotonically with the model’s size and thus fail to capture double descent, making it a particularly interesting setting to study new generalization measures (Maddox et al., 2020).
  While generalization measures have been studied for a long time, Jiang et al. (2020) recently brought new empirical rigor to the field. They perform a large-scale empirical study by generating a large set of trained neural networks with a wide range of generalization gaps. Proposing a range of new evaluation criteria, they test how informative of generalization previously proposed generalization measures actually are. In this paper, we evaluate our new generalization measure in the same framework and use the strongest measures as baselines for comparison against our proposed measure, the neural network’s prunability.
  A common theme across many generalization measures is that they try to formalize Occam’s Razor, the idea that simpler models generalize better than more complex models. Rissanen (1986) formalizes this principle as a model’s Minimum Description length which was later applied to small neural networks by Hinton & Van Camp (1993). Similarly, Neyshabur et al. (2015; 2017) and numerous other approaches suggest that networks with smaller parameter norms generalize better. We are aware of two existing generalization measures that are based on compression or pruning. Arora et al. (2018) derive a PAC-Bayesian generalization bound based on the size of a network following a particular compression method based on noise stability. Zhou et al. (2019), on the other hand, formulate a generalization bound that is non-vacuous even for large network architectures based on the description length of a compressed network which in turn also grows with the size of the original network. While these approaches are theoretically elegant, all such measures grow with the number of parameters in a given network and thus do not capture the phenomenon that more highly overparameterized networks tend to generalize better.
  Three classes of generalization measures seem to be particularly predictive of generalization. First, measures that estimate the flatness of local minima, either based on random perturbations of the
  weights (Neyshabur et al., 2017; Dziugaite & Roy, 2017; Jiang et al., 2020; McAllester, 1999) or directly based on the curvature of the loss surface (Maddox et al., 2020). In a purely empirical study, Morcos et al. (2018) find that a model’s robustness to clamping the activations of individual units to fixed values is predictive of its generalization performance. Second, margin-based measures that use the distance of training samples to decision boundaries (Jiang et al., 2019). Lastly, Jiang et al. (2020); Ru et al. (2020) have proposed measures that estimate the speed of optimization.
  A large fraction of a network’s parameters can be removed without impairing performance (Gale et al., 2019; Blalock et al., 2020); in fact, such pruning often improves generalization performance (Thodberg, 1991). There are many approaches to selecting parameters for removal; we focus on randomly selected parameters (random pruning) and removing the smallest-magnitude parameters (magnitude pruning), though other approaches exist in the literature (Han et al., 2015; Renda et al., 2020; Lee et al., 2019; Wang et al., 2020; Blalock et al., 2020). Random pruning is applied by the regularization method dropout (Srivastava et al., 2014), which is used to improve network generalization performance. Magnitude pruning can be used in an iterative pruning and retraining procedure (Frankle & Carbin, 2019) to identify sparse subnetworks that, for some sparsity levels, generalize better than their parent network. Both approaches are therefore natural candidates for a notion of network simplicity, which we will leverage in our proposed generalization measure. While research on dropout and the Lottery Ticket Hypothesis suggest that pruning during training and generalization are connected, we study the distinct question of whether pruning after training and generalization are connected.
sections.heading: 3 NOTATION
sections.text: Following the notation of Jiang et al. (2020), we denote by D the distribution over inputs X and their labels y and let κ denote the number of classes. By S we denote a given data set containing m i.i.d. tuples {(X1, y1), . . . , (Xm, ym)} drawn from D where Xi ∈ X is the input data and yi ∈ {1, . . . , κ} the class labels. We denote a feedforward neural network by fw : X → Z, its weight parameters by w and the number of its parameters by ω. We denote the weight tensor of the ith layer of the network by Wi and we then have that w = vec(W1, . . . ,Wd), where d is the depth of the network and vec denotes the vectorization operator.
  Let L be the 1-0 classification error under the data distribution D : L(fw) := E(X,y)∼D[fw(X) 6= y], and let L̂ be the empirical 1-0 error on S: L̂(fw) := 1m ∑m i=1[fw(Xi) 6= yi]. We define the generalization gap as g(fw) := L(fw) − L̂(fw). When training a network, we denote each hyperparameter by θi ∈ Θi for i = 1, . . . n where n is the total number of hyperparameters. We denote a particular hyperparameter configuration by θ := (θ1, θ2, . . . , θn) ∈ Θ, where Θ := Θ1 × Θ2 × · · · ×Θn.
sections.heading: 4 PRUNABILITY
sections.text: A generalization measure should satisfy three straightforward desiderata: 1) It should correlate with the generalization gap across a broad range of models. 2) It should not suffer trivially from Goodhart’s law, that is, incorporating it into the optimization procedure of a model should lead to improved generalization. 3) It should ideally have a plausible theoretical justification to allow for further study of its properties.
  A measure based on magnitude- and random pruning presents a promising direction for satisfying all three desiderata. First, it is well-established that we can remove large fractions of a neural network’s parameters without negatively impacting its train performance, while also improving its test performance (Blalock et al., 2020; Thodberg, 1991). Second, training models using dropout, i.e. random pruning, is widely known to improve generalization (Srivastava et al., 2014), as does the iterative magnitude pruning procedure of Frankle & Carbin (2019) (up to certain sparsity levels). Finally, pruning has a theoretical grounding in the minimum description length principle and in PAC-Bayesian bounds.
  The connection between dropout and generalization has been studied in the PAC-Bayesian framework (McAllester, 1999), which allows us to quantify the worst-case generalization performance of random predictors. PAC-Bayesian bounds define model complexity as the KL divergence be-
  tween some fixed prior distribution P , and the probability distribution over functions induced by the random predictor (often called the posterior Q, although this may not correspond to a Bayesian posterior) to obtain generalization bounds of the following form. Theorem 1 (McAllester (1999)). For any δ > 0, data distributionD, prior P , with probability 1−δ over the training set, for any posterior Q the following bound holds:
  Ev∼Q[L(fv)] ≤ Ev∼Q[L̂(fv)] +
  √ KL(Q||P ) + log(mδ )
  2(m− 1)
  McAllester (2013) shows that in the case where both the prior and posterior are distributions over networks to which dropout with a given dropout probability α is applied, the KL term becomes: KL(Q||P ) = 1−α2 ||w||
  2. We can directly use this formalization to derive a generalization bound for networks that are randomly pruned to the largest α, s.t. Ev∼Q[L̂(fv)] < L̂(fw)× (1 + β), i.e., such that the training loss does not increase more than a relative tolerance β. We have to adjust the bound to account for the search for α. We make use of the fact that we search over a fixed number c of possible values for α and use union bound which will change the log term in the bound to log( cmδ ). We thus obtain the following bound:
  Ev∼Q[L(fv)] ≤ Ev∼Q[L̂(fv)] +
  √ 1−α
  2 ||w|| 2 2 + log( m δ ) + 5
  2(m− 1) . (1)
  While this bound will be vacuous for many large neural networks, it does provide us with some intuition for why we should expect a model’s generalization to be linked to its robustness to pruning. In particular, this bound predicts the relative generalization performance of models from which different fractions of parameters can be removed without adversely affecting their training loss. It is this prediction that we evaluate with the experiments described below. We provide the details on the derivation in Appendix C.
  Given a trained model and a pruning algorithm, we define the model’s prunability as the smallest fraction of the model’s parameters that we can keep while pruning without increasing the model’s training loss by more than a given relative tolerance β. We choose the fraction of parameters pruned rather than the number of parameters remaining based on the empirical observation that naive parameter counting is a poor predictor of generalization performance.
  Definition 1 (Prunability). Let L̂ denote the cross-entropy loss. For a given model fw, a training data set Strain, a relative bound on the change in train loss β and a pruning method φ, we thus define prunability as
  µprunability(fw) = arg min α φ(fw, α)
  s.t. L̂(φ(fw, α),Strain) ≤ (1 + β)× L̂(fw,Strain) , (2)
  where φ(fw, α) sets the fraction 1− α of the weights of fw to zero.
  In our experiments we evaluate robustness to pruning both with regards to magnitude pruning, in which the parameters with the smallest absolute magnitude are set to 0, and random pruning, where random parameters are set to 0. Magnitude pruning can remove a greater number of model weights without affecting performance than random pruning (Blalock et al., 2020), and can therefore be considered a more effective pruning strategy. We hypothesize that using a more effective pruning method might yield a measure of prunability that is more predictive of generalization. Per default, we refer to a model’s prunability with regards to magnitude pruning in the following. Note that while iterative pruning is usually used when the aim is to achieve the best compression rate, we are only concerned with the generalization of the model at the end of training and thus apply one-shot pruning. In our experiments we use a tolerance β of 0.1 and note that the particular choice of β did not seem to have a large impact on the predictiveness of prunability. See Appendix A.6.1 for pseudo-code of how prunability is computed for a given model.
sections.heading: 5 EXPERIMENTAL RESULTS AND ANALYSIS
sections.text: The goals of our experiments are fourfold: 1) We verify that prunability predicts generalization across a set of models trained with different hyperparameters and generalization performance. To
  this end, we use a similar experimental framework as Jiang et al. (2020). 2) We evaluate how prunability performs in a particularly challenging double descent setting. 3) To understand what notion of simplicity prunability quantifies, we study the conditional mutual information between it and baselines that represent existing classes of different strong generalization measures. 4) Given that prunability and random perturbation robustness both measure the sensitivity of a model’s training loss to a perturbation of its weights, we directly compare how pruning and random weight perturbations impact models’ losses.
sections.heading: 5.1 BASELINES
sections.text: We compare our generalization measure to a number of baseline measures. Having somewhat tighter computational constraints than Jiang et al. (2020), we select one strong baseline per class of generalization measures as described by Jiang et al. (2020) and Jiang et al. (2019).
  From the class of generalization measures that aim to capture a model’s simplicity using parameternorms, we use the Sum of Squared Frobenius Norms (Jiang et al., 2020):
  µsum of fro(fw) = d · ( d∏ i=1 ||Wi||2F )1/d,
  where d is the number of layers of the model. From the class of measures based on the idea that models with flatter local minima generalize better, we use magnitude aware random perturbation robustness (Jiang et al., 2020):
  µpac bayes mag flat(fw) = 1
  σ2 ,
  where ui ∼ N (0, σ2|wi| + ) and σ2 is the largest number such that Eu[L̂(fw+u)] ≤ (1 + β) × L̂(fw), where β is an arbitrarily selected relative tolerance, in our experiments 0.1. From the class of measures based on the idea that models with wider margins between the training samples and decision boundaries generalize better, we use the Normalized Margins measure (Jiang et al., 2019):
  µnorm margins(fw) = a Tφ,
  wherein φ consists of five statistics of the normalized margins distribution for each layer of the model. That is, at each hidden layer of the network, the normalized distances of all samples to the decision boundary of the second most likely class are computed. Five statistics of each of these distance distributions are used as input for the linear regression. Lastly, from the class of measures based on the idea that the speed of optimization is predictive of generalization, we use the negative Sum of Train Losses (Ru et al., 2020) throughout training:
  µSoTL(fw) = − T∑ t=1 L̂(fwt),
  where T is the number of training epochs, wt the parameters at epoch t and L̂ the training crossentropy loss. In Appendix A.2 we provide further details on these generalization measures and additional baselines.
sections.heading: 5.2 MODELS
sections.text: To generate a large set of trained models, we build upon the DEMOGEN set of trained models introduced by Jiang et al. (2019). Our data set consists of 324 models that resemble the Networkin-Network architecture by (Lin et al., 2014) trained on CIFAR10. Jiang et al. (2019) propose this particular architecture because it is parameter-efficient and achieves relatively competitive performance on standard image classification benchmarks. We achieve a wide range of generalization gaps by varying a number of hyperparameters such as the width, depth or L2-regularization of the models. We modify the original set of models, DEMOGEN, used by Jiang et al. (2019) to obtain an even stronger experimental set up: noticing that the depth of neural networks has a large impact on generalization performance, we add models of different depths to the original DEMOGEN data set. Following Jiang et al. (2020) we only use models that apply batch normalization. See Appendix A.3 for further details of our experimental set-up.
sections.heading: 5.3 EVALUATION METRICS
sections.text: To study our generalization measures comprehensively, we consider 1) their Kendall’s Rank correlation with the generalization gap, 2) how predictive they are in terms of the adjusted R2 and 3) apply the conditional independence test of Jiang et al. (2020), in an attempt to understand the causal relations between the complexity measures and generalization. We briefly summarize the metrics in this section and provide a more detailed explanation in Appendix A.1
  We compute Kendall’s rank correlation coefficient which quantifies to what extent the ranking of models according to a given generalization measure corresponds to the ranking according to the generalization gaps. For a given generalization measure µ, we consider: T := ∪θ∈Θ{(µ(θ), g(θ))} where g(θ) is the generalization gap of the model trained with hyperparameters θ. Kendall’s rank correlation coefficient is then defined as the fraction of pairs of tuples that are correctly ranked according to the generalization measure: τ(T ) :=
  1 |T |(|T |−1) ∑ (µ1,g1)∈T ∑ (µ2,g2)∈T \(µ1,g1) sign(µ1 − µ2)sign(g1 − g2). While Kendall’s rank correlation coefficient is generally a useful metric, it does not adequately reflect whether a generalization measure’s performance is consistent across all hyperparameter axes. Thus, we also consider the granulated Kendall’s rank correlation coefficient which is essentially the average of Kendall’s rank coefficients ψi obtained by only varying one hyperparameter dimension at a time: Ψ := 1n ∑n i=1 ψi
  To go beyond correlation, Jiang et al. (2020) use a conditional independence test inspired by Verma & Pearl (1991). The main goal here is to understand whether there exists an edge in a causal graph between a given generalization measure µ and the generalization gap g: this tells us whether models generalize well because of the value of the generalization measure, or whether the two values are only correlated. This is achieved by estimating the conditional mutual information between the generalization measure and the generalization gap conditioned on different hyperparameters that are observed. Formally, we have that for any function φ : Θ → R, let Vφ : Θ1 × Θ2 → {+1,−1} be as Vφ(θ1, θ2) := sign(φ(θ1) − φ(θ2)). Let US be a random variable that corresponds to the values of the hyperparameters in S. Intuitively, the higher this metric is, the more likely it is that there is indeed an edge in the causal graph between the generalization gap and the generalization measure: K(µ) = minUSs.t.|S|≤2 Î(Vµ, Vg|US), where Î(Vµ, Vg|US) is the normalized conditional mutual information between the generalization measure and the generalization gap conditioned on observing the hyperparameter set S. To evaluate how well we can predict a model’s generalization using a linear function of a given generalization measure and following Jiang et al. (2019), we additionally evaluate the generalization measures’ predictiveness in terms of their adjusted R2, i.e. the proportion of the variance of the generalization gap g(θ) across hyperparameters θ ∈ Θ that can be explained by the generalization measure µ(θ).
sections.heading: 5.4 RESULTS
sections.heading: 5.4.1 PERFORMANCE OF PRUNABILITY ON EXTENDED DEMOGEN DATA SET
sections.text: Table 1 holds a summary of our experimental results on the extended DEMOGEN data set. We find that prunability is highly informative of generalization across all of our evaluation metrics. In particular, it outperforms random perturbation robustness, the training loss itself and the Frobenius norm measures in terms of Kendall’s rank correlation coefficient.
  We find that while prunability based on magnitude pruning outperforms prunability based on random pruning, the difference in performance is relatively small.
  We find that the Normalized Margins baseline clearly outperforms prunability while the Negative Sum of Train Losses and the Best Margin Variable seem similarly informative of generalization as prunability. Note that and the margin-based measures achieve much higher conditional mutual information scores than the other baselines, providing further evidence for the causal connection between wide margins and good generalization performance. The conditional mutual information between prunability and generalization is relatively low, suggesting that it seems somewhat less likely that there is a direct causal connection between a model’s prunability and its generalization performance.
sections.heading: Generalization Measure Kendall’s τ Adjusted R2 Cond. Mutual Information
sections.text: In Table 2, we compare the granulated and regular Kendall’s coefficients of some additional baselines. The results reconfirm the weak performance of norm and parameter count-based complexity measures both for pruned and unpruned networks. While this a well known issue, we point out that this is also problematic for recently proposed generalization measures based on the size of the compressed network such as Zhou et al. (2019). We also note that the Frobenius norm measure is strongly negatively correlated with generalization rather than positively correlated as one would expect based on Jiang et al. (2020). It seems that this result is largely due to a strong negative correlation for models with different dropout rates and relatively weak correlation coefficients along other hyperparameter axes.
sections.heading: 5.4.2 DOUBLE DESCENT
sections.text: In addition to our experiments on the DEMOGEN data set, we also evaluate prunability on a set of models that exhibit a test loss double descent (Nakkiran et al., 2020). This phenomenon is particularly interesting for the study of generalization measures, since many measures that aim to capture a model’s complexity grow monotonically as we increase a network’s width and thus do not display a double descent. We are thus including this experiment to evaluate whether prunability also succumbs to this phenomenon. We use the experimental setup proposed by Maddox et al. (2020), and compare our new measure to their curvature-based generalization measure which also aims to capture double descent. Note that up to now we studied the generalization gap in terms of the 0− 1 loss. In this section, however, we focus on another aspect of generalization and study the relation between prunability and models’ cross-entropy test loss.
  Maddox et al. (2020) introduce a generalization measure called Effective Dimensionality which is defined as: Neff(H, z) = ∑k i=1 λi λi+z
  where λi are the eigenvalues of the Hessian of the training loss H ∈ Rk×k, and z > 0 is a regularization constant. Intuitively, the Effective Dimensionality measures the flatness of the local minimum of a network in terms of the number of eigenvalues of the Hessian of the training loss that are ”large”. To get a measure on the same scale as our
  new generalization measure, we use a normalized version of Neff : µeffective dimensionality = Neffk . Additionally, we also evaluate a number of the strongest baselines from Section 5.4.1 in the double descent setting. We refer to appendix A.4 for further details on the experimental setup.
  We find that prunability does indeed display a double descent and is more strongly rank correlated with the test loss than the baseline measures (Kendall’s τ of 0.3613, p < 0.0005).
  In Appendix B.1 we study an additional double descent setting and obtain results that are consistent with the results presented in this section.
sections.heading: 5.4.3 PRUNING AND FLATNESS-BASED MEASURES
sections.text: We now investigate whether a network’s robustness to pruning can be explained by other established generalization measures, or whether it is measuring something entirely distinct from previous notions of model simplicity. To better understand the relation between prunability and the other generalization measures we perform the conditional independence test described in section A.1.3 between them. Recall that, up to now, we used this test to study the relation between the generalization measure and the generalization gap and that the higher the κ between two variables, the likelier it is that they neighbors in the causal DAG. See Table 3 for a summary of the results.
  First, we observe that the conditional mutual information between prunability and random perturbation robustness is the highest across the baselines we are evaluating. Because pruning is a special case of perturbation, some connection between the two methods is expected. However, prunability is clearly measuring something subtly different from flatness of the loss surface, as it outperforms random perturbation robustness in our evaluations. Thus, we investigate whether this distinction may arise from the differential effects of pruning and random perturbations in function space.
  To evaluate this, we directly compare the impact of both pruning and random perturbations on some of the models in our double descent experimental setting by performing pruning and random perturbations of the same magnitude and computing their respective impact on the loss. We find that pruning has a larger negative impact on a model’s training loss than a random perturbation of the same magnitude (see Figure 2). Pruning can lead to an improvement of the test loss which we do not observe for random perturbations; we conjecture that this relationship may be responsible for the difference between the two methods, though disentangling this phenomenon is left for future work. We also note that prunability achieves much higher Kendall’s τ , AdjustedR2 and Conditional Mutual Information than random perturbation robustness.
  In conclusion, pruning affects models differently from randomly perturbing their weights. Because pruning can in certain settings improve test performance (and hence seems to be more aligned with network simplicity) we suggest that this difference leads to the stronger performance of prunability as compared to random perturbation robustness. We compare the impact of pruning and random perturbations on a model’s training and test loss for an additional architecture in Appendix B.2, and find that the results are consistent with the results presented in this section.
sections.heading: Pruning versus Random Weight Perturbations
sections.heading: 6 CONCLUSION
sections.text: In this paper, we show that a network’s prunability, the smallest fraction of parameters we can keep while pruning without hurting the model’s training loss, is highly informative of the network’s generalization performance. We also show that prunability seems to capture something distinct from previously suggested measures based on robustness to random perturbations or the curvature of the loss landscape. We see a number of promising directions for further research. For instance, one could study whether the direction of pruning lies in the span of the main eigenvectors of the Hessian studied by Maddox et al. (2020). Given the strong empirical performance of prunability – and given that the theory behind its success is not yet well understood – this measure of model complexity may be of use to the construction of future generalization bounds. We include an attempt of this in Appendix C, but more thorough investigation will likely prove illuminating.
sections.heading: A EXPERIMENTAL SETUP
sections.heading: A.1 EVALUATION METRICS
sections.text: In this section we describe the metrics we use to evaluate the generalization measures. To study our generalization measures comprehensively, we consider the generalization measures’ Kendall’s Rank correlation with the generalization gap, how predictive they are in terms of Adjusted R2 and Jiang et al. (2020).’s conditional independence test in an attempt to understand the causal relations between the complexity measures and generalization.
sections.heading: A.1.1 KENDALL’S RANK CORRELATION COEFFICIENT
sections.text: This criterion evaluates the quality of a given generalization in terms of how well it ranks models with different generalization gaps. Intuitively, a generalization measure ranks two models that were trained with hyperparameters θ1 and θ2 correctly iff µ(θ1) > µ(θ2)→ g(θ1) > g(θ2) is satisified. Kendall’s rank coefficient then measures for what fraction of models in our data set this holds. Kendall T takes values between 1 (perfect agreement) and -1 (rankings are exactly reversed) where a Kendall’s t of 0 means that the complexity measure and generalization gap are independent.
  Formally, we consider the set of tuples of generalization measures and generalization gaps:
  T := ∪θ∈Θ{(µ(θ), g(θ))}
  And Kendall’s rank correlation coefficient is defined as:
  τ(T ) := 1 |T |(|T | − 1) ∑ (µ1,g1)∈T ∑ (µ2,g2)∈T \(µ1,g1) sign(µ1 − µ2)sign(g1 − g2)
sections.heading: A.1.2 GRANULATED KENDALL’S RANK COEFFICIENT
sections.text: While Kendall’s rank correlation coefficient is generally a useful metric, it does not adequately reflect whether a generalization measure’s performance is consistent across all hyperparameter axes. To account for this Jiang et al. (2020) propose the granulated Kendall’s rank-correlation coefficient which is essentially the average of Kendall’s rank coefficients obtained by only varying one hyperparameter dimension at a time.
  Formally, we have:
  mi := |Θ1 × · · · ×Θi−1 ×Θi+1 × ...Θn|
  and the Kendall’s rank correlation coefficient is defined as:
  ψi := 1
  mi ∑ θ1∈Θ1 · · · ∑ θi−1∈Θi−1 ∑ θi+1∈Θi+1 · · · ∑ θn∈Θn τ(∪θi∈Θi(µ(θ), g(θ)))
  Averaging all of these values, we obtain the granulated Kendall’s rank correlation coefficient:
  Ψ := 1
  n n∑ i=1 ψi
  Given these definitions, we obtain the following standard errors for the granulated Kendall’s coefficients in our experiments. For the width, dropout rate, weight decay and depth measurements we hsve, sτ = 0.00056 and for the data augmentation measurements we have sτ0.000484. Lastly, for ψ, we have sτ = 0.00011
sections.heading: A.1.3 CONDITIONAL MUTUAL INFORMATION
sections.text: To go beyond measures of correlation, Jiang et al. (2020) use a conditional independence test inspired by Verma & Pearl (1991). The main goal here is to understand whether there exists an edge in a causal graph between a given generalization measure µ and the generalization gap g. This is achieved by estimating the mutual information between the generalization measure and the generalization gap conditioned on different hyperparameters being observed. The higher this metric is, the more likely it is that there is indeed an edge in the causal DAG between the generalization gap and the generalization measure.
  Formally, we have that for any function φ : Θ → R, let Vφ : Θ1 × Θ2 → {+1,−1} be as Vφ(θ1, θ2) := sign(φ(θ1)− φ(θ2)). Let US be a random variable that corresponds to the values of the hyperparameters in S. The conditional mutual information can then be computed as:
  I(Vµ, Vg|US) = ∑ US p(US) ∑ Vµ∈{±1} ∑ Vg∈{±1} p(Vµ, Vg|US) log ( p(Vµ, Vg|US) p(Vµ|US)p(Vg|US) )
  By dividing the term above by the conditional entropy of generalization: H(Vg|US) = − ∑ US p(US) ∑ Vµ∈{±1} p(Vg|US) log(p(Vg|US))
  we obtain the normalized criterion:
  Î(Vµ, Vg|US) = I(Vµ, Vg|US) H(Vg|US)
  In the original Inductive Causation algorithm (Verma & Pearl, 1991), an edge in the causal graph is kept if there is no subset of hyperparameters S such that the two two nodes are independent, that is Î(Vµ, Vg|US) = 0. Due to computational limitations, and following Jiang et al. (2020), we only consider subsets of hyperparameters of size at most 2:
  K(µ) = min USs.t.|S|≤2 Î(Vµ, Vg|US)
  Intuitively, the higher K(µ), the more likely it is that there exists an edge between µ and generalization in the causal graph.
sections.heading: A.1.4 ADJUSTED R2
sections.text: Lastly, we consider a metric to evaluate how predictive a generalization measure is of generalization based on a simple linear regression: ĝ = aTµ+ b. We find a and b by minimizing the mean squared error: a∗, b∗ = arg mina,b ∑ i(a Tφ(µi) + b− gi)2
  On a test set of models we then compute the coefficient of determination R2 which measures what fraction of the variance of the data ca be explained by the linear model:
  R2 = 1− ∑n j=1(ĝj − gj)2∑n
  j=1(gj − 1 n ∑n j=1 gj) 2
  We compute the R2 using a 10-fold cross-validation.
  Alternatively, one can use the adjusted R2 score (R̄2) which measures how well a linear model fits a training set and which accounts for the number of variables used in the regression:
  R̄2 = 1− (1−R2) n− 1 n− dim(µ)− 1
sections.heading: A.2 GENERALIZATION MEASURES
sections.text: Additional generalization measures we consider are:
  • µbest margins variable: To account for the fact that the normalized margins variable is based on a large number of input variables, we select the single independent variable that has the largest standardized coefficient in the Normalized Margins model and directly use it as a generalization measure.
  • µtrain loss: L̂(fw), the cross entropy loss of the model fw on the training data set after training is finished.
  • µparameter count: The number of parameters ω of the model. • µsum two norms:
  µsum of two norms(fw) = ( d∑ i=1 ||Wi||22)
  • µsum two norms pruned: Essentially, the same as µsum two norms, but applied to fw that we obtain when we compute µprunability . Formally, we have:
  µsum two norms pruned(fw) = µsum two norms(min α φ(fw, α))
  s.t. L̂(φ(fw, α),Strain) ≤ (1 + β)× L̂(fw,Strain)
  • Analogously, µpruned parameter count is the parameter count ω of the pruned model we obtain while computing µprunability
sections.heading: A.3 DEMOGEN
sections.text: We extend the DEMOGEN data set in Jiang et al. (2019) with regards to two aspects. First, we follow Jiang et al. (2020) and only consider models that are trained using batch normalization. Second, Jiang et al. (2019) do not consider networks of different depths. We consider this to be a crucial hyperparameter and a extend the original DEMOGEN data set by training additional models with different numbers of NiN-blocks than the models in the original data set.
  We use the network architecture proposed by Jiang et al. (2019) in the DEMOGEN data set which is very similar to the architecture used in Jiang et al. (2020). The architecture is very similar to the Network in Network architecture in Lin et al. (2014) with the max pooling and dropout layer removed. We train the networks on CIFAR-10 (Krizhevsky et al., 2009). The architecture we use is thus:
  1. The input layer 2. 2, 3 or 4 NiN-blocks as described in Table 4. 3. A single convolution layer with kernel size 4x4 and stride 1.
  In this architecture we vary the following hyperparameters:
  1. Use channel sizes of 192, 288, and 384 2. Apply dropout after NiN-blocks with p = 0.0, 0.2, 0.5 3. Apply l2 regularization with λ = 0.0, 0.001, 0.005. 4. Train with and without data augumentation, that is random cropping, flipping and shifting.
  5. We consider two random initializations per hyperparameter configuration. 6. Models with 2, 3 or 4 NiN blocks as described above.
  In total we are thus working with a data set of 324 trained models. We train the models with SGD with momentum (α = 0.9) with a batch size of 128 and an initial learning rate of 0.01. The networks are trained for 380 epochs with a learning rate decay of 10x every 100 epochs. We base our implementation on the original code base: https://github.com/google-research/ google-research/tree/master/demogen.
sections.heading: A.4 DOUBLE DESCENT
sections.text: For our double descent experiments we use the models and baselines used by Maddox et al. (2020) which are available on: https://github.com/g-benton/hessian-eff-dim. In particular, the CNN we use is the architecture used by Nakkiran et al. (2020) which is availbable on: https://gitlab.com/harvard-machine-learning/double-descent/-/ blob/master/models/mcnn.py Likewise, the ResNet18 architecture can be found here: https://github.com/g-benton/hessian-eff-dim/blob/temp/hess/nets/ resnet.py.
  The other baselines correspond to the ones from the DEMOGEN experiments described in Appendix A.3. The margins baseline used in this setting is based on the one used in Jiang et al. (2019): a linear model is trained to predict the test loss based on the statistics of the margin distribution at the output layer of a given model.
  We train a set of 32 networks of widths 2, 4, 6, ..., 64 on CIFAR100 (Krizhevsky et al., 2009) using SGD with a learning rate of 10−2, momentum of 0.9, weight decay of 10−4 for 200 epochs with a batch size of 128. The learning rate decays to 10−4 on a piecewise constant learning rate schedule (Izmailov et al., 2018), beginning to decay on epoch 100. Random cropping and flipping are used for data augmentation which is turned off for the computation of eigenvalues. Our plots contain the results across 5 random seeds. The shaded areas indicate the standard error. All experiments were run on Nvidia GeForce RTX 2080 Ti GPUs.
sections.heading: A.5 RANDOM PERTURBATIONS VERSUS PRUNING
sections.text: We use the ResNet18 implementation from https://gitlab.com/ harvard-machine-learning/double-descent/-/blob/master/models/ resnet18k.py and use the same hyperparameters for training as in the double descent settings above. For every magnitude pruned model we also compute the randomly perturbed model in which we perturb the same set of weights by a random vector of the same size.
sections.heading: A.6 ALGORITHMS
sections.heading: A.6.1 ALGORITHM TO DETERMINE PRUNABILITY
sections.text: Algorithm 1: Maximal Lossless Magnitude Pruning Input: Original model fw, train data, tolerance in change of loss β, step size for search step size Result: Pruned Model fwpruned
  1 original train loss = loss(h, train data); 2 fraction of weights to remove = 0.98; 3 wpruned = prune(w, fraction of weights to remove); 4 while loss(fwpruned , train data) > (1 + β)× original train loss do 5 wpruned = prune(w, fraction of weights to remove); 6 fraction of weights to remove -= step size; 7 end 8 return fwpruned
  Where prune(w, sparisty) is an algorithm that sets sparsity % of w to 0 and then returns the new vector. In our experiments we evaluate both magnitude pruning, where the parameters with the
  smallest absolute magnitude are set to 0, and random pruning, where random parameters are set to 0.
  Empirically, we find that the particular choice for the tolerance β does not make a big difference with regards to predictiveness of prunability. In our experiments we use β = 0.1.
  Note that to determine a model’s prunability we use the differentiable cross-entropy loss rather than the 1-0 loss used elsewhere in the paper.
sections.heading: B ADDITIONAL EXPERIMENTS
sections.heading: B.1 DOUBLE DESCENT
sections.text: In Section 5.4.2, we conduct an experiment that suggests that prunability captures the particularly challenging double descent phenomenon. In this section, we provide an extended version of Figure 1, containing all baselines (see Figure 3a). Furthermore, we extend that experiment to an additional architecture, ResNet18 trained on CIFAR100 (see Figure 4). The results of this additional experiment are consistent with the one in the main part of the body: prunability is strongly Kendall rank correlated with the test loss and the test error. In this additional setting, however, the margins-based method outperforms prunability. We describe the details of the architecture and training of this experiment in Appendix A.5.
sections.heading: B.2 PRUNING VERSUS RANDOM PERTURBATIONS
sections.text: Likewise, we study the impact of pruning and random perturbations on the training and test loss in an additional experimental setting. As in the experiment in Section 5.4.3, we find that pruning and randomly perturbing weights (by a vector of the same magnitude), have very different impacts on the training and test loss (see Figure 5). In this experiment, we study the CNN used in our double descent experiment of Section 5.4.2. In particular, we find that pruning generally has a larger negative impact on the training loss than a random weight perturbation of the same magnitude. With regards to the test loss, we find that pruning has a smaller negative impact than random perturbations for moderate amounts of pruning, and a larger negative impact for larger amounts of pruning/perturbation. This matches the behavior of the first experiment. In this additional experiment we do not observe an improvement of the test loss through pruning which was not expected.
sections.heading: Pruning versus Random Weight Perturbations
sections.heading: C PAC-BAYES BOUND
sections.text: We use the following, simplified formulation of McAllester (1999)’s dropout bounds which is also used in Jiang et al. (2020):
  Theorem 1 For any δ > 0, distribution D, prior P, with probability 1 − δ over the training set, for any posterior Q the following bound holds:
  Ev∼Q[L(fv)] ≤ Ev∼Q[L̂(fv)] +
  √ KL(Q||P ) + log(mδ )
  2(m− 1)
  For the reader’s convenience we briefly reproduce the derivation of the dropout bound in McAllester (2013).
  To draw a sample ω from Q means first drawing a sparsity pattern S ∼ Sα, where α is the dropout probability, and a noise vector ∼ N (0, 1)d. Then, we construct ω as s ◦ (w + ), ◦ being the Hadamard product: (s◦w)i := siwi. Similarly, a sample from P is s◦ . We denote by Sα the distribution on the d-cube B of sparsity patterns. We then have Ev∼Q[fv] = Es∼Sα, ∼N (0,1)d [fs◦(w+ )]. We derive KL(Q||P ) as follows:
  KL(Q||P ) = Es∼Sα, ∼N (0,1)d [ ln Sα(s)e
  − 12 ||s◦ || 2
  Sα(s)e− 1 2 ||s◦(w+ )||2
  ]
  = Es∼Sα [ 1
  2 ||s ◦w||2]
  = 1− α
  2 ||w||2
  We can directly obtain a bound for prunability from this, by searching for the largest α, s.t.Ev∼Q[L̂(fv)] < L̂(fw) × (1 + β), where w are the weights learned during training of the network. We have to account for the fact that we search for α in our bound. We make use of the fact that we’re searching over a fixed number c of αs and use union bound in the bound which will change the log term in the bound to log( cmδ ). Gives us the following bound:
  Ev∼Q[L(fv)] ≤ Ev∼Q[L̂(fv)] +
  √ 1−α
  2 ||w|| 2 2 + log( m δ ) + 5
  2(m− 1)