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

DBA:高效的动态双线性低秩注意力Transformer

DBA: Efficient Transformer with Dynamic Bilinear Low-Rank Attention

Zhejiang University(浙江大学)

Bosheng Qin, Juncheng Li, Siliang Tang, Yueting Zhuang

摘要:

为了提高Transformer的效率,人们进行了许多研究,从二次型到线性型。其中,基于低秩的方法旨在学习投影矩阵以压缩序列长度。然而,投影矩阵一旦被学习就被固定,其利用用于相同位置中的令牌的专用系数来压缩序列长度。采用这样的输入不变投影忽略了序列的最具信息量的部分随序列而变化的事实,因此未能保留位于不同位置的最有用的信息。另外,以往的高效Transformers算法只关注了序列长度的影响,而忽略了隐状态维数的影响。为了解决上述问题,我们提出了一种高效且有效的注意力机制,即动态双线性低秩注意力(DBA),它通过输入敏感的动态投影矩阵压缩序列长度,并通过联合优化序列长度和隐藏状态维度来实现线性时间和空间复杂度,同时保持最先进的性能。具体来说,我们首先从理论上证明了序列长度可以从信息论的一个新的角度进行非破坏性压缩,压缩矩阵由输入序列动态确定。此外,我们表明,隐藏状态的尺寸可以近似扩展的约翰逊-林登施特劳斯引理,优化的双线性形式的注意。理论分析表明,DBA能够很好地捕捉交叉注意问题中的高阶关系。在不同序列长度条件下的任务上的实验表明,与各种强基线相比,DBA实现了最先进的性能,同时保持了更高的速度和更少的内存消耗。

英文摘要:

Many studies have been conducted to improve the efficiency of Transformer from quadric to linear. Among them, the low-rank-based methods aim to learn the projection matrices to compress the sequence length. However, the projection matrices are fixed once they have been learned, which compress sequence length with dedicated coefficients for tokens in the same position. Adopting such input-invariant projections ignores the fact that the most informative part of a sequence varies from sequence to sequence, thus failing to preserve the most useful information that lies in varied positions. In addition, previous efficient Transformers only focus on the influence of sequence length while neglecting the effect of hidden state dimension. To address the aforementioned problems, we present an efficient yet effective attention mechanism, namely the Dynamic Bilinear Low-Rank Attention (DBA), which compresses the sequence length by input-sensitive dynamic projection matrices and achieves linear time and space complexity by jointly optimizing the sequence length and hidden state dimension while maintaining state-of-the-art performance. Specifically, we first theoretically demonstrate that the sequence length can be compressed non-destructively from a novel perspective of information theory, with compression matrices dynamically determined by the input sequence. Furthermore, we show that the hidden state dimension can be approximated by extending the Johnson-Lindenstrauss lemma, optimizing the attention in bilinear form. Theoretical analysis shows that DBA is proficient in capturing high-order relations in cross-attention problems. Experiments over tasks with diverse sequence length conditions show that DBA achieves state-of-the-art performance compared with various strong baselines while maintaining less memory consumption with higher speed.

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

↑