Seeing Inside the Transformer
Attention Pattern Analysis
10 min+100 XPStep 1/10
Attention is where the data flows
In a transformer, attention is the only mechanism that moves information between positions. The MLPs process each token independently; only attention lets one token read another's contents. That makes attention patterns — the query-key match weights — a map of the network's information routing.
Each head computes: queries (what this position is looking for) matched against keys (what each position offers), producing weights that mix the values (what each position sends). A pattern is a per-token distribution over sources. Readable, visual, and — critically — interpretable without touching the weights.