Formula

Formula for Multi-dimensional RoPE in Complex Space

In a complex space, the rotary positional embedding for a dd-dimensional token vector can be formulated as: C(x,tθ)=k=1d/2xkeitθkekC(\mathbf{x},t\theta) = \sum_{k=1}^{d/2} x'_k e^{\mathtt{i} t\theta_k} \vec{e}_k where xkx'_k represents the kk-th component of the token embedding reinterpreted as a complex number (formed by pairs of adjacent elements), tt is the position, θk\theta_k is the rotation frequency parameter for the kk-th dimension, and ek\vec{e}_k is the standard basis vector with a single non-zero value in the kk-th coordinate and 0's elsewhere.

0

1

Updated 2026-04-29

Contributors are:

Who are from:

Tags

Foundations of Large Language Models

Ch.2 Generative Models - Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences