Glossary · Tokens in, tokens out

Tied embeddings

Also: tie_word_embeddingsweight tyingshared embeddings

Read it at the depth you need: one sentence · a paragraph · the math · in the models here

1In one sentence

Using the same [V, d] matrix as both the input embedding and the output head, which saves V × d parameters.

2In a paragraph

The embedding maps tokens to vectors and the output head maps vectors back to tokens, and both are [V, d]. Tying them uses one matrix for both jobs. Large models seldom bother (the saving is a rounding error for them), but for small models with big vocabularies it can be a fifth of the model or more. The config says so with tie_word_embeddings: true; Gemma ties by default without saying.

3The math, shapes and parameters

saving = V × d parameters = V × d × 2 bytes in BF16

The head still costs 2·V·d FLOPs per token: tying saves memory, not compute. A few checkpoints tie in the config and still store a copy of lm_head.weight (Qwen3 0.6B and 1.7B); the loader ignores it.

4In the 96 models on this site

28 of the 96 models here tie their embeddings, and what it saves:

ModelParametersSaved (V × d)Share it would add
SmolLM2 135M135M28.3M21.0%
Gemma 3 270M268M168M62.6%
SmolLM2 360M362M47.2M13.0%
Qwen2.5 0.5B494M136M27.6%
Qwen3 0.6B596M156M26.1%
Qwen3.5 0.8B752M254M33.8%
Gemma 3 1B1B302M30.2%
Llama 3.2 1B1.24B263M21.3%
Qwen2.5 1.5B1.54B233M15.1%
SmolLM2 1.7B1.71B101M5.9%
Qwen3 1.7B1.72B311M18.1%
Qwen3.5 2B1.88B509M27.0%
Granite 3.3 2B2.53B101M4.0%
Gemma 2 2B2.61B590M22.6%
SmolLM3 3B3.08B263M8.5%
Qwen2.5 3B3.09B311M10.1%
Llama 3.2 3B3.21B394M12.3%
Phi-4 Mini3.84B615M16.0%
Gemma 3 4B3.88B671M17.3%
Qwen3 4B4.02B389M9.7%
Qwen3.5 4B4.21B636M15.1%
Granite 3.3 8B8.17B201M2.5%
Gemma 2 9B9.24B918M9.9%
Gemma 3 12B11.8B1.01B8.6%
Gemma 4 26B-A4B25.2B738M2.9%
Gemma 3 27B27B1.41B5.2%
Gemma 2 27B27.2B1.18B4.3%
Gemma 4 31B30.7B1.41B4.6%

Introduced in Press and Wolf, “Using the Output Embedding to Improve Language Models” (2017).

Related

Embedding and output head · Vocabulary and tokenizer · every term