Instructions to use Tamil-ai/tamil-qwen25-14b-morph-rlmv with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Tamil-ai/tamil-qwen25-14b-morph-rlmv with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-14B-Instruct") model = PeftModel.from_pretrained(base_model, "Tamil-ai/tamil-qwen25-14b-morph-rlmv") - Notebooks
- Google Colab
- Kaggle
Tamil-Qwen2.5-14B-Morph-RLMV
Reinforcement Learning with Morphological Verifiers (RLMV) — a novel post-training method that uses deterministic linguistic verifiers as reward functions, applied to Tamil morphology on Qwen2.5-14B-Instruct.
This is analogous to DeepSeek-R1's approach for mathematics, but for agglutinative language morphology.
Paper: "A Thousand Language Problem: Morphological Understanding in Linguistic AI"
Method: RLMV
Tamil morphology is deterministic — a suffix form is either correct or incorrect. This makes it ideal for Reinforcement Learning with Verifiable Rewards (RLVR):
- Stage 1 (SFT): Fine-tune Qwen2.5-14B-Instruct on gold-standard Tamil morphological data
- Stage 2 (RLMV): Apply GRPO (Group Relative Policy Optimization) using 3 independent morphological verifiers as reward functions:
- Finite State Transducer (FST) verification
- Suffix rule matching
- Exact match against gold standard
No human preference data needed — grammar rules ARE ground truth.
Model Details
| Property | Value |
|---|---|
| Base model | Qwen/Qwen2.5-14B-Instruct |
| Method | GRPO with morphological reward verifiers |
| Adapter type | LoRA (r=32, alpha=64, dropout=0.05) |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Adapter size | 275 MB |
| Training framework | TRL (GRPOTrainer) |
| PEFT version | 0.18.1 |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
base_model_id = "Qwen/Qwen2.5-14B-Instruct"
adapter_id = "Tamil-ai/tamil-qwen25-14b-morph-rlmv"
# Load base model (4-bit for ~8GB VRAM)
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
quantization_config=BitsAndBytesConfig(load_in_4bit=True),
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
# Apply RLMV adapter
model = PeftModel.from_pretrained(model, adapter_id)
messages = [
{"role": "system", "content": "You are a Tamil linguistics expert. Answer with ONLY the Tamil word or phrase requested."},
{"role": "user", "content": "What is the accusative form of the Tamil word 'வீடு' (house)?"},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=64, temperature=0.1)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
# Expected: வீட்டை
Why RLMV?
Traditional RLHF requires expensive human preference data. For agglutinative languages like Tamil, morphological correctness is verifiable — making reward-based RL a natural fit:
- No annotator disagreement (grammar is deterministic)
- Scales to any agglutinative language with morphological rules
- Reward signal is precise (correct form or not)
- GRPO is memory-efficient (no critic model needed for 14B)
Training Pipeline
Qwen2.5-14B-Instruct
|
v
[Stage 1: SFT on gold morphological data]
|
v
tamil-qwen25-14b-morph (SFT model)
|
v
[Stage 2: GRPO with morphological verifiers]
|
v
tamil-qwen25-14b-morph-rlmv (THIS MODEL)
Evaluation
Evaluated on the Tamil Morphological Benchmark (1,030 test cases, 9 categories). Full results in the paper.
Limitations
- This is a LoRA adapter, not a standalone model
- Optimized for morphological tasks; general instruction following may vary
- Requires loading on top of the base Qwen2.5-14B-Instruct model
Citation
@misc{tamilai2026rlmv,
title={A Thousand Language Problem: Morphological Understanding in Linguistic AI},
author={Tamil-AI},
year={2026},
publisher={HuggingFace},
url={https://huggingface.co/Tamil-ai/tamil-qwen25-14b-morph-rlmv}
}
- Downloads last month
- 3