Source-linked AI summary

Traces of Class/Cross-Class Structure Pervade Deep Learning Spectra

Vardan Papyan

arXiv:2008.11865v1cs.LGcs.CVstat.ML

TL;DR

Empirical deepnet spectra show diverse bulks, outliers, and mini-bulks, while links between theoretical analyses and observed features remain incomplete. This paper attributes these structures to class/cross-class organization and reports relationships to misclassification and layer-wise class separation and orthogonality.

  • Problem

    Existing deepnet spectral measurements show varied features, but connections between theoretical analyses and observed spectra remain incomplete.

    Source: §1.2 · p. 3
  • Method

    The paper analyzes class and cross-class structure in gradients and spectral matrices, using knockouts to attribute spectral features to component matrices.

    Source: §1.8 · p. 5, §6 · p. 14, §6.1 · p. 17
  • Results

    Knockout analyses attribute FIM outliers, mini-bulks, and the main bulk to class means, cross-class covariance, and within-cross-class covariance, while outlier ratios relate to misclassification and layer-wise separability.

    Source: §1.13 · p. 8, §6.1 · p. 17, §8.2 · p. 32
  • Takeaways & Limitations

    Class/cross-class structure provides an account of deepnet spectral features and is associated with layer-wise separation and orthogonalization of class-distinctive information.

    Source: §1.13 · p. 8, §10 · p. 34

    When classes outnumber feature dimensions, the spectrum does not show a bulk-and-outliers structure; class means may also be present without visible outliers.

    Source: §9.2 · pp. 32–33

Abstract

from arXiv · show

Numerous researchers recently applied empirical spectral analysis to the study of modern deep learning classifiers. We identify and discuss an important formal class/cross-class structure and show how it lies at the origin of the many visually striking features observed in deepnet spectra, some of which were reported in recent articles, others are unveiled here for the first time. These include spectral outliers, "spikes", and small but distinct continuous distributions, "bumps", often seen beyond the edge of a "main bulk". The significance of the cross-class structure is illustrated in three ways: (i) we prove the ratio of outliers to bulk in the spectrum of the Fisher information matrix is predictive of misclassification, in the context of multinomial logistic regression; (ii) we demonstrate how, gradually with depth, a network is able to separate class-distinctive information from class variability, all while orthogonalizing the class-distinctive information; and (iii) we propose a correction to KFAC, a well-known second-order optimization algorithm for training deepnets.

1. Introduction

The introduction presents class/cross-class structure as a framework for explaining recurring deepnet spectral patterns through structured means and covariances, and identifies gaps in existing theory about their causes, ubiquity, and significance. It describes how this structure in layer-concatenated gradients induces outliers in FIM spectra inherited by Hessian spectra, with outlier-to-bulk ratios and dispersion linked to misclassification and layer-wise class separation and orthogonality.

1.1 Empirical measurements of deepnet spectra; 1.2 Initial theoretical studies

  • Prior measurements found bulk-and-outlier spectra in Hessians, FIMs, gradient covariances, weights, features, and backpropagated errors, while existing theories reproduced only some observed features.Earlier small-scale patterns were later observed in state-of-the-art deepnets, but connections between formal analyses and observed features remained incomplete.Source: §1.1 · pp. 1–2, §1.2 · p. 3

1.3 Why are many researchers measuring deepnet spectra?; 1.4 Open questions

  • The paper frames spectral analysis as a route to understanding deepnet behavior and asks what causes the patterns, why they recur across networks and objects, and whether they can guide improvements.These questions concern attribution, ubiquity, and the significance and practical use of spectral features.Source: §1.3 · p. 3, §1.4 · p. 3

1.5 Insights from three-level hierarchical structure

  • Building on Papyan (2019), the paper extends a three-level hierarchy previously connected to gradient spectra to explain spectra of all fundamental deep-learning quantities.The quantities include features, backpropagated errors, gradients, weights, the Fisher Information Matrix, and Hessian.Source: §1.5 · p. 3, §1.12 · p. 8

1.6 A pattern covering all cases

  • The recurring spectrum comprises a main bulk, C(C −1) outliers that may appear as spikes or a mini-bulk, C −1 larger outliers, and one still larger isolated outlier.The authors stress that this is a schematic pattern and its exact appearance varies by setting.Source: §1.6 · pp. 3–4

