The Vocabulary Tax: Safely Trimming Unused Tokens from LLMs for On-Device Use
Abstract
Open large language models (LLMs) and speech models ship vocabularies of up to 262k tokens, and every user downloads the tables those tokens index (the input embedding, an untied output head and, in recent on-device models, per-layer embeddings), whatever languages they need. We call the bytes in rows a deployment never uses the vocabulary tax and measure it, without downloading weights, for 1,244 generative and speech-recognition models on the Hugging Face Hub. For a Thai and English deployment it is a median 4.4% of model bytes below 0.5B parameters and 2.1% above 8B, and 1.93 GB in Gemma 4 E2B: it falls hardest on the small models that edge devices run. Keeping only the rows of the deployment's writing systems is exact. Keeping the tokens seen in the user's own text removes much more, a median 29.0% below 0.5B, but the usual way of doing it breaks BPE tokenizers: it drops the intermediate tokens that merges build on, so new text is split differently 1.9 times as often as the standard check reports. We repair this with merge closure, at a cost of 5.9% more rows, and add a trim certificate: a Good-Turing estimate, from the trimming text alone, of how much new text the trimmed tokenizer will split differently (correlation 0.996 over 300 settings in 22 languages) and of how much more text a target needs. Without test data our method never exceeds a 2% target, while prior keep rules checked on test data exceed it in 9-13 of 44 settings. On six models of 270M to 3B parameters in 11 languages, trimmed models keep their predictions: where the certificate passes, a median 89.7% of rows is removed and bits per character rise by at most 2.0%. The census, the trimming and the certificate are released as an open Python package, and the per-model tax for 41 languages as an open dataset.
Create a lesson
Metadata
- Categories
- cs.CL, cs.AI
- Comments
- 23 pages, 8 figures, 16 tables. Code: https://github.com/JoesSattes/ai-model-explorer ; Data: https://huggingface.co/datasets/JoesSattes/ai-vocabulary-tax
Related papers
CLAIMGATE: Cautious On-Device Checking of Spoken Legal and Clinical Claims
Shared title terminologycs.CLPeter Forcha, Harshitha Kaje Kusumadhara, Audrey Moguem Souop et al.
Estimating Silenced Tokens in Quantized LLMs
Shared title terminologycs.CLGiuseppe Pappalardo
Offline-First Quantized AI: Design and Evaluation of an On-Device Maternal-Health Assistant for Low-Connectivity Environments
Shared title terminologycs.CLOkenla AbdulQahhar Abimbola, Maurice Abraham John, Adepoju Jeremiah Moyondafoluwa et al.
ModernELECTRA: Replaced-Token Detection with Boundary-Window Reconstruction for Compact Encoders that Classify and Embed
Shared title terminologycs.CLMykhailo Shtopko, Ihor Stepanov, Dmytro Vodianytskyi et al.
Deneb-Vritra: Descriptions, Edges and Names Examined by Blocking Via Restoring Token Representations and Attention
Shared title terminologycs.CLMohammed Nayeem Khan, Akhil P, Shahina Shaik
Unlocking the Power of Loops in Pretrained LLMs with Loop Residuals
Shared title terminologycs.CLXuanlei Zhao, Hailun Xu, Kai Wang et al.