arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2512.07647cs.LGcs.AI
收藏

通过总变差距离建立拓扑k稀疏注意力的数学理论

A Mathematical Theory of Top-$k$ Sparse Attention via Total Variation Distance

Theory Laboratory, Central Research Institute, 2012 Laboratory, Huawei Technologies Co., Ltd.(华为技术有限公司理论实验室、中央研究院、2012实验室);National Technical University of Athens(希腊国家技术大学);Trustworthy Technology and Engineering Laboratory, Heisenberg Research Center, 2012 Laboratory, Huawei Technologies Co., Ltd.(华为技术有限公司可信技术与工程实验室、海森堡研究中心、2012实验室)

Georgios Tzachristas, Lei Deng, Ioannis Tzachristas, Gong Zhang, Renhai Chen

AI总结:

本文提出通过总变差距离建立拓扑k稀疏注意力的数学理论,推导出非渐近确定性界限,并在高斯分数模型下给出最小k_ε的渐近规则,验证了认证Top-k在减少评分键方面的有效性。

摘要:

我们开发了一个统一的数学框架,用于认证Top-k注意力截断,该框架在分布和输出层面量化近似误差。对于单个注意力分布P及其Top-k截断P^,我们证明总变差距离与被丢弃的softmax尾部质量一致,并满足TV(P, P^)=1-e^{-KL(P^∥P)},从而得到针对Top-k的精确界限,取代通用不等式。从这里我们推导出非渐近的确定性界限——从单个边界间隙通过多间隙和分块变体——这些界限仅使用有序logits控制TV(P, P^)。利用精确的头尾分解,我们证明输出误差可以分解为‖Attn(q,K,V)-Attn_k(q,K,V)‖_2=τ‖μ_{tail}-μ_{head}‖_2,其中τ=TV(P, P^),从而得到新的头尾直径界‖Attn(q,K,V)-Attn_k(q,K,V)‖_2≤τ·diam_{H,T},并进一步将误差与Var_P(V)联系起来。在独立同分布高斯分数模型s_i∼N(μ,σ²)下,我们推导出闭式尾部质量及最小k_ε的渐近规则,确保TV(P, P^)≤ε,即k_ε/n≈Φ_c(σ+Φ^{-1}(ε))。在bert-base-uncased和合成logits上的实验验证了k_ε/n的预测尺度,并显示认证Top-k可以将评分键减少2-4倍,同时满足规定的总变差预算。

英文摘要:

We develop a unified mathematical framework for certified Top-$k$ attention truncation that quantifies approximation error at both the distribution and output levels. For a single attention distribution $P$ and its Top-$k$ truncation $\hat P$, we show that the total-variation distance coincides with the discarded softmax tail mass and satisfies $\mathrm{TV}(P,\hat P)=1-e^{-\mathrm{KL}(\hat P\Vert P)}$, yielding sharp Top-$k$-specific bounds in place of generic inequalities. From this we derive non-asymptotic deterministic bounds -- from a single boundary gap through multi-gap and blockwise variants -- that control $\mathrm{TV}(P,\hat P)$ using only the ordered logits. Using an exact head-tail decomposition, we prove that the output error factorizes as $\|\mathrm{Attn}(q,K,V)-\mathrm{Attn}_k(q,K,V)\|_2=τ\|μ_{\mathrm{tail}}-μ_{\mathrm{head}}\|_2$ with $τ=\mathrm{TV}(P,\hat P)$, yielding a new head-tail diameter bound $\|\mathrm{Attn}(q,K,V)-\mathrm{Attn}_k(q,K,V)\|_2\leτ\,\mathrm{diam}_{H,T}$ and refinements linking the error to $\mathrm{Var}_P(V)$. Under an i.i.d. Gaussian score model $s_i\sim\mathcal N(μ,σ^2)$ we derive closed-form tail masses and an asymptotic rule for the minimal $k_\varepsilon$ ensuring $\mathrm{TV}(P,\hat P)\le\varepsilon$, namely $k_\varepsilon/n\approxΦ_c(σ+Φ^{-1}(\varepsilon))$. Experiments on bert-base-uncased and synthetic logits confirm the predicted scaling of $k_\varepsilon/n$ and show that certified Top-$k$ can reduce scored keys by 2-4$\times$ on average while meeting the prescribed total-variation budget.

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

↑