Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

FLEXITOKENS: Flexible Tokenization for Evolving Language Models

About

Adapting language models to new data distributions by simple finetuning is challenging. This is due to the rigidity of their subword tokenizers, which typically remain unchanged during adaptation. This inflexibility often leads to inefficient tokenization, causing overfragmentation of text in out-of-distribution domains, unseen languages, or scripts. In this work, we develop byte-level LMs with learnable tokenizers to make tokenization adaptive. Our models include a submodule that learns to predict boundaries given the input byte sequence, encoding it into variable-length segments. Most tokenizer-free methods train this boundary predictor using an auxiliary loss that enforces a fixed compression rate across the training corpus, introducing a new kind of rigidity. We propose FLEXITOKENS, a simplified training objective that enables significantly greater flexibility during adaptation. Evaluating across multiple multilingual benchmarks, morphologically diverse tasks, and domains, we demonstrate that FLEXITOKENS consistently reduces token over-fragmentation and achieves up to 10% point improvements on token classification and generative tasks compared to BPE and other gradient-based tokenizer baselines. We validate our findings using models of varying sizes, and our method demonstrates consistent improvements across scales. Code and data for our experiments will be released at https://github.com/skai-research/flexitokens

Abraham Toluwase Owodunni, Orevaoghene Ahia, Sachin Kumar• 2025

Related benchmarks

TaskDatasetResultRank
Named Entity RecognitionWikiAnn--
40
Irony DetectionIrony en
Accuracy (en)69.26
6
Language IdentificationILI hi
Accuracy (hi)90.33
6
Medical Abstract ClassificationMed. Abs. en
Accuracy (en)63.19
6
Natural Language InferenceXNLI
Accuracy (en)73.51
6
Code-Switching AccuracyCS en-es
Code-Switching Accuracy (en-es)92.11
5
Code-Switching AccuracyCS en-hi
Code-Switching Accuracy (en-hi)86.53
5
Machine TranslationOPUS-100 en-es (test)
COMET Score71.11
4
Machine TranslationOPUS-100 en-ru (test)
COMET Score62.88
4
Machine TranslationOPUS-100 en-hi (test)
COMET Score61.46
4
Showing 10 of 19 rows

Other info

Follow for update