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

面向Transformer与神经网络的原始-对偶框架

A Primal-Dual Framework for Transformers and Neural Networks

University of California, Los Angeles(加利福尼亚大学洛杉矶分校);Rice University(莱斯大学);University of Texas at Austin(德克萨斯大学奥斯汀分校)

Tan M. Nguyen, Tam Nguyen, Nhat Ho, Andrea L. Bertozzi, Richard G. Baraniuk, Stanley J. Osher

AI总结:

该研究提出Transformer与神经网络的原始-对偶理论框架,证明自注意力对应SVR的支持向量展开,推导两种新型注意力并验证其在多任务中降冗余、提精度与效率的优势。

摘要:

自注意力是Transformer在序列建模任务(包括自然语言处理与计算机视觉中的诸多应用)中取得显著成功的关键。与神经网络层类似,这些注意力机制通常基于启发式方法与经验开发。为构建Transformer中的注意力层提供一个有理论依据的框架,我们证明自注意力对应于由支持向量回归(SVR)问题推导得到的支持向量展开,该问题的原始形式具有神经网络层的结构。利用我们的框架,我们推导出了实际中常用的主流注意力层,并提出了两种新型注意力:1)由批归一化层推导而来的批归一化注意力(Attention-BN);2)通过使用更少训练数据拟合SVR模型推导而来的缩放头注意力(Attention-SH)。我们通过实验证明,在图像分类、时间序列分类等多种实际应用中,Attention-BN与Attention-SH在减少头冗余、提升模型准确率以及提高模型效率方面均具有优势。

英文摘要:

Self-attention is key to the remarkable success of transformers in sequence modeling tasks including many applications in natural language processing and computer vision. Like neural network layers, these attention mechanisms are often developed by heuristics and experience. To provide a principled framework for constructing attention layers in transformers, we show that the self-attention corresponds to the support vector expansion derived from a support vector regression problem, whose primal formulation has the form of a neural network layer. Using our framework, we derive popular attention layers used in practice and propose two new attentions: 1) the Batch Normalized Attention (Attention-BN) derived from the batch normalization layer and 2) the Attention with Scaled Head (Attention-SH) derived from using less training data to fit the SVR model. We empirically demonstrate the advantages of the Attention-BN and Attention-SH in reducing head redundancy, increasing the model's accuracy, and improving the model's efficiency in a variety of practical applications including image and time-series classification.

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

↑