atlas

Research map / Architectures and efficiency / Attention and transformers

How Smooth Is Attention?

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Attention head and block redesign · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Studies the local Lipschitz constant of unmasked and masked self-attention across regimes (finite sequence length, large radius, mean-field), proving sqrt(n) bounds and a novel mean-field framework for masked attention, validated on BERT and GPT-2.

Problem

The Lipschitz properties of self-attention, key for robustness and expressivity of Transformers, are poorly understood, especially how they depend on sequence length and for masked self-attention.

Approach

Derives Lipschitz bounds for self-attention on compact sets growing as sqrt(n) with sequence length, identifies a large-radius regime where the constant is independent of R, and builds a mean-field framework (with an extra position coordinate) for masked self-attention, showing similar bounds hold.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Increase sequence length on real text inputsBERT and GPT-2 self-attention · Alice in Wonderland and AG_NEWSlocal Lipschitz constant: n^{1/4}Mixed
Increase sequence length on constructed adversarial inputsSelf-attention layers · Adversarial datalocal Lipschitz constant: \sqrt{n}Helped
Use pretrained GPT-2 instead of the other real-data casesGPT-2 self-attention · Real text datalocal Lipschitz constant growth rate: faster than \sqrt{n}Mixed
Use smaller scaling factors for adversarial inputsGPT-2 randomly initialized self-attention · Adversarial datalocal Lipschitz constant growth rate: n^{1/2}Hurt

Surprising findings

Limitations

Experimental setup

Datasets: Alice in Wonderland (NLTK Gutenberg) AG_NEWS (torchtext)

Benchmarks: Alice in Wonderland AG_NEWS

Metrics: local Lipschitz constant (operator norm of Jacobian)

Baselines: L2 self-attention Kim et al. mean-field bound

Builds on: L2 self-attention mean-field self-attention (Geshkovski et al.) Wasserstein distance

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy