Primal-Attention: Self-attention through Asymmetric Kernel SVD in Primal Representation
Yingyi Chen, Qinghua Tao, Francesco Tonin, Johan A. K. Suykens
Abstract
Recently, a new line of works has emerged to understand and improve self-attention in Transformers by treating it as a kernel machine. However, existing works apply the methods for symmetric kernels to the asymmetric self-attention, resulting in a nontrivial gap between the analytical understanding and numerical implementation. In this paper, we provide a new perspective to represent and optimize self-attention through asymmetric Kernel Singular Value Decomposition (KSVD), which is also motivated by the low-rank property of self-attention normally observed in deep layers. Through asymmetric KSVD, i) a primal-dual representation of selfattention is formulated, where the optimization objective is cast to maximize the projection variances in the attention outputs; ii) a novel attention mechanism, i.e., Primal-Attention, is proposed via the primal representation of KSVD, avoiding explicit computation of the kernel matrix in the dual; iii) with KKT conditions, we prove that the stationary solution to the KSVD optimization in Primal-Attention yields a zero-value objective. In this manner, KSVD optimization can be implemented by simply minimizing a regularization loss, so that low-rank property is promoted without extra decomposition. Numerical experiments show state-of-theart performance of our Primal-Attention with improved efficiency. Moreover, we demonstrate that the deployed KSVD optimization regularizes Primal-Attention with a sharper singular value decay than that of the canonical self-attention, further verifying the great potential of our method. To the best of our knowledge, this is the first work that provides a primal-dual representation for the asymmetric kernel in self-attention and successfully applies it to modelling and optimization 2 .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
16 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention cites Reformer: The Efficient Transformer
- Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Context cites Language Models are Few-Shot Learners
- Elliptical Attention cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Elliptical Attention cites Reformer: The Efficient Transformer
- Elliptical Attention cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- Elliptical Attention cites Training data-efficient image transformers & distillation through attention
- Elliptical Attention cites Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis
- Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis cites Elliptical Attention
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Training data-efficient image transformers & distillation through attention
- In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitzness cites Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Context
- In-Context Learning with Transformers: Softmax Attention Adapts to Function Lipschitzness cites Language Models are Few-Shot Learners
- Get More with LESS: Synthesizing Recurrence with KV Cache Compression for Efficient LLM Inference cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis cites Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis cites Language Models are Few-Shot Learners
- Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component Analysis cites Training data-efficient image transformers & distillation through attention
Cited by top-tier papers16
- Get More with LESS: Synthesizing Recurrence with KV Cache Compression for Efficient LLM InferenceHarry Dong, Xinyu Yang, Zhenyu Zhang, Zhangyang Wang et al.ICML 2024 · 84 citations
- Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In ContextXiang Cheng, Yuxin Chen, Suvrit SraICML 2024 · 64 citations
- In-Context Learning with Transformers: Softmax Attention Adapts to Function LipschitznessLiam Collins, Advait Parulekar, Aryan Mokhtari, Sujay Sanghavi et al.NeurIPS 2024 · 33 citations
- Elliptical AttentionStefan K. Nielsen, Laziz U. Abdullaev, Rachel S. Y. Teo, Tan NguyenNeurIPS 2024 · 12 citations
- Unveiling the Hidden Structure of Self-Attention via Kernel Principal Component AnalysisRachel S. Y. Teo, Tan M. NguyenNeurIPS 2024 · 11 citations
Builds on22
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
- Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 citations
Related papers
- Self-Attention through Kernel-Eigen Pair Sparse Variational Gaussian ProcessesYingyi Chen, Qinghua Tao, Francesco Tonin, Johan A. K. SuykensICML 2024 · 4 citations
- Learning in Feature Spaces via Coupled Covariances: Asymmetric Kernel SVD and Nyström methodQinghua Tao, Francesco Tonin, Alex Lambert, Yingyi Chen et al.ICML 2024 · 4 citations
- A Primal-Dual Framework for Transformers and Neural NetworksTan Minh Nguyen, Tam Minh Nguyen, Nhat Ho, Andrea L. Bertozzi et al.ICLR 2023 · 2 citations
- Max-Margin Token Selection in Attention MechanismDavoud Ataee Tarzanagh, Yingcong Li, Xuechen Zhang, Samet OymakNeurIPS 2023 · 67 citations
- SAS: Sparse Attention Synthesizer for Efficient Language Model InferenceYuan Zhou, Shaojie Xiang, Lingfan Yu, Zhenyu Song et al.EuroSys 2026
