Elamur Research

More Than a Toy: Random Matrix Models Predict How Real-World Neural Representations Generalize

Paper · 2022 · Alexander Wei, Wei Ping Hu and Jacob Steinhardt

Summary

A neural network can have enough adjustable parameters to fit its training examples exactly and still predict well on new examples. That makes its training error a poor guide to how well it will generalize. The authors study a version of this problem in which the image representation is fixed and only a linear predictor is fitted. They ask whether the training data can tell us how much test error to expect, how that error changes with more examples, and why an ImageNet-pretrained representation makes some tasks easier to learn.

The most accurate predictor they test is generalized cross-validation, or GCV. It takes the mean squared training error and adjusts it using the eigenvalues of a matrix of similarities among the training examples. Across the reported image experiments, over 90% of predictions have error at most 0.09 in both absolute and relative terms. GCV remains accurate in settings where the training and test errors are far apart. A measure based on the size of the fitted weights tends to move in the wrong direction as more examples are added. An alternative that uses the eigenvalues alone works better in some settings but misses important differences across tasks and representations.

The authors explain the correction using a local Marchenko–Pastur law, a random matrix result about how certain measurements of a training sample relate to the population it came from. Under this condition, with an additional requirement for a family of transformed input distributions, they bound the difference between GCV and test risk. The bound depends on the average squared size of the target labels, which can stay small even when the target requires a very large weight vector. The experiments provide indirect evidence for the random matrix condition on neural features.

The same analysis helps explain why pretraining can improve learning. In the comparisons, pretrained representations spread variation across more directions, as indicated by their slower eigenvalue decay. Their advantage comes from how the downstream labels align with those directions. The authors also estimate how the spectrum and the alignment change across directions and combine those estimates to predict how test error falls with dataset size. The estimates broadly follow the measured trends, although the two tables give inconsistent observed scaling rates for Food-101.

Deep dive: More Than a Toy: Random Matrix Models Predict How Real-World Neural Representations Generalize

Generalized cross-validation predicts test error from training data and explains how pretrained neural features improve ridge regression. · about 32 minutes to read

The problem and its context

Why study a fixed representation?

The work begins with a difficulty in explaining generalization. A predictor with more adjustable parameters than training examples has room to fit many different patterns, including patterns imposed by changing the labels. That freedom makes it hard to infer future performance from the ability to fit the observed data. The paper asks what a theory must account for if it is to explain behavior on real datasets. It treats prediction from a fixed representation as an intermediate case where the statistical problem is still substantial and the fitting procedure is simple enough to analyze.

A representation assigns a collection of features to each input. For an image, those features can be the activations of the final layer before the output or the derivatives of the output with respect to the network parameters. Once the representation is frozen, fitting the task consists of learning how to weight those features. The weights can be fitted by ridge regression, which minimizes squared training error while charging a penalty for a large weight vector. This setup allows a direct comparison between random initialization and pretraining. Each produces a different set of features, and the same regression procedure can be applied to both.

The authors use generalization risk to mean the expected squared error of a particular fitted predictor on a new example drawn from the same population. The fitted predictor is already determined by the training sample. The expectation is over the new input and its label. This definition gives the study a specific target. The question is whether a risk estimator can recover the error of the fit that was actually obtained, using the same observations that went into making that fit.

What earlier approaches measured

One route to controlling test error is to show that training error is representative of it. Uniform convergence arguments formalize this by controlling the difference between the two risks over a family of predictors. Measures such as Rademacher complexity, which assess how flexibly a family can fit random patterns, belong to this tradition. The paper also discusses approaches that use the size of the weights, PAC-Bayes methods for stochastic predictors, and measures based on effective dimension. The authors frame their own comparison around whether representative measures recover changes in generalization, including changes with dataset size and pretraining.

Ridge regression allows more specialized reasoning. A common analysis separates bias, the error introduced by systematically shrinking a fit, from variance associated with label noise. The size of the target weight vector can help bound bias. A spectral measure can help characterize the variance by counting the directions in the representation that the regression can use at a given regularization level. The appeal of this approach is that both quantities have a statistical interpretation. Its applicability depends on whether the weight norm is informative, whether the relevant population spectrum can be estimated, and whether the noise decomposition captures the kind of error at issue.

An alternative is to estimate performance by leaving observations out of the training process and testing on them. Ordinary cross-validation implements this idea with held-out examples. Craven and Wahba’s generalized cross-validation instead uses training residuals and an average correction derived from the regression fit. The paper describes the original motivation as a rotation-invariant modification of cross-validation. The correction depends on how the fit acts across sample directions as a whole. It avoids having to treat each observation’s individual effect as a separate quantity.

Some earlier analyses of GCV held the inputs fixed. For this problem, a new test image introduces variability through the input itself. Even with deterministic labels, regression can make errors on fresh inputs because the training set constrains the fit only in certain directions. The paper also describes analyses for random inputs that assume the training and test risks nearly agree, as well as asymptotic analyses in which feature dimension and sample size grow with a fixed limiting ratio. Varying the number of training images while keeping the network fixed calls for an account that can accommodate a changing ratio.

What random matrices add

