Abstract
Machine learning models often rely on simple spurious features - patterns in training data that correlate with targets but are not causally related to them, like image backgrounds in foreground classification. This reliance typically leads to imbalanced test performance across minority and majority groups. In this work, we take a closer look at the fundamental cause of such imbalanced performance through the lens of memorization, which refers to the ability to predict accurately on atypical examples (minority groups) in the training set but failing in achieving the same accuracy in the testing set. This paper systematically shows the ubiquitous existence of spurious features in a small set of neurons within the network, providing the first-ever evidence that memorization may contribute to imbalanced group performance. Through three experimental sources of converging empirical evidence, we find the property of a small subset of neurons or channels in memorizing minority group information. Inspired by these findings, we hypothesize that spurious memorization, concentrated within a small subset of neurons, plays a key role in driving imbalanced group performance. To further substantiate this hypothesis, we show that eliminating these unnecessary spurious memorization patterns via a novel framework during training can significantly affect the model performance on minority groups. Our experimental results across various architectures and benchmarks offer new insights on how neural networks encode core and spurious knowledge, laying the groundwork for future research in demystifying robustness to spurious correlation.
Introduction: The Challenge of Spurious Correlations
Deep learning models are notorious for taking shortcuts. If the vast majority of training images for a specific class share a common background, the model may learn to identify the background rather than the object itself. This reliance on spurious correlations leads to high average accuracy but poor performance on minority groups—atypical examples where the spurious feature is absent or different.
As illustrated in Figure 1, models often achieve near-perfect training accuracy across all groups, yet suffer significant performance drops on minority groups ($G_1^*$ and $G_2^*$) during testing. This phenomenon, termed "spurious memorization," suggests that the model is not learning generalizable features for these groups but is instead memorizing specific training instances using a very specific, small subset of neurons.
Methodology: Identifying and Neutralizing Critical Neurons
The study investigates the structural basis of this memorization through a two-stage process:
1. Tracing and Identification
The authors used "unstructured tracing" to identify neurons with the highest weight magnitudes and gradients. They discovered that minority group performance is precariously dependent on a tiny fraction of "critical neurons"—sometimes as few as three in a network of millions.
As shown in Figure 2, perturbing just the top 0.01% of these neurons causes a massive drop in training accuracy for minority groups while having almost no effect on majority groups ($G_0, G_3$). This confirms that spurious memorization is highly localized within a "miniature subset" of neurons distributed across multiple layers.
2. The Mitigation Framework
To address this, the authors developed a fine-tuning framework inspired by contrastive learning (SimCLR). The approach utilizes a target model and an auxiliary model (a version of the target where critical neurons are pruned). During training, the target model is forced to align its feature representations with the auxiliary model using a contrastive loss (NT-Xent). By aligning the full model with a version that cannot rely on those memorization-heavy neurons, the model is forced to learn more robust, "core" features.
Experimental Results
The framework was evaluated on standard benchmarks for spurious correlation, including Waterbirds and CelebA, across ResNet-50 and ViT-Small architectures. The primary metric was Worst Group Accuracy (WGA), which tracks performance on the most challenging minority group.
- Waterbirds: WGA increased by 16.87% for ResNet-50 and 23.83% for ViT-Small compared to standard Empirical Risk Minimization (ERM).
- CelebA: Improvements of 10.77% (ResNet) and 9.45% (ViT) in WGA were observed.
- Qualitative Evidence: GradCAM visualizations confirmed that the fine-tuning strategy successfully shifted the model’s focus from spurious backgrounds to the actual objects.
Discussion and Conclusion
This research reveals that spurious memorization is not a global property of the network but is concentrated in a small subset of neurons. By identifying and neutralizing these neurons through a novel contrastive fine-tuning framework, the authors significantly improved model performance on minority groups without sacrificing overall accuracy. While the approach requires training data access and introduces some computational overhead, it demonstrates that neutralizing a few "bad apple" neurons can significantly enhance fairness and generalization in deep learning models.
Summary updated