Memorization Through the Lens of Curvature of Loss Function Around Samples

Isha Garg, Deepak Ravikumar, Kaushik Roy

TL;DR

This paper introduces a highly scalable metric to detect data memorization in deep neural networks by measuring the local curvature of the loss function around individual training samples. Unlike previous gold-standard methods that require training thousands of models to compute memorization scores, this approach requires just a single training run. Using this metric, the authors successfully uncover hidden dataset flaws, such as identical images with conflicting labels in CIFAR-100 and ImageNet.

What Problem Does This Paper Address?

Deep neural networks are notorious for their capacity to overfit and memorize data—even completely randomized labels. Identifying which specific samples are being memorized (like mislabeled data or extreme outliers) versus generalized is crucial for auditing dataset quality, preventing privacy leaks (such as membership inference attacks), and defending against data poisoning.

However, existing state-of-the-art methods to quantify sample-level memorization (like leave-one-out influence estimation) require training thousands of models on altered subsets of the data. This makes them computationally prohibitive for large-scale datasets. This paper tackles the challenge of finding a scalable, single-run metric to diagnose what a network is memorizing.

Methods

The authors propose measuring the local curvature of the loss function with respect to the input data point. Intuitively, if a network has to force a complex decision boundary around an atypical or mislabeled sample to memorize it, the loss surface around that sample will be highly curved and sensitive to small perturbations.

  • Mathematical Formulation: Curvature is quantified using the trace of the square of the Hessian matrix ($Tr(H^2)$) of the loss function with respect to the input $X$.
  • Efficiency Trick: Instead of explicitly computing the massive Hessian matrix, they use Hutchinson’s trace estimator combined with a finite-step approximation. This reduces the computation to simple forward and backward passes that can be easily parallelized.
  • Temporal Averaging: Because the loss curvature changes dynamically as training progresses, the final metric averages the curvature scores across all training epochs to ensure stability.

Datasets

The method was evaluated on standard computer vision benchmarks:

  • MNIST and Fashion-MNIST (FMNIST)
  • CIFAR-10 and CIFAR-100
  • ImageNet

While no new datasets were introduced, the authors used their metric to audit these existing benchmarks for latent annotation errors.

Key Insights and Ideas

  • The Curvature-Memorization Link: Samples with low curvature are prototypical and easily generalized. High-curvature samples are outliers, ambiguous instances, or outright mislabeled data that the network must explicitly memorize.
  • Uncovering Hidden Duplicates: By looking at the highest curvature samples, the authors discovered a novel failure mode in CIFAR-100 and ImageNet: duplicated images with entirely different labels (e.g., the exact same image labeled as 'girl' in one instance and 'baby' in another).
50 highest curvature samples from CIFAR100 and ImageNet, highlighting duplicated pairs with conflicting labels (marked with red dots).
  • Curvature Dynamics (The Overfitting Peak): Curvature doesn't just increase monotonically. It rises sharply during early training, peaks right before the network starts to overfit, and then decreases. This decrease happens because the cross-entropy loss aggressively maximizes logit margins, saturating the softmax layer and making the gradients insensitive to small input changes.
Loss curves and average trainset curvature estimates on CIFAR100 showing the peak and decline of curvature during training.

Key Results

  • High Alignment with Baselines: The proposed curvature metric achieved a high cosine similarity (up to 0.90 for the top-K memorized samples) with the Feldman & Zhang (2020) baseline, despite requiring only a fraction of the computational cost (1 training run vs. thousands).
  • Label Corruption Detection: When 1% to 10% of labels were synthetically corrupted, sorting samples by curvature identified the corrupted data with remarkably high accuracy, yielding AUROC scores between 0.84 and 1.0 across MNIST, CIFAR-10, and CIFAR-100.

Limitations and Future Work

  • Intentional Overfitting Required: To measure what a network can memorize, the model must be intentionally trained to 100% training accuracy (often removing weight decay), which might not reflect standard deployment training setups.
  • Blind to Non-Conflicting Duplicates: The method only flags duplicate images if they have different labels. Duplicates with the same label do not create a boundary conflict, so they exhibit low curvature and go undetected.
  • Epoch Averaging Necessity: Due to softmax saturation dropping curvature late in training, practitioners cannot simply compute curvature at the final epoch; they must track or sample it across the training trajectory.

Summary updated

BibTeX
@inproceedings{garg2024memorization,
  author = {Isha Garg and Deepak Ravikumar and Kaushik Roy},
  title = {{Memorization Through the Lens of Curvature of Loss Function Around Samples}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=WQbDS9RydY},
}
Figure