A line of work on high-dimensional ridge regression had already shown how to write a test-risk approximation using the population spectrum and the way the target function sits within it. Several of those analyses used Gaussian covariates or related random matrix assumptions. Their expressions clarify why a representation may be easier or harder to learn from. Using the expressions as numerical forecasts, however, would require knowing quantities such as the population second moment matrix and the target coefficients along each of its directions. In the paper’s setting these are unknown.

The distinction matters for scaling laws. The paper connects its dataset-size question to work on neural scaling by Kaplan and colleagues, and it describes two earlier approaches to scaling in kernel regression. One tries to explain the rate using the spectrum alone. The other derives rates that also depend on how the target aligns with the eigendirections. The practical question is how to estimate the population quantities that enter the second account when only a sample of images and labels is available. Scaling Laws for Neural Language Models

The paper also draws on earlier work on neural tangent kernels, which relate neural networks to linear predictors through their parameter derivatives. Much of the theory it describes concerns very wide networks and their limiting kernels. Here the kernel comes from the actual parameters of a finite network, which can already have been trained. That choice gives the authors a way to examine real representations while keeping the downstream fitting problem within ridge regression.

The method, step by step

From images to a fixed set of features

The experiments begin with a residual network prepared in one of two ways. The random networks use the initialization scheme of He and colleagues. The pretrained networks come from PyTorch and were trained on ImageNet. The authors randomly initialize their output layers for the downstream tasks. They then fix the network at those parameter values and use its output derivatives as features. The downstream regression changes the coefficients attached to the derivative features while leaving the point at which the derivatives were taken fixed.

The intuition is that an output’s derivatives describe which small parameter changes would move that output, and by how much. Two images can be similar in this representation if they evoke similar responses to the same set of parameter changes. Taking inner products of their derivative features gives the empirical neural tangent kernel, or eNTK. Here empirical means that the derivatives come from the actual finite network with its particular weights.

From a fixed image representation to predicted test risk

The steps in order.

From a fixed image representation to predicted test riskStep 1: Fix the network at its chosen weights1. Fix the network at its chosen weightsStep 2: Extract output derivatives for the training images2. Extract output derivatives for the training imagesStep 3: Compute similarities between the derivative features3. Compute similarities between the derivative featuresStep 4: Encode class labels as centered regression targets4. Encode class labels as centered regression targetsStep 5: Fit ridge regression across sample sizes and penalties5. Fit ridge regression across sample sizes and penaltiesStep 6: Correct training error using the kernel spectrum6. Correct training error using the kernel spectrumStep 7: Check predictions against held-out squared error7. Check predictions against held-out squared error
ϕₑₙₜₖ(x) = ∂f(x; θ₀) / ∂θ

Here ϕₑₙₜₖ is the derivative representation of image x. The function f gives the network’s output scores, called logits. The vector θ contains the adjustable network parameters, and θ₀ is the particular set of values at which the derivative is evaluated. The partial derivative notation collects the derivatives of every output score with respect to those parameters. With P parameters and C output scores, the authors arrange these derivatives in a matrix with P rows and C columns.

Storing all of these derivatives across a large image dataset would be expensive. The kernel trick lets the fit use inner products of features in place of their full coordinates. The exact calculation would still involve similarities between outputs as well as between examples. The authors use the randomly initialized output layer to simplify that calculation. In expectation over its initialization, the kernel has an identical image-similarity block for each output and zero blocks between distinct outputs. They approximate the full kernel using the similarity matrix for a single randomly initialized output logit.

I꜀ ⊗ K

Here I꜀ is the identity matrix with a row and column for each of the C outputs. The symbol ⊗ denotes the Kronecker product. K is the image-by-image kernel computed from the derivatives of the selected logit. The product places a copy of K in each class’s diagonal block. This structure turns the multiclass problem into separate regressions that share the same kernel, each with its own target labels.

The target for an image starts as a one-hot vector, with the active entry identifying the correct class. The authors center each label vector so that its entries average to zero. The regression predicts a real-valued score for each entry. To measure squared-error risk, the authors average the squared residuals over images separately for each output, then add the resulting errors across outputs. They aggregate the GCV predictions in the same way. The centering gives the error scale a useful reference, since predicting 0 yields risk at most 1.

What ridge regression fits

The theory is presented for a scalar response, so each regression can be described with one label per observation. In the following notation, x is a feature vector and y is the scalar target. The setup assumes that the target is linear in those features, with an unknown coefficient vector β. The paper later shows how an augmented representation can account for residual noise or misspecification within this framework.

y = βᵀx

Here y is the label to be predicted, β is the unknown target vector, and x is the representation of the input. The superscript ᵀ indicates transpose, so the right side is the inner product of the target weights with the input features. Each training feature vector is drawn independently from the same distribution.

Σ = Eₓ∼ᴰ[xxᵀ]

Here Σ is the population second moment matrix. The expectation Eₓ∼ᴰ averages over feature vectors x drawn from the input distribution D. The outer product xxᵀ records how pairs of coordinates vary together before averaging. The main theoretical development takes the features to have mean zero, in which case this second moment also gives their covariance.

Σ̂ = XᵀX / N

Here Σ̂ is the sample second moment matrix, X is the training feature matrix with one image representation per row, and N is the number of rows. Transposing X and multiplying it by X sums the outer products of the training features. Dividing by N takes their average. With far more features than images, there are directions of the full feature space in which the sample second moment is zero.