1.9 Global mean, C class means and C2 cross-class means; 1.10 Second moment matrices and covariances in the class/cross-class structure

  • The framework defines global, class, and cross-class means, then separates second moments into global-mean, between-class, between-cross-class, and within-cross-class components.These quantities provide the matrix components used for the spectral attributions.Source: §1.9 · p. 6, §1.10 · p. 7

1.7 Class block structure; 1.8 Cross-class block structure

  • Cross-entropy induces a three-index structure of example replication, observed class, and counterfactual cross-class, inherited by features, backpropagated errors, and extended gradients.Ordinary gradients have class structure; extended gradients use a would-be class label and exhibit cross-class structure, and the FIM is a weighted second moment of extended gradients.Source: §1.8 · p. 5, §1.11 · p. 7

1.11 Cause attribution

  • The global-mean second moment, between-class covariance, between-cross-class covariance, and within-cross-class covariance cause, respectively, the top outlier, C −1 leading outliers, C(C −1) mini-bulk, and main bulk.The paper says it tests these attributions by knocking out each matrix and checking whether the corresponding spectral feature disappears.Source: §1.11 · p. 8

1.12 Ubiquity

  • Across layers and concatenated layers, feature and backpropagated-error means approximate gradient means through Kronecker products within layers and Khatri-Rao products across layers.For fixed layer l, the feature class mean paired with a class or cross-class backpropagated-error mean approximates the corresponding gradient mean.Source: §1.12 · p. 8
  • Class means and C^2 cross-class means in layer-concatenated gradients induce C and C^2 outliers in FIM spectra.Source: §1.12 · p. 8
  • FIM outliers also induce Hessian spectral outliers because the Hessian includes the FIM as one of its two summed components.Source: §1.12 · p. 8

1.13 Significance

  • In multinomial logistic regression, the ratio of outliers to bulk predicts misclassification.Source: §1.13 · p. 8
  • In deepnets, feature class means gradually separate from the bulk and become orthogonal with depth, linking outlier ratios to layer-wise separability and outlier standard deviation to class orthogonality.Source: §1.13 · p. 8

2. Problem setting

The section frames balanced C-class classification as predicting labels for future examples and defines the train Hessian as the average training-loss second derivative. It also previews a table summarizing spectral attributions from knockout experiments.

2. Problem setting

  • The task is to predict labels for future data from n training examples in each of C classes, using a network trained by SGD on empirical cross-entropy.The network ends with a linear classifier that outputs C predictions.Source: §2 · p. 9
  • The train Hessian is the second derivative of the loss with respect to model parameters, averaged over training data.Source: §2 · p. 9
  • Table 1 summarizes knockout-based spectral attributions across quantities, their second moments, and related figures.Source: Table 1 · p. 10

3. Spectral attribution via knockouts

The section introduces subtraction and projection knockouts as linear-algebra procedures for attributing visible spectral features in one matrix to another. Attribution is based on whether features disappear after the relevant matrix is knocked out.

3. Spectral attribution via knockouts

  • Spectral attribution uses subtraction or projection knockouts to test whether features in one matrix disappear when another matrix is removed.Source: §3 · p. 10
  • Subtraction knockout removes a matrix B from A to eliminate selected spectral features, producing A ⊖B.Source: §3 · p. 10
  • Projection knockout removes B's column space from A, using (I −BB†)A(I −BB†) when the matrices are square.For non-square matrices, the text gives a corresponding definition using the singular vectors of B.Source: §3 · p. 10

4. Hessian spectrum

The section extends earlier Hessian-spectrum observations to modern networks and provides software for estimating their spectra. For VGG11, it reports a bulk-and-outliers pattern, zero concentration, negative train-Hessian eigenvalues, and different train/test magnitudes.

4.1 Spectrum of Hessian has structure

  • Modern VGG11 Hessian spectra show a bulk and approximately C outliers, with many eigenvalues at zero given the parameter-to-example scale.VGG11 has 28 million parameters, compared with 50 thousand training and 10 thousand testing examples.Source: Figure 3 · p. 11, §4.1 · pp. 11–12

