How do width, depth and number of attention heads trade off when scaling a transformer under a fixed parameter budget?
Last updated
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.