Dataset Viewer
The dataset viewer is not available for this dataset.
Unexpected token '<', "<html> <h"... is not valid JSON

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

MonTok: A Suite of Monolingual Tokenizers

This is a set of monolingual tokenizers for 98 languages. For each language, there are Unigram, BPE, and SuperBPE tokenizers, ranging in vocabulary size from around 6k to over 200k.

Training Details

Training Data

All tokenizers are trained on samples of the data used to the train the Goldfish language models. The tokenizers were either trained on scaled or unscaled data. This refers to whether the models are trained on byte-premium-scaled data or not. We used the Byte Premium Tool to calculate byte premiums. The dataset size is 300MB of data. For unscaled data tokenizers, this means they were trained on 300MB of data. For scaled data tokenizers, the tokenizers were trained on 300 times the byte premium MB of data.

Training

The BPE and Unigram tokenizers were trained using the Hugging Face implementations and the trainers in the tokenizers package.

BPE tokenizers were trained on a range of vocabularies: 6144, 8192, 16384, 32768, 49152, 65536, 81920, 98304, 114688, 262144. Unigram tokenizers were trained on a range of vocab sizes: 8192, 16384, 32768, 49152, 65536, 81920, 98304, 114688; however, some of the smaller vocabulary sizes were too small for the tokenizer to train. Therefore the smaller vocab sizes may be missing for some languages. SuperBPE tokenizers were trained on a range of vocab sizes: 65536, 81920, 98304, 114688, 131072, 262144. Furthermore, they were trained on a range of transition points, which refers to the proportion of the original vocabulary that is retained during the second phase of training. We use transition points 0.4, 0.5, 0.6, 0.7, 0.8, and 0.9; however, some transition points did not converge for some languages.

After training the SuperBPE tokenizers, we manually fixed the decoder by setting the attribute to:

tokenizer['decoder'] = {
    "type": "ByteLevel",
    "add_prefix_space": True,
    "trim_offsets": True,
    "use_regex": True
}

There are also 'optimal vocabulary' BPE tokenizers. These are tokenizers for which we estimated the vocabulary size that would lead to a certain rate of compression. See forthcoming preprint for more details.

We found that without this, languages that use South and Southeast Asian scripts tokenized texts into mostly UNKs. Thank you to Alisa Liu for helping us address this.

How to Use

I recommend using bpe_unscaled_tokenizers, unigram_unscaled_tokenizers, and superbpe_tokenizers.

For Subword Tokenizers

To download and load individual tokenizers:

from huggingface_hub import hf_hub_download
from tokenizers import Tokenizer


file_path = hf_hub_download(
    repo_id="catherinearnett/montok", 
    filename="bpe_unscaled_tokenizers/bpe_afr_latn_114688_300mb_unscaled.json",  
    repo_type="dataset"  
)

tokenizer = Tokenizer.from_file(file_path)

The tokenizer names are in the format: '{tokenizer type}_{lang code}_{vocab size}_{dataset size}_{bp scaling}.json'. Tokenizer type is bpe, unigram, or superbpe. Lang code is the ISO 369-3, followed by an underscore, followed by the ISO 15924 code. Vocab size is one of the ones listed above. Dataset size is 300MB. BP scaling is unscaled or scaled.

For Superword Tokenizers

To download and load the tokenizer:

from huggingface_hub import hf_hub_download
from transformers import PreTrainedTokenizerFast

file_path = hf_hub_download(
    repo_id="catherinearnett/montok",
    filename='superbpe_tokenizers/superbpe_afr_latn_114688_300mb_unscaled_0_8/tokenizer.json',
    repo_type="dataset"
)

tokenizer = PreTrainedTokenizerFast(tokenizer_file=file_path)

How to Cite:

@inproceedings{arnett2025crosslingual,
  author    = {Arnett, Catherine and Chang, Tyler A. and Biderman, Stella and Bergen, Benjamin K.},
  title     = {Explaining and Mitigating Crosslingual Tokenizer Inequities},
  booktitle = {Proceedings of the Thirty-Ninth Annual Conference on Neural Information Processing Systems (NeurIPS)},
  year      = {2025}
}
Downloads last month
67,311

Paper for catherinearnett/montok

Free AI Image Generator No sign-up. Instant results. Open Now