How do width, depth and number of attention heads trade off when scaling a transformer under a fixed parameter budget?

Last updated 22 November 2026

  • Total parameters are about 12·L·d², so a fixed budget trades depth L against width d. Loss is fairly insensitive across aspect ratios d/L of about 20 to 200 (Kaplan et al.), and typical LLMs use about 50 to 130.

  • Depth adds compositional steps but raises latency and optimization difficulty. Width gives larger, hardware-efficient matmuls but too shallow loses compositional capacity.

  • Head count is parameter-neutral (it only partitions d). Keep head dim at 64 to 128 to avoid a low-rank bottleneck, and use KV heads (GQA) as the inference-memory knob.

  • https://arxiv.org/html/2503.01805v1
  • https://apxml.com/courses/how-to-build-a-large-language-model/chapter-11-scaling-transformers-architectural-choices/depth-vs-width-tradeoffs
  • https://arxiv.org/html/2605.27989v1
All Transformers interview questions