Jeonghyeon Kim

Attention mechanisms

How does a token decide what to read?

Turn the attention equation into an actual computation. Track every dimension, inspect a causal attention matrix, and read the same implementation that produced the interactive trace.

Read the full explanation →

The article

02

Inside attention, one tensor at a time

Follow a complete decoder through Q, K, V, rotary positions, grouped-query attention, residual connections, and next-token logits. Every shape has a job.

22 min readEquations and code

Related reading

01

Before attention: how words become vectors

Build an embedding table, calculate a complete skip-gram training step, and discover why a decoder needs more than one fixed vector.

14 min readEquations and code
04

Why modern attention has so many names

Separate head sharing, position, compressed memory, sparse selection, and GPU execution. Then read DeepSeek’s recent designs with those distinctions in mind.

13 min readEquations and code