The paper denotes the population eigenvalues by λᵢ, ordered from largest to smallest, and the associated unit eigenvectors by vᵢ. An eigenvector gives a direction of variation. Its eigenvalue gives the mean squared size of the input in that direction. The sample eigenvalues are written λ̂ᵢ. The N eigenvalues used in the GCV expression can be obtained from the normalized sample kernel, XXᵀ divided by N. This is the sample-space counterpart to the feature-space matrix Σ̂, with the same non-zero eigenvalues.

β̂λ = arg min₍ᵦ₎ [ (1/N) ∑ᵢ₌₁ᴺ (yᵢ − bᵀxᵢ)² + λ‖b‖₂² ]

Here β̂λ is the fitted vector for a positive ridge penalty λ. The minimization searches over coefficient vectors b. The index i runs over the N training examples, with feature vector xᵢ and label yᵢ. The term bᵀxᵢ is the predicted label, and ‖b‖₂² is the squared Euclidean norm of the coefficients. The first term rewards agreement with the labels. The second discourages fitting them with large coefficients. The paper defines β̂₀ by taking the limit as λ approaches 0 from above. In the noiseless setup that fit is the projection of β onto the span of the observed features.

Rₑₘₚ(β̂λ) = (1/N) ∑ᵢ₌₁ᴺ (yᵢ − β̂λᵀxᵢ)²

Here Rₑₘₚ is the empirical risk, the average squared error on the N training inputs. The ith residual is the difference between its label yᵢ and the prediction made from xᵢ using β̂λ. The penalty on the weights is part of the fitting objective and is absent from this measure of the fit’s error.

R(β̂λ) = Eₓ∼ᴰ[(βᵀx − β̂λᵀx)²]

Here R is the generalization risk of that same fitted vector. The expectation averages over a fresh feature vector x from D. The target βᵀx and prediction β̂λᵀx both refer to that fresh vector. The difference between the two risk formulas is important even when every label is determined by its input. The training formula only examines directions the regression has already seen.

How GCV turns residuals into a forecast

The regression is linear in the training labels. Across the eigenvectors of the sample kernel, the fit follows the labels most closely along directions with large eigenvalues. The residual is proportionately larger along directions with small eigenvalues. GCV uses the average residual fraction across those directions to adjust the squared training error.

GCVλ = [ (1/N) ∑ᵢ₌₁ᴺ λ/(λ + λ̂ᵢ) ]⁻² Rₑₘₚ(β̂λ)

Here GCVλ is the predicted generalization risk of the fit at ridge penalty λ. The index i runs over the N eigenvalues λ̂ᵢ of the normalized sample kernel. The term λ/(λ + λ̂ᵢ) gives the fraction left over after ridge fitting in a kernel eigendirection. The bracket averages those fractions, and the exponent −2 makes the adjustment the reciprocal of the squared average. The final factor is the measured training risk.

The correction is large when the regression can track the labels closely across the sample. That is the situation in which the residual alone can give a particularly misleading picture. GCV still depends on the targets because it starts with their residuals. Two tasks posed on the same feature matrix can have the same correction factor and different predicted risks. The spectrum describes how the fitting procedure treats the sample, and the residuals describe the response of the actual targets to that procedure.

The zero-penalty case is defined by the limit from positive λ. In an interpolating fit, entering zero directly would miss the balance between two quantities shrinking together. The unadjusted squared residual goes to zero, and the average residual fraction used in the denominator also goes to zero when the sample kernel is invertible. The limit retains information about the rates of both changes.

To evaluate many penalties, the authors diagonalize the kernel for the relevant training sample. This lets them use the same eigendecomposition to fit the ridge predictors and compute GCV at different penalties. For each N they use penalty values obtained by dividing a grid of base values by N. The base values are chosen in proportion to the scale of the empirical second moment, with a range broad enough for the observed risk to approximately settle at the extremes across the sample sizes. The authors also report developing software for calculating large empirical neural tangent kernels.

The population quantity behind the correction

The main theory links the observed sample spectrum to an effective regularization level κ. The input to ridge regression is the explicit penalty λ. The population counterpart κ also accounts for the statistical effects of having a finite training sample. It is defined by an equation involving the full set of population eigenvalues.

1 = λ/κ + (1/N) ∑ᵢ₌₁ᴾ λᵢ/(κ + λᵢ)

Here κ is the unique positive solution for a positive penalty λ and sample size N. The index i runs over the P feature-space directions with population eigenvalues λᵢ. Each fraction measures how much a direction contributes at the effective regularization level κ. The population sum is normalized by the sample size. As for ridge regression itself, the paper defines the zero-penalty counterpart by a limit from above.

The random matrix hypothesis concerns inverses of second moment matrices after a positive multiple of the identity has been added. Adding that multiple keeps the inverse well defined and controls how strongly it responds to small eigenvalues. A local version of the Marchenko–Pastur law gives two kinds of comparisons. One concerns an average across the sample spectrum. The other concerns what the regularized inverse does along a fixed direction, including the target direction. The distinction matters because a spectral average can agree even when the behavior in a direction relevant to prediction differs.

(1/N) ∑ᵢ₌₁ᴺ 1/(λ̂ᵢ + λ) ≈ 1/κ

