arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2209.04881cs.LGcs.CC
收藏

关于自注意力的计算复杂性

On The Computational Complexity of Self-Attention

New York University(纽约大学);Microsoft(微软)

Feyza Duman Keles, Pruthuvi Mahesakya Wijewardena, Chinmay Hegde

摘要:

Transformer架构在许多最先进的应用中取得了显著的进步。然而,尽管他们的成功,现代Transformers依赖于自注意力机制,其时间和空间的复杂性是输入长度的平方。已经提出了几种方法来加速自注意力机制,以实现次二次运行时间,然而,这些作品中的绝大多数都没有严格的错误保证。在这项工作中,我们建立了一些场景中的自注意力的计算复杂性的下限。我们证明了自注意力的时间复杂度必然是输入长度的二次方,除非强指数时间假设(SETH)是假的。即使注意力计算只是近似地进行,并且对于各种注意力机制,这个论点也成立。作为我们的下限的补充,我们表明,它确实是可以近似点积自注意力使用有限泰勒级数在线性时间,在成本上有一个指数依赖的多项式阶。

英文摘要:

Transformer architectures have led to remarkable progress in many state-of-art applications. However, despite their successes, modern transformers rely on the self-attention mechanism, whose time- and space-complexity is quadratic in the length of the input. Several approaches have been proposed to speed up self-attention mechanisms to achieve sub-quadratic running time; however, the large majority of these works are not accompanied by rigorous error guarantees. In this work, we establish lower bounds on the computational complexity of self-attention in a number of scenarios. We prove that the time complexity of self-attention is necessarily quadratic in the input length, unless the Strong Exponential Time Hypothesis (SETH) is false. This argument holds even if the attention computation is performed only approximately, and for a variety of attention mechanisms. As a complement to our lower bounds, we show that it is indeed possible to approximate dot-product self-attention using finite Taylor series in linear-time, at the cost of having an exponential dependence on the polynomial order.

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

↑