Estimate the parameter count of a Transformer from layer count, hidden size and vocabulary, separating body and embedding parameters.
实际随具体架构大幅浮动。
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Attention parameters | each layer holds four projection matrices totalling about four times the squared width | Vaswani et al. 2017, attention |
| Feed-forward parameters | the feed-forward block uses an expansion ratio of four giving about eight times the squared width | Vaswani et al. 2017, attention |
| Embeddings | vocabulary size times width forms the embedding block which may tie weights with the output layer | Press & Wolf 2017, weight tying |