A Grapheme-Aware Indic Tokenizer for Tamil: Large-Scale Training and Intrinsic Evaluation
Organizations: Department of Computer Science and Engineering, IIITDM Kanchipuram · Wadhwani School of Data Science and AI, IIT Madras
Abstract
Tokenization forms the foundation of modern Natural Language Processing (NLP) systems by transforming raw text into discrete units that neural language models can process. The effectiveness of this process directly influences vocabulary efficiency, sequence length, computational cost, and downstream model performance. Although multilingual tokenizers such as Byte Pair Encoding (BPE), WordPiece, and SentencePiece have performed well across numerous languages, they often segment morphologically rich Indic languages inefficiently. Tamil, in particular, poses unique challenges because its grapheme-based writing system can represent a single visible character with multiple Unicode code points. In this work, we present a grapheme-aware Indic tokenizer for Tamil that preserves complete grapheme clusters through a reversible Unicode mapping strategy prior to WordPiece vocabulary learning. By operating on grapheme-level representations instead of individual Unicode code points, the tokenizer produces linguistically meaningful token boundaries while remaining fully compatible with transformer-based language models. The tokenizer is trained on a large-scale Tamil corpus and evaluated using a comprehensive intrinsic evaluation framework that measures compression efficiency, token fragmentation, information density, and vocabulary utilization. Experimental evaluation compares the proposed tokenizer against five widely used multilingual tokenizers: GPT-2, mBERT, mT5, mBART, and NLLB. The proposed tokenizer achieves the strongest performance among the evaluated tokenizers on fragmentation- and sequence-efficiency-oriented intrinsic metrics, while matching the highest observed compression ratio. These results demonstrate the effectiveness of grapheme-aware preprocessing for Tamil tokenization.
Figures & tables
| Statistic | Value |
|---|---|
| Wikipedia Articles | 569,055 |
| Text Lines | 3,471,054 |
| Total Words | 42,834,262 |
| Unique Words | 4,383,638 |
| Total Characters | 386,120,438 |
| Average Words per Line | 12.34 |
| Parameter | Value |
|---|---|
| Language | Tamil |
| Training Corpus | Tamil Wikipedia |
| Tokenizer Algorithm | WordPiece |
| Preprocessing | Grapheme-aware Unicode Mapping |
| Vocabulary Sizes | 10K, 20K, 30K, 50K |
| Training Strategy | Independent training for each vocabulary |
| Parameter | Value |
|---|---|
| Training Language | Tamil |
| Training Corpus | Tamil Wikipedia |
| Evaluation Corpus | FLORES+ Tamil |
| Evaluation Samples | 5,000 |
| Tokenizer Algorithm | WordPiece |
| Vocabulary Sizes | 10K, 20K, 30K, 50K |
| Vocabulary | CR | Fertility | CPT | WFR | PPC | NSL | Coverage |
|---|---|---|---|---|---|---|---|
| 10K | 9.0571 | 1.9841 | 4.5649 | 0.5769 | 0.5769 | 0.0806 | 99.9554 |
| 20K | 9.0571 | 1.7562 | 5.1572 | 0.4859 | 0.4859 | 0.0713 | 99.9554 |
| 30K | 9.0571 | 1.6566 | 5.4674 | 0.4396 | 0.4396 | 0.0673 | 99.9554 |
| 50K | 9.0571 | 1.5527 | 5.8332 | 0.3884 | 0.3884 | 0.0631 | 99.9554 |
| Tokenizer | CR | Fertility | CPT | WFR | PPC | NSL |
|---|---|---|---|---|---|---|
| GPT-2 | 1.3576 | 24.6169 | 0.3679 | 0.9849 | 0.9937 | 1.0000 |
| mBERT | 7.5238 | 3.5913 | 2.5220 | 0.7974 | 0.6335 | 0.1459 |
| mT5 | 9.0571 | 2.4990 | 3.6243 | 0.8100 | 0.8100 | 0.1015 |
| mBART | 9.0008 | 2.4226 | 3.7385 | 0.6619 | 0.6578 | 0.0984 |
| NLLB | 9.0008 | 2.5415 | 3.5638 | 0.7085 | 0.7041 | 0.1032 |
| IndicTokenizer (50K) | 9.0571 | 1.5527 | 5.8332 | 0.3884 | 0.3884 | 0.0631 |
| Tokenizer | Tokenization | Token Count |
|---|---|---|
| IndicTokenizer (50K) | \tamilfont தமிழ் மொழி உலகின் மிகை ##ப் பழமையான செம்மொழி ##களில் ஒன்றாகும் . | 10 |
| GPT-2 | byte level fragments | 157 |
| mBERT | \tamilfont தமிழ் மொழி உலக ##ின் மிக ##ை ##ப் ப ##ழ ##மையான ச ##ெ ##ம் ##ம ##ொ ##ழி ##களில் ஒன்றாகும் . | 19 |
| mT5 | \tamilfont ▁தமிழ் ▁மொழி ▁உலக ின் ▁மிக ைப் ▁பழ மையான ▁செ ம் மொழி களில் ▁ஒன்ற ாகும் . | 15 |
| mBART | \tamilfont ▁தமிழ் ▁மொழி ▁ உலகின் ▁மிக ைப் ▁பழ மையான ▁செ ம் மொழி களில் ▁ஒன்ற ாக ும் . | 16 |
| NLLB | \tamilfont ▁தமிழ் ▁மொழி ▁உலக ின் ▁மிக ைப் ▁பழ மையான ▁செ ம்ம ொ ழி களில் ▁ஒன்ற ாகும் . | 16 |
Subword Tokenization
Subword tokenization divides text into reusable units smaller than words to support efficient and flexible language modeling.
See all 84 papers