arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.17810cs.LG
收藏

Token Statistics Transformer:通过变分速率缩减实现线性时间注意力

Token Statistics Transformer: Linear-Time Attention via Variational Rate Reduction

UC Berkeley(加州大学伯克利分校);UPenn(宾夕法尼亚大学);UMich(密歇根大学);THU(清华大学);Transcengram(瞬像科技);Tsinghua SIGS(清华大学深圳国际研究生院);HKU(香港大学);JHU(约翰斯·霍普金斯大学)

Ziyang Wu, Tianjiao Ding, Yifu Lu, Druv Pai, Jingyuan Zhang, Weida Wang, Yaodong Yu, Yi Ma, Benjamin D. Haeffele

AI总结:

本文提出线性复杂度的Token Statistics Self-Attention (TSSA)模块及ToST架构,通过变分MCR²目标的展开梯度下降推导而成,在视觉和语言等任务上媲美传统Transformer,挑战了成对相似度注意力不可或缺的传统观点。

摘要:

注意力算子可以说是 transformer 架构的关键区分因素,该架构已在各种任务中展现出最先进的性能。然而,transformer 注意力算子通常会带来显著的计算负担,其计算复杂度随 token 数量呈二次方增长。在本工作中,我们提出了一种新型 transformer 注意力算子,其计算复杂度随 token 数量呈线性增长。我们通过扩展先前的工作来推导网络架构,先前的工作表明,通过“白盒”架构设计,transformer 风格的架构会自然产生,其中网络的每一层都被设计为实现最大编码速率缩减目标(MCR$^2$)的增量优化步骤。具体而言,我们推导了 MCR$^2$ 目标的一种新型变分形式,并表明由该变分目标的展开梯度下降所产生的架构引出了一种名为 Token Statistics Self-Attention (TSSA) 的新注意力模块。TSSA 具有线性的计算和内存复杂度,并在根本上偏离了计算 token 之间成对相似度的典型注意力架构。在视觉、语言和长序列任务上的实验表明,简单地将 TSSA 替换为标准自注意力(我们将其称为 Token Statistics Transformer (ToST)),即可实现与常规 transformer 相媲美的性能,同时在计算效率和可解释性上显著提升。我们的结果也在一定程度上对成对相似度风格的注意力机制对 transformer 架构的成功至关重要的传统观点提出了质疑。代码将在 https://github.com/RobinWu218/ToST 上提供。

英文摘要:

The attention operator is arguably the key distinguishing factor of transformer architectures, which have demonstrated state-of-the-art performance on a variety of tasks. However, transformer attention operators often impose a significant computational burden, with the computational complexity scaling quadratically with the number of tokens. In this work, we propose a novel transformer attention operator whose computational complexity scales linearly with the number of tokens. We derive our network architecture by extending prior work which has shown that a transformer style architecture naturally arises by "white-box" architecture design, where each layer of the network is designed to implement an incremental optimization step of a maximal coding rate reduction objective (MCR$^2$). Specifically, we derive a novel variational form of the MCR$^2$ objective and show that the architecture that results from unrolled gradient descent of this variational objective leads to a new attention module called Token Statistics Self-Attention (TSSA). TSSA has linear computational and memory complexity and radically departs from the typical attention architecture that computes pairwise similarities between tokens. Experiments on vision, language, and long sequence tasks show that simply swapping TSSA for standard self-attention, which we refer to as the Token Statistics Transformer (ToST), achieves competitive performance with conventional transformers while being significantly more computationally efficient and interpretable. Our results also somewhat call into question the conventional wisdom that pairwise similarity style attention mechanisms are critical to the success of transformer architectures. Code will be available at https://github.com/RobinWu218/ToST.

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

↑