atlas

Research map / Architectures and efficiency / Attention and transformers

Towards Understanding the Word Sensitivity of Attention Layers: A Study via Random Features

ICML 2024 · Architectures and efficiency › Attention and transformers · approach: Attention head mechanisms · 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.

The paper defines word sensitivity and shows random attention features (softmax) keep constant sensitivity to a single-word change while random features decay as 1/sqrt(n), leading to generalization lower bounds for RF but not RAF.

Problem

Whether attention layers have higher sensitivity to a single word change than fully connected random features, and how this affects the ability of models to distinguish contexts differing in one word in a long sentence.

Approach

Defines word sensitivity (WS) as the worst-case relative change of a feature map when one token embedding is perturbed; proves RF maps have WS O(1/sqrt n) while softmax random attention features have WS Omega(1) via a probabilistic-method argument that exploits softmax concentration, and links WS to generalization of fine-tuned/retrained GLMs.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use softmax attention rather than a fully connected random-feature maprandom feature maps on generic normalized contexts · Generic normalized contextword sensitivity: \bigO{1/\sqrt n} = o(1) -> \Omega(1)Helped
replace softmax with ReLU and renormalize attention scores (ablation)RAF · Generic normalized contextword sensitivityHurt
increase the depth of a random-feature architecture (ablation)DRF · Generic normalized contextword sensitivity: \bigO{\frac{e^{CL}}{\sqrt n}}No clear effect
fine-tune the model on the original sampleRF · Opposite-label single-word modificationtest error: > (2 - \gamma)^2 - \bigO{1/\sqrt n}Hurt
add the original sample to the training set and retrainRF · Opposite-label single-word modificationtest error: > (2 - \gamma)^2 - \bigO{1/\sqrt n}Hurt
fine-tune on the original sampleRAF · IMDb BERT-Base embeddings, n ∈ {40, 120}test errorHelped
replace softmax with ReLU and renormalize attention scores (ablation)RAF fine-tuning · IMDb BERT-Base embeddings, n = 120test errorHurt
fine-tune on the original sampleRF · IMDb BERT-Base embeddings, n = 40test errorMixed
add the original sample to the training set and retrainRAF · IMDb BERT-Base embeddingstest errorHelped

Surprising findings

Limitations

Experimental setup

Datasets: IMDB reviews

Benchmarks: IMDB

Metrics: word sensitivity relative change of feature map test error on perturbed sample

Baselines: random features (RF) ReLU-RAF deep random features (DRF)

Builds on: random features random attention features neural tangent kernel

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