Transformers Learn Low Sensitivity Functions: Investigations and Implications
Bhavya Vasudeva, Deqing Fu, Tianyi Zhou, Elliott Kau, Youqi Huang, Vatsal Sharan
TL;DR
The paper shows that Transformers exhibit a low-sensitivity bias to token-wise input perturbations across vision and language tasks, distinguishing them from CNNs, MLPs, and LSTMs. It extends the Boolean-sensitivity concept to real-valued data, defines a practical sensitivity measure, and provides theoretical support via a weak spectral bias in linear-attention kernels. Empirically, lower sensitivity correlates with improved robustness, flatter minima, and even provides a progress signal for grokking, with consistent results across synthetic data, ViT versus CNN comparisons, and RoBERTa versus LSTM analyses. These findings highlight a unified inductive bias of Transformers that has direct implications for robustness, generalization, and training dynamics, suggesting sensitivity as a practical tool for model analysis and design.
Abstract
Transformers achieve state-of-the-art accuracy and robustness across many tasks, but an understanding of their inductive biases and how those biases differ from other neural network architectures remains elusive. In this work, we identify the sensitivity of the model to token-wise random perturbations in the input as a unified metric which explains the inductive bias of transformers across different data modalities and distinguishes them from other architectures. We show that transformers have lower sensitivity than MLPs, CNNs, ConvMixers and LSTMs, across both vision and language tasks. We also show that this low-sensitivity bias has important implications: i) lower sensitivity correlates with improved robustness; it can also be used as an efficient intervention to further improve the robustness of transformers; ii) it corresponds to flatter minima in the loss landscape; and iii) it can serve as a progress measure for grokking. We support these findings with theoretical results showing (weak) spectral bias of transformers in the NTK regime, and improved robustness due to the lower sensitivity. The code is available at https://github.com/estija/sensitivity.
