GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Pranav63/qlora-multilingual-finetuning

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
configs
configs
 
 
eval
eval
 
 
image/README
image/README
 
 
scripts
scripts
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

QLoRA Fine-tuning Pipeline — Arabic-English Code-Switched Instructions

Fine-tuning Qwen2.5-3B-Instruct for Gulf enterprise Arabic-English code-switching using QLoRA, tracked with MLflow, benchmarked with custom eval suite.

Problem

Gulf enterprise professionals communicate in Arabic-English code-switching — Arabic prose with English technical terms embedded naturally ("الـ supply chain efficiency" not "كفاءة سلسلة التوريد"). Base LLMs collapse to pure Arabic on this input, losing the register Gulf professionals actually use.

Results

Metric Base Qwen2.5-3B Fine-tuned Improvement
Avg Code-Switch Ratio 5.1% 34.7% +584%
Supply Chain prompt 3.2% 46.0% +1337%
ML/DL prompt 6.9% 36.0% +421%
Data preprocessing prompt 5.2% 31.4% +504%
Overfitting prompt 5.1% 25.7% +403%

![Benchmark]1778355218681

Example Output

Input: كيف نحسن الـ supply chain efficiency في الـ manufacturing؟

Base model (5.1% CS ratio):

تحسين كفاءة الشبكة الصناعية يمكن أن يشمل عدة خطوات رئيسية... (collapses to pure Arabic, drops English terms)

Fine-tuned (46.0% CS ratio):

هناك عدة طرق يمكن استخدامها لتحسين الـ supply chain efficiency في الـ manufacturing، منها تحسين الـ inventory management باستخدام الـ ERP systems و الـ CRM systems... (maintains Gulf professional register)

Stack

  • Base Model: Qwen2.5-3B-Instruct
  • Fine-tuning: QLoRA via HuggingFace PEFT (LoRA r=16, alpha=32)
  • Experiment Tracking: MLflow
  • Hardware: Apple M5 Max (MPS)
  • Dataset: synthetically generated via Groq Llama API

Pipeline

01_download_data.py         → Pull public Arabic instruction datasets (7,620 samples)
02_generate_codeswitched.py → Synthetic code-switching via Groq LLaMA (653 clean samples)
03_prepare_dataset.py       → Format + push dataset to HuggingFace
04_train.py                 → QLoRA training with MLflow tracking (3 epochs, loss: 1.388)
05_merge_and_push.py        → Merge adapter + push model to HuggingFace
06_serve_local.py           → Local inference + comparison
eval/benchmark.py           → Quantitative base vs fine-tuned evaluation

Architecture Decisions

Why QLoRA over full fine-tuning? Full fine-tuning 3B parameters requires 24GB+ VRAM. QLoRA injects trainable rank decomposition matrices (r=16) into attention layers only — 1% of parameters trained, same task adaptation, fits on consumer hardware.

Why r=16, alpha=32? r=16 balances capacity vs memory. r=4 insufficient for register learning. r=64 approaches full fine-tuning cost. alpha=2x rank is standard scaling — LoRA contribution scaled by alpha/r=2, enough influence without overwriting pretrained weights.

Why Qwen2.5 over Llama 3.2? Qwen2.5 has stronger Arabic in pretraining mixture. Better multilingual base = less fine-tuning data needed for same result.

Why MLflow over W&B? Open source, self-hosted, zero external dependencies. Anyone cloning this repo runs identical experiment tracking locally.

Model & Dataset

  • Model: pranav63/qwen2.5-3b-arabic-en-instruct
  • Dataset: pranav63/arabic-english-codeswitched-instructions

Training Details

  • Epochs: 3
  • Final train loss: 1.388
  • Batch size: 1 (gradient accumulation: 8, effective batch: 8)
  • Learning rate: 2e-4 with cosine schedule
  • Training time: ~6 minutes on M5 Max
  • Trainable parameters: ~1% of total

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.