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.gguf

Training 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: q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, 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

Benchmark Base Model Fine-tuned
CareQA 78.53% 72.55%
HEADQA 78.99% 79.03%
MedQA 71.33% 67.32%
MMLU (Medical) 82.60% 78.41%
MMLU-Pro (Medical) 60.76% 56.72%
PubMedQA 74.60% 68.20%

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

Model Card Authors

Reyansh Gupta — USC CSCI 566

Model Card Contact

reyanshg@usc.edu

Downloads last month
27
GGUF
Model size
4B params
Architecture
qwen35
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for reyanshgupta/qwen-3.5-4b-primaryhealthcare-csci566

Finetuned
Qwen/Qwen3.5-4B
Adapter
(164)
this model

Evaluation results