flâneur — a map of the web's best reading

Chapter 1: Transformer Interpretability - ARENA

learn.arena.education · 3,829 words · saved by 1 readers

Here we introduce a toy 2L attention-only transformer trained specifically for today. Some changes to make them easier to interpret: - It has only attention blocks. - The positional embeddings are only added to the residual stream before calculating each key and query vector in the attention layers as opposed to the token embeddings - i.e. we compute queries as Q = (resid + pos_embed) @ W_Q + b_Q and same for keys, but values as V = resid @ W_V + b_V. This means that the residual stream can't directly encode positional information. - This turns out to make it way easier for induction heads to form, it happens 2-3x times earlier - see the comparison of two training runs here. (The bump in each curve is the formation of induction heads.) - The argument that does this below is positional_embedding_type="shortformer". - It has no MLP layers, no LayerNorms, and no biases. - There are separate embed and unembed matrices (i.e. the weights are not tied). We now define our model with a HookedTr

2️⃣ Finding induction heads Learning Objectives Understand what induction heads are, and the algorithm they are implementing Inspect activation patterns to identify basic attention head patterns, and write your own functions to detect attention heads for you Identify induction heads by looking at the attention patterns produced from a repeating random sequence Introducing Our Toy Attention-Only Model Here we introduce a toy 2L attention-only transformer trained specifically for today. Some changes to make them easier to interpret: - It has only attention blocks. - The positional embeddings are

Explore this link on the map →

saved by

related reading