Downloads · 30 days
4
16% of all-time downloads
coffeine/qwen3-4b-medquad-qlora-v1
qwen3-4b-medquad-qlora-v1 is a question answering model from coffeine. Use it when the input is a question plus a passage. It is set up for peft.
This repository contains an experimental QLoRA adapter fine-tuned from Qwen/Qwen3-4B using the MedQuAD medical question-answering dataset.
Downloads · 30 days
4
16% of all-time downloads
All-time downloads
25
Public
Repo size
77.5 MB
Likes
0
Public
Click a slice to open those files.
.safetensors66.1 MB · 85%
From the Hugging Face model README
This repository contains an experimental QLoRA adapter fine-tuned from Qwen/Qwen3-4B using the MedQuAD medical question-answering dataset.
The goal of this project is to explore parameter-efficient fine-tuning of Qwen3-4B for medical question answering using Hugging Face Transformers, PEFT, TRL, and bitsandbytes.
Important: This is an experimental research model. It is not intended for diagnosis, treatment decisions, or clinical use.
This repository contains a LoRA adapter, not a fully merged standalone Qwen3-4B model.
The model was fine-tuned using the MedQuAD dataset:
Dataset: Hmehdi515/MedQuad
For this initial experiment, a small subset of 96 training examples was used.
Training examples were filtered to:
The examples were converted to the Qwen3 chat format using:
Thinking mode was disabled during formatting and generation.
The initial experiment used the following instruction:
Answer the medical question clearly and concisely. When a question requires personal medical advice, recommend consulting a qualified clinician.
| Parameter | Value |
|---|---|
| Base model | Qwen/Qwen3-4B |
| Training examples | 96 |
| Epochs | 2 |
| Learning rate | 2e-4 |
| Batch size | 1 |
| Gradient accumulation | 8 |
| Maximum sequence length | 384 |
| LoRA rank | 8 |
| LoRA alpha | 16 |
| LoRA dropout | 0.05 |
| Quantization | 4-bit NF4 |
| Double quantization | Yes |
| Gradient checkpointing | Yes |
| GPU | NVIDIA Tesla T4 |
The observed average training loss was approximately:
1.72
The fine-tuned adapter was evaluated on 8 examples selected from the MedQuAD validation split.
A token-level F1 score was calculated between the generated answer and the MedQuAD reference answer.
Average Token-F1: 28.2
Individual evaluation results varied significantly.
Some common medical topics produced reasonable answers, while several rare or highly specific conditions resulted in inaccurate or hallucinated information.
For example, the model produced incorrect medical information when answering a question about Singleton-Merten syndrome.
Token-F1 measures lexical overlap between the generated and reference answers.
It does not measure:
Therefore, the Token-F1 score should not be interpreted as evidence that the model is medically reliable.
This adapter is intended for:
This is an early experimental fine-tune trained on only 96 MedQuAD examples.
The model may:
The underlying Qwen3-4B model already contains general medical knowledge. Small-scale fine-tuning does not guarantee that this knowledge becomes more accurate and may potentially degrade performance on some questions.
A direct comparison against the original Qwen3-4B model is planned.
This adapter must not be used as a substitute for a physician or other qualified healthcare professional.
Do not use this model for:
Medical information generated by the model should be independently verified using authoritative medical sources.
Planned experiments include:
Version: v1
This version should be considered a proof-of-concept QLoRA experiment rather than a production medical model.
Current benchmark:
| Model | Token-F1 |
|---|---|
| Qwen3-4B Base | Not tested yet |
| Qwen3-4B + MedQuAD QLoRA v1 | 28.2 |
The base-model benchmark will be added after evaluation on the same validation examples.
This repository is provided for research and educational purposes only.
The model can produce false or misleading medical information.
It is not a medical device and should not be relied upon for diagnosis, treatment, or other healthcare decisions.