揭示自注意力与专家混合模型的数学关联,提出新型激活注意力机制。
Quadratic Gating Mixture of Experts: Statistical Insights into Self-Attention
- 发现自注意力可表示为二次门控的线性专家混合
- 非线性专家使参数估计速度显著提升,单项式门控更高效
- 基于理论设计新注意力机制,在图像、语言等任务上表现更优
专家混合(MoE)模型以低计算开销实现模型容量扩展而广受关注。本文建立MoE与自注意力机制的严格联系,证明自注意力矩阵每行可表示为二次门控的线性专家混合。基于此,对两种二次门控函数——多项式门控和单项式门控的MoE模型进行系统收敛性分析,揭示其设计规律:使用单项式门控相比多项式门控能提升参数与专家估计的样本效率;采用非线性专家较线性专家显著加快估计速率。结合上述理论洞察与二者关联,提出新颖的主动注意力机制,即在自注意力公式中对值矩阵施加非线性激活。实验表明,该机制在图像分类、语言建模及多变量时间序列预测等多项任务中均优于标准自注意力。
原文摘要 · Abstract (English)
Mixture of Experts (MoE) models are well known for effectively scaling model capacity while preserving computational overheads. In this paper, we establish a rigorous relation between MoE and the self-attention mechanism, showing that each row of a self-attention matrix can be written as a quadratic gating mixture of linear experts. Motivated by this connection, we conduct a comprehensive convergence analysis of MoE models with two different quadratic gating functions, namely the quadratic polynomial gate and the quadratic monomial gate, offering useful insights into the design of gating and experts for the MoE framework. First, our analysis indicates that the use of the quadratic monomial gate yields an improved sample efficiency for estimating parameters and experts compared to the quadratic polynomial gate. Second, parameter and expert estimation rates become significantly faster when employing non-linear experts in place of linear experts. Combining these theoretical insights with the above link between MoE and self-attention, we propose a novel \emph{active-attention} mechanism where we apply a non-linear activation function to the value matrix in the formula of self-attention. Finally, we demonstrate that the proposed active-attention outperforms the standard self-attention through several extensive experiments in various tasks, including image classification, language modeling, and multivariate time series forecasting.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。