An open, reproducible benchmark and toolkit for measuring how modern LLM tokenizers, embedding models and LLMs handle Bangla (Bengali), a language with hundreds of millions of speakers that is still low-resource for NLP tooling.
It ships:
- a tokenizer study (fertility, cost multiplier against English on parallel text, grapheme-cluster / conjunct breakage, mid-codepoint splits, encoding sensitivity);
- Bangla text normalization (NFC, nukta forms, ZWJ/ZWNJ, khanda ta, digits, danda, visual-order vowel repair, standard-spelling variants), fully tested;
- a retrieval eval (BM25 with Bangla-aware analyzers vs. multilingual embedding models, recall@k / MRR / nDCG with bootstrap CIs);
- a YAML generation-task suite (summarization, reading-comprehension QA, topic classification, Banglish→Bangla transliteration) with Bangla-correct metrics, optional LLM-as-judge, and adapters for Anthropic, OpenAI-compatible servers, Ollama and local Hugging Face models.
Every number in this README was produced by the code in this repo on pinned data (see Reproduce). Nothing is estimated or copied from papers.
Why the Bangla tokenization tax matters
LLM APIs bill, rate-limit and truncate by tokens. If a tokenizer needs 5.9× more tokens to say the same thing in Bangla as in English, a Bangla user pays ~5.9× more per request, gets ~5.9× less effective context window, and waits longer for each response. Quality suffers too: when token boundaries cut through a juktakkhor (conjunct such as ক্ষ, ন্ত্র) or even through the UTF-8 bytes of a single letter, the model has to reassemble the script from fragments that carry no linguistic meaning.
Headline results
Measured on 2026-11-24 on the 488 unique FLORES-200 passages behind Belebele, aligned
Bangla / English / romanized Bangla (full tables: results/SUMMARY.md).
- Older byte-level BPE vocabularies charge ~5–6× for Bangla.
cl100k_base(GPT-4) needs 5.92× the tokens of the parallel English text, Llama 3 5.88×, Qwen 2.5 / Qwen 3 5.08×.o200k_base(GPT-4o / 4.1 / 5, gpt-oss) brings this down to 1.71×, Gemma 3 to 1.21×, and Indic-focused vocabularies (MuRIL, IndicBERT v2) reach parity. - Those vocabularies contain no Bangla "words" at all. The
cl100k_base, Llama 3.2 and Qwen 3 vocabularies contain zero tokens made of two or more complete Bengali codepoints (o200k_basehas 1,985). As a result they split 100% of multi-codepoint aksharas, and 34–43% of their token boundaries fall inside a single 3-byte Bengali codepoint. - Typing Banglish is cheaper than typing Bangla on those tokenizers: romanized Bangla costs 1.95–1.96× English on cl100k / Llama 3 / Qwen versus 5.1–5.9× for Bengali script.
- Encoding inconsistency is real and costs tokens. In Belebele's Bangla text, 443 of 488 passages mix precomposed (U+09DC/09DD/09DF) and decomposed (consonant + U+09BC) nukta letters for the same visible characters. Writing them precomposed changes the token count by +28.6% on Sarvam-1, +10.7% on Mistral NeMo and −8.6% on mBERT.
- Dense retrievers are strong on Bengali script but collapse on romanized Bangla.
BGE-M3 reaches nDCG@10 0.915 on Bangla (English: 0.955), but only 0.583 on the same
questions and passages written in romanized Bangla, where a character-4-gram BM25 gets
0.890.
paraphrase-multilingual-MiniLM-L12-v2, whose model card does not list Bengali, scores 0.046 (≈ random). - Bangla-aware lexical analysis matters. On Bangla, BM25 goes from nDCG@10 0.638 (whitespace split) to 0.696 (normalization + Bangla word segmentation), 0.799 (+ light suffix stripping) and 0.851 (character 4-grams).
- Standard ROUGE silently returns 0 for Bangla.
rouge_score0.1.2's default tokenizer keeps only[a-z0-9], so even an identical Bangla pair scores ROUGE-1 = 0.0. This repo's ROUGE tokenizes Bangla properly (seebangla_llm_bench.metrics).
Tokenizer cost and breakage


