Define tied embeddings and explain why Llama-3 chose to untie them
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
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.
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.
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.
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.