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

二次门控专家混合:自注意力机制的统计洞察

Quadratic Gating Mixture of Experts: Statistical Insights into Self-Attention

The University of Texas at Austin(德克萨斯大学奥斯汀分校);Johns Hopkins University(约翰霍普金斯大学)

Pedram Akbarian, Huy Nguyen, Xing Han, Nhat Ho

AI总结:

本文建立MoE与自注意力的理论联系,提出二次门控MoE的收敛性分析,并据此设计主动注意力机制,在图像分类、语言建模和时序预测中优于标准自注意力。

摘要:

专家混合(MoE)模型以在保持计算开销的同时有效扩展模型容量而闻名。本文建立了MoE与自注意力机制之间的严格关系,表明自注意力矩阵的每一行都可以写成线性专家的二次门控混合。受此联系启发,我们对具有两种不同二次门控函数(即二次多项式门和二次单项式门)的MoE模型进行了全面的收敛性分析,为MoE框架中门控和专家的设计提供了有用的见解。首先,我们的分析表明,与二次多项式门相比,使用二次单项式门在估计参数和专家时能提高样本效率。其次,当使用非线性专家代替线性专家时,参数和专家的估计速率显著加快。将这些理论见解与上述MoE和自注意力之间的联系相结合,我们提出了一种新颖的“主动注意力”机制,在自注意力的公式中对值矩阵应用非线性激活函数。最后,我们通过多个任务中的大量实验(包括图像分类、语言建模和多元时间序列预测)证明了所提出的主动注意力优于标准自注意力。

英文摘要:

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.

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

↑