4. Hessian spectrum

  • The section confirms prior reports of a Hessian spectrum with a bulk-and-outliers structure and approximately C outliers, now at the full scale of modern state-of-the-art networks trained on real natural images.Earlier experiments included two-hidden-layer networks with 30 hidden units each trained on synthetic data sampled from a Gaussian Mixture Model, and one-hidden-layer networks with 70 hidden units trained on MNIST.Source: §4 · pp. 10–11
  • Released software approximates modern deepnet Hessian spectra using state-of-the-art numerical linear algebra tools.Source: §4 · p. 11

4.1 Spectrum of Hessian has structure

  • Train-Hessian spectra include negative eigenvalues despite hundreds of training epochs and learning-rate annealing, while train and test Hessian magnitudes differ.Source: §4.1 · p. 12

5. Decomposing Hessian into two components: Hess = G + E

The Hessian is decomposed into the Fisher Information Matrix G and a residual E. Knockout comparisons attribute its outliers to G and its bulk largely to E.

5. Decomposing Hessian into two components: Hess = G + E

  • The generalized Gauss-Newton decomposition writes the Hessian as the sum of G and E, with G the Fisher Information Matrix.Source: §5 · p. 12

5.1 Outliers attributable to G, bulk attributable to E

  • The Hessian, G-only, and E-only spectra each resemble variations of the paper’s bulk-and-outliers pattern.The spectra were approximated with LanczosApproxSpec, with LowRankDeflation applied to the Hessian and G to approximate the top-C subspace.Source: §5.1 · p. 12
  • Knocking out E shrinks the Hessian bulk, while knocking out G eliminates its outliers.The outliers in G are attributed to C high-energy gradient class means, explaining the observed C Hessian outliers.Source: §5.1 · p. 12

6. Cross-class structure in G

The paper decomposes G using class- and cross-class-specific gradients, then attributes distinct spectral features to components of that decomposition. Their separation varies with training epochs and sample size.

6. Cross-class structure in G

  • G is a weighted second moment of gradients defined for each example’s actual class and hypothetical cross-class assignments.For c = c′, the gradient is the usual training-example gradient; for c ≠ c′, it is the gradient as if the example belonged to c′.Source: §6 · p. 14

6.1 C outliers attributable to Gclass, C2 outliers attributable to Gcross and bulk attributable to Gwithin

  • In log(G), three separated bulks appear; knockouts attribute the C right outliers to Gclass, the left mini-bulk to Gcross, and the main bulk to Gwithin.Knocking out Gc=c′ has no clear spectral effect, consistent with gradient means being approximately zero at SGD convergence.Source: §6.1 · pp. 15, 17

6.2 Dynamics of bulk and two groups of outliers with training and sample size

  • Across epochs and sample sizes, G’s C and C2 outliers align with Gclass and Gcross eigenvalues, while its main bulk aligns with Gwithin averages.Source: §6.2 · p. 17
  • At fixed sample size, increasing epochs separates the Gcross and Gwithin bulks; at fixed epoch, increasing sample size merges them.Changing epochs or sample size does not significantly alter the distance between Gclass and Gwithin.Source: §6.2 · p. 17

7. Multilayer perceptron

This section examines class-related spectral structure in the MLP across layers, including outliers, within-class bulk, class-mean energy and orthogonality, and backpropagated class information. It also compares CFAC and KFAC spectra and class-mean pairings, relating class structure to outliers in deep-layer weight spectra.

7.3 Kronecker structure in G

  • The MLP analysis relates layer features, cross-class backpropagated errors, gradients, and G through Kronecker structure and decomposes feature second moments into between- and within-class terms.The forward pass applies layer weights and ReLU to features; the backward pass yields weight gradients.Source: §7.1 · p. 17, §7.2 · p. 18, §7.3 · p. 19

7.5 C outliers attributable to Hclass and bulk attributable to Hwithin

  • With increasing depth, the feature spectrum’s C outliers emerge from the bulk and are attributable to between-class structure, while the bulk is attributable to within-class covariance.The largest outlier is attributable to the global mean.Source: §7.5 · pp. 19–20, Figure 7 · p. 20

