Compute the per-head dimension and the single-layer parameter count of multi-head attention from hidden size and head count.
常见 head_dim 64,过大或过小均影响表达。
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Dimension split | model width equals heads times head dimension | Attention Is All You Need |
| Typical size | head dimensions usually sit at sixty-four with more heads at scale | Model documentation |
| Capacity | too small a head limits subspaces and too large reduces parallelism | Attention analysis literature |
每头维度 d_head=d_model/h,需整除;常见 d_model=512,h=8→d_head=64。