Teaching Old Tokenizers New Words: Efficient Tokenizer Adaptation for Pre-trained Models
Taido Purason, Pavel Chizhov, Ivan P. Yamshchikov, Mark Fishel
TL;DR
This paper tackles tokenizer adaptation for pretrained models by proposing continued BPE training for vocabulary extension and a leaf-based pruning strategy to shrink vocabularies without harming performance. Continued BPE training yields more efficient tokenization and better utilization of added tokens than naive extension, while leaf-based pruning preserves model quality during vocabulary reduction. Across multilingual experiments and several model families, the methods deliver substantial compression gains and enable safe pruning, with downstream results often unaffected or even improved. An open-source toolkit is released to enable practitioners to apply these techniques to domain- and language-specific tokenization needs.
Abstract
Tokenizer adaptation plays an important role in transferring pre-trained language models to new domains or languages. In this work, we address two complementary aspects of this process: vocabulary extension and pruning. The common approach to extension trains a new tokenizer on domain-specific text and appends the tokens that do not overlap with the existing vocabulary, which often results in many tokens that are unreachable or never used. We propose continued BPE training, which adapts a pre-trained tokenizer by continuing the BPE merge learning process on new data. Experiments across multiple languages and model families show that this approach improves tokenization efficiency and leads to better utilization of added vocabulary. We also introduce leaf-based vocabulary pruning, which removes redundant tokens while preserving model quality. Together, these methods provide practical tools for controlled vocabulary modification, which we release as an open-source package.
