Step-by-step answer
Stretch 90 min5 stepsFind an induction head in GPT-2
GPT-2 small loaded through TransformerLens on CPU, run on random token sequences repeated twice, with every head scored for attention to "the token after this one's last occurrence". Heads 5.5, 6.9, 7.10, 5.1 and 7.2 score 0.84–0.94, and the loss on the repeat falls from 12.35 to 0.21 nats.
Back to the exercise