Define tied embeddings and explain why Llama-3 chose to untie them
Weight tying shares one `(vocab, d_model)` matrix between the input embedding lookup and the output logits projection (`W_out = W_in^T`). Saves vocab*d_model params (~525M at Llama-3 8B sizes).
Imagine a dictionary you use both to look up words by id (input) and to score how well a sentence ends with each word (output). Tying says: one dictionary, use it both ways. Untying says: keep two dictionaries, one optimized for lookup and one optimized for scoring. At small scale, one dictionary is fine. At frontier scale, having two specialists each doing their own job consistently scores a fraction of a point higher on benchmarks. Llama-3 and most >7B production models pay the extra storage to get the lift.
Detailed answer & concept explanation~4 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.
2 min: define tying (shared `W_in` matrix used as `W_in^T` at output), state the param cost (`vocab * d_model`, ~525M at Llama-3 8B), give the modern default (untie at >7B, tie below ~3B), and explain WHY (input is a lookup, output is a scorer; at scale they want different representations).
| Aspect | Tied embeddings | Untied embeddings |
|---|---|---|
| Param count at vocab=128k, d=4096 | Shared (saves ~525M) | Two matrices (costs ~525M extra) |
| Input embedding role | Lookup AND scoring (compromise) | Pure lookup |
| Output head role | Scoring AND lookup (compromise) | Pure similarity scorer |
| Quality at >7B scale | Slight regression | Slight lift (~0.5-1 benchmark point) |
| Quality at <3B scale | Roughly equal or better (param efficiency) | Slightly worse per-param |
| 2026 frontier convention | Used in small LMs (<3B) | Default for 7B+ decoder LLMs |
Real products, models, and research that use this idea.
- Llama-3 8B, 70B, and 405B all untie embeddings. The 8B pays ~525M extra params for the dedicated output head.
- DeepSeek V3 (671B MoE) unties its embedding from its output head, consistent with the frontier convention.
- Llama-1 7B and 13B (2023) tied embeddings; Llama-2 7B and 13B tied; Llama-2 70B untied; Llama-3 untied across all sizes. The transition tracks scale crossing the 70B threshold.
- Llama-3.2 1B and 3B (small variants) tied embeddings, consistent with the 'tie below ~3B' rule of thumb.
- Press and Wolf (2017) introduced weight tying in the era of <1B models and demonstrated it improved perplexity at that scale.
What an interviewer would ask next. Try answering before peeking at the approach.
QIf untying gives the output head freedom to specialize, why not also use a bigger d_model JUST at the output head?
QWhat happens at training time if you accidentally tie embeddings when the codebase expects untied?
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.
Assuming tied embeddings are always the right default. They were for GPT-2 and Llama-1, but every major decoder LLM from Llama-3 onward untied them deliberately.
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.