Qwen3-4B MedQuAD QLoRA v2
This repository contains the v2 QLoRA adapter fine-tuned from Qwen/Qwen3-4B for medical question answering using the MedQuAD dataset.
This version expands the training set from 96 examples in v1 to 2,000 examples and evaluates the resulting model on 98 held-out examples.
Research/educational model only. This model is not intended for clinical use, diagnosis, or treatment decisions.
Model Overview
- Base model:
Qwen/Qwen3-4B
- Method: QLoRA / Supervised Fine-Tuning
- Domain: Medical Question Answering
- Dataset:
Hmehdi515/MedQuad
- Training examples: 2,000
- Evaluation examples: 98
- Training epochs: 2
- Training loss: 0.8522
- Average Token-F1: 41.93
- Hardware: NVIDIA Tesla T4 (~15 GB VRAM)
This repository contains a LoRA adapter, not a fully merged copy of Qwen3-4B.
What Changed From v1?
The first experiment used only 96 training examples.
v2 increases the training data while keeping the core QLoRA configuration largely unchanged.
| Version | Training Examples | Evaluation Examples | Training Loss | Token-F1 |
|---|
| v1 | 96 | 8 | ~1.72 | 28.20 |
| v2 | 2,000 | 98 | 0.8522 | 41.93 |
Important: The v1 and v2 Token-F1 scores were calculated on evaluation sets of different sizes, so they should not be interpreted as a strict head-to-head benchmark.
A future evaluation should compare the base model, v1, and v2 on the exact same held-out examples.
Dataset
The experiment uses:
Hmehdi515/MedQuad
The original dataset contains medical questions and reference answers.
For v2, the training split was shuffled with a fixed seed before selecting examples.
Examples were retained when:
- the question was non-empty
- the answer contained approximately 20 to 160 words
After filtering and sampling:
- Training: 2,000 examples
- Evaluation: 98 examples
Prompt Format
Training examples were converted to the Qwen3 chat format:
1SYSTEM:
2Answer the medical question accurately and directly.
3Focus specifically on what the question asks.
4Do not invent facts, statistics, symptoms, treatments,
5or inheritance patterns.
6If you are uncertain, say that you are uncertain rather
7than guessing.
8
9USER:
10<medical question>
11
12ASSISTANT:
13<reference answer>