Make bench tokenizer configs byte-identical to their source models
#8
by sbrandeis HF Staff - opened
The encode benches in huggingface/tokenizers load their model configs from this dataset. Some entries were slimmed-down fixtures or diverged from the source models, which made bench numbers unrepresentative (reported as "vocab is smaller than the real model"). This PR makes every bench config byte-identical to tokenizer.json in the original model repo:
gpt-oss.json(new): fromopenai/gpt-oss-20b(byte-identical inopenai/gpt-oss-120b). 199,998 vocab / 446,189 merges vs 3,060 / 4,000 ingpt-oss-slim.json.glm-5.2.json(new): fromzai-org/GLM-5.2. 154,820 vocab / 321,649 merges vs 2,951 / 4,000 inglm-5.2-slim.json.gemma-4.json(new): fromgoogle/gemma-4-31B-it(the variantgemma-4-slim.jsonwas derived from β vocab/merges are identical across gemma-4 sizes, only the base models' post_processor differs). 262,144 vocab / 514,906 merges vs 2,787 / 4,000 in the slim file.mistral-small-4.json(new): frommistralai/Mistral-Small-4-119B-2603β the current tekken chain (Sequence[Split, ByteLevel]pre-tokenizer, 131,072 vocab, 1,000 added special tokens), a workload archetype the benches didn't cover.llama-2.json(refresh): synced byte-identical withmeta-llama/Llama-2-7b-hf. The previous copy had the same vocab and merge set but 119 trailing whitespace merges in a different order β merge order is BPE priority, so whitespace runs tokenized differently.llama-3-tokenizer.json(refresh): synced byte-identical withmeta-llama/Llama-3.1-8B(the file was already semantically this tokenizer, but re-serialized in the tuple-merges format, 17.2MB vs 9.1MB). Vocab, merges, and added tokens are unchanged β encode ids are identical..gitattributes: track the three new configs via LFS/Xet, same as the other full configs.
The -slim fixtures are left untouched. The bench manifest in huggingface/tokenizers points at the full configs as of the fix/bpe-benches branch.
sbrandeis changed pull request status to merged