7.6 Gradual separation and whitening of feature class-means

  • With depth, class means gain energy and their C eigenvalues separate from the bulk, while their centered eigenvalues become more similar, indicating increasingly orthogonal class means.Centering by the global mean removes the first outlier.Source: §7.6 · p. 21, Figure 8 · p. 22

7.7 Cross-class block structure in backpropagated errors

  • The backpropagated-error second-moment decomposition groups errors by class and cross-class structure, separating between-class and between-cross-class components from within-cross-class covariance.The decomposition parallels the gradient decomposition.Source: §7.7 · pp. 21–22

7.8 C outliers attributable to ∆class, C2 outliers attributable to ∆cross and bulk attributable to ∆within

  • With depth, C outliers in the backpropagated-error spectrum are attributable to between-class structure, C^2 outliers to between-cross-class structure, and the bulk to within-class structure.Both sets of outliers emerge from the bulk with increasing depth.Source: Figure 9 · p. 23, §7.8 · p. 24

7.9 Gradual separation and whitening of backpropagated error class-means

  • With depth, backpropagated-error class means gain energy and separate from the bulk, but class information is gradually lost toward shallower layers and their means become less orthogonal.By the last layer, the class-mean eigenvalues are of fairly similar magnitude.Source: §7.9 · pp. 24–25, Figure 10 · p. 25

7.10 Class-distinct factorized approximate curvature

  • On MNIST’s last MLP layer, CFAC’s C and C^2 outliers align with those of G, whereas KFAC’s outliers do not.KFAC is a proxy for G; full Gauss–Newton is problematic for deepnets because G is too large to store in memory.Source: Figure 11 · p. 26, §7.9 · p. 26, §7.10 · p. 26

7.11 CFAC is a better proxy for G than KFAC

  • CFAC spectra align better with G than KFAC at deeper layers, while shallower-layer improvement depends on the dataset.Alignment is nearly perfect for CIFAR10 layers seven and eight, but some shallower cases show little improvement.Source: Figure 12 · p. 27, §7.10 · p. 27, §7.11 · p. 28

7.10 Class-distinct factorized approximate curvature

  • KFAC’s mini-bulks and outliers are drastically misaligned from G, motivating CFAC as an alternative approximation.The proposed CFAC spectra align more closely with G, particularly at deeper layers.Source: §7.10 · p. 28

7.12 Relating the class/cross-class structure in the features, backpropagated errors and G

  • KFAC combines each class feature mean with error means from every class, whereas CFAC pairs it only with its matching class error mean.Source: §7.12 · p. 28

7.13 Relating the class structure in features, backpropagated errors and weights

  • Knockouts attribute the top C weight-spectrum outliers to between-class weights; the bulk remains unaffected, and outliers separate from it in deeper layers.The outliers are eliminated by the knockout, while the bulk stays along the identity line.Source: Figure 13 · p. 29, §7.13 · pp. 29–30

8. Multinomial logistic regression

The section analyzes the Fisher information matrix (FIM) for multinomial logistic regression, then derives its expected spectrum under a generative model. That spectrum has outliers and multiple bulk components whose ratios are predictive of misclassification.

8. Multinomial logistic regression

  • The section introduces multinomial logistic regression as a simpler setting for studying FIM spectral components and their relation to misclassification.The classifier's predicted probability vectors and Kronecker-product identities are used to express the FIM.Source: §8 · p. 30, §8.1 · p. 30

8.2 Spectrum of FIM under generative model setting

  • The canonical model uses class-indexed examples formed from a class-specific signal and normally distributed sample deviations, with a scalar signal-to-noise ratio.It also assumes symmetric predicted probabilities across samples and nonmatching cross-classes.Source: §8.2 · p. 31
  • Under the canonical classification model with symmetric probabilities, the expected FIM takes a simple form and is a perturbation of a rank-C^2 matrix.The expected FIM consists of a block-diagonal term and an identity-Kronecker-average term.Source: §8.2 · p. 31
  • The expected FIM spectrum has C outliers, a mini-bulk of approximately C^2 eigenvalues, and a main bulk; their ratios are predictive of misclassification.Increasing signal-to-noise ratio separates the outliers from both bulks and the mini-bulk from the main bulk.Source: §8.2 · p. 32

9. Overview of literature in light of this paper

