chapter 04
Sinusoidal positions
Instead of learning a table, compute each position's vector from sine and cosine waves of many speeds.
The formula, then the picture
PE(pos, 2i) = sin(pos · ωi) PE(pos, 2i+1) = cos(pos · ωi) ωi = 1 / 100002i/d
Each pair of dimensions is one wave. Early pairs wiggle fast, later pairs crawl.
Read a position off the waves
The famous heatmap
Clock hands at different speeds
Why waves and not just numbers
Wavelengths form a geometric ladder
The dot product only cares about distance
PE(p) · PE(p+k) = Σi cos(k · ωi) (no p anywhere)