Sparse Attention as Compact Kernel Regression
Not on the map. Why?
Abstract (arXiv)
Recent work has revealed a link between self-attention mechanisms in transformers and test-time kernel regression via the Nadaraya-Watson estimator, with standard softmax attention corresponding to a Gaussian kernel. However, a kernel-theoretic understanding of sparse attention mechanisms is currently missing. In this paper, we establish a formal correspondence between sparse attention and compact (bounded support) kernels. We show that normalized ReLU and sparsemax attention arise from Epanechnikov kernel regression under fixed and adaptive normalizations, respectively. More generally, we demonstrate that widely used kernels in nonparametric density estimation -- including Epanechnikov, biweight, and triweight -- correspond to α-entmax attention with α = 1 + frac1n for n ∈ mathbbN, while the softmax/Gaussian relationship emerges in the limit n → ∞. This unified perspective explains how sparsity naturally emerges from kernel design and provides principled alternatives to heuristic top-k attention and other associative memory mechanisms. Experiments with a kernel-regression-based variant of transformers -- Memory Mosaics -- show that kernel-based sparse attention achieves competitive performance on language modeling, in-context learning, and length generalization tasks, offering a principled framework for designing attention mechanisms.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 34 of its 50 references that are in the map. First posted on arXiv 30 Jan 2026.
Builds on
34 of 50 references.
References · 34
- 2017Attention Is All You Needcited by 59,932
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,616
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
- 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,424
- 2020Big Bird: Transformers for Longer Sequencescited by 1,673
- 2021Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolationcited by 1,085
- 2022Transformers learn in-context by gradient descentcited by 714
- 2023Retentive Network: A Successor to Transformer for Large Language Modelscited by 594
- 2022Hungry Hungry Hippos: Towards Language Modeling with State Space Modelscited by 495
- 2023Gated Linear Attention Transformers with Hardware-Efficient Trainingcited by 490
- 2021Linear Transformers Are Secretly Fast Weight Programmerscited by 471
22 more
- 2020Hopfield Networks is All You Needcited by 461
- 2023TinyStories: How Small Can Language Models Be and Still Speak Coherent English?cited by 425
- 2016From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classificationcited by 337
- 2024Learning to (Learn at Test Time): RNNs with Expressive Hidden Statescited by 329
- 2024Titans: Learning to Memorize at Test Timecited by 303
- 2019Transformer Dissection: A Unified Understanding of Transformer's Attention via the Lens of Kernelcited by 211
- 2019Sparse Sequence-to-Sequence Modelscited by 167
- 2024Transformers need glasses! Information over-squashing in language taskscited by 87
- 2025Test-time regression: a unifying framework for designing sequence models with associative memorycited by 63
- 2025It's All Connected: A Journey Through Test-Time Memorization, Attentional Bias, Retention, and Online Optimizationcited by 60
- 2021Memory-efficient Transformers via Top-k Attentioncited by 59
- 2024Softmax is not Enough (for Sharp Size Generalisation)cited by 42
- 2023On Sparse Modern Hopfield Modelcited by 41
- 2025Scalable-Softmax Is Superior for Attentioncited by 38
- 2023STanHop: Sparse Tandem Hopfield Model for Memory-Enhanced Time Series Predictioncited by 35
- 2025Key-value memory in the braincited by 22
- 2024Memory Mosaicscited by 16
- 2024Sparse and Structured Hopfield Networkscited by 13
- 2025AdaSplash: Adaptive Sparse Flash Attentioncited by 12
- 2025Dense Associative Memory with Epanechnikov Energycited by 10
- 2024Hopfield-Fenchel-Young Networks: A Unified Framework for Associative Memory Retrievalcited by 6
- 2025Memory Mosaics at scalecited by 5
Built on by
Citing papers per year: 2026: 2.
2 papers.