Foundations / Representation
verifiedToken Embedding
A token id is just a number with no meaning — id 400 is not twice id 200. The embedding table gives each id a vector instead, learned during training, so that tokens used in similar ways end up pointing in similar directions. It is the step that turns arbitrary labels into geometry the model can do arithmetic on.
A lookup table of shape |V| × d sub model , indexed by token id. It is often the single largest parameter tensor in a small model, and is frequently tied to the output projection so the same matrix maps in and out. Tying saves |V|·d sub model parameters and usually costs nothing in quality.
E ∈ ℝ super |V|×d sub model , with the embedding of token t being row E sub t . With weight tying, the output logits are h·Eᵀ rather than h·W for a separate W. The transformer's original scheme also scales embeddings by √d sub model before adding positional encoding.
vocab holds 66% of the budget; rest holds the remaining 34%.
Share of the model's parameters held by the embedding table against everything else. Drag the vocabulary to watch the table take over the budget in a small model.
Reviewed by opendroid · 2026-08-04
- arXiv:1706.03762 — Attention Is All You Need
- arXiv:1608.05859 — Using the Output Embedding to Improve Language Models