An experimental clinical question-answering project that fine-tunes
meta-llama/Llama-3.2-3B-Instruct on MedQuAD using Unsloth and Low-Rank
Adaptation (LoRA).
This repository is a research demonstration. It must not be used for diagnosis, treatment, clinical decision-making, or as a substitute for advice from a qualified healthcare professional. Model outputs may be inaccurate, incomplete, outdated, or harmful.
The included ROUGE-L and METEOR evaluations measure lexical overlap. They do not establish medical correctness, factual grounding, safety, fairness, or clinical utility.
general_clinical_LLM.ipynb— dataset preparation, LoRA fine-tuning, baseline and fine-tuned evaluation, adapter export, and a sample inference.finetune_requirements3.txt— pinned Python dependencies used by the notebook.
-
Create and activate a Python 3.11 environment.
-
Install the dependencies:
python -m pip install -r finetune_requirements3.txt
-
Accept the applicable terms and request access to
meta-llama/Llama-3.2-3B-Instruct. -
Configure any authentication required by Hugging Face and Kaggle without placing access tokens in the notebook or repository.
-
Open
general_clinical_LLM.ipynband run its cells in order.
The notebook downloads MedQuAD and the base model. It creates local training outputs, a LoRA adapter directory, and a ZIP archive. These generated artifacts are intentionally excluded from version control.
The notebook downloads the Kaggle mirror
pythonafroz/medquad-medical-question-answer-for-ai-research.
MedQuAD was created from medical question-answer pairs collected from NIH
websites. Refer to the
abachaa/MedQuAD repository for the
original dataset, license information, and source documentation.
If you use MedQuAD, cite:
Asma Ben Abacha and Dina Demner-Fushman. 2019. A Question-Entailment Approach to Question Answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 3263–3273.
The base model is provided by Meta under the Llama 3.2 Community License. Users are responsible for complying with that license and the associated Acceptable Use Policy. Distribution of Llama materials or derived model weights may trigger additional naming, notice, attribution, and “Built with Llama” requirements.
- Evaluation relies only on ROUGE-L and METEOR lexical-overlap scores.
- The generation limit is token-based and may truncate responses before they reach a natural ending.
- The project does not evaluate clinical factuality, calibration, harmful advice, demographic performance, or real-world safety.
- Results should not be interpreted as suitable for patient-facing or professional clinical use.
Normal execution may create outputs/, wandb/, lora_medquad_model2/,
lora_medquad_model2_reloaded/, and lora_medquad_model2.zip. Do not commit
these artifacts without separately reviewing their size, contents, provenance,
and applicable model-license obligations.