Here λ̂ᵢ are the sample-kernel eigenvalues, λ is the explicit penalty, and κ is its effective population counterpart. The sum averages the inverse of the shifted eigenvalues over the N training dimensions. The approximation sign refers to the concentration statement in the local law. The reciprocal of the left-hand side is the empirical estimate κ̂ of effective regularization.

vᵀλ(λI + Σ̂)⁻¹v ≈ vᵀκ(κI + Σ)⁻¹v

Here v is a fixed feature-space direction with population second moment vᵀΣv at most 1. The matrices Σ̂ and Σ are the sample and population second moments, and I is the identity in feature space. The inverse notation applies to the shifted matrices in parentheses. On the left, the regularized inverse uses the sample matrix and the explicit penalty λ. On the right, the population matrix is paired with κ. The hypothesis controls this comparison uniformly over a range of penalties around the one under study.

The first comparison supplies a statistical interpretation for GCV’s multiplier. The paper shows that the multiplier is approximately the squared ratio of effective to explicit regularization. Under the law, this also describes the ratio between the generalization risk and training risk where that ratio is defined. The authors call the regime non-classical when κ is much larger than λ. In that regime the two errors can be far apart. A large feature dimension creates room for such a gap, and the regularization choice affects whether it appears.

To see where the target enters, the authors use a population expression they call the omniscient risk estimate. It summarizes the effects of the population spectrum and target simultaneously.

Rₒₘₙᵢ(λ) = (∂κ/∂λ) κ² ∑ᵢ₌₁ᴾ [λᵢ/(κ + λᵢ)²] (βᵀvᵢ)²

Here Rₒₘₙᵢ(λ) is the risk approximation at explicit penalty λ. The derivative ∂κ/∂λ describes how the effective penalty changes when the explicit penalty changes, with N fixed. The sum runs over all P population directions. The eigenvalue λᵢ controls the input variation in direction vᵢ. The squared projection (βᵀvᵢ)² gives the target’s alignment with that direction. The authors call the quantity omniscient because both the population eigensystem and the ground-truth vector are unknown in the experiment.

There are two links in the proof. To connect GCV with the population expression, the authors rewrite the training residual using the derivative of a regularized quadratic form along β. Differentiating the population counterpart produces the eigenvalue weights and the derivative of κ in the risk formula. The averaged law supplies the normalization from GCV. A local law applied at one isolated penalty would give limited control over those derivatives. The proof uses control over an interval and bounds an analytic continuation to justify differentiating the approximation.

The second link connects the population expression to the test error of the actual fit. Test error weights the coefficient error by Σ, because future inputs are drawn from the population. To recover that weighting, the proof introduces a perturbation that transforms the input features using Σ and differentiates in the perturbation parameter. This is why the formal test-risk theorem assumes the local law for a family of transformed distributions as well as the original one. The population expression is the quantity that both calculations approach.

|GCVλ − R(β̂λ)| ≲ N^(−1/2 + o(1)) · (βᵀΣβ) · [‖Σ‖ₒₚ/λ + (1 + Tr(Σ)/(Nλ))^(3/2)]

Here the left side is the absolute difference between predicted and actual generalization risk. The symbol ≲ suppresses constant factors in a high-probability bound, and o(1) denotes a term that tends to zero as N grows. The quantity βᵀΣβ is the expected squared label. The operator norm ‖Σ‖ₒₚ is the largest eigenvalue of Σ, and the trace Tr(Σ) adds all its eigenvalues. The right side shows both the concentration with sample size and the cost of taking λ small. The target factor is measured in prediction units, so a large Euclidean coefficient norm can coexist with a modest value of this factor.

From a forecast at one sample size to a learning curve

For the scaling analysis, the authors describe two population sequences using power laws. One sequence tells how fast the input variance drops as one moves through the eigendirections. The other tells how the target’s squared coefficients change through the same ordering.

λᵢ ≍ i^(−1−γ)

Here λᵢ is the population eigenvalue of rank i, where the largest eigenvalue comes first. The positive exponent γ controls the rate of spectral decay. The symbol ≍ means comparable up to constant factors in the power-law description. Larger γ corresponds to a steeper decline.

(βᵀvᵢ)² ≍ i^(−δ)

Here β is the target vector and vᵢ is the eigenvector at spectral rank i. The exponent δ, assumed smaller than 1 in the paper’s setup, governs the trend in squared target coefficients. A higher δ means that the coefficients assigned to the deeper directions are smaller relative to those at the front of the spectrum. A negative δ describes increasing squared coefficients with rank over the fitted power-law range.

Earlier work by Cui and colleagues gives the population scaling rate that follows from these ingredients in the noiseless regime with optimally chosen ridge regularization.

Rₒₘₙᵢ(λ*) ≍ N^(−α)

Here λ* is the optimal ridge penalty for the given sample size N, and Rₒₘₙᵢ is the population risk approximation. The exponent α describes the rate of decrease when positive.

α = γ + δ

Here α combines the spectral exponent γ and the alignment exponent δ. This makes the tradeoff explicit. A representation with slower eigenvalue decay can have a better scaling rate if the target coefficients improve sufficiently in the eigenbasis of that representation.

