Spend a fixed parameter budget: more layers or wider d_model, and what does the evidence say?
Given a fixed parameter budget for a new LLM, defend the choice between scaling depth (more layers) and scaling width (larger d_model). Reference what scaling law ablations from Levine et al. and the Chinchilla era follow-ups found, and how modern 70B class models tend to land.
Depth provides composition (refinement steps), width provides per step capacity. Past a depth threshold (~32 for 7B, ~80 for 70B), width scales cleaner; spend the marginal parameter on `d_model`.
Imagine you have a budget to build a hotel. You can either build it taller (more floors) or wider (bigger floors). At first, adding floors helps a lot: each new floor lets guests have a different kind of room. Past a certain height the elevators get slow and adding more floors helps less. At that point, your money is better spent making each floor bigger so each room can fit more stuff. LLMs are the same. Depth (number of layers) is like floors: each layer refines the model's understanding step by step. Width (`d_model`) is like the size of each floor; bigger floors hold more knowledge per layer. Once you have around 32 layers in a small model or 80 in a big one, adding more layers stops helping much and you should grow each layer instead.
Detailed answer & concept explanation~6 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
8 min: define composition vs capacity, walk the empirical anchors at 7B / 70B / 405B, cite Levine and Chinchilla, explain the aspect ratio asymptote, and finish with the cases where the rule breaks.
| Model | Layers | d_model | Aspect (d_model / layers) |
|---|---|---|---|
| Vaswani 2017 base | 6 | 512 | 85 |
| Llama 3.1 8B | 32 | 4096 | 128 |
| Llama 3.1 70B | 80 | 8192 | 102 |
| Llama 3.1 405B | 126 | 16384 | 130 |
| Mistral Large 3 | ~88 | ~9216 | ~105 |
Real products, models, and research that use this idea.
- Llama 3.1 8B: 32 layers, d_model 4096, FFN hidden 14336; aspect ratio 128.
- Llama 3.1 70B: 80 layers, d_model 8192, FFN hidden 28672; aspect ratio 102; slightly squatter than 8B, confirming wider not deeper.
- Llama 3.1 405B: 126 layers, d_model 16384, FFN hidden 53248; aspect ratio 130; width keeps growing faster than depth.
- Llama 4 Maverick (MoE 400B/17B active): the dense stack stays modest depth, with capacity coming from 128 experts; depth vs width applies to the dense part only.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhy does the aspect ratio settle in the 100-130 range instead of continuing to drop?
QHow does Chinchilla's data vs parameters finding interact with depth vs width?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Believing depth always helps. Past the compute optimal depth for a given parameter budget, additional layers actually hurt; they consume parameters that would have given more quality if spent on width.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.