Tokenizer Myths and Where To Find Them
Organizations: Stanford Computer Science
Abstract
Tokenization is a fundamental component of modern language models: before a model sees data, its tokenizer has already determined how the data appears. We identify and challenge three myths in the tokenization research literature. Myth #1: Bits-Per-Byte (BPB) is agnostic to the tokenizer and/or the vocabulary size: BPB is tokens per byte times bits per token, and the two factors do not cancel; using untrained models, we show that BPB prefers some tokenizers over others: the model has learned nothing, but the tokenizer--model pair has. Myth #2: lower BPB means a better model: On untrained models, BPB strongly prefers some vocabulary sizes, even though accuracy remains at chance, and on real models trained on the same data, BPB correlates weakly with downstream performance. Myth #3: different "tokenizer-agnostic" metrics yield consistent results: The "unigram-normalized loss" is not tokenizer-agnostic; its reported correlation of 0.989 with BPB comes from a confounder and falls to 0.057 once fixed; from the same data the two metrics select different vocabularies at each model size. We present a tokenizer trilemma: no metric can score only the true distribution best, give the same predictions the same score, and tie all untrained models, so choosing a metric is choosing a research question. We conclude with a caution for reading the tokenization literature and a conjecture for future work.
Figures & tables
| Option-Letter Scoring | Answer-Text Scoring | |
|---|---|---|
| Prompt | Question: Which piece of safety equipment is used to keep mold spores from entering the respiratory system? A. safety goggles B. breathing mask C. rubber gloves D. lead apron Answer: | Question: Which piece of safety equipment is used to keep mold spores from entering the respiratory system? Answer: |
| Scored strings | ␣A , ␣B , ␣C , ␣D | ␣safety goggles , ␣breathing mask , ␣rubber gloves , ␣lead apron |
| Bytes charged |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| At the minimum | At the largest | |||
|---|---|---|---|---|
| Corpus and tokenizer | Largest | |||
| English, BPE | ||||
| Code, BPE | ||||
| French, BPE | ||||
| Hindi, BPE | ||||
| Russian, BPE | ||||
| measured on | BLiMP | GSM8K | MBPP | HumanEval |
|---|---|---|---|---|
| Held-out mixture | ||||
| Code | ||||
| Multilingual |
| TokSuite’s Rule (Used) | Harness’s Rule | ||
| Benchmark | Scored | Slope Interval | Slope Interval |
| TokSuite, 14 tokenizers | |||
| MMLU | Letter | ||
| MMLU | Text | ||
| ARC-Easy | Letter | ||
| ARC-Easy | Text | ||