atlas

Research map / Architectures and efficiency / Attention and transformers

Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Sparse and structured attention · 1 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.

Derives softmax self-attention from kernel PCA and proposes RPC-Attention, a robust attention variant using principal component pursuit unrolled into self-attention layers, showing gains on ImageNet-1K, attacks/corruptions, ADE20K and WikiText-103.

Problem

Self-attention is built on heuristics, lacking a principled framework; softmax attention is also vulnerable to data corruption and adversarial perturbations.

Approach

Shows that softmax attention equals kernel PCA projection of queries onto principal axes of the key matrix in a feature space, with values capturing Gram-matrix eigenvectors; uses principal component pursuit (solved via unrolled ADMM, called Principal Attention Pursuit) to define a robust attention layer (RPC-Attention).

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Replace softmax attention with RPC-Attention using 6 PAP iterations at the first layerViT-tiny SymViT · ImageNet-1K valTop-1 accuracy: 70.44 -> 71.49Helped
Use 6 PAP iterations at the first layer instead of baseline softmax attentionViT-tiny SymViT · ImageNet-CmCE: 74.75 -> 73.03Helped
Use 5 PAP iterations at the first layer instead of baseline softmax attentionViT-tiny SymViT · ImageNet-OAUPR: 17.43 -> 20.35Helped
Use 2 PAP iterations at all layers instead of baseline softmax attentionViT-tiny SymViT · PGD ImageNet-1KTop-1 accuracy: 4.98 -> 6.12Helped
Use 6 PAP iterations at the first layer instead of baseline softmax attentionViT-tiny SymViT · FGSM ImageNet-1KTop-1 accuracy: 23.38 -> 27.22Helped
Use 6 PAP iterations at the first layer instead of baseline softmax attentionViT-tiny SymViT · AutoAttack ImageNet-1KTop-1 accuracy: 23.09 -> 24.74Helped
Use 6 PAP iterations at the first layer instead of baseline softmax attentionViT-tiny SymViT · Square attack ImageNet-1KTop-1 accuracy: 41.50 -> 43.64Helped
Apply RPC-Attention in the first four layers with 4 PAP iterationsWikiText-103 Symlm · WikiText-103 testPerplexity: 36.36 -> 35.26Helped
Apply RPC-Attention in the first four layers with 4 PAP iterationsWikiText-103 Symlm · Attacked WikiText-103 testPerplexity: 44.32 -> 43.16Helped
Use 4 PAP iterations at the first layerSegmenter with SymViT backbone · ADE20KMean IOU: 34.00 -> 34.69Helped
Use 6 PAP iterations at the first layerSegmenter with SymViT backbone · Corrupted ADE20KMean IOU: 10.47 -> 11.60Helped
Apply 2 PAP iterations at all layers instead of baseline softmax attentionSymViT-base · ImageNet-1K valTop-1 accuracy: 80.62 -> 80.72Helped

Surprising findings

Limitations

Experimental setup

Datasets: ImageNet-1K ADE20K WikiText-103

Benchmarks: ImageNet-1K ImageNet-C ImageNet-A ImageNet-O ImageNet-R ADE20K WikiText-103 PGD FGSM SPSA SLD CW

Metrics: top-1 accuracy top-5 accuracy mCE AUPR mean accuracy mean IOU perplexity

Baselines: SymViT (softmax attention) Symlm FAN

Builds on: principal component pursuit kernel PCA vision transformer (DeiT) Segmenter FAN

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