Skip to main content

Building an Urdu LLM: From Data Curation to Deployment

A technical deep-dive into fine-tuning Qwen 2.5 7B for Urdu across three versions: curating a bilingual Urdu/Roman-Urdu corpus, QLoRA training on a rented H100, diagnosing and fixing catastrophic forgetting, building a blinded multi-judge evaluation harness (including a free Claude-Code-CLI judge), fixing the regressions a data change caused, RAG-aware retraining that fixed retrieval's structural failure without turning it into a blanket win, and shipping a live demo on Gradio + Modal.

20 min read
Machine LearningLLM Fine-TuningQLoRALow-Resource NLPLLM-as-JudgeRAGSynthetic DataModalMLOps
Building an Urdu LLM: From Data Curation to Deployment

Frequently Asked Questions

What model and method were used to build the Urdu LLM?

Qwen 2.5 7B Instruct fine-tuned with QLoRA, which trains low-rank adapters on a frozen 4-bit base, so it runs on modest hardware and ships as a small adapter. Total cost was about $60 across three versions.

How much better is the fine-tuned model than the base?

The current version wins about 79.5% of blind pairwise comparisons against base Qwen 2.5 7B, judged by multiple independent LLM judges on a 100-prompt evaluation set, and it recovers every regression its predecessor introduced.

What is catastrophic forgetting and how was it fixed?

v1 over-fit to Urdu and lost general ability, drifting or breaking on ordinary prompts. The v2 fix mixed general-capability data back in, lowered the learning rate, and trained fewer epochs so the model gained Urdu without erasing what the base already knew.

Why did Roman Urdu and code-mixing matter?

Most Pakistanis type Roman Urdu (Urdu in Latin script) and freely mix in English. A model that only handles formal Urdu script solves the wrong problem, so the corpus deliberately covered all three registers.

How do you evaluate an LLM without a standard benchmark?

A blinded pairwise harness: multiple LLM judges (including a free Claude-Code-CLI judge) compare base vs fine-tuned answers with the order randomized to cancel position bias, reported as a median win rate with the range across judges.