Skip to main content
← Lab

flopcross

confirmedGo · CPUInference & servingJuly 7, 2026

the question

Where does transformer compute go, and when does attention overtake the FFN?

what came out

The FFN owns ~88% of fixed per-token FLOPs, but attention grows linearly with context and overtakes it at exactly 1.5 x ffn_dim tokens (13,440 for the 1.5B, 7,296 for the 0.5B) -- a clean architectural constant, because d_model cancels. Go, exact, pre-registered.

method & receipts

→ read the code and re-run it

github.com/v-code01/flopcross