ArXiv

In-Place Tokenizer Expansion for Pre-trained LLMs

Authors
Jimmy T. H. Smith, Tarek Dakhran, Alberto Cabrera...
Categories
cs.CL, cs.AI, cs.LG
arXiv
https://arxiv.org/abs/2607.15232v1
PDF
https://arxiv.org/pdf/2607.15232v1

Brief

In-Place Tokenizer Expansion upgrades a pre-trained LLM's tokenizer by continuing its BPE merges on a multilingual corpus: carried-over tokens keep their embeddings, new tokens are initialized as the mean of their source sub-token embeddings, and a two-stage adaptation (embedding-only then full-model continued pre-training) restores checkpoint quality. Applied to LFM2-8B-A1B → LFM2.5-8B-A1B with a 128K tokenizer, Hindi/Vietnamese/Thai see 2.4×/2.6×/up to 4.0× token reductions and estimated 2.2–3.7× per-character decode speedups; weights and tokenizer are released.

Why it matters

Introduces in-place tokenizer expansion: continue the source tokenizer's BPE merges on a multilingual corpus, copy carried-over embedding rows unchanged, initialize new token embeddings as the mean of their source sub-token embeddings, and use a two-stage adaptation (embedding-only training, then full-model continued pre-training) to recover source-checkpoint quality.

Key details

  • Applied to a continued checkpoint of LFM2-8B-A1B to produce LFM2.5-8B-A1B with a 128K tokenizer; the expanded tokenizer encodes Hindi and Vietnamese in ~2.4× and ~2.6× fewer tokens (up to 4.0× on Thai) and yields an estimated 2.2–3.7× per-character decode speedup; model weights and the expanded tokenizer are released.
Source evidence

Abstract

A tokenizer fixed at the start of pre-training allocates vocabulary in proportion to the pre-training corpus, reflecting the deployment priorities at that time. When those priorities shift, languages added later are split into many more tokens per word, which can raise latency, compute, and energy consumption for users of those languages. Cloud models can afford a broad vocabulary because the embedding and LM-head matrices are a small fraction of their parameters. On a compact model those matrices are a material share of per-token decode bandwidth, so on-device models ship small vocabularies and accept fragmentation outside a fixed language set. We present tokenizer expansion, an in-place recipe for upgrading a pre-trained model's tokenizer when the model producer controls its design. We continue the existing tokenizer's BPE merges on a multilingual corpus, so most source tokens carry over unchanged as single tokens and every new token has an exact decomposition into source tokens. We copy the carried-over embedding rows unchanged and initialize new rows as the mean of their source sub-token embeddings. A two-stage adaptation, embedding-only training then full-model continued pre-training, recovers source-checkpoint quality. We apply the recipe to a continued pre-trained checkpoint of LFM2-8B-A1B, an 8B-parameter Mixture-of-Experts model, to help produce LFM2.5-8B-A1B with a 128K tokenizer. The expanded tokenizer encodes Hindi and Vietnamese in roughly $2.4\times$ and $2.6\times$ fewer tokens than the source (up to $4.0\times$ on Thai). Combining these reductions with the measured per-token cost of the larger vocabulary, we estimate a $2.2$-$3.7\times$ per-character decode speedup for these languages across our reference devices. We release the model weights and the expanded tokenizer, and report the negative findings that shaped the recipe.