arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.20271stat.MLcs.LG
收藏

多头注意力作为恩德里亚-沃森估计的集合:方差减少、去相关和最优头多样性

Multi-Head Attention as Ensemble Nadaraya-Watson Estimation: Variance Reduction, Decorrelation, and Optimal Head Diversity

School of Mathematics and Statistics, College of Science(数学与统计学学院,科学学院)

Ernest Fokoué

AI总结:

本文提出多头注意力可以视为恩德里亚-沃森核回归估计器的集合,通过分析头输出的去相关性,推导出方差减少与头多样性之间的关系,并提出头多样性指数来衡量不同头之间的去相关程度,最终得出最优的头数量和维度分配方案。

摘要:

我们发展了多头注意力(MHA)作为恩德里亚-沃森(NW)核回归估计器集合的严谨统计理论。基于单头softmax注意力与NW估计器之间的代数恒等式,我们证明MHA是H个NW估计器的结构化集合,每个在键空间的不同的学习投影子空间中操作。我们推导出MHA均方误差的显式偏倚-方差-协方差分解,表明方差减少不仅取决于头数H,还根本上取决于头输出的去相关性。去相关由学习投影子空间之间的主角之间决定:正交投影产生最大方差减少;对齐投影产生无。我们引入头多样性指数(HDI),一个可计算的谱度量,衡量头之间的去相关程度,并证明MHA均方误差随HDI单调递减。这为经验观察到的注意力头的专业化提供了第一个严谨的理论解释。在固定总维度预算D=H*d_k下,我们解决最优头维度分配问题,推导出MSE最小化的配对(H*,d_k*)从数据分布和回归平滑度。解决方案得出新的架构扩展定律:最优每头维度随着训练集大小对数增长,而最优头数几乎与总预算D线性增长。我们的框架统一了三个先前的工作:单头注意力的NW理论、集合学习的一般加权理论以及生物和计算集合之间的去相关-方差减少同构性。多头注意力是Transformer对通用原则的实例化:相同代理加上促进多样性的机制产生涌现最优性。

英文摘要:

We develop a rigorous statistical theory of multi-head attention (MHA) as an ensemble of Nadaraya-Watson (NW) kernel regression estimators. Building on the algebraic identity between single-head softmax attention and the NW estimator, we prove that MHA is a structured ensemble of H NW estimators, each operating in a distinct learned projection subspace of the key space. We derive an explicit Bias-Variance-Covariance decomposition of the MHA mean squared error, showing that variance reduction depends not merely on the number of heads H but fundamentally on the decorrelation of head outputs. Decorrelation is governed by the principal angles between learned projection subspaces: orthogonal projections yield maximum variance reduction; aligned projections yield none. We introduce the Head Diversity Index (HDI), a computable spectral measure of inter-head decorrelation, and prove that MHA mean squared error is monotonically decreasing in HDI. This provides the first rigorous theoretical explanation for the empirically observed specialization of attention heads. Under a fixed total-dimension budget D = H * d_k, we solve the optimal head-dimension allocation problem, deriving the MSE-minimizing pair (H*, d_k*) from data distribution and regression smoothness. The solution yields a new architectural scaling law: the optimal per-head dimension grows logarithmically with training set size, while the optimal number of heads grows nearly linearly with the total budget D. Our framework unifies three strands of prior work: the NW theory of single-head attention, the general weighting theory for ensemble learning, and the decorrelation-variance-reduction isomorphism between biological and computational ensembles. Multi-head attention is the Transformer's instantiation of a universal principle: identical agents plus diversity-enforcing mechanisms yields emergent optimality.

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

↑