d_model is the most important hyperparameter you'll see in this quest. It's the dimensionality of every internal representation: the embedding rows, the attention outputs, the FFN outputs, the residual stream that flows through every layer. Bigger d_model means more capacity per token, at quadratic cost in attention parameters and linear cost in FFN parameters.
| Model | d_model | Layers | Total params |
|---|---|---|---|
| BERT-base | 768 | 12 | 110M |
| GPT-2 | 768 | 12 | 117M |
| GPT-2-XL | 1,600 | 48 | 1.5B |
| Llama 3 (8B) | 4,096 | 32 | 8B |
| Llama 3.3 (70B) | 8,192 | 80 | 70B |
| GPT-3 | 12,288 | 96 | 175B |
Why larger d_model helps: every dimension can encode a different feature of meaning — syntactic role, sentiment, formality, topic, named-entity type, and many more we don't have names for. Interpretability research (sparse autoencoders) suggests there are tens of thousands of distinct "features" packed into superposition in modern d_model=4096+ representations.