AttentionX:从分布式优化视角利用注意力中的共识差异
AttentionX: Exploiting Consensus Discrepancy In Attention from A Distributed Optimization Perspective
AI总结:
本文提出AttentionX,从分布式优化视角将PDMM算法捕获的共识差异引入标准注意力机制,在ViT和nanoGPT上取得良好性能。
摘要:
本文通过从分布式优化视角利用共识差异来扩展 transformer 中的标准 Attention,称为 AttentionX。值得注意的是,原始对偶乘子法(PDMM)旨在迭代求解 P2P 网络上的一大类分布式优化问题,其中相邻节点在优化过程中按照预定义的线性边约束逐渐达成共识。具体而言,在 PDMM 的每次迭代中,网络中的每个节点首先从邻居收集信息,然后进行局部信息融合。从宏观视角看,Attention 中基于 $KQ$-softmax 的 $V$-表示加权求和对应于从邻居收集信息,而 transformer 中通过前馈网络(FFN)进行的特征处理对应于局部信息融合。PDMM 利用拉格朗日乘子以线性边约束残差的形式捕获历史共识差异,这对算法的收敛起着至关重要的作用。受 PDMM 启发,我们提出 AttentionX,将共识差异纳入标准 Attention 的输出更新表达式中。AttentionX 中的共识差异是指 $V$-表示的加权求和与缩放后的 $V$-表示本身之间的差异。在 ViT 和 nanoGPT 上的实验显示出良好的性能。
英文摘要:
In this paper, we extend the standard Attention in transformer by exploiting the consensus discrepancy from a distributed optimization perspective, referred to as AttentionX. It is noted that the primal-dual method of multipliers (PDMM) \cite{Zhang16PDMM} is designed to iteratively solve a broad class of distributed optimization problems over a pear-to-pear (P2P) network, where neighbouring nodes gradually reach consensus as specified by predefined linear edge-constraints in the optimization process. In particular, at each iteration of PDMM, each node in a network first performs information-gathering from neighbours and then performs local information-fusion. From a high-level point of view, the $KQ$-softmax-based weighted summation of $V$-representations in Attention corresponds information-gathering from neighbours while the feature-processing via the feed-forward network (FFN) in transformer corresponds to local information fusion. PDMM exploits the Lagrangian multipliers to capture the historical consensus discrepancy in the form of residual errors of the linear edge-constraints, which plays a crucial role for the algorithm to converge. Inspired by PDMM, we propose AttentionX to incorporate the consensus discrepancy in the output update-expression of the standard Attention. The consensus discrepancy in AttentionX refers to the difference between the weighted summation of $V$-representations and scaled $V$-representions themselves. Experiments on ViT and nanoGPT show promising performance.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。