How a token vocabulary is built
The most common method is called byte pair encoding. You start from single letters and look, in a huge collection of texts, for the pair of pieces that most often shows up side by side. That pair becomes a new piece. You repeat this until the vocabulary reaches the size you want.
GPT-2, in 2019, had 50,257 tokens. Llama 3 has 128,256, and Gemma 3 about 262,000, to cover many languages better. A bigger vocabulary splits words less, but it makes the model heavier, because each token has its own embedding.
- 50,257tokens in GPT-2
- 128,256tokens in Llama 3
- 262,000tokens in Gemma 3, roughly