English → Indian Language Translation (gemma-3-270m-it fine-tune)
Fine-tuned google/gemma-3-270m-it (268M params) for English → Indian language translation across 11 languages.
This is a lightweight translation model targeting short-to-medium text (up to ~512 tokens). It was trained on the ai4bharat/BPCC parallel corpus using sequence packing with document-level attention masking.
Supported Languages
Code
Language
Script
hi
Hindi
Devanagari
bn
Bengali
Bengali
ta
Tamil
Tamil
te
Telugu
Telugu
mr
Marathi
Devanagari
gu
Gujarati
Gujarati
kn
Kannada
Kannada
ml
Malayalam
Malayalam
pa
Punjabi
Gurmukhi
or
Odia
Odia
as
Assamese
Bengali
Prompt Format
Uses the Gemma IT chat template. The prompt format must match what was used during training:
<start_of_turn>user
Translate English to {Language}:
{source_text}<end_of_turn>
<start_of_turn>model
Where {Language} is the full language name (e.g. "Hindi", "Bengali", "Tamil") — not the ISO code.
Training Details
Data
Dataset:ai4bharat/BPCC (Bharat Parallel Corpus Collection)
Multiple translation pairs are bin-packed into fixed-length 512-token sequences. Each packed sequence uses:
Position ID resets at each document boundary (BOS token) to create block-diagonal causal attention masks
Label masking on prompt tokens — only target (translation) tokens and EOS contribute to loss
Layout per document: [BOS] [prompt_tokens] [target_tokens] [EOS]
Training Loss
Step
Train Loss
Eval Loss
Learning Rate
1
6.7994
—
0.00e+00
50
4.4387
8.5473
6.38e-06
100
3.4441
8.0905
1.29e-05
250
2.6934
8.5179
3.24e-05
500
2.2552
8.4022
6.50e-05
1000
1.7838
8.1475
9.67e-05
1500
1.5401
8.0835
8.94e-05
2000
1.2843
8.2637
8.22e-05
Training loss decreased steadily from 6.80 → 1.28 over 2000 steps. Eval loss is high due to the large vocabulary (262k tokens) and sequence packing evaluation — the model is learning meaningful translations despite the cross-entropy numbers.
Example Outputs
Translations from checkpoint-2000 (greedy decoding, repetition_penalty=1.3):
Language
Input
Output
Hindi
How are you?
आप कैसे हैं ?
Hindi
Please give me a glass of water.
मुझे एक ग्लास पानी दें।
Bengali
How are you?
তোমার কি আছে ?
Tamil
How are you?
நீங்கள் எப்படி இருக்கிறீர்கள் ?
Marathi
The weather is nice today.
असे तर, आज हवामान खूप चांगले आहे .
Gujarati
The weather is nice today.
આજે હવામાન સારું છે .
Malayalam
The weather is nice today.
കാലാവസ്ഥ ഇന്ന് നല്ലതാണ് .
Short, simple sentences translate well. Longer and more complex inputs may produce incomplete or less accurate results — this is expected from a 268M parameter model at a mid-training checkpoint.
Limitations
Model size: At 268M parameters, this is a very small model. Translation quality varies across languages and degrades on longer or more complex inputs.
Mid-training checkpoint: This is checkpoint-2000 out of a planned 4000 steps (~0.78 epochs). Further training may improve quality.
English → Indic only: The model was trained for one-way translation (English to Indian languages). It is not designed for Indic → English or Indic → Indic translation.
Max input length: Trained with max_seq_len=512; inputs longer than this may produce poor results.
Script coverage: Relies on the base Gemma tokenizer's coverage of Indic scripts. Some scripts may be underrepresented in the base model's pretraining data.
Usage
python
1from transformers import AutoTokenizer, AutoModelForCausalLM
23model_id ="sulabhkatiyar/english-indic-gemma-3-270m-it"4tokenizer = AutoTokenizer.from_pretrained(model_id)5model = AutoModelForCausalLM.from_pretrained(model_id)67messages =[{"role":"user","content":"Translate English to Hindi:\nThe weather is nice today."}]8input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True)9output = model.generate(input_ids, max_new_tokens=256)10print(tokenizer.decode(output[0][input_ids.shape[-1]:], skip_special_tokens=True))