sarvesh.
Notebook

An attention map is the start of a question

An attention head mixes information from earlier token positions into the current one. A bright connection shows how strongly a position is weighted; it does not, by itself, tell me how that connection affects the answer.

In my October 18 Gemma 3 4B study, I scanned 204 layer interventions and then 48 individual-head replacements. Copying layer 25, head 2’s output from a Germany prompt into the matching France prompt changed the winning next token from Paris to Berlin, at 76.85%. The layer and head numbers here start at one.

I then separated the routing from the information being carried. Transferring only the country token’s value contribution through that head gave Berlin 74.66%. Transferring only the attention routing pattern left Paris the winner at 80.51%. Identical-input replacements left the output scores unchanged.

That supports a particular route from the country position to the final prediction in these examples. The same head replacement transferred the answer on two additional prompt pairs, but the detailed value-path test used only the original pair. It is a partial explanation—not a universal “country head” or a complete account of how the model answers geography questions.

Related project · Gemma Microscope