paper-with-me

홈 › Papers

Fast Gradient Computation for RoPE Attention in Almost Linear Time

2024-12-23 · Yifang Chen, Jiayan Huo, Xiaoyu Li, 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, i.e., $n^{1+o(1)}$ where $n$ is the number of input tokens, algorithms for the forward computation under specific parameter settings. However, achieving a subquadratic time algorithm for other parameter regimes remains impossible unless the widely accepted Strong Exponential Time Hypothesis (SETH) is disproven. 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 SETH, the bounded entry condition is necessary for subquadratic performance.

📄 PDF Abstract BibTeX arXiv:2412.17316

Code (0)

등록된 구현이 없습니다.

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…
Dense Connections Dense Connections, or Fully Connected Connections, are a type of layer in a deep neural network that use a linear operation where every input is connected to every output…
Multi-Head Attention 설명 없음
Position-Wise Feed-Forward Layer 설명 없음
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…

Similar Papers 제목 키워드 기반

Fast RoPE Attention: Combining the Polynomial Method and Fast Fourier Transform

2025-05-17 · Josh Alman, Zhao Song

The transformer architecture has been widely applied to many machine learning tasks. A main bottleneck in the time to perform transformer computations is a task called attention computation. [Alman and Song, NeurIPS 2023…

Position

Multi-Layer Transformers Gradient Can be Approximated in Almost Linear Time

2024-08-23 · YIngyu Liang, Zhizhou Sha, Zhenmei Shi, Zhao Song 외

The computational complexity of the self-attention mechanism in popular transformer architectures poses significant challenges for training and inference, and becomes the bottleneck for long inputs. Is it possible to sig…

Tensor Attention Training: Provably Efficient Learning of Higher-order Transformers

2024-05-26 · YIngyu Liang, Zhenmei Shi, Zhao Song, Yufa Zhou

Tensor Attention, a multi-view attention that is able to capture high-order correlations among multiple modalities, can overcome the representational limitations of classical matrix attention. However, the $O(n^3)$ time …

Conv-Basis: A New Paradigm for Efficient Attention Inference and Gradient Computation in Transformers

2024-05-08 · YIngyu Liang, Heshan Liu, Zhenmei Shi, Zhao Song 외

The self-attention mechanism is the key to the success of transformers in recent Large Language Models (LLMs). However, the quadratic computational cost $O(n^2)$ in the input sequence length $n$ is a notorious obstacle f…

Toward Efficient Gradient-Based Value Estimation

2023-01-31 · Arsalan SharifNassab, Richard Sutton

Gradient-based methods for value estimation in reinforcement learning have favorable stability properties, but they are typically much slower than Temporal Difference (TD) learning methods. We study the root causes of th…