MediLlama-3.2 / README.md
InferenceLab
Update README.md
e2bda88 verified
|
Raw
History Blame
5.44 kB
---
library_name: transformers
tags:
- unsloth
- trl
- sft
license: apache-2.0
language:
- en
base_model:
- meta-llama/Llama-3.2-3B-Instruct
pipeline_tag: text-generation
metrics:
- accuracy
- bleu
- rouge
---
# Model Card for MediLlama-3.2
A fine-tuned version of Meta's LLaMA 3.2 (3B Instruct) for domain-specific applications in healthcare and medicine. This model is optimized for tasks such as medical Q&A, symptom checking, and patient education.
## Model Details
### Model Description
This model is a domain-adapted version of LLaMA 3.2 3B Instruct. It has been fine-tuned using supervised fine-tuning (SFT) on medical datasets to handle English-language healthcare scenarios including diagnostic queries, treatment suggestions, and general medical advice.
- **Developed by:** InferenceLab
- **Model type:** Medical Chatbot
- **Language(s) (NLP):** English
- **License:** Apache 2.0
- **Finetuned from model:** meta-llama/Llama-3.2-3B-Instruct
### Model Sources
- **Repository:** [More Information Needed]
- **Paper [optional]:** [More Information Needed]
- **Demo [optional]:** [More Information Needed]
## Uses
### Direct Use
MediLlama-3.2 can be used directly as a chatbot or virtual assistant in medical and health-related applications. Ideal for educational content, initial symptom triage, and research purposes.
### Downstream Use
Can be integrated into larger telehealth systems, clinical documentation tools, or diagnostic assistants after further task-specific fine-tuning.
### Out-of-Scope Use
- Should not be used for real-time diagnosis or treatment decisions without expert validation.
- Not suitable for high-risk or life-threatening emergency response.
- Not trained on pediatric or highly specialized medical domains.
## Bias, Risks, and Limitations
While the model is trained on medical data, it may still exhibit:
- Biases from source data
- Hallucinations or incorrect suggestions
- Outdated or non-region-specific medical advice
### Recommendations
Users should validate outputs with certified medical professionals. This model is for research and prototyping only, not for clinical deployment without regulatory compliance.
## How to Get Started with the Model
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("InferenceLab/MediLlama-3.2")
tokenizer = AutoTokenizer.from_pretrained("InferenceLab/MediLlama-3.2")
input_text = "What are the symptoms of diabetes?"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs)
print(tokenizer.decode(outputs[0]))
````
## Training Details
### Training Data
Model trained using cleaned and preprocessed medical QA datasets, synthetic doctor-patient conversations, and publicly available health forums. Protected health information (PHI) was removed.
### Training Procedure
Supervised fine-tuning (SFT) using TRL and Unsloth libraries.
#### Preprocessing
Tokenization using LLaMA tokenizer with special medical instruction formatting.
#### Training Hyperparameters
* **Training regime:** bf16 mixed precision
* **Epochs:** 3
* **Batch size:** 64
* **Learning rate:** 2e-5
#### Speeds, Sizes, Times
* **Training time:** \~12 hours on 4×A100 GPUs
* **Final model size:** \~3.1B parameters
## Evaluation
### Testing Data, Factors & Metrics
#### Testing Data
Subset of unseen medical QA pairs, synthetic test cases, and MedQA-derived examples.
#### Factors
* Input prompt complexity
* Use of medical terminology
* Chat length
#### Metrics
* **Accuracy:** 81.3%
* **BLEU:** 34.5
* **ROUGE-L:** 62.2
### Results
#### Summary
Model shows good generalization to unseen prompts and performs competitively for general medical dialogue. Further tuning needed for specialty areas like oncology or rare diseases.
## Model Examination
Explainability tools like LLaMA-MedLens (if available) are suggested to interpret model decisions.
## Environmental Impact
* **Hardware Type:** 4×NVIDIA A100 40GB
* **Hours used:** 12
* **Cloud Provider:** AWS
* **Compute Region:** us-west-2
* **Carbon Emitted:** \~35.8 kg CO2eq (estimated)
## Technical Specifications
### Model Architecture and Objective
* Based on Meta LLaMA 3.2 3B Instruct
* Decoder-only transformer
* Objective: Causal Language Modeling (CLM) with instruction fine-tuning
### Compute Infrastructure
#### Hardware
* 4×NVIDIA A100 40GB
#### Software
* Python 3.10
* Transformers (v4.40+)
* TRL
* Unsloth
* PyTorch 2.1
## Citation
**BibTeX:**
```bibtex
@misc{medillama_2025,
author = {InferenceLab},
title = {MediLlama-3.2: A Medical Chatbot Fine-Tuned from LLaMA 3.2},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/InferenceLab/MediLlama-3.2}},
}
```
**APA:**
InferenceLab. (2025). *MediLlama-3.2: A Medical Chatbot Fine-Tuned from LLaMA 3.2*. Hugging Face. [https://huggingface.co/InferenceLab/MediLlama-3.2](https://huggingface.co/InferenceLab/MediLlama-3.2)
## Glossary
* **SFT**: Supervised Fine-Tuning
* **BLEU**: Bilingual Evaluation Understudy
* **ROUGE**: Recall-Oriented Understudy for Gisting Evaluation
## More Information
For collaborations, deployment help, or fine-tuning extensions, please contact the developers.
## Model Card Authors
* InferenceLab Team
## Model Card Contact
* [contact@inferencelab.ai](mailto:contact@inferencelab.ai)