The paper revisits spectral-analysis literature by arguing that layer-wise quantities and class/cross-class means reveal structure that eigenvalues alone do not explain. It connects that view to batch normalization, generalization analyses, catastrophic forgetting, and CFAC.

9.1 Start looking at layer-wise features and backpropagated errors, stop focusing on the Hessian

  • The Hessian blends layer-wise feature and backpropagated-error structure with an additional FIM-related perturbation, motivating study of layer-wise features and errors instead.The paper argues that the Hessian is a particularly complicated object because it combines information across layers.Source: §9.1 · p. 32

9.2 Start looking at class/cross-class means and covariances, stop looking at eigenvalues

  • Class and cross-class means explain structure that spectra reflect but eigenanalysis alone does not reveal.When class means are not large, outliers may be absent even though the means remain present; the paper says these means and within-cross-class covariances remain valid quantities to study.Source: §9.2 · pp. 32–33

9.3 The effect of batch normalization on the bulk-and-outliers structure

  • Batch normalization subtracts the feature global mean, reducing class-mean magnitude and pushing the Hessian's top-C outliers back into the main bulk.The paper notes that this does not completely remove the outliers or lessen their significance for classification performance.Source: §9.3 · p. 33

9.4 Flatness conjecture

  • The paper argues that flatness measures based on Hessian trace or spectral norm miss outlier separation, which it says should correlate with generalization.It contrasts these measures with separation of outliers from the bulk.Source: §9.4 · p. 33

9.5 Predicting generalization through information matrices

  • For the information-criterion measurements discussed, traces are dominated by bulk eigenvalues and therefore neglect separation of class means from noise.In multinomial logistic regression, the paper proves that bulk eigenvalues scale with misclassification.Source: §9.5 · pp. 33–34

9.6 Catastrophic forgetting

  • The paper connects deeper representations' greater discriminativeness with the possibility that catastrophic forgetting results from suppression of class means.This complements prior empirical findings that forgetting tends to occur primarily in deeper representations.Source: §9.6 · p. 34

9.7 KFAC ineffient for large batch training

  • Although this paper does not explain KFAC's inefficiency for large-batch training, it proposes CFAC as a promising alternative.Source: §9.7 · p. 34

10. Conclusions

The conclusions describe deepnet spectra as containing C outliers, C² secondary outliers, and a main bulk, and identify their organized structure as significant. Appendix A decomposes G in successive stages and combines the resulting expressions.

10. Conclusions

  • Deepnet spectra contain C outliers, C² secondary outliers, and a main bulk; the paper presents this organized structure as significant for understanding deepnet performance.The conclusions say the cause of these spectral observations had been an open question and that the paper identifies a specific structure.Source: §10 · p. 34

Appendix A. Cross-class structure in G

  • Appendix A introduces expressions for G and substitutes them into its definition to derive the cross-class structure.The passage excerpts mark the definition, substitution, and resulting expression but do not state the full derivation.Source: Appendix A · p. 35

A.1 First decomposition

  • The first decomposition further separates only the first summation in the preceding expression.Source: §A.1 · p. 36

A.2 Second decomposition

  • The second decomposition is introduced as a further stage in the decomposition of G.Source: §A.2 · p. 36

A.3 Combination

  • The final expression is obtained by combining the expressions from the preceding subsections.Source: §A.3 · p. 37

Appendix B. Multinomial logistic regression

This appendix gives the expected Fisher information matrix spectrum for multinomial logistic regression under symmetric probabilities and CCM, then describes Lanczos-based tools for approximating large-matrix spectra. It discusses their computational costs and practical adjustments.

Appendix B. Multinomial logistic regression

  • Under symmetric probabilities and CCM, the expected FIM is expressed using class-specific blocks and a shared average component, and the theorem gives its spectrum.The block-diagonal operator places each U_c in its class block; the theorem states the spectrum of the expected FIM.Source: Appendix B · pp. 37, 41

Appendix C. Tools from numerical linear algebra

  • The authors implement Lanczos and KPM for spectral-density approximation, but focus on Lanczos because KPM was temperamental and problematic in their experience.Source: Appendix C · p. 45

C.1 SlowLanczos

  • Lanczos reduces a symmetric matrix to tridiagonal form and computes the spectrum of that smaller matrix.The passage states that computing the tridiagonal matrix's spectrum requires O(p^2) operations.Source: §C.1 · p. 45

C.2 Complexity of SlowLanczos

  • SlowLanczos has O(Np^2 + p^3) runtime and O(p^2) memory, making it impractical when p is on the order of millions.Source: §C.2 · p. 46

C.3 Spectral density estimation via FastLanczos

  • FastLanczos removes reorthogonalization and uses M ≪ p iterations to approximate the spectral density from the tridiagonal matrix’s eigenvalues.The approximation can average results from several initial vectors; omitting reorthogonalization reduces memory and removes the O(p^3) runtime term.Source: §C.3 · pp. 46–47

C.4 Complexity of FastLanczos

  • With one initial vector, FastLanczos has O(MNp) runtime and O(p) memory, and can use batches of 1024 rather than the training batch size of 128.Source: §C.4 · p. 47

C.5 Reorthogonalization

  • Without reorthogonalization, floating-point loss of orthogonality can produce ghost eigenvalues, but toy synthetic-data tests still approximated spectra well.Source: §C.5 · pp. 47–48

C.6 Normalization

  • Rescaling the spectrum to [−1, 1] allows the Gaussian-bump width σ to be fixed independently of the spectrum being approximated.Source: §C.6 · p. 48

C.7 Spectral density estimation of f(A)

The section describes approximating a transformed spectrum with Lanczos-based density estimation. It motivates applying a logarithm to absolute eigenvalues and reports a synthetic-data check of the approximation.

C.7 Spectral density estimation of f(A)

  • On synthetic data, the spectral approximation is overlaid as a red line on blue eigenvalue histograms, with both plots averaging nvec = 10 initial vectors.Source: Figure 15 · p. 49
  • The approximation procedure normalizes the operator’s spectral range before estimating the transformed spectrum.The described normalization estimates the minimum and maximum eigenvalues, adds a margin, and rescales the operator.Source: §C.7 · p. 50
  • The proposed log-spectrum approximation applies f = log(|λ| + ϵ), with a small ϵ for numerical stability, and adjusts the spectral scaling accordingly.The authors suggest approximating the spectrum of log(|E|) because E is symmetric about the origin.Source: §C.7 · pp. 49–50

C.8 SubspaceIteration

The section proposes extracting the Hessian’s top C outliers with subspace iteration before approximating the remaining bulk. It also reports power-law fits for the test residual spectrum E.

C.8 SubspaceIteration

  • Subspace iteration extracts the top C Hessian outliers before LanczosApproxSpec estimates the rank-C-deflated bulk, at O(TC^2Np) runtime.The stated runtime is C² times higher than FastLanczos.Source: §C.8 · p. 50
  • The test spectrum of E is nearly symmetric about zero and has a power-law fit φ = 1.2×10−4 |λ|−2.7 with R² of 0.99.Source: Figure 16 · p. 51, §C.8 · p. 51
  • For the log-spectrum, the reported power-law fit is φ = 2.6×10−4 |λ|−2.2 with R² of 0.99, which the authors say cannot originate from classical RMT distributions.Source: §C.8 · p. 51

D.1 Training networks

The appendix describes network training across several architectures and datasets, then specifies the spectral-estimation pipeline and deterministic-operator constraints.

D.1 Training networks

  • Experiments cover VGG11, ResNet18, and eight-layer MLPs across MNIST, FashionMNIST, CIFAR10, and CIFAR100.For each dataset and network, learning rates and 20 training sample sizes from 10 to 5000 are swept; MLPs use 25 learning-rate values.Source: §D.1 · pp. 51–52
  • Low-rank deflation enables precise outlier-location detection and improves resolution of the bulk distribution.With deflation, the top eigenvalues align with outliers detected without deflation.Source: Figure 17 · p. 52

D.2 Analyzing the spectra

  • Spectra are normalized, approximated with Lanczos, and denormalized, optionally after rank-C subspace deflation.Log-spectrum calculations use 2048 iterations and a different κ value.Source: §D.2 · p. 52

D.3 Removing sources of randomness

  • To meet deterministic-operator assumptions, training omits random flips and crops, replaces VGG dropout with batch normalization, and keeps batch normalization in test mode.Source: §D.3 · p. 53
Loading 2008.11865v1…