Generalization in Neural Networks Through the Lens of Magnitude Potential

Sahel Torkamani, Henry Gouk, Rik Sarkar

TL;DR

Researchers have introduced Magnitude Potential (MP), a geometric metric derived from the theory of metric magnitude, to track how neural networks represent data during training. By calculating the MP Ratio—which compares how well a point is represented by its own class versus the entire dataset—they can identify memorized samples, detect structural changes in decision boundaries, and even predict "grokking" before it shows up in accuracy scores.

What Problem Does This Paper Address?

Despite the massive success of deep learning, we still struggle to explain why and how overparameterized networks generalize so well. Traditional statistical learning theory often fails to describe these models, which are capable of memorizing entire datasets yet still perform well on unseen data.

Specific phenomena like memorization (learning specific noisy examples by heart) and grokking (a sudden transition from memorization to generalization long after training loss has flatlined) remain mysterious. The authors aim to provide a geometric "lens" to look into the model's latent space (specifically the logit layer) to see these transitions as they happen, rather than just observing the final accuracy.

Methods

The paper builds on the mathematical theory of Metric Magnitude, which essentially measures the "effective number of points" in a space.

  1. Magnitude Potential (MP): Think of this as a "soft coverage" score. If you imagine every data point in a set $X$ carries a certain "charge," the MP at a new point $z$ measures the total influence felt from $X$. Unlike Kernel Density Estimation (KDE), which gets overwhelmed by dense clusters, MP is designed to be sensitive to outliers and sparse boundary regions—much like how neural networks behave.
  2. Magnitude Potential Ratio (MP Ratio): This is the core metric used for analysis. It is the ratio of a point's potential relative to its own class divided by its potential relative to the whole dataset.
  3. High MP Ratio: The point is geometrically "deep" within its class territory.
  4. Low MP Ratio: The point is isolated or sits in a region where classes are heavily mixed (often a sign of memorization).
  5. Efficiency: Calculating these potentials usually requires expensive matrix inversions. The authors provide a "Leave-One-Out" theorem (Theorem 6) that allows them to compute these scores for training points efficiently without retraining the model thousands of times.

Datasets

The authors validated their approach across several benchmarks:

  • 2D Toy Gaussian Dataset: Used for direct visualization of decision boundaries.
  • CIFAR-10 & CIFAR-100: Standard image classification benchmarks used to study memorization scores and "Neural Collapse."
  • Modular Arithmetic ($Z_{37}$ and $Z_{113}$): The classic "grokking" setup where a model learns to perform addition modulo $p$.

Key Insights and Ideas

  • A Better Outlier Detector: MP is mathematically "smoother" than nearest-neighbor methods and less biased toward high-density regions than KDE. This makes it uniquely suited for the high-dimensional, often sparse latent spaces of neural networks.
  • Geometric Signal for Memorization: The MP Ratio correlates strongly with "Feldman memorization scores." While Feldman's scores require training thousands of models to see which points are "hard," the MP Ratio can be calculated from a single snapshot of a trained model.
  • Leading Indicator for Grokking: In modular arithmetic experiments, the MP Ratio begins to rise before the validation accuracy starts its sudden climb. This suggests that the geometric restructuring of the latent space precedes the functional improvement in performance.
  • Independence from Neural Collapse: "Neural Collapse" is a known phenomenon where within-class features converge to a single point. The authors proved that the MP Ratio remains a useful signal even when they explicitly use techniques to prevent Neural Collapse from happening.

Key Results

  • Memorization Correlation: On CIFAR-100, the MP Ratio achieved a Spearman correlation of up to -0.763 with Feldman memorization scores. A low MP Ratio is a very strong indicator that a point has been memorized rather than generalized.
  • Structural Detection: In 2D experiments, the standard deviation of the MP Ratio dropped significantly exactly when the model transitioned from simple linear separators to complex, class-specific curved boundaries.
  • Grokking Prediction: The mean training MP Ratio rises sharply as the model begins to consolidate class distributions, providing a clear geometric signal of the "aha!" moment in grokking tasks.

Limitations and Future Work

  • The $t$ Parameter: The metric relies on a scale parameter $t$. While the authors found the MP Ratio is relatively stable across different values of $t$, choosing the "optimal" scale currently requires some trial and error.
  • Computational Scale: Although Theorem 6 makes the calculation much faster, it still involves matrix inversions. For massive datasets (millions of points), the authors suggest using sampling-based approximations, but the full scalability to "Foundation Model" sizes remains to be studied.
  • Architectural Scope: Most experiments were conducted on MLPs and ResNets. Extending this analysis to large-scale Transformers in NLP or Generative Models is a promising next step.

Summary updated

Abstract

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.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
CIFAR-100Magnitude Potential Ratio (t=0.20, 10-seed average)Spearman correlation (ρ) with Feldman memorization scores−0.763split: train · backbone=ResNet-50
Source quote
L363: −0.763
Reported baseline / comparator measurements (4)
BenchmarkMethodMetricScoreProtocol / Evidence
CIFAR-100Max softmax probability baselineSpearman correlation (ρ) with Feldman memorization scores−0.507split: train · backbone=ResNet-50
Source quote
L342: −0.507
CIFAR-100Logit margin baselineSpearman correlation (ρ) with Feldman memorization scores−0.655split: train · backbone=ResNet-50
Source quote
L345: −0.655
CIFAR-100Entropy baselineSpearman correlation (ρ) with Feldman memorization scores0.661split: train · backbone=ResNet-50
Source quote
L348: 0.661
CIFAR-100Cross-entropy loss baselineSpearman correlation (ρ) with Feldman memorization scores0.507split: train · backbone=ResNet-50
Source quote
L351: 0.507
BibTeX
@inproceedings{torkamani2026generalization,
  author = {Sahel Torkamani and Henry Gouk and Rik Sarkar},
  title = {{Generalization in Neural Networks Through the Lens of Magnitude Potential}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=V9A3lPMU5E},
}
Figure