Improving Transformers with Probabilistic Attention Keys
Tam Minh Nguyen, Tan Minh Nguyen, Dung D. Le, Duy Khuong Nguyen, Viet-Anh Tran, Richard G. Baraniuk, Nhat Ho, Stanley J. Osher
摘要
Multi-head attention is a driving force behind state-of-the-art transformers, which achieve remarkable performance across a variety of natural language processing (NLP) and computer vision tasks. It has been observed that for many applications, those attention heads learn redundant embedding, and most of them can be removed without degrading the performance of the model. Inspired by this observation, we propose Transformer with a Mixture of Gaussian Keys (Transformer-MGK), a novel transformer architecture that replaces redundant heads in transformers with a mixture of keys at each head. These mixtures of keys follow a Gaussian mixture model and allow each attention head to focus on different parts of the input sequence efficiently. Compared to its conventional transformer counterpart, Transformer-MGK accelerates training and inference, has fewer parameters, and requires fewer FLOPs to compute while achieving comparable or better accuracy across tasks. Transformer-MGK can also be easily extended to use with linear attention. We empirically demonstrate the advantage of Transformer-MGK in a range of practical applications, including language modeling and tasks that involve very long sequences. On the Wikitext-103 and Long Range Arena benchmark, Transformer-MGKs with 4 heads attain comparable or better performance to the baseline transformers with 8 heads.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 21 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention 引用了 Reformer: The Efficient Transformer
- Random Shuffle Transformer for Image Restoration 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Context 引用了 FourierFormer: Transformer Meets Generalized Fourier Integral Theorem
- Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Context 引用了 Primal-Attention: Self-attention through Asymmetric Kernel SVD in Primal Representation
- Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In Context 引用了 Language Models are Few-Shot Learners
- FourierFormer: Transformer Meets Generalized Fourier Integral Theorem 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- FourierFormer: Transformer Meets Generalized Fourier Integral Theorem 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- FourierFormer: Transformer Meets Generalized Fourier Integral Theorem 引用了 Language Models are Few-Shot Learners
- FourierFormer: Transformer Meets Generalized Fourier Integral Theorem 引用了 Training data-efficient image transformers & distillation through attention
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale 引用了 Language Models are Few-Shot Learners
- Primal-Attention: Self-attention through Asymmetric Kernel SVD in Primal Representation 引用了 Transformers are RNNs: Fast Autoregressive Transformers with Linear Attention
- Primal-Attention: Self-attention through Asymmetric Kernel SVD in Primal Representation 引用了 FourierFormer: Transformer Meets Generalized Fourier Integral Theorem
- Primal-Attention: Self-attention through Asymmetric Kernel SVD in Primal Representation 引用了 Reformer: The Efficient Transformer
- Primal-Attention: Self-attention through Asymmetric Kernel SVD in Primal Representation 引用了 Language Models are Few-Shot Learners
- Primal-Attention: Self-attention through Asymmetric Kernel SVD in Primal Representation 引用了 Training data-efficient image transformers & distillation through attention
- Training data-efficient image transformers & distillation through attention 引用了 An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
引用它的顶会 Paper21
- Transformers Implement Functional Gradient Descent to Learn Non-Linear Functions In ContextXiang Cheng, Yuxin Chen, Suvrit SraICML 2024 · 64 次引用
- Architecture Agnostic Federated Learning for Neural NetworksDisha Makhija, Xing Han, Nhat Ho, Joydeep GhoshICML 2022 · 62 次引用
- FourierFormer: Transformer Meets Generalized Fourier Integral TheoremTan Nguyen, Minh Pham, Tam Nguyen, Khai Nguyen 等NeurIPS 2022 · 59 次引用
- Primal-Attention: Self-attention through Asymmetric Kernel SVD in Primal RepresentationYingyi Chen, Qinghua Tao, Francesco Tonin, Johan A. K. SuykensNeurIPS 2023 · 42 次引用
- Random Shuffle Transformer for Image RestorationJie Xiao, Xueyang Fu, Man Zhou, Hongjian Liu 等ICML 2023 · 38 次引用
它引用的 Paper27
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn 等ICLR 2021 · 21,477 次引用
- Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa 等ICML 2021 · 8,974 次引用
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 次引用
- Transformers are RNNs: Fast Autoregressive Transformers with Linear AttentionAngelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, François FleuretICML 2020 · 2,665 次引用
相关 Paper
- Compositional Attention: Disentangling Search and RetrievalSarthak Mittal, Sharath Chandra Raparthy, Irina Rish, Yoshua Bengio 等ICLR 2022 · 20 次引用
- MoH: Multi-Head Attention as Mixture-of-Head AttentionPeng Jin, Bo Zhu, Li Yuan, Shuicheng YanICML 2025 · 2 次引用
- Improving Transformer with an Admixture of Attention HeadsTan Nguyen, Tam Nguyen, Hai Do, Khai Nguyen 等NeurIPS 2022 · 38 次引用
- DHA: Learning Decoupled-Head Attention from Transformer Checkpoints via Adaptive Heads FusionYilong Chen, Linhao Zhang, Junyuan Shang, Zhenyu Zhang 等NeurIPS 2024 · 12 次引用
- Improving Transformers with Dynamically Composable Multi-Head AttentionDa Xiao, Qingye Meng, Shengping Li, Xingyuan YuanICML 2024 · 8 次引用
