InDIM (Indic Decision Intelligence Models) are compact encoders for Indian languages. InDIM-small has 32M parameters and covers 12 Indian languages and English: Assamese, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, Telugu, Urdu and English. It reads native script, romanized text (Hindi, Tamil, … in Latin letters) and code-mixed text.
It is a base model: fine-tune it for classification, token tagging (NER, PII) or retrieval. On our fine-tuned tasks it beats mmBERT-small (140M) on 12 of 15 benchmarks at about a quarter of the size, runs about 3× faster on CPU and keeps its outputs under int8 quantisation.
| Parameters | 31.5M encoder (+0.3M masked-LM head) |
| Architecture | ModernBERT encoder: 12 layers, hidden 384, FFN 576, 6 heads, RoPE, global attention every third layer and 128-token local attention in the others |
| Vocabulary | 128,064-piece Unigram tokenizer for Indic + English; factorized 128-dim word embedding, tied with the output layer |
| Pretraining length | 512 tokens (longer inputs work; see the PII results below) |
| Precision | fp32 weights; fp16 inference is exact; int8 friendly (see Precision) |
The factorized embedding needs the model code in this repository (trust_remote_code=True).
from transformers import AutoTokenizer, AutoModel, AutoModelForMaskedLM, pipeline
tok = AutoTokenizer.from_pretrained("CobuildX-AI/InDIM-small", trust_remote_code=True)
mlm = AutoModelForMaskedLM.from_pretrained("CobuildX-AI/InDIM-small", trust_remote_code=True)
fill = pipeline("fill-mask", model=mlm, tokenizer=tok)
fill("भारत की राजधानी [MASK] है।") # top prediction: "दिल्ली"
encoder = AutoModel.from_pretrained("CobuildX-AI/InDIM-small", trust_remote_code=True)
Fine-tuning: AutoModelForSequenceClassification and AutoModelForTokenClassification load the stock ModernBERT
heads on top (classifier_pooling "cls" or "mean"). Learning rates of 2e-4 to 8e-4 worked best for our tasks (higher
than for larger models).
ONNX: onnx/model.onnx (fp32) and onnx/model_int8.onnx (dynamic int8) take input_ids and attention_mask
[batch, length] and return the last hidden state.
All fine-tuned numbers use the same recipe for every model within a task (plain fine-tuning, no distillation), a learning rate picked per model on validation, and the mean of 3 training runs unless marked. Higher is better unless marked.
| Task | Test set | Metric | InDIM-small (32M) | mmBERT-small (140M) |
|---|---|---|---|---|
| Intent (60 intents, 7 languages) | MASSIVE test | accuracy | 85.2 | 84.2 |
| Sentiment | IndicSentiment (13 languages, human labels) | accuracy | 0.822 | 0.839 |
| Sentiment | Telugu / English / romanized Hindi sources, human labels | macro F1 | 0.512 | 0.508 |
| Slot filling (55 slot types) | MASSIVE test | span F1 | 0.700 | 0.680 |
| PII (27 types) | our synthetic test | span F1 | 0.992 | 0.993 |
| PII | Ylemis India-PII (independent) | typed F1 | 0.989 | 0.987 |
| PII | IndiaPII-Bench (independent) | typed F1 | 0.960 | 0.950 |
| PII | IndicPIIDetX test, 14 shared types | typed F1 | 0.950 | 0.930 |
| PII | IndicPIIDetX test, all 27 types | typed F1 | 0.906 | 0.894 |
| Profanity / abuse (5 labels) | gold set (3,980 held-out texts, LLM-labelled) | macro F1 | 0.703 | 0.725 |
| Hate | Hindi HateCheck | PR-AUC | 0.749 | 0.742 |
| Causal reasoning (trained on English only) | IndicCOPA, 18 languages | accuracy, 1 run | 0.533 | 0.530 |
| Paraphrase (trained on English only) | IndicXParaphrase, 10 languages | accuracy, 1 run | 0.571 | 0.561 |
| Named entities | Naamapadam, 11 languages | entity F1, 1 run | 0.704 | 0.671 |
Masked-word prediction (whole-word pseudo-log-likelihood, bits per character; lower is better). Held-out text, but from the same kinds of sources as InDIM-small's pretraining data, which favours InDIM-small: read it as a check of script and register coverage, not as a fair language-modelling comparison.
| Text | InDIM-small | mmBERT-small |
|---|---|---|
| All Indic (macro) | 1.571 | 2.314 |
| Native script | 1.263 | 1.737 |
| Romanized (natural) | 1.856 | 3.051 |
| Romanized (transliterated) | 1.410 | 2.907 |
| Code-mixed | 2.146 | 2.377 |
| English | 0.986 | 0.731 |
Cross-lingual retrieval (FLORES devtest, English ↔ language, mean-pooled embeddings, accuracy@1, macro over 12 languages; "centered" subtracts each language's mean embedding):
| InDIM-small | mmBERT-small | |
|---|---|---|
| English → native script, centered | 0.502 | 0.248 |
| Native script → English, centered | 0.513 | 0.228 |
| English → romanized (transliterated), centered | 0.345 | 0.077 |
| English → native script, raw | 0.133 | 0.070 |
The raw embeddings are not aligned across languages (no sentence-level training); fine-tune for retrieval.
CPU latency (Intel i7-10700, batch 1, median ms, encoder only, PyTorch fp32) at 64 / 128 / 512 tokens:
| Parameters | 8 threads | 1 thread | |
|---|---|---|---|
| InDIM-small | 31.5M | 8 / 12 / 37 | 22 / 40 / 183 |
| mmBERT-small | 140.5M | 20 / 30 / 99 | 64 / 117 / 494 |
The tokenizer also uses fewer tokens for Indic text than mmBERT's (for example 25 against 36 tokens for a mixed Hindi / romanized sentence), so real texts are shorter sequences as well.
Intended use: a base for fine-tuning classifiers, taggers and retrieval models for Indian-language text, especially where models must run on CPU or at low cost. Not intended for decisions about individual people (hiring, credit, moderation penalties, surveillance) without evaluation on your data and a person reviewing each case. The model is provided "as is", without warranties of any kind; Cobuild Tech Private Limited is not liable for its use. You are responsible for checking that it suits your data and for complying with the laws that apply to your use.
If you use InDIM models, please cite:
@misc{indim2026,
title = {InDIM: Compact Encoders for Indian Languages},
author = {{Sudalai Rajkumar} and {Sairaam Varadarajan}},
organization = {CobuildX AI},
year = {2026},
version = {0.1},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/CobuildX-AI/InDIM-small}},
doi = {10.57967/hf/11878}
}
Apache-2.0 (see LICENSE). InDIM-small was initialised from mmBERT-small (MIT); see NOTICE.
Questions: hello@cobuildx.ai.
onnx/model.onnx 127 MBmodel.safetensors 127 MBonnx/model_int8.onnx 33 MB