Pay Attention to Attention Distribution: A New Local Lipschitz Bound for Transformers
We present a novel local Lipschitz bound for self-attention blocks of transformers. This bound is based on a refined closed-form expression for the spectral norm of the softmax function. The resulting bound is not only more accurate than in the prior art, but also unveils the dependence of the Lipschitz constant on attention score maps. Based on the new findings, we suggest an explanation of the way distributions inside the attention map affect the robustness from the Lipschitz constant perspective. We also introduce a new lightweight regularization term called JaSMin (Jacobian Softmax norm Minimization), which boosts the transformer's robustness and decreases local Lipschitz constants of the whole network.
Code (0)
등록된 구현이 없습니다.
Similar Papers 제목 키워드 기반
How Smooth Is Attention?
Self-attention and masked self-attention are at the heart of Transformers' outstanding success. Still, our mathematical understanding of attention, in particular of its Lipschitz properties - which are key when it comes …
The Lipschitz Constant of Self-Attention
Lipschitz constants of neural networks have been explored in various contexts in deep learning, such as provable adversarial robustness, estimating Wasserstein distance, stabilising training of GANs, and formulating inve…
Adversarial RobustnessLanguage ModellingWasserstein Distributionally Robust Nonparametric Regression
Distributionally robust optimization has become a powerful tool for prediction and decision-making under model uncertainty. By focusing on the local worst-case risk, it enhances robustness by identifying the most unfavor…
regressionUniform Convergence of Lipschitz Functions with Dependent Gaussian Samples
In many practical learning problems, training samples are not i.i.d., and there is an intrinsic dependency among samples. Therefore, theoretical study of learning with dependent data has recently gained attention. In thi…
Softmax is $1/2$-Lipschitz: A tight bound across all $\ell_p$ norms
The softmax function is a basic operator in machine learning and optimization, used in classification, attention mechanisms, reinforcement learning, game theory, and problems involving log-sum-exp terms. Existing robustn…
Reinforcement Learning