TL;DR
Sharpness-Aware Minimization (SAM) is famous for helping neural networks generalize better, yet it paradoxically makes them more vulnerable to privacy attacks than standard gradient descent. This paper uncovers the single geometric mechanism behind both effects: in real-world datasets with rare "tail" examples, SAM actively preserves weak minority features. While this boosts accuracy on rare subclasses, learning those features from just a handful of training points leaves a distinct fingerprint that attackers can exploit—meaning the rare tail ends up wagging the entire model.
What Problem Does This Paper Address?
In machine learning, generalization and privacy usually go hand in hand. If a model generalizes well, its behavior on training data and unseen test data should look nearly identical. That makes life hard for Membership Inference Attacks (MIAs), where an attacker tries to guess whether a specific data point was used to train the model (for instance, by checking if the model is suspiciously confident about it).
Enter Sharpness-Aware Minimization (SAM). Instead of just finding a point with low training loss like Stochastic Gradient Descent (SGD), SAM looks for flat regions where the loss stays low even if you wiggle the parameters. Flatness leads to great generalization. Yet, recent empirical work noticed something bizarre: models trained with SAM leak more membership privacy than SGD. How can an algorithm shrink the gap between seen and unseen data while simultaneously making training examples easier to spot?
The authors resolve this paradox by looking at long-tailed data distributions—datasets made of abundant "typical" examples (driven by strong majority features) alongside a long tail of rare "atypical" examples (which rely on weaker minority features).
Methods
To isolate what SAM is actually doing without getting lost in the weeds of massive architectures, the authors build a clean, novel theoretical framework:
- Two-Branch Interpolation Model: They analyze an overparameterized two-layer linear network split into two branches—one aligned with a strong majority feature, the other with a weaker minority feature. Because the model is overparameterized, there is a smooth trajectory of zero-loss solutions: moving one way leans heavily on the majority feature; moving the other preserves the minority feature.
- Late-Phase Curvature Analysis: Rather than treating "flatness" abstractly, they compute the exact loss-surface curvature perpendicular to this zero-loss trajectory, comparing one step of full-batch Gradient Descent (GD) against one step of SAM.
- Cluster Separation & Prototype Scoring: To bridge optimization with representation quality and privacy, they introduce two analytical tools in the penultimate embedding space: a clustering ratio (comparing within-group spread to cross-group distance) and a prototype-alignment score that measures how closely an example aligns with the average embedding of atypical training points.
Datasets
The authors test their theory on two fronts:
- CIFAR-100: Used as a real-world benchmark exhibiting long-tailed subclass structure. To separate "typical" from "atypical" examples, they use pre-computed influence entropy scores (measuring whether a sample's prediction relies on many training points or just a few).
- Custom Synthetic Dataset: Newly constructed to mirror their theoretical setup. It features 500 training and 2,000 test samples (with 5% atypical examples), where each input has 300-dimensional majority and minority branches with asymmetric signal-to-noise ratios.
Key Insights and Ideas
- Flatness has a feature-level meaning: Along the trajectory of solutions that fit the training data, leaning on the dominant majority feature creates a sharper loss landscape. Because SAM perturbations push away from sharp directions, SAM naturally slides farther toward the minority-preserving side of the trajectory than GD.
- Untangling the tail: Preserving that minority feature pulls typical and atypical embeddings apart into distinct clusters. Instead of lumping rare examples in with the crowd, SAM gives them their own representational breathing room.
- The finite-sample trap: Here is the catch. Because atypical examples are rare, the model estimates their cluster prototype from only a tiny number of training points ($m$). Every atypical training member pulls that empirical average slightly toward its own random noise—creating a self-correlation proportional to $1/m$. When SAM amplifies minority feature alignment, it amplifies both the true signal and this finite-sample quirk, making atypical training members stand out from unseen atypical test points. (For typical examples, $m$ is huge, so any similar effect gets diluted away.)
Key Results
Both real-world and synthetic experiments back up the theory:
- Cleaner Cluster Separation (CIFAR-100): Using a ResNet50, SAM reduces cross-group representational entanglement between typical and atypical test samples by 2.5% compared to SGD, while tightening within-group entanglement by 13.2%.
- Targeted Privacy Leakage (CIFAR-100): Stratified confidence-based MIAs reveal where the privacy leak actually lives. On typical samples, SAM is slightly safer than SGD (13.72% vs. 14.75% attack success), and they tie on intermediate samples (~65.8%). On atypical samples, however, SAM's MIA vulnerability jumps to 82.12% compared to SGD's 78.76% (+3.36 percentage points).
- Generalization vs. Privacy (Synthetic): While both GD and SAM hit 100% test accuracy on majority/typical examples, SAM noticeably boosts minority/atypical test accuracy while simultaneously widening the membership signal gap ($\Delta_{\text{MIA}}$).
Limitations and Future Work
The authors are upfront about the simplifying assumptions required to keep the math transparent:
- Simplified Architecture & Dynamics: The proofs rely on a two-branch linear network within an aligned parameter space, focusing strictly on local, late-phase training dynamics near zero loss rather than the full trajectory from random initialization in deep nonlinear networks.
- Perturbation Radius ($\rho$) Trade-offs: The theory holds for sufficiently small step sizes and perturbation radii $\rho$. Empirically, cranking $\rho$ up too high over-amplifies the minority feature at the expense of the majority feature, tanking accuracy on typical samples.
- Threat Model Scope: Their theoretical privacy metric tracks prototype alignment in embedding space—a representation-level root cause—rather than modeling every possible black-box MIA.
- Future Takeaway: Privacy audits shouldn't rely solely on dataset-wide averages; evaluating typical and rare subpopulations separately is essential when using optimizers that reshape learned representations.
Summary updated