Formula

Formula for the Inner Product of RoPE-Encoded Tokens in Complex Space

The inner product between two RoPE-encoded tokens at positions tt and ss, represented by C(x,tθ)C(\mathbf{x}, t\theta) and C(y,sθ)C(\mathbf{y}, s\theta), is calculated using their complex representations. The formula is: C(x,tθ),C(y,sθ)=(xyˉ)ei(ts)θ\langle C(\mathbf{x}, t\theta), C(\mathbf{y}, s\theta) \rangle = (\mathbf{x}'\bar{\mathbf{y}}')e^{i(t-s)\theta} Here, x\mathbf{x}' represents the complex form of the original token embedding x\mathbf{x}, and yˉ\bar{\mathbf{y}}' is the complex conjugate of the complex form of embedding y\mathbf{y}. This equation highlights that the relationship between the two tokens is dependent on their relative position, (ts)(t-s).

Image 0

0

1

Updated 2026-04-29

Contributors are:

Who are from:

Tags

Ch.2 Generative Models - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences