Learn Before
Formula

Formula for Relative Position Scaled by Sinusoidal Wavelength

This formula calculates a value based on the relative distance (i - j) between two sequence positions. This distance is then scaled by a denominator, $10000^{2k/d}$, which serves as a wavelength term and is a core component of the sinusoidal positional encoding scheme from the original Transformer model. The full formula is: (ij)/100002k/d(i-j)/10000^{2k/d} In this expression, k typically represents the dimension index within the embedding, and d is the total dimensionality of the model's embeddings. The resulting value is commonly used as an input to sine and cosine functions to generate a final positional encoding vector or bias.

Image 0

0

1

Updated 2025-10-09

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