Source-linked AI summary
Generalization in Neural Networks Through the Lens of Magnitude Potential
Sahel Torkamani, Henry Gouk, Rik Sarkar
TL;DR
Explaining neural-network generalization and training dynamics remains difficult. This paper develops magnitude potential and its class-to-dataset ratio as geometric measures, reporting associations with memorization and training changes, including a signal during modular-arithmetic grokking.
Problem
The mechanisms behind neural-network generalization and the behavior of overparameterized networks remain difficult to analyze, despite their capacity to memorize training data.
Source: §1 · p. 1Method
The paper defines magnitude potential as a representation measure and uses the ratio of a point’s potential with respect to its class to its potential with respect to the full dataset.
Source: §1 · p. 1, §3.1 · p. 4Results
Takeaways & Limitations
The MP ratio provides a geometric signal related to point representation and, when aggregated, to changes in training dynamics.
Source: §1 · pp. 1–2Computing magnitude requires matrix inversion, which can be costly for large training sets; the performance of sampling-based approximations remains to be studied.
Source: §7 · p. 9
Abstract
from arXiv · showhide
Explaining generalization and training dynamics in neural networks remains a challenge, and various approaches have been developed to study different aspects of these phenomena. In this paper, we introduce the idea of {\em magnitude potential} -- a quantity based on the theory of metric magnitude -- that reflects how well an arbitrary point is represented by a given set. We find that this basic quantity can be applied to examine various features in neural generalization. The ratio between the magnitude potential with respect to a class and with respect to the entire data, computed at the logit layer, is informative of the representation of the point. In experiments, these ratios for individual training points are found to be correlated with the Feldman memorization scores. Magnitude potential ratios aggregated across points detect structural changes in the decision boundaries and provide a geometric indicator of grokking in modular arithmetic. Although the magnitude potential ratio and neural collapse are both closely associated with intra-class and inter-class geometric structure, the magnitude potential ratio remains informative even when neural collapse is explicitly suppressed.
1 Introduction
The paper introduces magnitude potential as a metric-magnitude-based measure of how well a point is represented by a set, then uses its class-to-dataset ratio to study memorization and training dynamics. The reported results link the ratio to memorization and geometric signals during decision-boundary changes and grokking.
1 Introduction
- Magnitude potential extends metric magnitude to estimate how well an arbitrary point is represented by a set, and the class-to-dataset ratio compares those two representations.The potential is described as a continuous Lipschitz function applicable to training and unseen points.Source: §1 · pp. 1–2
- Unlike KDE, magnitude potential downweights dense clusters and gives larger class scores to sparse clusters and isolated points, resembling neural-network outputs that fit outliers.The authors also report Lipschitz continuity and limiting behaviors involving within-class variance collapse and nearest-neighbor structure.Source: §1 · p. 2
- Low magnitude-potential ratios are associated with heavily memorized points, while ratios aggregated across samples capture training-phase transitions.The ratio compares a point’s magnitude potential relative to its class with its potential relative to the entire dataset.Source: §1 · p. 2
- In a simple 2D dataset, validation MP-ratio standard deviation drops as boundaries become class-specific, then rises when the model starts to overfit.The initial boundaries are linear separators.Source: §1 · p. 2
- During modular-arithmetic grokking, the training MP-ratio mean rises before validation accuracy transitions, then training and validation ratios stabilize near full validation accuracy.At that stage, the standard deviation of the MP ratio decreases for both sets.Source: §1 · p. 2
- The reported results hold independently of neural collapse.The introduction states this result without further qualification in the supplied passage.Source: §1 · p. 3
2 Preliminaries
Metric magnitude assigns weights to points in a metric space using a similarity function, and defines the magnitude as the sum of those weights. The preliminaries also describe its finite-set matrix form and scaling by a positive parameter.
2 Preliminaries
- Metric magnitude is the sum of point weights, with each weight constrained by a similarity-weighted sum over the set.The similarity is defined as ζ(z1, z2) = exp(−d(z1, z2)).Source: §2 · p. 3
- For a finite subset of R^D, the similarity matrix gives the weighting vector by applying its inverse to the all-ones vector; magnitude sums the resulting weights.The supplied passages identify the similarity matrix as positive definite and invertible.Source: §2 · p. 3
- Magnitude can be defined at a positive scale t by scaling the metric, with corresponding scale-dependent weighting and similarity functions.The scaled metric is defined as dt(x, y) = t · d(x, y).Source: §2 · p. 3
3 Magnitude Potential Ratio: Definition and Theory
Magnitude potential provides a soft geometric measure of how well a point is represented by a set, and the MP ratio compares representation by a point’s class with representation by the full dataset. The paper uses this ratio to characterize logit-space geometry and its changes.
3 Magnitude Potential Ratio: Definition and Theory
- Magnitude potential acts as soft coverage: values near 1 indicate that a point is well represented by a set, while values near 0 indicate distance from it.It is also the minimal-norm function in the associated RKHS that assigns 1 to every point in the set.Source: §3 · p. 4
- Magnitude potential is Lipschitz continuous in the point’s location, with its change bounded by distance, scale, and the L1 norm of the set’s magnitude weights.The bound is |ρ_t(z1, X) − ρ_t(z2, X)| ≤ t · d(z1, z2) · ∥w_X∥_1.Source: §3 · p. 4
- At small scales, magnitude potential tends to 1 for every point and its variance collapses; at large scales, nearest-neighbor distance dominates its behavior.The large-scale result describes scattered data, where non-nearest-neighbor kernel values decay faster.Source: §3 · p. 4
3.1 Magnitude Potential Ratio (MP ratio)
- The MP ratio compares a point’s magnitude potential with respect to its class against its potential with respect to the full dataset.For training points, the class-set potential uses leave-one-out because a point’s potential with respect to a set containing itself is always 1; validation points use the full set.Source: §3.1 · pp. 4–5, §3 · p. 4
- Unlike kernel density estimation, magnitude potential down-weights dense clusters and gives geometrically isolated points meaningful representation weight.In experiments, the MP ratio is computed in pre-softmax logit space, with distances measured in that representation space.Source: §3.1 · p. 5
4 MP ratio and memorization scores
The paper compares per-sample MP ratios with Feldman memorization scores on CIFAR-100. The ratios are negatively correlated with those scores, linking geometric coverage to memorization.
4 MP ratio and memorization scores
- The comparison uses Feldman scores estimated from 4,000 ResNet-50 models trained on random 70% subsets of CIFAR-100.The MP ratio is computed for 50,000 training points using random subsamples of 200 points per class for the leave-one-out calculation.Source: §4 · p. 5
- MP ratio and Feldman memorization scores are negatively correlated on CIFAR-100, with the strongest reported absolute correlations exceeding 0.70.The comparison covers multiple scales; the highest correlation occurs at t = 0.2.Source: §4 · p. 5, Table 1 · p. 6
- Smaller t values are more sensitive to the most memorized points, while averaging over 10 independent random samples consistently improves correlation.The paper also compares MP ratio against four single-checkpoint baselines: max softmax probability, logit margin, entropy, and cross-entropy loss.Source: §4 · p. 5
5 Training Dynamics
Aggregated MP ratios track changes in representation geometry during training. In a 2D classification setting they reflect boundary changes and overfitting, while in modular addition they provide geometric signals before and during grokking.
5 Training Dynamics
- The training-dynamics analysis aggregates MP ratios over training and validation points, each measured relative to the training dataset.The 2D experiment uses three isotropic Gaussian classes in R^2, with 240 samples split 70/30 into training and validation sets.Source: §5 · p. 6, §5.1 · p. 6
5.1 Fitting and Decision Boundary
- In the 2D setting, validation MP-ratio standard deviation drops as boundaries change from approximately linear separators to smooth class-specific curves, then rises during overfitting.Validation accuracy remains near 100% throughout, so the ratio reveals structural changes not apparent from accuracy alone.Source: §5.1 · p. 6, Figure 3 · p. 7
- In the 2D experiments, MP ratio provides early signs of phase transitions that accuracy, weight norms, and relative flatness fail to capture.The comparison uses metrics proposed by Petzka et al. [28].Source: §5.1 · p. 6
5.2 Grokking in Modular Addition Datasets
- For modular addition, the MP ratio signals both the accuracy transition and stabilization, while accuracy alone cannot distinguish the earlier phases.The experiments use a 2-layer MLP with MSE loss, and the paper reports that the dynamics replicate for a 1-layer Transformer with cross-entropy in the appendix.Source: §5.2 · pp. 6–8
- Training MP ratio rises as modular-addition samples consolidate within class distributions, while its standard deviation falls before validation accuracy transitions.The weight norm begins decreasing slightly earlier; training and validation losses continue decreasing gradually without discontinuities.Source: §5.2 · p. 7, Figure 4 · p. 8
- As validation accuracy approaches 100%, training and validation MP-ratio standard deviations decrease while mean ratios, losses, and weight norm stabilize.Accuracy alone saturates too early to distinguish this stable generalizing solution from earlier training phases.Source: §5.2 · pp. 7–8
6 Robustness to Neural Collapse
The paper tests whether logit-layer MP ratios remain informative when neural collapse is suppressed. Their trajectories are nearly identical in standard and Anti-NC models.
6 Robustness to Neural Collapse
- The comparison uses CIFAR-10; the Anti-NC condition splits training data 40,000/10,000, while the standard condition uses official settings.Both conditions use ResNet-18, with 81 standard-model snapshots and 51 Anti-NC snapshots.Source: §6 · p. 8
- MP-ratio trajectories are nearly identical in standard and Anti-NC ResNet-18 models, indicating that the ratio captures generalization structure whether or not neural collapse occurs.The Anti-NC model uses a regularizer that explicitly penalizes neural collapse.Source: §6 · p. 8
7 Limitations
The authors identify limits in selecting the scale parameter t, computing magnitude, and testing grokking at large scale. They also report similar MP Ratio trajectories when neural collapse is suppressed.
7 Limitations
- MP Ratio trajectories remain nearly identical under standard training and Anti-NC regularization, despite the latter suppressing neural collapse.The authors report this pattern in CIFAR-10.Source: Figure 5 · p. 9
- A principled method for choosing t is difficult to derive, and the appropriate scale depends on the problem and measurement objective.In the reported experiments, t was selected mainly through trial and error; tested values preserved a strong negative correlation with memorization.Source: §7 · pp. 8–9
- Long grokking runs generally use smaller setups than full-scale applications, and checking large overparameterized models was impractical.The authors followed standard experimental setups in the area.Source: §7 · p. 9
- The matrix inversion needed to compute magnitude remains costly for large training sets, although random training-set samples perform reasonably well.Sampling-based approximations are suggested, but their performance remains to be studied.Source: §7 · p. 9
8 Related Work
The paper situates its geometric analysis alongside work on memorization, grokking, and neural representations, and distinguishes pointwise magnitude potential from magnitude-based measures of whole training trajectories.
8 Related Work
- Studies of memorization, neural collapse, and grokking followed demonstrations that large CNNs can memorize random data [33] and overparameterized networks can generalize under double descent.These findings illustrate behavior that the cited work says is more complex than traditional learning theory suggests.Source: §8 · p. 9
- Prior analyses study neural training through weight decay, loss-landscape geometry, statistical physics, algorithmic arguments about memorization, and embedding geometry.The cited approaches include work on grokking [20], memorization [8], glass-like training dynamics, neural collapse [25], and loss-landscape flatness [11].Source: §8 · p. 9
- Magnitude-based work has linked network generalization to magnitude and effective model counts [1], and magnitude dimension to an upper bound on generalization error.Those measures concern training trajectories as a whole, unlike this paper's pointwise magnitude potential in learned representations.Source: §8 · p. 9
- The paper places magnitude potential among geometric techniques for studying training dynamics and presents it as a measure of how well a point is represented by a set.The authors describe it as paralleling other approaches and potentially useful for wider study of machine-learning behavior.Source: §8 · pp. 9–10
9 Conclusion
The conclusion presents MP Ratio as a pointwise geometric measure associated with memorization and training-phase structure, including when neural collapse is suppressed. The assumptions section relies on positive-definite similarity matrices to keep magnitude quantities well-defined.
9 Conclusion
- MP Ratio strongly correlates with memorization scores per sample and, when aggregated during training, detects decision-boundary changes and provides a leading geometric indicator of grokking.The conclusion says these results do not require extensive retraining or assumptions about model architecture and loss function.Source: §9 · p. 10
- MP Ratio captures generalization structure even when neural collapse is explicitly suppressed.The conclusion also relates the measure to intra-class and inter-class geometric structure.Source: §9 · p. 10
- Magnitude potential is presented as a measure of how well a point is represented by a set, based on metric magnitude.The proposed ratio compares coverage by the point's own class with coverage by the entire dataset.Source: §9 · p. 10
A Assumptions
- The assumptions require a positive-definite similarity matrix, which makes magnitude weightings well-defined and unique.The paper states that subspaces of such spaces are also positive definite.Source: A Assumptions · p. 13
- Sufficient positive-definiteness conditions include finite Euclidean and ℓ1 subsets and finite ultrametric spaces for t > 0.The Euclidean condition covers the standard machine-learning setting with data in RD.Source: A Assumptions · p. 13
- Under the standing assumption, magnitude weights and potential remain well-defined and stable when dataset variance collapses or the scale parameter tends to zero.The discussion also accounts for point collections with duplicates, distributing each distinct point's weight among its duplicates.Source: A Assumptions · p. 13
B Proofs of Theorems
The appendix proves properties of magnitude potential, including continuity and scale behavior, and documents experimental resources and comparisons with KDE and k-NN distance.
B Proofs of Theorems
- Leave-one-out magnitude potential at a point in the set is derived by removing that point and expressing its potential through the full-set inverse similarity matrix.The theorem states that a point's potential with respect to the full set is 1 by definition.Source: B Proofs of Theorems · pp. 13–14
- Magnitude potential is Lipschitz continuous in the query point, with a bound proportional to scale, distance, and the L1 norm of the set weights.At small scale it tends to 1 for all query points, while at large scale its behavior is governed by the nearest neighbor for points outside the set.Source: B Proofs of Theorems · p. 15
C Experimental Setup
- Experiments ran on a single NVIDIA A40 GPU with four CPU cores per job and 16–48 GB of RAM, with runtimes also reported for memorization and neural-collapse analyses.A full 10-seed memorization run takes 12.2 hours; processing snapshots takes about 7 minutes for Anti-NC and 11 minutes for the standard model.Source: C Experimental Setup · p. 17
D Magnitude Potential Comparison
- On two toy datasets, magnitude potential assigns high values across dense and sparse clusters, whereas KDE suppresses sparse points and k-NN distance does not capture geometry smoothly.The comparison includes asymmetric two-moons and a dense disk with a sparse ring.Source: Figure 6 · p. 17
E Fitting and Decision Boundaries – 2D Toy Dataset
The toy-data analysis links magnitude-potential-ratio changes to decision-boundary transitions and reports that conventional fitting signals alone do not detect overfitting early. A modular-addition figure aligns training and validation signals across epochs.
E Fitting and Decision Boundaries – 2D Toy Dataset
- The magnitude potential ratio captures decision-boundary transitions, while validation accuracy and loss support generalization and conventional fitting signals alone do not detect overfitting early.The reported toy-data transition includes a shift from linear separators to class-cluster-specific boundaries, followed by a rise in standard deviation when overfitting begins.Source: E Fitting and Decision Boundaries – 2D… · p. 18, Figure 8 · p. 18, Figure 9 · p. 19
F Grokking in Modular Addition – MLP with MSE
- Figure 10 aligns training and validation MP ratios, accuracy, relative flatness, weight norm, and loss on a shared log-scaled epoch axis.Markers indicate the onsets of training and validation MP-ratio rises, validation-accuracy increases and near-perfect generalization, and stabilization.Source: Figure 10 · p. 20
G Grokking in Modular Addition – Transformer with Cross-Entropy, Sparse Training (Nanda et al. [24])
The sparse modular-addition experiment uses a Transformer trained with cross-entropy, and its figure tracks training and validation MP ratios alongside accuracy, loss, and weight norm. On CIFAR-10, the MP-ratio trajectory remains qualitatively similar across scale choices and when neural collapse is suppressed.
G Grokking in Modular Addition – Transformer with Cross-Entropy, Sparse Training (Nanda et al. [24])
- The sparse modular-addition setup uses all 12,769 ordered pairs in Z113, split 30/70 into training and validation, with a one-layer Transformer trained for 40,000 epochs.The model uses cross-entropy and AdamW with learning rate 10^-3 and weight decay 1.0.Source: G Grokking in Modular Addition –… · p. 20
- Figure 11 plots training and validation MP ratios at t=0.01 with accuracy overlays, plus train/validation loss and weight norm.The validation MP-ratio band shows its standard deviation, which is also plotted in a narrow strip below.Source: Figure 11 · p. 21
H Robustness to Neural Collapse – CIFAR-10
- The CIFAR-10 MP-ratio trajectory remains qualitatively similar across scale parameters and between standard and Anti-NC models.The comparison plots training-set trajectories in the top row and validation-set trajectories in the bottom row.Source: Figure 12 · p. 21
I Per Sample Analysis: Memorization Detection on CIFAR-100
The CIFAR-100 analysis compares per-sample MP ratios with Feldman memorization scores and examines their stability across subsampling. The paper checklist reports public datasets and an anonymized code repository, and says limitations are discussed separately.
I Per Sample Analysis: Memorization Detection on CIFAR-100
- For larger t up to 0.20, the MP-ratio difference between memorized and non-memorized points is larger; binned means are stable across subsampling seeds, while per-sample values vary more.The figures report binned means across 10 seeds and per-sample standard deviations across 10 seeds.Source: Figure 13 · p. 22, Figure 14 · p. 23, Figure 15 · p. 23
- At t=0.15, shown training samples with Feldman memorization score 1.00 have MP ratio <0.12, and the two independent procedures identify the same subset.The figure describes these samples as having logit neighborhoods geometrically inconsistent with the rest of their class.Source: Figure 16 · p. 24
2. Limitations
- The checklist states that the paper addresses limitations of the proposed method in a separate Limitations section.It identifies that discussion as Section 7.Source: §2 · p. 26
NeurIPS Paper Checklist
- The checklist reports an anonymized code repository and publicly available datasets, including CIFAR-10, CIFAR-100, modular-arithmetic splits, and Feldman memorization scores.The repository README includes download instructions.Source: §2 · p. 28