ffn-size-typically-4x-embedding-size

IN premiseentries/2026/06/21/wiki-Transformer_deep_learning_architecture-chunk-2.md

Created 2026-06-21T09:50:11+00:00

The feedforward network intermediate size (d_ffn) is typically 4 times the embedding dimension (d_emb), as used in GPT-2 and BERT.

Summary

In standard transformer models like GPT-2 and BERT, the internal feedforward layers are sized to be roughly four times wider than the model's main hidden representation. This 4x ratio is a widely followed design convention that directly determines how much compute and memory each layer consumes relative to the model's core size, so it anchors architecture decisions and resource planning.

Dependents

These beliefs depend on this one: