Pay Attention to Attention Distribution: A New Local Lipschitz Bound for Transformers

Nikolay Yudin, Alexander Gaponov, Sergei Kudriashov, Maxim Rakhuba
7/10/2025
cs.LGmath.NA

No confident code implementation found for this paper.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{yudin2025attention,
  title  = {Pay Attention to Attention Distribution: A New Local Lipschitz Bound for Transformers},
  author = {Nikolay Yudin and Alexander Gaponov and Sergei Kudriashov and Maxim Rakhuba},
  year   = {2025},
  eprint = {2507.07814},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.07814v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.07814.svg)](https://codeofpaper.com/paper/2507.07814)

Discussion