Downloads · 30 days
0
Pharmamapllm/MedLLaMA3-DDI-QLoRA-V1
MedLLaMA3-DDI-QLoRA-V1 is a machine learning model from Pharmamapllm. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
PharmaMap-LLM: A QLoRA Fine-Tuned MedLLaMA-3 Model for Drug-Drug Interaction (DDI) Prediction
Downloads · 30 days
0
Access
Public
Updated Nov 3, 2025
Repo size
101 MB
Likes
0
Public
Click a slice to open those files.
.safetensors83.9 MB · 83%
From the Hugging Face model README
PharmaMap-LLM: A QLoRA Fine-Tuned MedLLaMA-3 Model for Drug-Drug Interaction (DDI) Prediction
This model is part of the MSc research project PharmaMap-LLM, developed to enable memory-efficient biomedical relation extraction using instruction-tuned Large Language Models (LLMs). It fine-tunes johnsnowlabs/JSL-MedLlama-3-8B-v2.0 using QLoRA on DrugBank-based datasets for DDI classification and reasoning.
johnsnowlabs/JSL-MedLlama-3-8B-v2.0from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
# Load base + LoRA adapter
base_model = AutoModelForCausalLM.from_pretrained("johnsnowlabs/JSL-MedLlama-3-8B-v2.0", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("Pharmamapllm/MedLLaMA3-DDI-QLoRA-V1")
model = PeftModel.from_pretrained(base_model, "Pharmamapllm/MedLLaMA3-DDI-QLoRA-V1")
prompt = """Drug1: Ranolazine
SMILES for drug1: COC1=CC=CC=C1OCC(O)CN1CCN(CC(=O)NC2=C(C)C=CC=C2C)CC1
Organism targeted by drug1: Unknown
Genes targeted by drug1: P00747, P35498, Q14500, Q13936, P35348, P08588
Drug2: Capreomycin
SMILES for drug2: ...
Organism targeted by drug2: Unknown
Genes targeted by drug2: P9WJ63
CLASSIFICATION:"""
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=150)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
| Metric | Value |
|---|---|
| F1-Score (DDI 2013) | 0.87 |
| Precision | 0.89 |
| Recall | 0.85 |
| Instruction-following | 91% |
| Latent clustering (UMAP) | ✅ Well-separated classes |
| Arcee LLM-as-Judge score | High agreement |
"CLASSIFICATION:" triggers generation| Setting | Value |
|---|---|
| Method | QLoRA + PEFT (LoRA) |
| LoRA Rank | 8 |
| LoRA Dropout | 0.05 |
| Learning Rate | 1e-5 |
| Epochs | 3 |
| Batch Size | 15 (with grad acc: 2) |
| Quantization | 4-bit (nf4, double quant) |
| Device | Colab A100 (16-bit bfloat) |
adapter_model.safetensors — LoRA adapter weightsadapter_config.json — PEFT adapter configurationtokenizer.model, tokenizer_config.json — Tokenizer filesspecial_tokens_map.json — Special token mappingREADME.md — This file!@misc{raveendran2025pharmamap,
title={PharmaMap-LLM: Fine-tuning Large Language Models for Drug-Drug Interaction (DDI) Analysis},
author={Raveendran, Kithusshand},
year={2025},
institution={University of Westminster, Informatics Institute of Technology},
howpublished={\url{https://huggingface.co/Pharmamapllm/MedLLaMA3-DDI-QLoRA-V1}}
}
Kithusshand Raveendran
MSc in Advanced Software Engineering
University of Westminster / Informatics Institute of Technology
🔗 LinkedIn Profile
This model is for research and educational purposes only. It is not approved for clinical use. Always consult licensed medical professionals before using automated predictions for any real-world treatment.
johnsnowlabs/JSL-MedLlama-3-8B-v2.0