AI From Scratch/Phase 07/Lesson 04/~45 minutes

Positional Encoding — Sinusoidal, RoPE, ALiBi

BuildPythonNo prerequisites

Attention is permutation-invariant. "The cat sat on the mat" and "mat the on sat cat the" produce the same output without positional signal. Three algorithms fix it — each with a different bet on what "position" means.

Loading lesson page...