An Investigation of how Label Smoothing Affects Generalization

Blair Chen, Ziyin Liu, Zihao Wang, Paul Pu LiangarXiv 2020

Introduction

Label smoothing is a ubiquitous regularization technique in deep learning that replaces "hard" one-hot labels with a softened target distribution. While empirically successful in reducing overfitting across various domains, the mathematical intuition behind its effectiveness and a principled method for selecting the smoothing hyperparameter $p$ have remained elusive. This paper addresses these gaps by framing label smoothing as a defense against label noise. The authors derive exact formulas for the optimal smoothing parameter ($p^*$) that minimizes generalization loss under different test set corruption assumptions.

Theoretical Framework

The authors analyze the expected generalization loss by modeling training data with a clean rate $a$ and a corruption rate $1-a$. They consider three distinct scenarios for the test set:

  1. $\alpha$-Type (Clean Test Set): Training data is noisy, but the test set is perfectly clean.
  2. $\beta$-Type (Corrupted Test Set): Both training and test sets share the same independent noise level, reflecting standard dataset splits.
  3. $\gamma$-Type (Bayesian Approach): Smoothing is viewed as an a priori assumption about target distributions.
Theoretical loss landscapes for $\alpha$, $\beta$, and $\gamma$-type test set assumptions.

For each type, the authors derive empirical generalization loss functions. They also extend these binary classification models to multiclass settings using a "mean-field" approximation to handle complex noise transition matrices.

Experimental Setup

To validate their theoretical predictions, the authors conducted experiments on standard vision datasets:

  • MNIST: Using a 4-layer Convolutional Neural Network.
  • CIFAR-10: Using a ResNet-18 architecture. Symmetric noise was artificially injected into these datasets to control the clean rate $a$ and compare empirical results with theoretical derivations.

Analysis of Optimal Smoothing

A key insight is that the optimal smoothing parameter $p^*$ is intrinsically linked to the dataset's clean rate $a$. In the $\alpha$-type scenario, $p^*$ equals the clean rate ($p^* = a$). However, for the more realistic $\beta$-type scenario, stronger smoothing is required ($p^* < a$).

Optimal smoothing parameter $p^*$ as a function of the clean rate $a$ for different test set types.

The authors demonstrate that the $\alpha$-type optimal smoothing rule is mathematically equivalent to Forward-Matrix Correction, bridging a simple heuristic with robust learning theory. Conversely, they find that "weak" smoothing (e.g., $p=0.95$) on high-noise data can actually impair performance compared to no smoothing.

Empirical Validation

The theoretical loss landscapes accurately predicted empirical test loss on MNIST and CIFAR-10 across various noise levels. For $\beta$-type noise in binary settings, the optimal parameter is $p^* = 2a^2 - 2a + 1$. In multiclass settings with $M$ classes, it generalizes to $p^*_\beta = \frac{1-2a+a^2M}{M-1}$. Notably, in high-noise scenarios, using a default weak smoothing parameter led to accuracy drops of up to 8% compared to no smoothing.

Discussion and Future Directions

Despite the predictive power of the loss formulas, a discrepancy exists between the $p$ that minimizes test loss and the $p$ that maximizes test accuracy, with smaller parameters often yielding better accuracy. Future work includes developing methods to estimate the "effective clean rate" in real-world datasets and exploring "logit smoothing," a concept derived from the theoretical gap between label smoothing and Forward-Matrix correction. Additionally, the framework's applicability to perfectly clean (zero-noise) settings remains an open question.

Summary updated

BibTeX
@misc{chen2020investigation,
  author = {Blair Chen and Ziyin Liu and Zihao Wang and Paul Pu Liang},
  title = {{An Investigation of how Label Smoothing Affects Generalization}},
  year = {2020},
  eprint = {2010.12648},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.12648},
}
Figure