Share from 0:00
0:00
/

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

The podcast on this paper is generated with Google's Illuminate.

Self-attention is actually doing kernel PCA under the hood - now we can make it robust

So how does Self-attention works: it's kernel PCA in disguise, as proposed in this paper.

πŸ“š https://arxiv.org/abs/2406.13762

πŸ€” Original Problem:

Self-attention in transformers has been developed through heuristics and experience, lacking a systematic theoretical framework to understand its inner workings and improve robustness against data corruption.

-----

πŸ”§ Solution in this Paper:

β†’ Derives self-attention from kernel Principal Component Analysis (kernel PCA), showing it projects query vectors onto principal component axes of key matrix

β†’ Introduces RPC-Attention (Attention with Robust Principal Components) that uses Principal Component Pursuit to handle corrupted data

β†’ Implements PAP (Principal Attention Pursuit) algorithm that iteratively recovers clean data from corrupted inputs

-----

πŸ’‘ Key Insights:

β†’ Self-attention mathematically performs kernel PCA in feature space

β†’ Value matrix captures eigenvectors of Gram matrix of key vectors

β†’ Number of principal components used must be ≀ number of data points

β†’ Different value matrix parameterizations lead to different attention architectures

-----

πŸ“Š Results:

β†’ RPC-Attention outperforms baseline on ImageNet-1K by 1% accuracy

β†’ Shows 3% improvement in AUPR on ImageNet-O

β†’ Better performance against PGD, FGSM, SPSA adversarial attacks

β†’ 1 PPL improvement on WikiText-103 language modeling

Discussion about this video

User's avatar

Ready for more?