Downloads · 30 days
153
33% of all-time downloads
Moreza009/Llama-DrugReasoner
Llama-DrugReasoner is a text generation model from Moreza009. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
[](https://arxiv.org/abs/2508.18579) [](https://github.com/mohammad-gh009/DrugReasoner)
Downloads · 30 days
153
33% of all-time downloads
All-time downloads
468
Public
Repo size
525 MB
Likes
2
Public
Click a slice to open those files.
.safetensors336 MB · 63%
From the Hugging Face model README
DrugReasoner is an AI-powered system for predicting drug approval outcomes using reasoning-augmented Large Language Models (LLMs) and molecular feature analysis. By combining advanced machine learning with interpretable reasoning, DrugReasoner provides transparent predictions that can accelerate pharmaceutical research and development.
Drug discovery is a complex and resource-intensive process, making early prediction of approval outcomes critical for optimizing research investments. While classical machine learning and deep learning methods have shown promise in drug approval prediction, their limited interpretability constraints their impact. Here, we present DrugReasoner, a reasoning-based large language model (LLM) built on the LLaMA architecture and fine-tuned with group relative policy optimization (GRPO) to predict the likelihood of small-molecule approval. DrugReasoner integrates molecular descriptors with comparative reasoning against structurally similar approved and unapproved compounds, generating predictions alongside step-by-step rationales and confidence scores. DrugReasoner achieved robust performance with an AUC of 0.732 and an F1 score of 0.729 on the validation set and 0.725 and 0.718 on the test set, respectively. These results outperformed conventional baselines, including logistic regression, support vector machine, and k-nearest neighbors and had competitive performance relative to XGBoost. On an external independent dataset, DrugReasoner outperformed both baseline and the recently developed ChemAP model, achieving an AUC of 0.728 and an F1-score of 0.774, while maintaining high precision and balanced sensitivity, demonstrating robustness in real-world scenarios. These findings demonstrate that DrugReasoner not only delivers competitive predictive accuracy but also enhances transparency through its reasoning outputs, thereby addressing a key bottleneck in AI-assisted drug discovery. This study highlights the potential of reasoning-augmented LLMs as interpretable and effective tools for pharmaceutical decision-making.
Clone the repository
git clone https://github.com/mohammad-gh009/DrugReasoner.git
cd DrugReasoner
Create and activate virtual environment
Windows:
cd src
python -m venv myenv
myenv\Scripts\activate
Mac/Linux:
cd src
python -m venv myenv
source myenv/bin/activate
Install dependencies
pip install -r requirements.txt
Login to your Huggingface account You can use this instruction on how to make an account and this on how to get the token
huggingface-cli login --token YOUR_TOKEN_HERE
Note: GPU is required for inference. If unavailable, use our Kaggle Notebook.
python inference.py \
--smiles "CC(C)CC1=CC=C(C=C1)C(C)C(=O)O" "CC1=CC=C(C=C1)C(=O)O" \
--output results.csv \
--top-k 9 \
--top-p 0.9 \
--max-length 4096 \
--temperature 1.0
from inference import DrugReasoner
predictor = DrugReasoner()
results = predictor.predict_molecules(
smiles_list=["CC(C)CC1=CC=C(C=C1)C(C)C(=O)O"],
save_path="results.csv",
print_results=True,
top_k=9,
top_p=0.9,
max_length=4096,
temperature=1.0
)
DrugReasoner demonstrates superior performance compared to traditional baseline models across multiple evaluation metrics. Detailed performance comparisons are available in our paper.
If you use DrugReasoner in your research, please cite our work:
@misc{ghaffarzadehesfahani2025drugreasonerinterpretabledrugapproval,
title={DrugReasoner: Interpretable Drug Approval Prediction with a Reasoning-augmented Language Model},
author={Mohammadreza Ghaffarzadeh-Esfahani and Ali Motahharynia* and Nahid Yousefian and Navid Mazrouei and Jafar Ghaisari and Yousof Gheisari},
year={2025},
eprint={2508.18579},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2508.18579},
}
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.