Try and compare tokenizersEssayer et comparer des segmenteurs
TRA6008 S2 · in classS2 · en classe
Paste and look
Any text pasted into a tokenizer comes back split, token by token.
The two screenshots below were taken on 8 September 2026 with GPT-4o selected, and cropped to the panels that matter. Both the interface and the splits change, so what you see today may not match them.
What you should see
- Common English words are one token each, because the merges that build them ran often enough.
- Rare words and typos shatter. Tokenization itself comes out in two or three pieces, and htis in more.
- Other languages cost more tokens for the same sentence, and the further a language is from the training text, the more it costs.
One vocabulary per model
The vocabulary behind the splitting is a design decision, and it has grown. GPT-2 worked with 50,257 tokens (Radford et al., 2019); the tokenizers OpenAI has released since, in its open tiktoken library, reach roughly 200,000. Much of that growth went to non-English text: a recent tokenizer keeps whole many French and Dutch words an older one fragmented. The differences between languages shrink without disappearing, and they can be measured (see also the Consequences of tokenization chapter) (voir aussi le chapitre Conséquences de la jetonisation).
Tiktokenizer offers a choice of models, and the most recent OpenAI one it lists is GPT-4o. That is the tool lagging rather than anything withheld: tiktoken maps GPT-5 to the same vocabulary as GPT-4o, so the split above is the current one. Other companies are less open about this than OpenAI. Anthropic publishes no tokenizer for Claude, only an endpoint that reports how many tokens a text costs, so for those models the count can be checked and the cuts cannot be seen.
Coller un texte et regarder
N’importe quel texte collé dans un segmenteur en ressort découpé, jeton par jeton.
Les deux captures ci-dessous ont été prises le 8 septembre 2026 avec GPT-4o sélectionné, et rognées sur les panneaux qui comptent. L’interface comme les découpages changent : ce que vous verrez aujourd’hui peut ne pas y correspondre.
Ce que vous devriez voir
- Les mots anglais courants font un jeton chacun, parce que les fusions qui les construisent ont tourné assez souvent.
- Les mots rares et les coquilles éclatent. Tokenization lui-même ressort en deux ou trois morceaux, et htis en davantage.
- Les autres langues coûtent plus de jetons pour la même phrase, et plus une langue est éloignée des textes d’entraînement, plus elle coûte cher.
Un vocabulaire par modèle
Le vocabulaire derrière le découpage est une décision de conception, et il a grandi. GPT-2 travaillait avec 50 257 jetons (Radford et al., 2019) ; les segmenteurs qu’OpenAI a publiés depuis, dans sa bibliothèque ouverte tiktoken, atteignent environ 200 000. Une bonne part de cette croissance est allée aux textes non anglais : un segmenteur récent garde entiers de nombreux mots français et néerlandais qu’un ancien fragmentait. Les écarts entre les langues se réduisent sans disparaître, et ils se mesurent (see also the Consequences of tokenization chapter) (voir aussi le chapitre Conséquences de la jetonisation).
Tiktokenizer propose un choix de modèles, et le plus récent d’OpenAI qu’il énumère est GPT-4o. C’est l’outil qui est en retard, non quelque chose qu’on retiendrait : tiktoken associe GPT-5 au même vocabulaire que GPT-4o, si bien que le découpage ci-dessus est celui d’aujourd’hui. D’autres entreprises sont moins ouvertes qu’OpenAI là-dessus. Anthropic ne publie aucun segmenteur pour Claude, seulement un point d’accès qui indique combien de jetons coûte un texte : pour ces modèles, le compte se vérifie et les coupes ne se voient pas.
Sources
- Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., & Sutskever, I. (2019). Language Models are Unsupervised Multitask Learners. OpenAI. https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf
- Sennrich, R., Haddow, B., & Birch, A. (2016). Neural Machine Translation of Rare Words with Subword Units. Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). https://doi.org/10.18653/v1/P16-1162
Sources
- Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., & Sutskever, I. (2019). Language Models are Unsupervised Multitask Learners. OpenAI. https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf
- Sennrich, R., Haddow, B., & Birch, A. (2016). Neural Machine Translation of Rare Words with Subword Units. Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). https://doi.org/10.18653/v1/P16-1162