| Tokenizer | Bangla tokens/word | English tokens/word | Bangla cost × English (95% CI) | Romanized × English | Akshara break rate | Conjunct break rate | Mid-codepoint splits | Δ tokens if ড়/ঢ়/য় precomposed |
|---|---|---|---|---|---|---|---|---|
| BanglaBERT | 1.39 | 2.04 | 0.60× (0.60–0.61) | 1.38× | 4.0% | 7.7% | 0.0% | −2.6% |
| MuRIL | 1.43 | 1.25 | 1.01× (1.00–1.02) | 1.68× | 4.8% | 9.8% | 0.0% | +2.6% |
| IndicBERT v2 | 1.41 | 1.22 | 1.02× (1.02–1.03) | 1.69× | 5.9% | 10.3% | 0.0% | −1.4% |
| Sarvam-1 | 1.79 | 1.42 | 1.12× (1.11–1.13) | 2.06× | 14.2% | 23.2% | 0.4% | +28.6% |
| Gemma 3 | 1.66 | 1.22 | 1.21× (1.20–1.22) | 1.77× | 11.0% | 20.7% | 0.0% | −0.5% |
| XLM-R | 2.16 | 1.38 | 1.39× (1.37–1.40) | 1.57× | 14.8% | 32.2% | 0.0% | +0.0% |
| o200k_base (GPT-4o/4.1/5) | 2.33 | 1.20 | 1.71× (1.70–1.73) | 1.79× | 39.2% | 50.1% | 0.7% | −1.9% |
| gpt-oss (o200k_harmony) | 2.33 | 1.20 | 1.71× (1.70–1.73) | 1.79× | 39.2% | 50.1% | 0.7% | −1.9% |
| Mistral NeMo (Tekken) | 2.74 | 1.25 | 1.94× (1.93–1.96) | 1.86× | 51.3% | 61.1% | 1.5% | +10.7% |
| mBERT (cased) | 2.88 | 1.30 | 1.96× (1.94–1.98) | 1.75× | 38.6% | 63.5% | 0.0% | −8.6% |
| DeepSeek-V3 | 2.76 | 1.21 | 2.02× (2.01–2.04) | 1.95× | 53.4% | 64.1% | 1.5% | −0.4% |
| Qwen 2.5 | 7.09 | 1.24 | 5.08× (5.03–5.14) | 1.95× | 100.0% | 100.0% | 34.1% | +0.0% |
| Qwen 3 | 7.09 | 1.24 | 5.08× (5.03–5.14) | 1.95× | 100.0% | 100.0% | 34.1% | +0.0% |
| Llama 3.x | 8.06 | 1.21 | 5.88× (5.82–5.94) | 1.95× | 100.0% | 100.0% | 42.2% | −2.8% |
| cl100k_base (GPT-4) | 8.12 | 1.21 | 5.92× (5.86–5.99) | 1.96× | 100.0% | 100.0% | 42.7% | −2.8% |
How to read it: cost × is total Bangla tokens ÷ total English tokens for the same 488
passages (95% percentile bootstrap over passages, 1,000 resamples, seed 0). BanglaBERT is
below 1× because its vocabulary is Bangla-first and English is the expensive language there.
Akshara break rate is the share of multi-codepoint orthographic syllables (e.g. ক্ষু, র্থী)
that at least one token boundary cuts; conjunct break rate restricts that to virama-joined
clusters. UNK rates were ≤ 0.1% for every tokenizer and are in the full table. Llama 3 and
Gemma 3 tokenizers were loaded from the ungated unsloth/* mirrors (identical tokenizer files).
Claude's tokenizer is not public; --tokenizers claude measures it through the
count_tokens API when an ANTHROPIC_API_KEY is set. It is not in the table because no key
was available for this run.
Retrieval: same questions, three scripts
Belebele question → passage retrieval (900 questions, 488 passages; one relevant passage per question), identical items in Bangla script, romanized Bangla and English.

| System | Bangla nDCG@10 | Bangla R@1 | Romanized nDCG@10 | Romanized R@1 | English nDCG@10 | English R@1 |
|---|---|---|---|---|---|---|
bm25-whitespace | 0.638 (0.610–0.664) | 0.539 | 0.664 (0.634–0.693) | 0.570 | 0.686 (0.658–0.712) | 0.587 |
bm25-bangla | 0.696 (0.670–0.721) | 0.611 | 0.754 (0.728–0.779) | 0.668 | 0.881 (0.861–0.898) | 0.823 |
bm25-bangla-stem | 0.799 (0.776–0.821) | 0.714 | 0.754 (0.728–0.779) | 0.668 | 0.881 (0.861–0.898) | 0.823 |
bm25-char3 | 0.841 (0.820–0.861) | 0.779 | 0.845 (0.824–0.864) | 0.772 | 0.856 (0.836–0.875) | 0.786 |
bm25-char4 | 0.851 (0.831–0.870) | 0.782 | 0.890 (0.873–0.908) | 0.832 | 0.897 (0.880–0.914) | 0.846 |
minilm-l12 | 0.046 (0.035–0.058) | 0.027 | 0.269 (0.244–0.295) | 0.197 | 0.858 (0.839–0.877) | 0.779 |
mpnet-base | 0.472 (0.443–0.500) | 0.334 | 0.279 (0.254–0.305) | 0.202 | 0.885 (0.869–0.902) | 0.816 |
labse | 0.675 (0.647–0.701) | 0.551 | 0.313 (0.286–0.342) | 0.232 | 0.786 (0.764–0.808) | 0.670 |
e5-small | 0.838 (0.817–0.857) | 0.742 | 0.408 (0.378–0.435) | 0.306 | 0.949 (0.936–0.959) | 0.908 |
e5-base | 0.863 (0.845–0.881) | 0.784 | 0.501 (0.473–0.531) | 0.412 | 0.958 (0.947–0.968) | 0.921 |
e5-large | 0.907 (0.892–0.922) | 0.842 | 0.523 (0.495–0.551) | 0.418 | 0.965 (0.955–0.974) | 0.933 |
bge-m3 | 0.915 (0.899–0.930) | 0.860 | 0.583 (0.554–0.611) | 0.483 | 0.955 (0.945–0.965) | 0.913 |
nDCG@10 with a 95% bootstrap CI over queries. BM25 uses k1=1.2, b=0.75. bm25-bangla =
normalization + Bangla word segmentation; -stem adds light suffix stripping (no-op on
non-Bengali text); char3/char4 are within-word character n-grams. Embedding models run at
pinned Hugging Face revisions with their documented query/passage prefixes (E5).
Generation (live local model + deterministic baselines)
Live outputs from gemma4:12b-it-qat (Gemma 4 12B, quantization-aware-trained weights)
served locally by Ollama with greedy decoding and seed 0, zero-shot Bangla prompts from
tasks/. The baseline column is the deterministic mock adapter, which is not a
model: a seeded random pick for QA/classification, the first sentence (LEAD-1) for
summarization, and the unchanged input for transliteration. Samples are seeded (seed 13).
| Task | n | Metric | gemma4:12b-it-qat (live, 95% CI) | Mock baseline |
|---|---|---|---|---|
| Belebele reading-comprehension QA (4-way MC) | 200 | accuracy | 0.830 (0.775–0.880) | 0.295 (random pick) |
| SIB-200 topic classification (7-way) | 204 | accuracy | 0.853 (0.799–0.902) | 0.142 (random label) |
| SIB-200 topic classification (7-way) | 204 | macro-F1 | 0.845 | 0.137 (random label) |
| XL-Sum summarization | 50 | chrF | 35.3 (32.6–38.1) | 27.5 (LEAD-1) |
| XL-Sum summarization | 50 | ROUGE-L (Bangla tokens) | 0.165 (0.137–0.196) | 0.130 (LEAD-1) |
| Aksharantar word transliteration | 200 | exact match | 0.385 (0.315–0.455) | 0.000 (copy input) |
| Aksharantar word transliteration | 200 | CER ↓ | 0.285 (0.188–0.438) | 1.197 (copy input) |
| Belebele passage transliteration (romanized → Bengali) | 50 | chrF | 83.8 (78.9–87.5) | 0.8 (copy input) |
| Belebele passage transliteration (romanized → Bengali) | 50 | CER ↓ | 0.099 (0.062–0.150) | 0.970 (copy input) |
Notes from the per-item outputs (in results/generation/*.json): the model often answered
SIB-200 items with the short label "technology"; the task maps that to science/technology
through label_aliases (18 of 204 items, re-scored from the saved outputs with
blb rescore, no new model calls). Word-level transliteration is where the model is weakest:
it gets 38.5% of Aksharantar words exactly right, and a single degenerate repetitive output
(CER 14.0) inflates the mean CER and widens its CI; the median CER is 0.134. LLM-as-judge (--judge) is implemented and tested
with the mock adapter but was not used for these numbers: the only available live model is
the one being evaluated, and self-judging is biased.
Architecture
flowchart LR
subgraph data[Data, pinned + checksummed]
BB[Belebele<br/>bn / en / romanized]
SIB[SIB-200]
XL[XL-Sum]
AK[Aksharantar]
FX[hand-written fixtures]
end
N[normalize.py<br/>NFC, nukta, ZWJ/ZWNJ,<br/>digits, spelling]
S[script.py<br/>akshara segmentation]
T[tokenizers.py<br/>tiktoken / HF / count_tokens]
TS[tokenizer_study.py<br/>fertility, cost ×, breakage]
R[retrieval.py<br/>BM25 analyzers + dense]
G[generation.py<br/>YAML tasks, metrics, judge]
A[adapters.py<br/>mock, Anthropic, OpenAI-compat,<br/>Ollama, HF]
O[(results/*.json)]
REP[report.py<br/>tables + charts]
BB --> TS & R & G
FX --> TS & R & G
SIB & XL & AK --> G
N --> TS & R & G
S --> TS
T --> TS
A --> G
TS & R & G --> O --> REPQuickstart
git clone https://github.com/RatulSikder97/bangla-llm-bench && cd bangla-llm-bench
uv sync --extra hf # core + Hugging Face tokenizers (no torch)
uv run blb tokenizers --corpus fixtures --tokenizers ci
uv run blb normalize "সময়ের মূল্য ২০২৬ |" --digits ascii
uv run blb segment "ক্ষুধার্ত শিক্ষার্থী" # ক্ষু | ধা | র্ত | | শি | ক্ষা | র্থীReproduce
All runs are seeded (bootstrap seed 0, task sample seed 13), data files are fetched by
immutable commit and SHA-256 verified, model and tokenizer revisions are pinned, and
dependencies are locked in uv.lock.
uv sync --all-extras
uv run blb data fetch # ~50 MB into ~/.cache/bangla-llm-bench
uv run blb data audit --corpus belebele # encoding audit
uv run blb tokenizers --corpus belebele --tokenizers all --figures docs/figures
for t in belebele-bn belebele-en belebele-bn-latn; do uv run blb retrieval --task $t --systems all; done
for f in tasks/*.yaml; do uv run blb generate $f --model mock; done
for f in tasks/*.yaml tasks/fixtures/*.yaml; do uv run blb generate $f --model ollama:gemma4:12b-it-qat; done
uv run blb reportNumbers above were produced on an Apple M4 Pro (24 GB, macOS) with Python 3.12.12,
transformers 5.24.0, sentence-transformers 6.3.0, torch 2.15.0, tiktoken 0.14.0, and Ollama
serving gemma4:12b-it-qat. Each result JSON records its own environment.
Running real models
| Adapter | Spec | Notes |
|---|---|---|
| Anthropic | anthropic:claude-sonnet-5-5 (default model) | needs uv sync --extra anthropic and ANTHROPIC_API_KEY; server-side refusal fallback enabled; adaptive thinking at effort=low |
| OpenAI-compatible | openai:<model>@<base_url> | any /v1/chat/completions server (vLLM, llama.cpp, TGI, hosted APIs); OPENAI_API_KEY if required |
| Ollama | ollama:<model>[@<host>] | greedy decoding, seed=0, thinking off |
| Hugging Face | hf:<repo> | local transformers chat model, greedy |
| Mock | mock | deterministic baselines for CI; never a model result |
uv run blb generate tasks/belebele-qa.yaml --model anthropic:claude-sonnet-5-5
uv run blb generate tasks/xlsum-summarization.yaml --model ollama:gemma4:12b-it-qat \
--judge anthropic:claude-sonnet-5-5Every result JSON carries "live": true|false and a provenance string, and blb report
labels mock rows as MOCK baseline. No Anthropic or OpenAI results are included in this
repository because no API keys were available when it was built; the only live LLM numbers
come from the local Ollama model.
Extending
Add a tokenizer: one line in REGISTRY in
src/bangla_llm_bench/tokenizers.py, e.g.
_hf("my-tok", "org/repo", "My tokenizer"), plus its commit in HF_REVISIONS. Anything that
can return token boundaries (or just counts) can implement the Tokenizer protocol.
Add an embedding model: a DenseSpec(key, repo, revision, query_prefix, doc_prefix) in
retrieval.py.
Add a model provider: implement generate(GenerationRequest) -> Generation and set live,
then register a prefix in build_adapter in adapters.py.
Add a task: write a YAML file; fields are validated by TaskSpec in
generation.py:
name: my-task
type: qa_mc # summarization | qa_mc | classification | transliteration
source: {name: belebele, limit: 200, seed: 13} # or {name: fixture, split: my.jsonl}
prompt: |
{passage}
প্রশ্ন: {question}
{choices_block}
max_tokens: 8Metrics follow from type: chrF + Bangla ROUGE-1/2/L (summarization), accuracy (QA),
accuracy + macro-F1 (classification), chrF + CER + exact match (transliteration), plus
judge_score when --judge is given and the task defines judge_rubric.
Development
uv sync --all-extras
uv run ruff check . && uv run ruff format --check .
uv run mypy # strict
uv run pytestCI (.github/workflows/ci.yml) runs lint, strict type checks and
tests, then the tokenizer study, lexical retrieval and the mock generation suite on the
hand-written fixtures, and uploads the results as an artifact.
Limitations
- Corpus. The tokenizer study and retrieval use FLORES-200-derived Belebele passages: formal, translated, Wikipedia/Wikinews-style text. Conversational, social-media and dialectal Bangla (e.g. Sylheti, Chittagonian) will tokenize and retrieve differently.
- Words. Fertility uses a regex word splitter, not a morphological analyzer, so tokens/word is comparable across tokenizers but not to numbers computed with other splitters.
- Breakage ≠ quality. Cutting through an akshara is a proxy for how unnatural a segmentation is; it is not proven here to cause worse downstream accuracy.
- Retrieval task. Belebele questions were written to be answerable from one passage and are short; 488 passages is a small corpus, so absolute nDCG values are higher than in realistic search. Relative gaps (script, analyzer, model) are the point.
- Generation. The only live LLM run is one local quantized model (
gemma4:12b-it-qatvia Ollama) on seeded samples (200 / 204 / 200 / 50 / 50 items). Hosted models were not evaluated (no API keys). Prompts are zero-shot and in Bangla; prompt wording affects scores. - Transliteration references. Belebele's romanized passages and Aksharantar's romanized words follow particular romanization conventions, and chrF/CER penalize valid alternative spellings and punctuation.
- Light stemmer. The suffix list is deliberately small and unvalidated against a morphological gold standard; it is a retrieval heuristic.
Data and licenses
Code: MIT (LICENSE). Data is not redistributed; each dataset is downloaded at
runtime under its own license (CC BY-SA 4.0, CC BY-NC-SA 4.0, CC BY / CC0). See
DATASETS.md for sources, pinned revisions, licenses and citations. The small
fixtures in fixtures/ were written by hand for this repo.
Citation
If you use this benchmark, please cite it (see CITATION.cff) and the datasets in DATASETS.md.
@software{sikder2026banglallmbench,
author = {Sikder, Ratul},
title = {bangla-llm-bench: measuring how LLMs, tokenizers and embedding models handle Bangla},
year = {2026},
url = {https://github.com/RatulSikder97/bangla-llm-bench},
version = {0.1.0}
}