CoolFace
Modelpublic

Tamil-ai/tamil-qwen25-14b-morph-rlmv

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes5downloads
Model Card

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):

  1. 1.Stage 1 (SFT): Fine-tune Qwen2.5-14B-Instruct on gold-standard Tamil morphological data
  2. 2.Stage 2 (RLMV): Apply GRPO (Group Relative Policy Optimization) using 3 independent morphological verifiers as reward functions:
  3. 3.Finite State Transducer (FST) verification
  4. 4.Suffix rule matching
  5. 5.Exact match against gold standard

No human preference data needed — grammar rules ARE ground truth.

Model Details

PropertyValue
Base modelQwen/Qwen2.5-14B-Instruct
MethodGRPO with morphological reward verifiers
Adapter typeLoRA (r=32, alpha=64, dropout=0.05)
Target modulesqproj, kproj, vproj, oproj, gateproj, upproj, down_proj
Adapter size275 MB
Training frameworkTRL (GRPOTrainer)
PEFT version0.18.1

Usage

python
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

bibtex
@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}
}