# Ezhuthu

*Released.* A Tamil tokenizer, version 1, 9 November 2026.

Ezhuthu (எழுத்து, letter) is a 64,000-token tokenizer for Tamil, with English and code. It keeps every common Tamil letter whole, and in training it never joined a word's stem to its suffix. Language models trained with it learned Tamil better than with plain BPE, at the same size, text and compute.

[Download on Hugging Face](https://huggingface.co/zhagaramlabs/ezhuthu-64k) [Code on GitHub](https://github.com/zhagaramlabs/uraikal)

- **0.003%** of Tamil words cut inside a letter on held-out web text. Gemma 3 cuts 24%
- **0.7%** lower bits per byte than plain BPE in a 350M-parameter model, at equal compute
- **1.66** tokens per Tamil word on held-out web text, against 2.28 for Gemma 3 and 12.04 for Llama 3.1

## 1. Use it

It loads with Hugging Face `transformers`, versions 4.46 to 5.22 checked, with no remote code.

```python
from transformers import AutoTokenizer

tok = AutoTokenizer.from_pretrained("zhagaramlabs/ezhuthu-64k")
ids = tok("தமிழ் எழுத்து")["input_ids"]
tok.convert_ids_to_tokens(ids)  # ['தமிழ்', ' எழுத்து']
tok.decode(ids)                 # 'தமிழ் எழுத்து'
```

`<|endoftext|>`, id 64,000, marks where a document starts. The tokenizer doesn't add it by itself, so put it before each document when you train.

## 2. Why whole letters

Most Tamil letters are a consonant and a vowel sign, or a consonant and a pulli (்), and Unicode stores each as two characters. Tokenizers that learn from those characters often cut the pair apart, so one letter costs two tokens and a model has to learn to put it back together. Ezhuthu builds its 4,000 most common letters first and only ever merges whole letters after that.

It also learned where Tamil words bend. [TamilMorph](https://huggingface.co/datasets/Surendhar32/TamilMorph) splits 418,000 Tamil word forms into stem and suffix. While Ezhuthu trained, no merge was allowed across that split in the 366,584 words we trained on, so its tokens tend to end where a stem ends. On TamilMorph words held out of training, its boundaries match the stem's end with a Morph-F1 of 0.608, against 0.549 without the cuts and 0.307 for plain BPE.

## 3. Tokens per word

Fewer tokens means cheaper and faster use, and more text in a model's context. These are 2,000 passages of web Tamil gathered after we picked our tokenizers. The [leaderboard](/leaderboard/#2) has all 20 tokenizers.

| Tokenizer | Vocabulary | Tokens per word | Words cut inside a letter |
|---|---:|---:|---:|
| [Agaram](https://huggingface.co/murai-labs/agaram-2.5b) | 64k | 1.53 | 17.1% |
| [IndicBERTv2](https://huggingface.co/ai4bharat/IndicBERTv2-MLM-only) | 250k | 1.60 | 10.0% |
| **Ezhuthu** | 64k | 1.66 | 0.003% |
| [MuRIL](https://huggingface.co/google/muril-base-cased) | 197k | 1.72 | 7.9% |
| [Gemma 3](https://huggingface.co/google/gemma-3-4b-it) | 262k | 2.28 | 24.0% |
| [Qwen3.5](https://huggingface.co/Qwen/Qwen3.5-0.8B) | 248k | 4.13 | 63.2% |
| [Llama 3.1](https://huggingface.co/meta-llama/Llama-3.1-8B) | 128k | 12.04 | 99.0% |

Two tokenizers spend fewer tokens than Ezhuthu, but both cut Tamil words inside a letter, and IndicBERTv2 gives back the original text for only 0.1% of passages. The stem cuts cost Ezhuthu about 7% more tokens than the same tokenizer without them. We kept them because they gave the better model.

## 4. Does it make a better model?

Token counts don't say whether a model learns better. So we trained the same model on the same text with each tokenizer, at the same compute, and measured bits per byte on held-out Tamil. Bits per byte doesn't depend on how the text was split. Lower is better.

| Tokenizer | 350M model, web | 350M model, literature | 85M model, web |
|---|---:|---:|---:|
| **Ezhuthu** | 0.3593 | 0.5030 | 0.4095 |
| Ezhuthu without stem cuts | 0.3601 | 0.5037 | 0.4102 |
| Plain BPE | 0.3620 | 0.5079 | 0.4134 |
| Agaram | | | 0.4128 |

Each number is the mean of 2 seeds at 350M and 3 at 85M. At 350M the BPE tokenizer was trained on Ezhuthu's own text; at 85M it's our earlier BPE with the same recipe. Agaram's model got 6% more steps, because Agaram makes more tokens of the same text.

At 350M, Ezhuthu beats plain BPE by 0.7% on web Tamil and 1.0% on literature. On web Tamil, both its seeds beat both seeds of the version without stem cuts. On English and code it's within 0.3% of BPE.

Tamil reading and reasoning tests (Belebele, XCOPA and Global PIQA) don't separate the tokenizers yet: every model this size scores near chance.

## 5. How it was built

- **Text.** 7.8 GB: Tamil from Sangraha, Tamil Wikipedia and Project Madurai (75%), English from FineWeb (15%), Python code (5%) and romanized Tamil (5%).
- **Letters first.** The 4,000 most common letters are assembled from their characters by fixed merges. Learned merges then join whole letters only.
- **Stem cuts.** From TamilMorph, by Muthukumar, Herygers and Beinborn (DravidianLangTech 2026, MIT licence), following MorphBPE's idea of blocking merges at morpheme boundaries.
- **Everything else is standard:** NFC normalization, Qwen3.5's pre-tokenizer pattern, and byte fallback, so there's no unknown token and any text decodes back to itself.
- **Checked:** all 10,357 held-out passages, from web Tamil to the Thirukkural, English and code, decode back exactly, in NFC form.

## 6. Limits

- Ezhuthu spends 6 to 7% more tokens on Tamil web text than the same tokenizer without stem cuts. That's the price of the better model above.
- The stem cuts cover only words TamilMorph lists, about 1 running word in 4.
- 4 rare letters aren't kept whole: ஙெ, ஙௌ, ஞௌ and ழௌ.
- English costs a little more than in big multilingual tokenizers: 1.42 tokens per word, against 1.34 for Gemma 3.
- The romanized Tamil it learned from was transliterated by machine, not typed by people.
- Our evidence stops at 350M-parameter models.

## 7. Licence and citation

- **Tokenizer:** Apache 2.0. The files hold a vocabulary and merges, not training text.
- **Credits:** Sangraha, Wikipedia, Project Madurai, FineWeb, Aksharantar and TamilMorph. The [model card](https://huggingface.co/zhagaramlabs/ezhuthu-64k) lists each source with its licence.
- **Code:** Apache 2.0, in [Uraikal](https://github.com/zhagaramlabs/uraikal), with the steps to rebuild it and rerun every number.

```bibtex
@misc{ezhuthu2026,
  title  = {Ezhuthu: a whole-letter Tamil tokenizer},
  author = {{Zhagaram Labs}},
  year   = {2026},
  url    = {https://zhagaramlabs.com/models/ezhuthu/}
}
```

## 8. Versions

| Version | Released | What changed |
|---|---|---|
| 1 | 9 November 2026 | First release: 64,000 tokens, whole letters, stem cuts from TamilMorph. |

We tested a 128,000-token version at 350M parameters and it trailed 64k by 0.9% on fresh.web: its embedding took 30% of the parameters against 18%, so at equal compute it read about 9% less text. We're sticking with 64k at these model sizes.

## Related

- The [leaderboard](/leaderboard/#2) scores 20 open tokenizers on Tamil, and our companion preprints cover [where open tokenizers break Tamil](/papers/tamil-tokenizers/) and [adding Tamil to Qwen3.5](/papers/qwen-tamil-extension/).
- [All our models](/#models), released and in progress.
