Fine-tuning Qwen2.5-0.5B using QLoRA + DoRA for a domain-specific healthcare assistant on consumer GPUs.
This project demonstrates how to build a specialized AI assistant using:
- Qwen2.5-0.5B-Instruct
- QLoRA (4-bit Quantized LoRA)
- DoRA Adapters
- Unsloth
- Hugging Face Transformers
- TRL SFTTrainer
The model was trained on ~500 healthcare instruction-response examples and optimized to run efficiently on small GPUs.
General-purpose LLMs are powerful, but they often struggle with domain-specific reasoning.
This project shows how lightweight fine-tuning techniques can dramatically improve model quality for specialized tasks without requiring massive infrastructure.
- Python
- PyTorch
- Unsloth
- Hugging Face
- TRL
- QLoRA
- DoRA
- Qwen2.5
- 4-bit QLoRA fine-tuning
- DoRA adapter training
- Small GPU compatible
- Healthcare domain adaptation
- Hugging Face Hub integration
- Before vs after model comparison
- Memory-efficient training
| Component | Value |
|---|---|
| Base Model | Qwen2.5-0.5B-Instruct |
| Fine-Tuning Method | QLoRA + DoRA |
| Dataset Size | ~500 Examples |
| Training Time | ~15 Minutes |
| Adapter Size | ~5MB |
| Precision | 4-bit |
| Framework | Unsloth |
LLM-FineTuning/
│
├── FineTuning-Example.ipynb
├── healthcare_data.json
├── requirements.txt
├── README.md[
{
"instruction": "What are early symptoms of diabetes?",
"output": "Common symptoms include increased thirst..."
}
]LoRA freezes the original model and trains only small adapter matrices.
- Lower memory usage
- Faster training
- Tiny checkpoint sizes
- Near full fine-tuning quality
https://arxiv.org/abs/2106.09685
QLoRA compresses the base model into 4-bit precision before training.
- Massive VRAM reduction
- Consumer GPU compatible
- Minimal quality loss
https://arxiv.org/abs/2305.14314
DoRA improves LoRA by separately learning:
- Weight magnitude
- Weight direction
- Better stability
- Improved adaptation quality
- Closer to full fine-tuning performance
https://arxiv.org/abs/2402.09353
git clone https://github.com/dhanushkumar-amk/LLM-FineTuning.git
cd LLM-FineTuningpip install unsloth trl datasets transformers accelerate bitsandbytesRun the notebook:
FineTuning-Example.ipynbThe notebook includes:
- Dataset loading
- Dataset formatting
- QLoRA setup
- DoRA adapter configuration
- Training
- Inference
- Before vs after comparison
- Hugging Face upload
r = 16
lora_alpha = 32
lora_dropout = 0.05
load_in_4bit = True
use_dora = TrueThe fine-tuned model produced:
- More domain-aware responses
- Better healthcare terminology understanding
- Improved instruction-following
- More reliable outputs compared to the base model
https://huggingface.co/Dhanushkumaramk/healthcare-qwen2.5-0.5B-dora
This project was trained on a small GPU using:
- 4-bit quantization
- Parameter-efficient fine-tuning
- Lightweight adapters
No enterprise hardware required.
This project demonstrates:
- Practical LLM fine-tuning
- Memory-efficient training
- Adapter-based optimization
- Domain adaptation
- Real-world AI engineering workflows
- Larger healthcare dataset
- RAG integration
- Evaluation benchmarks
- Multi-domain fine-tuning
- Quantized inference deployment
Dhanush Kumar
https://github.com/dhanushkumar-amk
https://huggingface.co/Dhanushkumaramk
Star the repository and share it with others learning AI engineering and LLM fine-tuning.