arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2412.17316cs.LGcs.AIcs.CCcs.CL
收藏

RoPE 注意力可以几乎线性时间训练

RoPE Attention Can Be Trained in Almost Linear Time

Wyoming Seminary(怀俄明神学院);University of Arizona(亚利桑那大学);The University of Hong Kong(香港大学);University of Wisconsin-Madison(威斯康星大学麦迪逊分校);Simons Institute for the Theory of Computing, University of California, Berkeley(计算理论学院,加州大学伯克利分校)

Yang Cao, Jiayan Huo, Yingyu Liang, Zhenmei Shi, Zhao Song

AI总结:

本文提出了一种在RoPE注意力中基于有界条目的几乎线性时间反向计算算法,并证明了有界条目条件对于亚二次性能的必要性。

摘要:

旋转位置嵌入(RoPE)机制已成为Transformer架构的强大增强,使模型在编码位置信息时能够捕捉令牌关系。然而,RoPE机制使注意力机制的计算更加复杂,这使得高效算法具有挑战性。早期研究在特定参数设置下(即条目有界的情况下)引入了几乎线性时间的前向计算算法(即时间复杂度为n^{1+o(1)},其中n是输入令牌的数量),但未解决反向计算的问题。在本工作中,我们开发了首个在RoPE注意力下基于有界条目的几乎线性时间反向计算算法。我们的方法建立在最近快速RoPE注意力计算的进展之上,利用了多项式方法和快速傅里叶变换的新型组合。此外,我们还表明,从强指数时间假设(SETH)导出的下界来看,有界条目条件对于亚二次性能是必要的。

英文摘要:

The Rotary Position Embedding (RoPE) mechanism has become a powerful enhancement to the Transformer architecture, which enables models to capture token relationships when encoding positional information. However, the RoPE mechanisms make the computations of attention mechanisms more complicated, which makes efficient algorithms challenging. Earlier research introduced almost linear time algorithms for the forward computation under specific parameter settings of bounded entries (i.e., in time $n^{1+o(1)}$ where $n$ is the number of input tokens), but has not addressed backward computation. In this work, we develop the first almost linear time algorithm for backward computations in the RoPE-based attention under bounded entries. Our approach builds on recent advancements in fast RoPE attention computations, utilizing a novel combination of the polynomial method and the Fast Fourier Transform. Furthermore, we show that with lower bounds derived from the Strong Exponential Time Hypothesis (SETH), the bounded entry condition is necessary for subquadratic performance.

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

↑