Skip to content
Transformer Circuits·Indexed by this site · Originally published· Alignment →SelectedAttention31

Anthropic releases a set of math exercises for Transformer reverse engineering

Exercises

AI summary

Anthropic's interpretability team released a set of exercises accompanying its mathematical framework for Transformers, requiring readers to write out specific weight matrices for attention heads to implement particular algorithms, with solutions provided. The exercises are in three parts: warm-up questions discuss how a single attention head uses W_Q, W_K, W_V, and W_out to describe reading and writing information between subspaces of the residual stream, as well as the meaning and rank of W_Q^T·W_K and W_out·W_V; exercise one uses two previous-token attention heads to construct a virtual attention head that looks two tokens back, expanding the W_net matrix; exercises two and three build induction heads by hand using pointer arithmetic and previous-token K-Composition respectively, with the latter suited to mechanisms such as rotary attention that do not expose positional information to W_V.

Why it was selected

Anthropic's interpretability team writes out the attention head weights as explicit matrices, allowing readers to derive mechanisms such as induction heads by hand.

Read originaltransformer-circuits.pub