Benign Overfitting in Single-Head Attention
Roey Magen, Shuning Shang, Zhiwei Xu, Spencer Frei, Wei Hu, Gal Vardi
TL;DR
The paper investigates benign overfitting for a single-head softmax attention mechanism in a high-dimensional, noisy-label setting. It shows that gradient descent on logistic loss attains exact interpolation after two iterations when the signal-to-noise ratio scales as O(1/√n), while maintaining near-optimal generalization. It extends the result to min-norm / max-margin interpolators, establishing similar benign behavior under the same SNR, and demonstrates the tightness of the SNR threshold in two-token scenarios. Complementary experiments validate the theoretical predictions, including attention allocation that favors signal tokens for clean data and noise tokens for noisy data. This work provides a foundational step toward understanding overfitting in attention mechanisms central to Transformers and suggests directions for more complex architectures and training dynamics.
Abstract
The phenomenon of benign overfitting, where a trained neural network perfectly fits noisy training data but still achieves near-optimal test performance, has been extensively studied in recent years for linear models and fully-connected/convolutional networks. In this work, we study benign overfitting in a single-head softmax attention model, which is the fundamental building block of Transformers. We prove that under appropriate conditions, the model exhibits benign overfitting in a classification setting already after two steps of gradient descent. Moreover, we show conditions where a minimum-norm/maximum-margin interpolator exhibits benign overfitting. We study how the overfitting behavior depends on the signal-to-noise ratio (SNR) of the data distribution, namely, the ratio between norms of signal and noise tokens, and prove that a sufficiently large SNR is both necessary and sufficient for benign overfitting.