To estimate γ, the authors track how an inverse-kernel statistic changes with N. Under the local law in the limit near zero penalty and the population spectral power law, the statistic follows a power law in sample size.

(1/N) Tr[(XXᵀ)⁻¹] ≍ N^γ

Here X is the training feature matrix, XXᵀ is the unnormalized matrix of feature inner products, and Tr adds the diagonal entries of its inverse. The expression uses the regime in which that inverse exists. The sample size is N and γ is the population eigendecay exponent. A fit on logarithmic axes estimates γ from the change in this statistic across sample sizes. The method uses the changing sample spectrum as evidence about the population instead of equating the eigenvalues of any one sample to their population counterparts.

To estimate δ, the authors use a quantity that depends on the training labels as well as the kernel. The local law relates its variation to κ and the population alignment coefficients.

yᵀ(XXᵀ + NλI)⁻¹y ≍ κ^(−(1−δ)/(1+γ))

Here y is the vector of observed scalar training targets, X is their feature matrix, and I is the identity in sample space. Adding NλI shifts the unnormalized kernel by an amount corresponding to ridge penalty λ. The effective penalty κ describes the population counterpart of the inverse. The exponents γ and δ retain their definitions from the two power laws. The authors substitute the empirical κ estimate, use the preceding fit for γ, and infer δ from the dependence of the label statistic on κ. They add the estimated exponents to forecast the rate of decrease of the optimally regularized test risk.

Experiments and results

A fixed representation that can do the task

The representation comparisons establish that the empirical tangent features are useful for image classification in their own right. For these comparisons, the paper reports the fraction of test images classified incorrectly. This is a separate metric from the summed mean squared error that GCV predicts. A classifier can assign the correct class the highest score while incurring squared error on several scores, so the two metrics answer different questions.

Test classification error on CIFAR-100 with ResNet-34

The empirical tangent kernel comes closer to full-network fine-tuning than regression on final-layer activations does.

Test classification error on CIFAR-100 with ResNet-34Regression on final-layer activations: 33.9Regression on final-layer activations33.9Regression on the empirical tangent kernel: 19.0Regression on the empirical tangentkernel19.0Full-network fine-tuning with SGD (this paper): 15.9Full-network fine-tuning with SGD (thispaper)15.9
The numbers
System or settingtest classification error %
Regression on final-layer activations33.9
Regression on the empirical tangent kernel19.0
Full-network fine-tuning with SGD (this paper)15.9

The pattern holds across the pretrained architecture and dataset pairs in the classification comparison. On the CIFAR-10 test set with ResNet-18, the classification error is 6.7% for the eNTK, 14.0% for final-layer regression, and 4.3% for full-network training. On the Flowers-102 test set with ResNet-50, the corresponding errors are 7.0%, 9.7%, and 5.6%. On Food-101 with ResNet-101, they are 21.3%, 33.7%, and 15.3%. Full-network fine-tuning uses stochastic gradient descent, while the regression uses frozen neural features.

The CIFAR-100 experiment in the opening figure makes the distinction between objectives concrete. The pretrained ResNet-34 eNTK fit selected for its lowest mean squared error has 19.9% test classification error. The table’s eNTK comparison reports 19.0% for test classification error. The figure conditions its classification number on the squared-error objective. Both appearances of 15.9% refer to test classification error from fine-tuning. The central prediction experiment concerns how closely GCV tracks squared test error along the ridge path.

Predicting risk across training sizes and penalties

For Fashion-MNIST the main risk comparison uses a randomly initialized ResNet-18. The CIFAR-10 comparison uses a pretrained network of that architecture, while CIFAR-100 uses pretrained ResNet-34. The other main comparisons use pretrained ResNet-50 for Flowers-102 and pretrained ResNet-101 for Food-101. For each pair the authors compute a kernel and evaluate fits across training-set sizes and ridge penalties. The largest matrix they report is 75,750 × 75,750 for Food-101. The corresponding ResNet-101 has 44 million parameters, which gives the scale of the derivative representation avoided by using the kernel.

For each fit, GCV sees the training residuals and sample spectrum. The authors compare its output to the summed mean squared error on held-out examples. Across the reported risk predictions, over 90% have at most 0.09 error in absolute terms and at most 0.09 error in relative terms. This is a statement about agreement across the collection of evaluated settings. The individual curves show the closest agreement for large values of the product of sample size and ridge penalty, with some separation at smaller values.

The curves also address two practical questions about where GCV works. The agreement extends to the vicinity of the ridge penalties that give low test mean squared error, where a risk forecast is particularly relevant. It also extends to settings where training mean squared error is far below test mean squared error. A predictor that simply followed the training risk would be unreliable in those parts of the curves. The authors further observe that when the product of sample size and penalty is held fixed, the estimates generally improve as the sample size grows.

Comparison with the weight norm and the spectrum

The empirical norm baseline uses the fitted coefficient norm divided by the square root of sample size. It stands for the type of complexity measure that interprets a fit with larger weights as having greater potential to generalize poorly.

R̂ₙₒᵣₘ(λ) = ‖β̂λ‖₂/√N

Here R̂ₙₒᵣₘ(λ) is the norm-based score for the fit with ridge penalty λ. The fitted vector is β̂λ, ‖·‖₂ denotes its Euclidean norm, and N is the number of training examples. Since the score need not be calibrated in units of squared risk, the experiments compare its trend and correlation with test risk.

The spectral baseline comes from a model in which the target weight vector has an isotropic prior. That assumption gives the same expected squared coefficient in every unit direction. Averaging over such targets removes the specific alignment of the observed classification task. The resulting predictor uses the sample spectrum and two fitted quantities.

R̂ₛₚₑ꜀(λ) = κ̂² [a² ∑ᵢ₌₁ᴺ λ̂ᵢ/(λ + λ̂ᵢ)² + (σ²/N) ∑ᵢ₌₁ᴺ 1/(λ + λ̂ᵢ)²]

Here R̂ₛₚₑ꜀(λ) is the spectrum-only risk estimate, and κ̂ is the sample-based estimate of effective regularization. The symbol a² denotes the signal-strength parameter called α² in the paper’s baseline formula. The separate letter here distinguishes it from the scaling exponent. The parameter σ² represents noise variance. Both sums run over the N empirical eigenvalues λ̂ᵢ at penalty λ. The authors choose the two parameters by minimizing squared prediction error against the observed generalization risks over the evaluated combinations of sample size and penalty. This gives the baseline the benefit of seeing the test risks when fitting its parameters.

The authors first compare the Pearson correlations of the predictions with held-out squared-error risk across those combinations. Correlation measures whether a predictor follows the observed changes in risk. In particular, a high correlation can coexist with a systematic difference in the size of the predicted values, which is why the direct agreement of the predictions remains relevant.

Test-risk prediction on Fashion-MNIST with randomly initialized ResNet-18

GCV follows changes in test risk most closely across the evaluated training sizes and ridge penalties.

Test-risk prediction on Fashion-MNIST with randomly initialized ResNet-18Norm-based predictor: -0.584Norm-based predictor-0.584Fitted spectrum-only predictor: 0.080Fitted spectrum-only predictor0.080Generalized cross-validation (this paper): 0.996Generalized cross-validation (thispaper)0.996
The numbers
System or settingPearson r with test mean squared error
Norm-based predictor-0.584
Fitted spectrum-only predictor0.080
Generalized cross-validation (this paper)0.996

On CIFAR-10 the correlations with test risk are 0.999 for GCV, 0.977 for the spectrum-only estimate, and −0.641 for the norm score. On CIFAR-100 they are 0.996, 0.846, and −0.507 in the same order. On Flowers-102, they are 0.999, 0.665, and −0.786. On Food-101, the respective correlations are 0.979, 0.718, and −0.483. The gap between GCV and the spectral baseline varies by dataset. The spectral summary tracks CIFAR-10 fairly well across the grid, while the Fashion-MNIST comparison shows that the same family of spectral predictors can miss almost all of the observed variation.

How the predicted error changes with sample size

The scaling comparison asks whether each risk estimator recovers the slope of the learning curve near the best ridge fits. At each N the authors take the penalty that minimizes observed generalization risk. They then fit a slope on logarithmic axes for the risk predictions at those settings. The observed risks at the same settings provide the reference slope. This compares risk forecasts for a common set of fits. There is no corresponding scaling experiment on Flowers-102, for which the paper gives a dataset size of 2040 images.

For Fashion-MNIST with random ResNet-18, the observed slope is −0.166. GCV gives −0.192, the spectral baseline gives −0.008, and the norm measure gives 0.121. For CIFAR-10 with pretrained ResNet-18, the observed slope is −0.162 and GCV gives −0.182. The spectral and norm estimates there are −0.134 and 0.044. For CIFAR-100 with pretrained ResNet-34, both the observed and GCV slopes are −0.124, while the spectral estimate is −0.070 and the norm estimate is 0.166. On Food-101 the observed slope in this comparison is −0.099, against GCV at −0.085, the spectrum-only estimate at −0.035, and the norm estimate at 0.188.

The paper also estimates the scaling exponent from eigendecay and alignment separately, using the inverse-kernel and label statistics. This is a different forecast of the same kind of learning curve. In these results the direction of decline is written using a positive exponent. On CIFAR-10 with random ResNet-18, the combined exponent estimate is 0.066 and the measured exponent is 0.059. For pretrained ResNet-18 on that task, the estimate is 0.181 and the measured exponent is 0.162. For CIFAR-100 with random ResNet-34, the estimated and measured exponents are 0.016 and 0.014. With pretrained ResNet-34, those entries are 0.128 and 0.124.

The Food-101 entry in this second comparison lists a predicted exponent of 0.087 and an observed exponent of 0.985. That observed entry conflicts with the slope of −0.099 under the opposite sign convention in the earlier benchmark. The results for the other reported pairs support the relationship between the estimated spectral quantities and the measured learning curves. The two Food-101 entries leave the size of that agreement unclear for this dataset.

What the ablations show

The weight-norm trend survives interpolation

The paper’s diagnostic for the norm-based explanation examines the zero-penalty fit. In the Fashion-MNIST example with randomly initialized ResNet-18 features, training risk stays at 0 while held-out squared-error risk falls as more images are added. Over the same sample sizes, the fitted norm divided by the square root of N rises. Additional plots document the same behavior in other settings. Fixing the penalty at the interpolation limit isolates the change with dataset size. The upward trend persists without varying the explicit penalty across fits.

