CoolFace
Modelpublic

randomDude26/gemma_mktg_cpt_sft

sourceHugging Facecc-by-4.0updated 2mo agoView on Hugging Face
0likes5downloads
Model Card

Gemma-3-4B-IT — CPT + joint SFT for Mizo, Khasi, Tulu, Gondi

Gemma-3-4B-IT with continued pretraining (CPT) on monolingual Mizo, Khasi, Hindi and Kannada text, then supervised fine-tuning jointly on four low-resource Indian language pairs.\n\nCPT helps most where the base model is weakest: it is the best model on Khasi and improves Gondi and Tulu over SFT alone.

A LoRA adapter — load it on top of the base model google/gemma-3-4b-it.

Training data

Fine-tuned jointly on four low-resource pairs from `randomDude26/mi_kh_tulu_dataset`:

PairTrainValTest
en-mizo (English → Mizo, lus)49,496464800
en-khasi (English → Khasi, kha)22,358482800
en-tulu (English → Tulu, tcy)16,218488800
hi-gondi (Hindi → Gondi, gon)15,500389737

The validation and test splits are decontaminated: no exact or near duplicate of any test/val sentence appears in training (exact pair, exact source, exact target, ≥0.90 character similarity, ≥0.80 4-gram containment, ≥0.80 token Jaccard). All scores below are on those decontaminated test sets.

Gondi has 737 test sentences rather than 800 — after decontamination only 737 clean sentences remain.

Results

Decontaminated test sets. BLEU and chrF++ via sacrebleu (BLEU(effective_order=True), CHRF(word_order=2)).

DirectionnBLEUchrF++
eng→mizo80030.8956.86
eng→khasi80034.4958.74
eng→tulu80035.2863.33
hi→gondi7377.5130.40

Checkpoint used for these scores: gemma-sft-joint-20260523_214614/checkpoint-3500

Against the zero/few-shot baselines (BLEU)

DirectionGemma 0-shotGemma 3-shot**this model**
eng→mizo6.9910.8630.89
eng→khasi3.163.6934.49
eng→tulu4.324.1635.28
hi→gondi2.442.647.51

Configuration

LoRA

rank r64
lora_alpha128
lora_dropout0.05
target modulesq_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj
modules_to_save—

Training

batch size16 (per device), grad-accum 2 → effective 32
learning rate2e-4, cosine, 200 warmup steps
weight decay0.01
max sequence length512 (prompt + response)
precisionbf16, gradient checkpointing
decodinggreedy

Checkpoints are saved every 500 steps. Checkpoint 3500 is reported: validation loss bottoms out earlier (~step 2500), but validation BLEU keeps improving to 3500 — the two diverge, and checkpoints were selected on BLEU.

Usage

python
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel

REPO = "randomDude26/gemma_mktg_cpt_sft"

tokenizer = AutoTokenizer.from_pretrained(REPO)
tokenizer.padding_side = "left"

base = AutoModelForCausalLM.from_pretrained(
    "google/gemma-3-4b-it", dtype=torch.bfloat16
)
model = PeftModel.from_pretrained(base, REPO).merge_and_unload().cuda().eval()

# the prompt MUST match the training format
prompt = (
    "<start_of_turn>user\n"
    "Translate the following English sentence into Tulu.\n"
    "Output only the translated sentence. Do not include explanations.\n\n"
    "The temple is very old.<end_of_turn>\n"
    "<start_of_turn>model\n"
)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
out = model.generate(**inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Citation

Paper under anonymous review. Dataset: `randomDude26/mi_kh_tulu_dataset`.