Datasets:

Modalities:
Text
Formats:
text
Size:
< 1K
Libraries:
Datasets

Make bench tokenizer configs byte-identical to their source models

#8
by sbrandeis HF Staff - opened
Hugging Face Internal Testing Organization org

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): from openai/gpt-oss-20b (byte-identical in openai/gpt-oss-120b). 199,998 vocab / 446,189 merges vs 3,060 / 4,000 in gpt-oss-slim.json.
  • glm-5.2.json (new): from zai-org/GLM-5.2. 154,820 vocab / 321,649 merges vs 2,951 / 4,000 in glm-5.2-slim.json.
  • gemma-4.json (new): from google/gemma-4-31B-it (the variant gemma-4-slim.json was 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): from mistralai/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 with meta-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 with meta-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

Sign up or log in to comment