FANTa and BPE language models (2.6B body, 107 languages)

Research artifacts of a master's thesis on FANTa (Fair Adaptive Neural TokenizAtion), a learned segmenter that is trained to give all languages a similar number of tokens, and that spells spans outside its vocabulary byte by byte. The repository holds two language models that share the architecture, the pretraining text and the hyperparameters, and differ only in the tokenizer:

Folder Tokenizer Parameters
bpe/ BPE, 128k entries 3.193B (2.54B in the transformer body, the rest embeddings)
fanta/ FANTa, 128,000-entry lookup vocabulary plus byte spelling 3.241B (as above, plus 48M in the byte-span modules)

These are base models trained for one epoch on 52B (BPE) or 41B (FANTa) tokens of the same text. They are not instruction-tuned, they are close to chance on most downstream tasks, and they are released for reproducing the thesis, not for use.

Files

Each folder contains:

  • model.pt: the checkpoint in the format written by systems.pretraining.train.save_checkpoint of the code repository, without the optimizer and scheduler state (weights in the stored dtype, the training configuration, vocab_size and step).
  • final.pt.provenance.json: the training configuration, git commit, data shards and tokenizer hashes of the run.
  • the tokenizer files: bpe/bpe_128k.json; for FANTa the segmenter checkpoint fanta/m5_a0.2_s0.pt and the vocabulary fanta/m5_a0.2_128k.json.
  • results/: the evaluation outputs of the thesis (bits per byte and the harness tasks).

The code is at https://github.com/kobrue02/rl-tokenizers. The BPE checkpoint is read by systems.pretraining.checkpoint_io.load_pretrained_model. The FANTa checkpoint also holds the byte-span modules, and the repository's evaluation code (scripts.mix.eval_2p6b) loads it together with the segmenter and the vocabulary. Use the commit recorded in final.pt.provenance.json or the tagged release of the thesis.

Training data

A single mixture of 107 languages, the languages that both BOUQuET and the web corpora cover. Code, mathematics and highly domain-specific subcorpora were removed. Composition in bytes of text, for the corpus used by the BPE run:

Source Languages Share GB
FineWeb-2 (Penedo et al., 2025) 106 87.0% 181.5
Wikipedia (Wikimedia Foundation) 107 5.0% 10.4
OPUS-100 (Zhang et al., 2020) 81 2.9% 6.1
FineWeb-Edu, English (Penedo et al., 2024) 1 5.0% 10.4

Realized shares deviate where a source is exhausted. Both models read the same text, so FANTa, which compresses it more, sees fewer tokens (41.3B against 51.8B for BPE). The data sources carry their own licenses (for example CC BY-SA for Wikipedia and ODC-By for FineWeb-2); the MIT license of this repository covers the code and the weights, not the training text.

Evaluation

Results of the thesis, on 107 languages (bits per byte on held-out text) and on the harness tasks of the thesis (mean accuracy over the languages of each task, chance level in the second column). Bold marks the better model.

Measure Chance BPE FANTa
Bits per byte, pooled (lower is better) 0.721 0.894
XNLI 0.33 0.369 0.352
XCOPA 0.50 0.553 0.537
XStoryCloze 0.50 0.529 0.526
Global PIQA 0.50 0.580 0.552
SIB-200 (in-language, 8-shot) 0.14 0.156 0.180
MultiBLiMP 0.50 0.793 0.763
mHellaSwag 0.25 0.305 0.293

The FANTa model has a higher bits per byte than the BPE model in all 107 languages (a ratio of 1.24 pooled), and the Gini coefficient of the bits per byte across languages is the same for both (about 0.20). The tokenizer-level results (token parity, compression, cost) are in the thesis.

Limitations

One training run per tokenizer at one size, so the comparison has no estimate of its own variance. The FANTa tokenizer is the most favorable of six seeds on its fairness metrics. The models are small and trained for a single epoch, so the benchmark scores are close to chance and small differences should not be read as findings.

Citation

@mastersthesis{brueggemann2026fanta,
  author = {Br{\"u}ggemann, Konrad},
  title  = {TITLE OF THE THESIS},
  school = {SCHOOL},
  year   = {2026}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support