Sparse and Continuous Attention Mechanisms
André F. T. Martins, António Farinhas, Marcos V. Treviso, Vlad Niculae, Pedro M. Q. Aguiar, Mário A. T. Figueiredo
Abstract
Exponential families are widely used in machine learning; they include many distributions in continuous and discrete domains (e.g., Gaussian, Dirichlet, Poisson, and categorical distributions via the softmax transformation). Distributions in each of these families have fixed support. In contrast, for finite domains, there has been recent work on sparse alternatives to softmax (e.g. sparsemax and alpha-entmax), which have varying support, being able to assign zero probability to irrelevant categories. This paper expands that work in two directions: first, we extend alpha-entmax to continuous domains, revealing a link with Tsallis statistics and deformed exponential families. Second, we introduce continuous-domain attention mechanisms, deriving efficient gradient backpropagation algorithms for alpha in 1,2. Experiments on attention-based text classification, machine translation, and visual question answering illustrate the use of continuous attention in 1D and 2D, showing that it allows attending to time intervals and compact regions.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f56fd2b7-7f1a-47d9-b011-cd4afb6942b6Cited by top-tier papers13
- MetaFormer is Actually What You Need for VisionWeihao Yu, Mi Luo, Pan Zhou, Chenyang Si et al.CVPR 2022 · 1,114 citations
- Dynamic Context Pruning for Efficient and Interpretable Autoregressive TransformersSotiris Anagnostidis, Dario Pavllo, Luca Biggio, Lorenzo Noci et al.NeurIPS 2023 · 95 citations
- The Transient Nature of Emergent In-Context Learning in TransformersAaditya K. Singh, Stephanie C. Y. Chan, Ted Moskovitz, Erin Grant et al.NeurIPS 2023 · 92 citations
- SPANet: Frequency-balancing Token Mixer using Spectral Pooling Aggregation ModulationGuhnoo Yun, Juhan Yoo, Kijung Kim, Jeongho Lee et al.ICCV 2023 · 35 citations
- ∞-former: Infinite Memory TransformerPedro Henrique Martins, Zita Marinho, André F. T. MartinsACL 2022 · 12 citations
Builds on3
- On the Relationship between Self-Attention and Convolutional LayersJean-Baptiste Cordonnier, Andreas Loukas, Martin JaggiICLR 2020 · 629 citations
- Balanced Datasets Are Not Enough: Estimating and Mitigating Gender Bias in Deep Image RepresentationsTianlu Wang, Jieyu Zhao, Mark Yatskar, Kai-Wei Chang et al.ICCV 2019 · 469 citations
- Hard-Coded Gaussian Attention for Neural Machine TranslationWeiqiu You, Simeng Sun, Mohit IyyerACL 2020 · 55 citations
Related papers
- Kernel Multimodal Continuous AttentionAlexander Moreno, Zhenke Wu, Supriya Nagesh, Walter H. Dempsey et al.NeurIPS 2022 · 2 citations
- Long-Context Generalization with Sparse AttentionPavlo Vasylenko, Hugo Pitorro, Andre F. T. Martins, Marcos V. TrevisoICLR 2026 · 19 citations
- MultiMax: Sparse and Multi-Modal Attention LearningYuxuan Zhou, Mario Fritz, Margret KeuperICML 2024 · 4 citations
- Sparse Attention with Linear UnitsBiao Zhang, Ivan Titov, Rico SennrichEMNLP 2021 · 32 citations
- Sparse Text GenerationPedro Henrique Martins, Zita Marinho, André F. T. MartinsEMNLP 2020 · 20 citations
