Formula

Euclidean Representation of RoPE Rotation

The Euclidean space representation of Rotary Positional Embeddings (RoPE) applies a rotational transformation to a d-dimensional vector x\mathbf{x} through matrix multiplication. This transformation is performed by a d-dimensional square rotation matrix, denoted as R(t)Rd×dR(t) \in \mathbb{R}^{d \times d}, which is specific to the token's position tt. The formula is: Ro(x,tθ)=xR(t)=[x1x2xd][Rtθ1Rtθ2Rtθd/2]\mathrm{Ro}(\mathbf{x}, t\theta) = \mathbf{x} R(t) = \begin{bmatrix} x_1 & x_2 & \dots & x_d \end{bmatrix} \begin{bmatrix} R_{t\theta_1} & & & \\ & R_{t\theta_2} & & \\ & & \ddots & \\ & & & R_{t\theta_{d/2}} \end{bmatrix} Here, the input row vector x\mathbf{x} is multiplied by the block diagonal matrix R(t)R(t). This matrix is composed of d2\frac{d}{2} individual 2x2 rotation matrices, RtθkR_{t\theta_k}, along its diagonal, each acting on a consecutive pair of components from the vector x\mathbf{x}.

Image 0

0

1

Updated 2026-04-29

Contributors are:

Who are from:

Tags

Ch.3 Prompting - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences

Ch.2 Generative Models - Foundations of Large Language Models

Related