Reproduce “In-Place Tokenizer Expansion for Pre-trained LLMs” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Jimmy T.H. Smith, Tarek Dakhran, Alberto Cabrera, Simon S. Lee, Paul Pak, Aditya Tadimeti, Tim Seyde, Maxime Labonne and 2 more

Researchers at Liquid AI developed an in-place recipe for upgrading a pre-trained LLM's tokenizer, addressing inefficient tokenization for underrepresented languages without compromising existing model quality. Their method, applied to the LFM2-8B-A1B model, involves expanding the tokenizer's Byte Pair Encoding merges and using a two-stage adaptation process. This approach led to a 2.4-4.0x reduction in token counts for languages like Hindi, Vietnamese, and Thai, improving per-character decode speed by 2.2-3.7x for these languages on target devices, while also surpassing the original model's aggregate quality score by 3.6 points.

Key insights

  • Freezing the original, copied embedding rows during the initial adaptation stage is critical to prevent degradation of generative performance and increased repetition in the fine-tuned model.
  • Maintaining a balanced multilingual mixture in the continued pre-training stage is essential for preventing broad generative collapse across tasks and languages.
  • The 'continued-BPE extension' approach allows for a deterministic decomposition of new tokens into source tokens, providing a robust foundation for embedding initialization and enabling a more controlled vocabulary expansion.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.