Concept icon
Concept

Sinusoidal Positional Encoding

A simple and dominant scheme for fixed positional encodings relies on sine and cosine functions. Suppose the input representation XRnimesd\mathbf{X} \in \mathbb{R}^{n imes d} contains the dd-dimensional embeddings for nn sequence tokens. The sinusoidal positional encoding outputs X+P\mathbf{X} + \mathbf{P} using a positional embedding matrix PRnimesd\mathbf{P} \in \mathbb{R}^{n imes d} of the exact same shape, seamlessly adding the positional information directly to the token embeddings.

0

1

Concept icon
Updated 2026-09-07

Tags

Ch.2 Generative Models - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences

D2L

Dive into Deep Learning @ D2L

Prep Sessions

Foundational Deep Learning Architectures: Transformers and Residual Networks @ University of Michigan - Ann Arbor

Ch.1 Transformer Architecture and Components - Foundational Deep Learning Architectures: Transformers and Residual Networks @ University of Michigan - Ann Arbor

Sinusoidal and Learned Positional Encodings - Foundational Deep Learning Architectures: Transformers and Residual Networks @ University of Michigan - Ann Arbor