The result has a geometric interpretation in the noiseless setup. The interpolating solution is the projection of the target coefficient vector into the span of the training features. A larger span can expose target components that a smaller sample left unobserved. Some of those components can require large coefficients because the corresponding feature directions have very small variance. The norm can rise as the regression learns more of the function. This makes increasing norm consistent with improving predictions and gives the authors a reason to allow very large target norms in the theory.

Sampling distorts the apparent spectrum

The authors examine the sample eigenvalue curves for increasing training sizes, including pretrained ResNet-34 features on CIFAR-100. The curves change with sample size enough to make the population decay trend hard to infer from a single one. The same qualitative observation appears in additional architecture and dataset comparisons. The sample matrix records variation in the observed span, and the accessible part of the spectrum changes as the sample grows.

This analysis supports a specific methodological choice. The scaling procedure estimates population eigendecay through how a statistic of the whole sample kernel varies with N. The GCV calculation likewise uses a regularized average of the sample eigenvalues directly. Both calculations can have predictive value in a setting where inserting individual sample eigenvalues into a formula for the population spectrum gives a poor approximation.

Pretraining changes both the spectrum and the target’s alignment

In the pretraining comparison, the authors keep the architecture and downstream task fixed within each pair and compare the random and pretrained representations. For CIFAR-100 with ResNet-34, the raw sample curves already show slower eigenvalue decay after pretraining. The estimated population exponent γ follows that pattern, with 0.482 at random initialization and 0.257 after pretraining. The fitted alignment exponent δ moves from −0.466 to −0.128. Both alignment exponents are negative, so the estimated squared coefficients still grow with rank in each case. They grow less strongly after pretraining.

CIFAR-10 with ResNet-18 gives the same combination of changes. The estimated eigendecay exponent is 0.535 at initialization and 0.270 after pretraining. The alignment estimates are −0.468 and −0.089. For Fashion-MNIST with ResNet-18, the corresponding spectral estimates are 0.657 and 0.353, and the alignment estimates are −0.462 and −0.149. Fashion-MNIST’s measured scaling exponents are 0.166 and 0.188. This pair illustrates that pronounced changes in the two components can accompany a more modest change in the overall rate.

With slower spectral decay, more directions retain appreciable input variation at the relevant regularization levels. That increases effective dimension in the sense used by the paper. The improved alignment provides the opposing effect. The target can be expressed with less relative reliance on large coefficients deep in the spectrum. Looking at the two exponents together accounts for the direction of the pretraining changes. The comparison also gives a task-specific meaning to the quality of a representation. The spectrum describes the inputs, while the alignment depends on the labels the same features are used to predict.

The two parts of the local law make a shared prediction

The authors also check an implication of the random matrix hypothesis that can be examined with training data alone. The label-dependent inverse-kernel statistic should be roughly a function of κ. The spectral average gives an empirical way to estimate κ. If both parts of the law describe the same data, then curves generated by sweeping the ridge penalty at different sample sizes should nearly coincide when plotted against estimated effective regularization. The authors plot the statistic after multiplying it by the estimated effective penalty for normalization.

The curves nearly overlap across the sample sizes examined, with the pattern appearing across several settings. This check ties a label-dependent measurement to a spectral measurement through the same effective penalty. It gives evidence beyond comparing GCV to held-out risk. Its direct scope is the relationship between these observable statistics. The full hypothesis additionally controls unobserved population quantities and directions outside the one probed by the labels.

Noise can be represented as a difficult target direction

The paper also isolates a theoretical reason to allow complex targets. Imagine that the label consists of a linear function of the features plus a residual, denoted ξ. This residual can represent observation noise, a systematic error in the best linear approximation, or a combination. The authors append a coordinate containing the residual multiplied by the square root of a small positive parameter t. The target assigns that coordinate a coefficient equal to the inverse square root of t.

x′ = (x, t^(1/2)ξ)

Here x′ is the augmented feature vector, x is the original feature vector, and ξ is the residual associated with the observation. The positive parameter t controls the size of the added coordinate. This coordinate becomes very small as t approaches 0.

β′ = (β, t^(−1/2))

Here β′ is the augmented target vector and β contains the original linear coefficients. The exponent −1/2 gives the added coordinate a large target weight when t is small. Its product with the extra feature is precisely ξ. The label can therefore be written as a deterministic linear function of the augmented input while its overall expected squared size stays fixed.

This construction makes the fits of the augmented regression approach those of the original regression at positive penalty. When the feature dimension exceeds the sample size and the sample satisfies the stated non-degeneracy condition, the convergence holds uniformly down to zero penalty. The appendix gives additional conditions under which mean-zero observation noise preserves the relevant approximation along the augmented target direction. The construction explains why some behavior that can be described as noise can also appear as learning a target with large coefficients along weak feature directions.

A final representation check repeats the GCV risk comparisons with last-layer activations. These features give a smaller representation that reaches both sides of the boundary between fewer and more features than observations. GCV continues to track held-out squared risk in the reported plots. This broadens the empirical case for the estimator while leaving the main performance and pretraining comparisons centered on the eNTK.

Limitations

Limits identified by the authors

