NandiBERT-450M
| Model | Parameters | Hidden | Context | Description |
|---|---|---|---|---|
| NandiBERT-150M | 146M | 768 | 16K | Pre-trained encoder |
| NandiBERT-450M (this model) | 445M | 1,024 | 32K | Long-context pre-trained encoder |
For NandiBERT-450M, the parameter count is the encoder that you fine-tune (445M). The checkpoint also stores the untied MLM output layer (103M), so the model file holds 548M parameters.
Description
- One Model. From English to Indic and Beyond: NandiBERT-450M covers 17 languages: English; 13 Indian languages (Assamese, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Nepali, Odia, Punjabi, Tamil, Telugu and Urdu), 11 of which also work in romanized form; Bahasa Indonesia and Malay from Southeast Asia; and Arabic from the Middle East. A single model replaces separate English and Indic encoders.
- Deep, with efficient attention: 28 layers at 1,024 hidden size, with QK-norm and SwiGLU. Grouped-query attention with 8 query heads and 2 key-value heads keeps memory low on long inputs.
- 32K context: A 32,768-token window, so full contracts, reports and papers fit in a single pass, with a 100K-token multilingual vocabulary shared across the NandiBERT family.
- Factorized embeddings: The 100K-token vocabulary is stored as a rank-512 factorized embedding, which cuts the embedding table from 103M to 52M parameters and puts that capacity into the encoder layers instead.
- Built to fine-tune: A strong starting point for classification, named-entity recognition, reranking and long-document retrieval, loadable with Hugging Face
transformers.
Benchmark Results
Indic Benchmarks
Note: NandiBERT is pre-trained on 13 Indic languages in native script: Assamese, Bengali, Gujarati, Hindi, Kannada, Malayalam, Marathi, Nepali, Odia, Punjabi, Tamil, Telugu and Urdu.
English Benchmarks
Note: Model results are the average of 3 different seeds.
Usage
NandiBERT-450M loads with Hugging Face transformers 5.x using trust_remote_code=True. For long documents, pass inputs of up to 32,768 tokens.
import torch
from transformers import AutoModelForMaskedLM, AutoTokenizer
model_id = "FrontiersMind/NandiBERT-450M"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForMaskedLM.from_pretrained(
model_id,
dtype=torch.bfloat16,
trust_remote_code=True,
device_map="cuda",
)
texts = [
f"The capital of France is {tokenizer.mask_token}.",
f"भारत की राजधानी {tokenizer.mask_token} है।",
]
for text in texts:
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
logits = model(**inputs).logits
mask_index = (inputs.input_ids == tokenizer.mask_token_id).nonzero()[0, 1]
print(tokenizer.decode(logits[0, mask_index].argmax()))
Fine-tuning
AutoModelForSequenceClassification and AutoModelForTokenClassification reuse the pretrained MLM head. The encoder output goes through the MLM head (dense, activation, RMSNorm) and then a new linear layer, so only the linear layer starts from random weights. This is the default setup.
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_id = "FrontiersMind/NandiBERT-450M"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForSequenceClassification.from_pretrained(model_id, num_labels=3, trust_remote_code=True)
To fine-tune without the MLM head, pass classifier_head=None to from_pretrained.
For word-level input (is_split_into_words=True, as in NER), the tokenizer adds a space before every word, the same as in running text, so pass the words as they are. Use word_ids() to map tokens back to words.
Citation
@misc{frontiersmind2026nandibert,
title = {NandiBERT: Open Encoders for English and Indic Languages},
author = {{FrontiersMind}},
year = {2026},
howpublished = {\url{https://huggingface.co/FrontiersMind/NandiBERT-450M}}
}