Towards the Memorization Effect of Neural Networks in Adversarial Training

Han Xu, Xiaorui Liu, Wentao Wang, Wenbiao Ding, Zhongqin Wu, Zitao Liu, Anil Jain, Jiliang Tang

TL;DR

In standard classification, memorizing rare or "atypical" examples is crucial for achieving high test accuracy without harming typical data. This paper reveals that in adversarial training (AT), memorizing atypical examples fails to yield adversarial robustness on those rare cases and actually acts as training data poisoning—severely degrading performance on normal, typical examples. To fix this, the authors introduce Benign Adversarial Training (BAT), which identifies and downweights harmful atypical samples while enforcing representation-level class separation.

What Problem Does This Paper Address?

Overparameterized neural networks often achieve optimal performance through "benign overfitting"—memorizing rare, atypical examples in the long tail of the training distribution. In standard Empirical Risk Minimization (ERM), memorizing these outliers improves test accuracy on atypical examples without harming typical ones.

However, adversarially trained models exhibit poor generalization: they suffer from lower clean accuracy, lower robust accuracy, and severe robust overfitting. The authors ask a fundamental question: What is the true effect of memorization in adversarial training? Specifically, does fitting adversarial counterparts of rare samples help or hurt the network?

Key Insights and Ideas

  • Robustness on atypical samples does not generalize: On CIFAR-100, while a network reaches $\sim$100% training adversarial accuracy on atypical samples, test robust accuracy stagnates around 10% (even though clean test accuracy reaches $\sim$40%). Because atypical sub-populations have very few samples, they suffer heavily from the sample complexity gap required for adversarial generalization.
  • Atypical samples "poison" typical samples in AT: Unlike in standard ERM—where atypical data has zero negative effect on typical samples—adversarially training on 100% atypical data reduces typical-set clean accuracy by $\sim$4.5% and robust accuracy by $\sim$4.6% on CIFAR-100.
  • Why this happens (The Geometry of Adversarial Overfitting): Atypical samples often share visual characteristics with a different ("wrong") class (e.g., an unusual plate shaped like an apple). In ERM, a model can carve a small decision pocket around this outlier. But in AT, the model is forced to classify the entire $\epsilon$-ball around the outlier as the true class. This large ball encroaches directly onto the typical distribution of the opposing class, mathematically guaranteeing high error on typical samples.

Methods

The authors propose Benign Adversarial Training (BAT), combining two mechanisms:

  1. Reweighting via Poisoning Scores: For each training adversarial sample $x_i^{\text{adv}}$, the model calculates a poisoning score $q(x_i^{\text{adv}}) = \max_{t \neq y} F_t(x_i^{\text{adv}})$, measuring model confidence toward the most likely incorrect class. Atypical samples with high poisoning scores are downweighted exponentially: $$w_i = \exp(-\alpha \cdot q(x_i^{\text{adv}}))$$ This suppresses harmful atypical samples while preserving "benign" atypical samples.

  2. Discrimination Loss ($\mathcal{L}_{\text{DL}}$): To counteract feature overlap, BAT adds a contrastive loss over penultimate representations of typical samples. It pulls representations from the same class together while pushing apart representations of different classes, increasing margin and mitigating boundary overlap caused by outliers.

       Standard AT                         Benign AT (BAT)
 [Class A]       [Class B]           [Class A]       [Class B]
    ●●●             ▲▲▲                 ●●●             ▲▲▲
     ●  \ $\epsilon$-ball /  ▲            ●               ▲
         (  Atypical  )               (Outlier downweighted)
          \ Class A  /                  + Contrastive margin

Datasets

The study evaluates on standard vision benchmarks with known atypical sample splits:

  • CIFAR-100 ($\sim$40% atypical samples)
  • Tiny ImageNet (evaluated on the first 50 classes, $\sim$49% atypical samples)
  • CIFAR-10 (evaluated in preliminary studies and appendices, $\sim$11% atypical samples)

No new datasets were introduced; atypical samples were identified using memorization values from leave-out retraining and influence estimation.

Key Results

BAT consistently surpasses standard PGD adversarial training and existing reweighting/regularization defenses (TRADES, MART, GAIRAT) across both clean and robust metrics on WideResNet-28-10 (WRN-28):

  • CIFAR-100 (WRN-28, $\ell_\infty = 8/255$):
  • Clean Accuracy: BAT achieves 62.0%, outperforming standard PGD AT (59.7%), TRADES (57.3%), and MART (56.5%).
  • Auto-Attack (AA): BAT achieves 24.8%, compared to 22.5% for PGD AT, 22.9% for TRADES, and 23.8% for MART.
  • PGD-100 Accuracy: BAT achieves 28.5% vs. 24.7% for standard AT.
  • Tiny ImageNet (WRN-28, $\ell_\infty = 4/255$):
  • Clean Accuracy: BAT reaches 62.4% vs. 58.9% (PGD AT) and 58.2% (MART).
  • Auto-Attack (AA): BAT reaches 35.6% vs. 30.0% (PGD AT) and 34.1% (MART).

Crucially, BAT avoids the typical trade-off where gains in robustness sacrifice clean accuracy.

Limitations and Future Work

  • Computational Cost of Estimating Memorization: Computing ground-truth memorization scores via leave-out retraining requires training hundreds to thousands of models. While the authors suggest proxies (ensemble disagreement or model confidence), end-to-end efficiency during pipeline setup remains an overhead.
  • Scale: Experiments were limited to CIFAR-10/100 and a 50-class subset of Tiny ImageNet; validation on full-scale ImageNet is omitted.
  • Hyperparameter Sensitivity: Performance relies on tuning both $\alpha$ (reweighting intensity) and $\beta$ (discrimination loss weight); setting either too high hurts clean accuracy.

Summary updated

BibTeX
@inproceedings{xu2022towards,
  author = {Han Xu and Xiaorui Liu and Wentao Wang and Wenbiao Ding and Zhongqin Wu and Zitao Liu and Anil Jain and Jiliang Tang},
  title = {{Towards the Memorization Effect of Neural Networks in Adversarial Training}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=gc8zLQWf2k},
}
Figure