Why is the feed-forward hidden dimension conventionally expanded to four times the model dimension?

Last updated 22 November 2026

  • It is an empirical convention from the original Transformer (d_model 512, d_ff 2048), not a derived optimum.

  • The FFN does most per-token transformation and knowledge storage. Expanding before the nonlinearity gives it capacity, and 4x puts about two-thirds of block parameters there (8d² vs 4d² for attention).

  • The ratio isn't sacred: SwiGLU uses about 8/3, and scaling studies show quality is fairly insensitive to the exact ratio.

  • https://mbrenndoerfer.com/writing/transformer-feed-forward-networks
  • https://www.youtube.com/watch?v=m-uDHJ-Lqmw
  • https://skphd.medium.com/transformers-interview-questions-and-answers-d7248f43fbe8
All Transformers interview questions