The guarantee is conditional on a local random matrix law. The formal statement of the main theorem takes as a premise that the law applies both throughout a neighborhood of the penalty and under a family of linear transformations applied to the input distribution. Results for random matrices supply settings in which such assumptions can hold. For example, the paper describes results for suitably controlled linear transformations of independent coordinates. For the real neural features in the experiments, the authors check observable implications. That check cannot directly establish the required bounds involving the population second moment matrix.

The authors single out small regularization as an unresolved theoretical regime. A natural experimental choice has λ on the order of N⁻¹. The existing local-law results they discuss require regularization bounded away from zero. Moreover, the theorem’s comparison between the omniscient expression and actual test risk incurs a factor proportional to the inverse penalty. The stated guarantee can therefore deteriorate as the penalty goes down. The agreement in some of the small-penalty experiments covers territory beyond what that bound firmly resolves.

The proof presents the centered case. The authors mention a way to account for a non-zero feature mean through a matrix update and leave that extension undeveloped. They also distinguish the reduction for noisy or misspecified labels from the assumptions needed for risk prediction after the reduction. With conditionally mean-zero noise and moment control, the analysis can bound the extra approximation error. For arbitrary misspecification, the bound they give in terms of residual size does not improve with N. Rewriting a label as linear in an augmented feature vector therefore establishes a broader fitting framework, with the statistical guarantee depending on how the augmented features behave.

The discussion identifies logistic-regression classification accuracy, covariate shift, and the evolution of neural features during training as open directions. The established link is for squared-loss ridge regression. Full-network fine-tuning changes the representation, and the eNTK experiments use derivatives evaluated at a fixed set of parameters. The benchmark comparison measures how competitive the fixed features are on the tasks studied. The authors leave changes in eigendecay and alignment during network training for future investigation.

Limits visible in the comparisons

The reported empirical scope is image classification with residual networks and a choice between random initialization and ImageNet pretraining. The eNTK combines an exact derivative feature definition with a practical output-kernel approximation. Using one randomly initialized output to stand in for the repeated blocks makes the experiments feasible at their reported scale. The risk curves describe that approximation, and the classification comparisons alone leave the effect of cross-output kernel terms unresolved.

The two quantitative benchmarks for risk predictors also have different evidentiary roles. The correlation comparison pools combinations of training-set size and penalty. A strong correlation indicates that the predictor follows the changes across those settings, while absolute and relative prediction errors measure calibration. In the scaling comparison, the penalties are selected using observed test risk. The resulting slopes answer whether GCV forecasts the risk of those selected fits. How closely a procedure that selects its penalty completely by GCV would match the measured optimal learning curve remains a separate question.

The baseline experiments test specific representatives of broader approaches. The negative norm correlations concern the reported weight-norm score. The spectrum-only comparison concerns a predictor derived under an isotropic prior with fitted signal and noise strengths. The study demonstrates where those summaries lose relevant information. Its experiments leave room for spectral methods that incorporate additional task information and for complexity measures designed around a different aspect of the fit.

There is also a distinction between evidence of large target norms and an infinite norm as a literal property. A fit in a particular finite network has a finite coefficient vector. The observed growth under interpolation and the fitted alignment exponents motivate treating the unweighted target norm as effectively unbounded in the high-dimensional analysis. The evidence comes from the observed ranges of sample sizes and spectral behavior. The population power laws used for the scaling account are approximations across such ranges, and the inconsistent Food-101 entries prevent a clean numerical check for that case.

Finally, the paired pretraining experiments jointly change the spectrum and the orientation of the features relative to the target. The population risk formula helps interpret their opposing contributions, and the estimates fit that account. The comparisons do not independently manipulate alignment while holding the spectrum fixed. They establish how the two quantities vary within the chosen architecture and task pairs. A broader account of how pretraining creates the observed alignment would need evidence about the features as they are learned.

What came after

LESS, published in 2024, cites the paper in work on selecting influential data for targeted instruction tuning. Its title places the choice of examples at the center of the task. That gives it a different object of study from the ridge experiments, where the number of training images changes and the analysis asks how error depends on the representation and its alignment with the labels. The citation establishes a connection to later research on task-specific use of training data. It leaves open whether LESS uses the GCV estimate, the alignment analysis, or another part of the paper. LESS

RoCoFT, published in 2025, cites the paper in work on efficient fine-tuning of large language models with row and column updates. Where the ridge experiments fix neural features and estimate the test error of a downstream linear fit, RoCoFT’s stated topic is the form of the parameter update used for fine-tuning. The citation connects the study of pretrained representations to a later investigation of how to adapt a pretrained network. The relationship alone leaves open how RoCoFT uses the ridge-regression results or whether it tests their random matrix explanation. RoCoFT

Cite

Cite as Alexander Wei, Wei Ping Hu and Jacob Steinhardt. 2022. More Than a Toy: Random Matrix Models Predict How Real-World Neural Representations Generalize. arXiv (Cornell University).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2203.06176 · arXiv 2203.06176

@misc{alexander2022more,
  title = {{More Than a Toy: Random Matrix Models Predict How Real-World Neural Representations Generalize}},
  author = {Alexander Wei, Wei Ping Hu and Jacob Steinhardt},
  year = {2022},
  doi = {10.48550/arxiv.2203.06176},
  eprint = {2203.06176},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2203.06176}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/alexander-2022-more-than-toy-random-matrix/