mlp-computes-attention-copies-modular-addition

IN premise — summaries/2026/08/24/engels-2024-not-all-features-linear-s1-create-a-graph-g-out-of-the-dictionary-elements-by-adding-di.md

Created 2026-08-25T02:58:01+00:00

In modular addition tasks (e.g., days of the week), patching experiments show MLPs in late layers compute the output value γ on input tokens, while attention heads only copy γ to the prediction token position.

Summary

In tasks like "what day is it three days from now," the model's feed-forward layers are where the actual arithmetic happens, while the attention heads simply shuttle the already-computed answer to the correct output slot. This division of labor matters because it tells us that understanding or correcting the model's reasoning in these tasks requires looking at the MLPs, not the attention mechanism.