Glossary · Tokens in, tokens out

Vocabulary and tokenizer

Also: vocab_sizetokenstokenizerBPE

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

1In one sentence

The fixed list of tokens a model reads and writes (V of them), set by its tokenizer. V sets the size of the embedding table and the output head.

2In a paragraph

Models do not see characters or words but tokens: pieces of text from a fixed vocabulary, found by an algorithm such as byte-pair encoding. Common words are one token, rare words several. A bigger vocabulary packs more text into each token (so more fits in the context and generation is faster) at the cost of a bigger embedding table and output head, and a softmax over more entries at every step.

3The math, shapes and parameters

The vocabulary appears in two matrices of shape [V, d]: the embedding and the output head (one matrix if they are tied). vocab_size in the config is often padded above the tokenizer's real count to a multiple of 64 or 128, for faster matmuls.

4In the 96 models on this site

Vocabularies here, one model per series:

SeriesVEmbedding (V × d) in the smallestShare of that model
Gemma 3262,144168M in Gemma 3 270M62.6%
Gemma 4262,144738M in Gemma 4 26B-A4B2.9%
Gemma 2256,000590M in Gemma 2 2B22.6%
Qwen3.5248,320254M in Qwen3.5 0.8B33.8%
Llama 4202,0481.03B in Llama 4 Scout (17B-16E)0.96%
gpt-oss201,088579M in gpt-oss-20b2.8%
Inkling201,024823M in Inkling-Small0.31%
MiniMax200,064615M in MiniMax M20.27%
Kimi163,8401.17B in Kimi K20.11%
Ling157,1841.29B in Ling-1T0.13%
Seed-OSS155,136794M in Seed-OSS 36B2.2%
GLM-5154,880952M in GLM-5.20.13%
Qwen2.5151,936136M in Qwen2.5 0.5B27.6%
Qwen3151,936156M in Qwen3 0.6B26.1%
DeepSeek-R1 distills151,936233M in DeepSeek-R1-Distill-Qwen-1.5B13.1%
Qwen3-Next151,936311M in Qwen3-Next 80B-A3B0.39%
GLM-4.5151,552621M in GLM-4.5-Air0.58%
Falcon3131,072268M in Falcon3 1B16.1%
Nemotron 3131,072352M in Nemotron 3 Nano 30B-A3B1.1%
Llama 3128,256263M in Llama 3.2 1B21.3%
DeepSeek102,400210M in DeepSeek-V2-Lite1.3%
OLMo 2100,352206M in OLMo 2 1B13.8%
OLMo 3100,278411M in OLMo 3 7B5.6%
SmolLM49,15228.3M in SmolLM2 135M21.0%
Granite49,152101M in Granite 3.3 2B4.0%
Mistral32,768134M in Mistral 7B v0.31.9%
Phi32,06498.5M in Phi-3 Mini2.6%
Llama 232,000131M in Llama 2 7B1.9%

Related

Embedding and output head · Tied embeddings · every term