FFN's FLOPs Dominance: The Expansion Factor's Role

The primary reason for FFN's higher FLOPs lies in its architectural design, specifically the expansion-then-contraction pattern where the hidden dimension is typically expanded by a factor of 4x (e.g., d_model to 4*d_model and back to d_model), leading to computationally intensive large matrix multiplications compared to Attention.

Sources

Open the full topic