abdullah693 commited on
Commit
5fadfc9
·
verified ·
1 Parent(s): 746a0ff

Add model card

Browse files
Files changed (1) hide show
  1. README.md +97 -0
README.md ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: gemma
3
+ base_model: google/gemma-3-4b-it
4
+ language:
5
+ - ur
6
+ - en
7
+ library_name: transformers
8
+ pipeline_tag: text-generation
9
+ tags:
10
+ - urdu
11
+ - pakistan
12
+ - gemma3
13
+ - full-finetune
14
+ - education
15
+ - reasoning
16
+ - instruction-tuning
17
+ - adaption
18
+ - urdummlu
19
+ datasets:
20
+ - abdullah693/adaption-urdu-edu-cultural-reasoning
21
+ ---
22
+
23
+ # Gemma-3-4B Urdu Education & Reasoning (full fine-tune)
24
+
25
+ A **full fine-tune** of [`google/gemma-3-4b-it`](https://huggingface.co/google/gemma-3-4b-it) for **Urdu education, reasoning, and culture**, trained on the UrduMMLU-aligned [abdullah693/adaption-urdu-edu-cultural-reasoning](https://huggingface.co/datasets/abdullah693/adaption-urdu-edu-cultural-reasoning) dataset. The goal is a strong **sub-5B** Urdu model: math/science reasoning, social-science and Islamic knowledge, Pakistan studies, and native Urdu literature/grammar.
26
+
27
+ > ⚠️ **Research / educational use.** Not an authoritative source for exam preparation, religious rulings, or legal/medical advice.
28
+
29
+ ## At a glance
30
+
31
+ | | |
32
+ |---|---|
33
+ | **Base** | google/gemma-3-4b-it (`Gemma3ForCausalLM`, text) |
34
+ | **Method** | Full fine-tune (SFT) — all weights updated, not LoRA |
35
+ | **Training data** | [adaption-urdu-edu-cultural-reasoning](https://huggingface.co/datasets/abdullah693/adaption-urdu-edu-cultural-reasoning) (~39.9K Urdu/English QA, UrduMMLU-aligned) |
36
+ | **Epochs** | 3 (75 steps) |
37
+ | **Loss** | 2.71 → 0.96 train; eval loss ~1.13 |
38
+ | **Reported win rate** | 62% vs. base (pairwise preference) |
39
+ | **Languages** | Urdu (primary) + English |
40
+ | **Trained via** | Adaption AutoScientist (Together.AI backend) |
41
+
42
+ ## Intended use
43
+
44
+ Urdu question answering, explanation, and reasoning across STEM, humanities/social science, Islamic studies, Pakistan studies, and Urdu language/literature. Prompt it in Urdu; it can produce concise answers or worked explanations, and can be steered into MCQ-style answers.
45
+
46
+ ## Usage
47
+
48
+ ```python
49
+ from transformers import AutoModelForCausalLM, AutoTokenizer
50
+ import torch
51
+
52
+ mid = "abdullah693/gemma-3-4b-it-urdu-edu-reasoning"
53
+ tok = AutoTokenizer.from_pretrained(mid)
54
+ model = AutoModelForCausalLM.from_pretrained(mid, torch_dtype=torch.bfloat16, device_map="auto")
55
+
56
+ msgs = [{"role": "user", "content": "سورج اور زمین کے درمیان فاصلے کو کیا کہتے ہیں؟ مختصر وضاحت کریں۔"}]
57
+ ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
58
+ out = model.generate(ids, max_new_tokens=256, do_sample=False)
59
+ print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
60
+ ```
61
+
62
+ ## Evaluation
63
+
64
+ Designed to be evaluated on **[UrduMMLU](https://huggingface.co/datasets/MBZUAI/UrduMMLU)** (26,431 Urdu MCQs, 5 domains) using the paper's protocol — generation + parse the option letter, Urdu prompt, 0-/5-shot. Reference baselines (Urdu, 0-shot) for the sub-5B tier:
65
+
66
+ | Model | UrduMMLU (Urdu, 0-shot) |
67
+ |---|---|
68
+ | google/gemma-3-4b-it (this model's base) | 44.88% |
69
+ | Qwen3-4B | 51.70% |
70
+ | LLaMA-3.1-8B | 43.84% |
71
+
72
+ Goal: beat the base (~45%) and approach the sub-5B leader. *UrduMMLU scores for this fine-tune will be added once evaluated; the training set was deduplicated against UrduMMLU.*
73
+
74
+ ## Training data composition
75
+
76
+ The dataset is composed to mirror UrduMMLU's domain mix (rather than over-weighting math): Urdu language/literature/grammar, MMLU humanities & social science (adapted to Urdu), STEM reasoning (GSM8K/MATH/ARC/AQuA), Islamic studies, Pakistan studies, and general knowledge. See the [dataset card](https://huggingface.co/datasets/abdullah693/adaption-urdu-edu-cultural-reasoning) for full provenance and licenses.
77
+
78
+ ## Limitations
79
+
80
+ - 4B scale — limited factual depth; can hallucinate, especially on long-tail Pakistan-specific facts.
81
+ - Urdu grammar and Pakistan geography/current-affairs coverage in training was thin (no permissive native datasets), so these remain weaker areas.
82
+ - Inherits the biases and knowledge cutoff of the Gemma-3 base.
83
+
84
+ ## License
85
+
86
+ Governed by the [Gemma Terms of Use](https://ai.google.dev/gemma/terms). Fine-tuned by `abdullah693`; Urdu data adaptation via Adaption AutoScientist.
87
+
88
+ ## Citation
89
+
90
+ ```bibtex
91
+ @misc{gemma3_4b_urdu_edu_2026,
92
+ title = {Gemma-3-4B Urdu Education & Reasoning},
93
+ author = {abdullah693},
94
+ year = {2026},
95
+ url = {https://huggingface.co/abdullah693/gemma-3-4b-it-urdu-edu-reasoning}
96
+ }
97
+ ```