Introduction
In the development of Large Language Models (LLMs), tokenization serves as the critical "first mile" of processing. While often overlooked, the efficiency of a tokenizer directly impacts a model's performance, inference speed, and cost. Most contemporary models, such as LLaMA or Mistral, utilize tokenizers heavily biased toward Latin scripts. This creates a significant disparity when processing linguistically diverse scripts, particularly those used in Indian languages (Devanagari, Dravidian, etc.). This paper introduces AdaptMix, a novel adaptive data mixture algorithm designed to optimize tokenizer efficiency for multilingual contexts.
The Challenge of "Fertility"
The primary metric for tokenizer inefficiency is fertility: the ratio of tokens to words. In English-centric tokenizers, a single Hindi or Tamil word may be fragmented into five or six meaningless sub-tokens, whereas an English equivalent remains a single token. High fertility leads to three major issues:
- Wasted Context: Models reach their context window limits prematurely.
- Slower Inference: The model must generate more tokens to convey the same information.
- Suboptimal Learning: Excessive fragmentation obscures the semantic and phonetic structures of the language.
Methodology: AdaptMix
To address these inefficiencies, the BharatGen Team developed AdaptMix (Adaptive Data Mixture). Unlike static data sampling, AdaptMix treats tokenizer training as an iterative optimization problem.
The process involves a feedback loop: a candidate tokenizer is trained on an initial mixture, its fertility is measured across target languages, and the training data is re-weighted for the subsequent iteration. Languages suffering from high fragmentation receive a higher proportion of data in the next round, forcing the tokenizer to learn more efficient subword representations for those specific scripts.
Beyond data balancing, the researchers conducted systematic vocabulary ablation, testing sizes from 32K to 256K. They identified 128K as the "Goldilocks" zone—providing the best balance between linguistic compression and computational overhead (avoiding the massive embedding matrices required by 256K vocabularies).
Datasets and Synthetic Curation
The study utilized a massive corpus spanning 16 Indian languages, code, and mathematics. To bolster underrepresented languages like Maithili and Sindhi, the team generated over 100 million Indian personas to create high-quality synthetic text. This was complemented by a two-stage translation pipeline (machine translation followed by LLM-based post-correction) to ensure linguistic accuracy across the 15+ Indic languages.
Results and Key Insights
The AdaptMix approach yielded substantial improvements in tokenizer performance:
- Efficiency Gains: The AdaptMix tokenizer achieved an average fertility of 1.97 tokens per word for Indic languages. This represents a 40% improvement over existing Indic-focused models like Airavata and a massive leap over general models like LLaMA (7.89) or Qwen (7.69).
- The Pre-tokenization Paradox: A surprising finding was that "aggressive" pre-tokenization (manually splitting diacritics) increased fertility but improved perplexity. This suggests that while splitting diacritics creates more tokens, it helps the model better understand the underlying phonetic structure of Indic scripts.
- Fairness and Parity: By reducing the "token tax" on non-English languages, the new tokenizer ensures more equitable performance across different scripts.
Conclusion and Future Work
AdaptMix demonstrates that intelligent data weighting can significantly bridge the efficiency gap in multilingual tokenization. While challenges remain—such as the morphological complexity of agglutinative languages and the numerical instability of the Unigram algorithm at scale—this work provides a blueprint for more inclusive LLM design. Future research will focus on scaling these tokenizers to models with 7B+ parameters to verify if these efficiency gains translate to even larger architectures.
Summary updated