Skip to main content
QUICK REVIEW

[论文解读] Sparse Attention as Compact Kernel Regression

Saul Santos, Nuno Gonçalves|arXiv (Cornell University)|Jan 30, 2026
Domain Adaptation and Few-Shot Learning被引用 0
一句话总结

该论文将稀疏注意力形式化为核回归视角,展示 sparsemax 和 alpha-entmax 来源于类似 Epanechnikov 的紧致核,并在语言建模、上下文学习与长度泛化等任务上验证了基于核的 Memory Mosaics 的竞争力表现。

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 $α$-entmax attention with $α= 1 + \frac{1}{n}$ for $n \in \mathbb{N}$, while the softmax/Gaussian relationship emerges in the limit $n o \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.

研究动机与目标

  • 以非参数核回归为基础,将稀疏注意力作为密集 softmax 的一种 principled 替代方案进行论证。
  • 表征紧致支撑核如何在注意力中引入稀疏性与局部性。
  • 在 Memory Mosaics 内开发并分析基于核的注意力变体。
  • 提供一个统一框架,将 top-k、固定归一化和自适应稀疏注意力机制联系起来。

提出的方法

  • 回顾 Nadaraya-Watson 核回归视角下的注意力,并将 softmax 与高斯核联系起来。
  • 将归一化的 ReLU、sparsemax、alpha-entmax 映射到带自适应带宽的 Epanechnikov 与相关紧致核。
  • 证明 alpha-entmax 其中 alpha = 1 + 1/r 对应核 K_h(u) ∝ [1 - ||u||^2 / h^2]^r,其中 r = 1/(alpha - 1)。
  • 引入锚定的紧致核,如 top-k 均匀、top-k softmax 和 ReLUmax,将它们与 kNN 与基于边际的稀疏性联系起来。
  • 将 Memory Mosaics 作为一种基于核回归的 Transformer 变体,并描述在 Nadaraya-Watson 更新中键和值的构成与使用方式。

实验结果

研究问题

  • RQ1紧致(有界支撑)核如何与稀疏注意力机制(如 sparsemax 和 alpha-entmax)相关?
  • RQ2是否可以在统一的核回归框架内刻画现有的稀疏注意力方法(top-k、固定归一化)?
  • RQ3Memory Mosaics 中基于核的稀疏注意力变体在语言建模、上下文学习和长度泛化任务上是否具有竞争力?
  • RQ4从核设计会出现哪些新的注意力变换(如 ReLUmax),它们在实际中表现如何?

主要发现

  • sparsemax 注意力对应自归一化的 Epanechnikov 核回归,带有自适应带宽。
  • alpha>1 时的 alpha-entmax 注意力对应带紧致支撑的多项式核,r = 1/(alpha - 1),涵盖 Epanechnikov、biweight 和 triweight 核。
  • Top-k 与固定归一化稀疏注意力也落在同一核回归框架内,将 top-k softmax 与 kNN 回归、归一化的 ReLU 与固定带宽的 Epanechnikov 回归联系起来。
  • 一种新变换 ReLUmax,使核的支撑锚定在最大相似度附近,避免退化的零分母问题。
  • Memory Mosaics 的实验表明基于核的稀疏注意力在语言建模、上下文学习和长度泛化任务上具有竞争力的表现,且自适应稀疏核往往优于固定稀疏基线。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。