Home▸Machine Learning & Neural Networks▸Positional Encoding Heat Map, Frequency Clocks and Word Swap Test

🧭 Positional Encoding Heat Map, Frequency Clocks and Word Swap Test

Positional Encoding Heat Map, Frequency Clocks and Word Swap Test

Machine Learning & Neural Networks2DModerate60 FPS📱 Mobile-adapted🟠 Blender⇄ 3D version
Positional Encoding Heat Map, Frequency Clocks and Word Swap Test ↗ Open standalone

The simulation visualizes sinusoidal positional encoding vectors as glowing wave patterns across embedding dimensions, showing how each position in a sequence gets a distinct combination of sine and cosine frequencies.

🔬 What It Demonstrates

The simulation visualizes sinusoidal positional encoding vectors as glowing wave patterns across embedding dimensions, showing how each position in a sequence gets a distinct combination of sine and cosine frequencies.

🎮 How to Use

Use the sequence length slider to change how many word positions are shown and the speed slider to control animation pace, then press play to watch the encoding patterns build position by position, or rebuild to regenerate the scene.

💡 Did You Know?

In the original transformer paper, the wavelengths of the sine and cosine functions used for positional encoding form a geometric progression from 2π up to roughly 10,000 times 2π, letting the model represent both fine-grained and very coarse positional differences at once.

⚙ Under the hood

Positional Encoding Heat Map, Frequency Clocks and Word Swap Test

positional encodingtransformersattentionnlpmachine-learningsequence models

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)