In-Place Tokenizer Expansion for Pre-trained LLMs
This work addresses the inefficiency of fixed vocabularies in pretrained large language models when supporting new languages, which leads to tokenization redundancy, increased latency, and higher energy consumption—particularly hindering on-device multilingual capabilities. The authors propose an in-place tokenizer expansion method that preserves the original vocabulary while extending it through continued application of Byte Pair Encoding (BPE) merge rules on multilingual corpora. New subword embeddings are initialized as the mean of their constituent subword embeddings, followed by a two-stage training process involving embedding fine-tuning and full-model continued pretraining to recover performance. This approach achieves the first lossless, in-place tokenizer expansion for already-trained large models, ensuring new tokens decompose precisely into atomic units. Evaluated on the LFM2-8B-A1B model with a 128K-token vocabulary, the method reduces token counts for Hindi and Vietnamese by 2.4–2.6× (up to 4× for Thai), yielding an estimated 2.2–3.7× speedup in character-level decoding. The extended model and tokenizer are publicly released.