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
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.
SmallThinker: A Family of Efficient Large Language Models Natively Trained for Local Deployment
Institute of Parallel and Distributed Systems, Shanghai Jiao Tong University(并行与分布式系统研究所,上海交通大学);School of Artificial Intelligence, Shanghai Jiao Tong University(人工智能学院,上海交通大学);Zenergize AI