# Sparse Attention as Compact Kernel Regression

DevFeed: [Sparse Attention as Compact Kernel Regression](<https://devfeed.tech/articles/sparse-attention-as-compact-kernel-regression-103737.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2601.22766>)

Author: Saul Santos, Nuno Gon\\c{c}alves, Daniel C. McNamee, Marcos Treviso, Andr\\'e F. T Martins

Published: 2026-10-28T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [Transformer](<https://devfeed.tech/topics/transformer.md>), [scikit-learn](<https://devfeed.tech/topics/scikit-learn.md>)

Tags: [abstract](<https://devfeed.tech/tags/abstract.md>), [adaptive](<https://devfeed.tech/tags/adaptive.md>), [alpha](<https://devfeed.tech/tags/alpha.md>), [alternatives](<https://devfeed.tech/tags/alternatives.md>), [arxiv](<https://devfeed.tech/tags/arxiv.md>), [attention](<https://devfeed.tech/tags/attention.md>), [based](<https://devfeed.tech/tags/based.md>), [context](<https://devfeed.tech/tags/context.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [design](<https://devfeed.tech/tags/design.md>), [designing](<https://devfeed.tech/tags/designing.md>), [estimator](<https://devfeed.tech/tags/estimator.md>), [experiments](<https://devfeed.tech/tags/experiments.md>), [fixed](<https://devfeed.tech/tags/fixed.md>), [formal](<https://devfeed.tech/tags/formal.md>), [framework](<https://devfeed.tech/tags/framework.md>), [gaussian](<https://devfeed.tech/tags/gaussian.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [kernels](<https://devfeed.tech/tags/kernels.md>), [language](<https://devfeed.tech/tags/language.md>), [regression](<https://devfeed.tech/tags/regression.md>)

## AI overview

The paper connects sparse transformer attention to compact, bounded-support kernel regression. It derives normalized ReLU and sparsemax attention from Epanechnikov regression with fixed and adaptive normalization, respectively, and relates Epanechnikov, biweight, and triweight kernels to α-entmax with α = 1 + 1/n; softmax's Gaussian-kernel relationship appears as n tends to infinity. This gives a kernel-based account of how sparsity arises and a principled alternative to heuristic top-k attention. Experiments with the Memory Mosaics transformer variant report competitive performance on language modeling, in-context learning, and length generalization.

## Source excerpt

arXiv:2601.22766v4 Announce Type: replace Abstract: 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 $\alpha$-entmax attention with $\alpha = 1 + \frac{1}{n}$ for $n \in \mathbb{N}$, while the softmax/Gaussian relationship emerges in the limit $n \to \infty$. 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.