Spend a fixed parameter budget: more layers or wider d_model, and what does the evidence say?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
What an interviewer would ask next. Try answering before peeking at the approach.
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.