reyanshgupta/qwen-3.5-4b-primaryhealthcare-csci566
Model Card for Qwen 3.5 4B — Primary Healthcare Fine-tune
Fine-tuned version of unsloth/Qwen3.5-4B on a large medical QA dataset for primary healthcare, developed as part of the CSCI 566 (Deep Learning) course project at USC.
Model Details
Model Description
This model is a LoRA fine-tune of Qwen3.5-4B, trained on ~146K medical multiple-choice QA examples to improve performance on clinical reasoning tasks relevant to primary healthcare. Both LoRA adapter weights and quantized GGUF files are provided.
- Model type: Causal Language Model (LoRA fine-tune)
- Language(s) (NLP): English
- License: Apache 2.0
- Finetuned from model: unsloth/Qwen3.5-4B
Uses
Direct Use
Answer medical multiple-choice questions and provide evidence-based clinical reasoning for primary healthcare queries.
Downstream Use
Can be further fine-tuned or used as a backbone for medical decision-support tools, clinical education assistants, or healthcare chatbots.
Out-of-Scope Use
This model is not intended for direct clinical diagnosis or as a replacement for qualified medical professionals. It should not be used for emergency medical advice or high-stakes clinical decisions without human oversight.
Bias, Risks, and Limitations
- The model may produce plausible-sounding but incorrect medical information.
- Performance may degrade on rare conditions, non-English queries, or highly specialized subspecialties.
Recommendations
Always consult a qualified healthcare professional for personal medical advice. Outputs from this model should be treated as informational only and verified against authoritative clinical sources.
How to Get Started with the Model
With LoRA adapter (Transformers + PEFT)
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained("unsloth/Qwen3.5-4B")
tokenizer = AutoTokenizer.from_pretrained("reyanshgupta/qwen-3.5-4b-primaryhealthcare-csci566", subfolder="adapter")
model = PeftModel.from_pretrained(base_model, "reyanshgupta/qwen-3.5-4b-primaryhealthcare-csci566", subfolder="adapter")With GGUF (llama.cpp / Ollama)
huggingface-cli download reyanshgupta/qwen-3.5-4b-primaryhealthcare-csci566 gguf/qwen-3.5-4b.Q4_K_M.ggufTraining Details
Training Data
~146,354 medical multiple-choice QA examples in ShareGPT chat format, covering a broad range of primary care topics including internal medicine, pharmacology, and clinical reasoning. A validation split of ~5,548 examples was held out during training.
The system prompt used during training:
"You are a knowledgeable medical AI assistant. Provide accurate, evidence-based medical information. Always recommend consulting a qualified healthcare professional for personal medical advice."
Training Procedure
Training Hyperparameters
- Training regime: bf16 mixed precision
- Fine-tuning method: LoRA via Unsloth + TRL SFTTrainer
- LoRA rank (r): 32
- LoRA alpha: 64
- LoRA dropout: 0.0
- RSLoRA: Yes
- Target modules: qproj, kproj, vproj, oproj, gateproj, upproj, down_proj
- Max sequence length: 800
- Per-device batch size: 4
- Gradient accumulation steps: 8 (effective batch size: 32)
- Learning rate: 2e-4
- Warmup steps: 400
- Weight decay: 0.01
- Epochs: 1
- Optimizer: AdamW
Evaluation
Testing Data, Factors & Metrics
Testing Data
Held-out validation split (~5,548 examples) from the same medical QA distribution as training data, plus standard medical benchmarks (MedQA, MedMCQA).
Metrics
- Accuracy on multiple-choice medical QA benchmarks
Results
Summary
Qwen3.5-4B is the strongest base model in the comparison, achieving the highest scores across all benchmarks. Fine-tuning led to modest decreases on most benchmarks, with the exception of HEADQA where performance marginally improved. The strong base performance suggests the model already has substantial medical knowledge; the drop after fine-tuning is likely due to the narrow training distribution over a single epoch. HEADQA improvement indicates the fine-tune did reinforce some relevant clinical reasoning patterns.
Technical Specifications
Model Architecture and Objective
Decoder-only transformer (Qwen3.5-4B) with LoRA adapters applied to attention and MLP projection layers. Trained with next-token prediction (SFT) on chat-formatted medical QA data.
Compute Infrastructure
Hardware
NVIDIA RTX 5090 GPU: 24GB (CUDA 12.8)
Software
- Python 3.13
- Unsloth
- TRL (SFTTrainer)
- PEFT
- Transformers
<!-- ## Citation
If you use this model, please cite:
BibTeX:
@misc{gupta2026qwen35healthcare,
author = {Reyansh Gupta},
title = {Qwen 3.5 4B Fine-tuned for Primary Healthcare},
year = {2026},
url = {https://huggingface.co/reyanshgupta/qwen-3.5-4b-primaryhealthcare-csci566}
}Model Card Authors
Reyansh Gupta — USC CSCI 566
Model Card Contact
reyanshg@usc.edu
