arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.17334cs.LG
收藏

基于功率的局部注意力:连接线性复杂度与全注意力

Power-based Partial Attention: Bridging Linear-Complexity and Full Attention

Yufeng Huang

AI总结:

本文提出基于功率的局部注意力机制,通过调整参数p,在线性复杂度与全注意力之间实现性能平衡,证明亚二次注意力可达到全注意力效果。

摘要:

在变压器研究中,人们普遍认为“注意力即一切所需”,但所需的注意力量从未被系统量化。二次$O(L^2)$注意力是否必要,还是存在一种亚二次注意力机制能够实现类似性能?为回答这一问题,我们引入了基于功率的局部注意力(PPA),其注意力顺序为$O(L^{1+p})$,其中$0 \leq p \leq 1$,$p=0$对应线性复杂度的滑动窗口注意力,$p=1$对应全注意力。通过这种注意力构造,我们可以探索transformer架构性能如何随注意力缩放行为(由$p$控制)而变化。我们的实验总体趋势显示,性能在$p$值的狭窄范围内从滑动窗口(线性复杂度)注意力过渡到全注意力,并在$p$接近1时趋于平稳。在我们的实验中,我们展示了存在$0<p<1$使得$O(L^{1+p})$注意力足以实现与$O(L^2)$全注意力相似的结果。

英文摘要:

It is widely accepted from transformer research that "attention is all we need", but the amount of attention required has never been systematically quantified. Is quadratic $O(L^2)$ attention necessary, or is there a sub-quadratic attention mechanism that can achieve comparable performance? To answer this question, we introduce power-based partial attention (PPA), an attention mechanism of order $O(L^{1+p})$, where $0 \leq p \leq 1$, such that $p=0$ corresponds to sliding window attention with linear complexity, and $p=1$ corresponds to full attention. With this attention construction, we can explore how transformer architecture performance varies as a function of the attention scaling behavior controlled by $p$. The overall trend from our experiments shows an S-curve-like behavior where the performance transitions from sliding-window (linear-complexity) attention to full attention over a narrow window of $p$ values, and plateaus as $p$ approaches $1$. In our experiments, we show that there exists $0<p<1$ such that $O(L^{1+p})$ attention is sufficient to achieve similar results as $O(L^2)$ full attention.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