LLM & Transformer Fundamentals·Question 15 of 109Basic

What is weight tying, and why do some models tie the embedding and output matrices while others do not?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Weight tying means the input embedding matrix and the output LM head are the same matrix, used transposed at the output. Both map between token identity and residual-stream space, so the argument is that one matrix should serve.

Full worked answer

Weight tying means the input embedding matrix and the output LM head are the same matrix, used transposed at the output. Both map between token identity and residual-stream space, so the argument is that one matrix should serve.

The saving is vocab x d_model parameters. With a 128k vocab and d_model 4096 that is ~524M parameters, which is a serious fraction of an 8B model and a rounding error in a 400B one. That size asymmetry basically explains the split in practice: small models tend to tie (Gemma ties, and with a ~256k vocab the saving is enormous relative to the body), while large models increasingly untie because the parameters are cheap and untying measurably improves loss.

Why untying helps is the interesting part. The two matrices want different geometries. The embedding wants tokens that appear in similar contexts to sit close together. The unembedding wants tokens that are interchangeable as predictions to sit close together. Those are related but not identical, and forcing one matrix to satisfy both constrains it. There is also a rank argument: the logit matrix is bounded by d_model, the softmax bottleneck, and tying does not help there.

Two details worth knowing. First, gradients behave differently: the embedding side receives sparse updates for tokens actually present in the batch, while the head receives dense updates from the full-vocab softmax, and with tying they land on the same matrix, which changes its effective learning rate relative to the rest of the model. Second, scale mismatch is real, which is why several tied models multiply embedding outputs by sqrt(d_model).

The original arguments came from Press and Wolf and from Inan et al. around 2016 and 2017, in an era of small models where the embedding table genuinely was most of the model. The tradeoff has shifted since, which is the point.

What a good answer covers

  • Weight tying means the input embedding matrix and the output LM head are the same matrix, used…
  • Both map between token identity and residual-stream space, so the argument is that one matrix should serve
  • The saving is vocab x d_model parameters
  • With a 128k vocab and d_model 4096 that is ~524M parameters, which is a serious fraction of an 8B model…
  • That size asymmetry basically explains the split in practice

Interviewer follow-ups to expect

  1. How does the vocabulary size decision interact with the tying decision?

  2. What happens to a tied model if you want to extend the vocabulary post-hoc?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep