đ ReidLM
ReidLM is a fine - tuned LLaMA 3 model optimized for generating high - quality information in the rare disease domain.
đ Quick Start
To start using ReidLM, you can use the following code example:
import transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Tanvi03/ReidLM"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
def generate_text(prompt, max_length=1000):
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(inputs.input_ids, max_length=max_length, num_return_sequences=1)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
prompt = "Explain MEN-1 with respect to how it affects the pituitary gland. What is the other name for this syndrome?"
generated_text = generate_text(prompt)
print(generated_text)
⨠Features
- Domain - Specific Optimization: ReidLM is a fine - tuned version of Meta's LLaMA 3 model, specifically optimized for the rare disease domain.
- High - Quality Output: It can generate high - quality, contextually accurate responses related to rare diseases.
- Educational Use: It can serve as an educational tool for medical students and professionals.
đĻ Installation
No specific installation steps are provided in the original document.
đģ Usage Examples
Basic Usage
import transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Tanvi03/ReidLM"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
def generate_text(prompt, max_length=1000):
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(inputs.input_ids, max_length=max_length, num_return_sequences=1)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
prompt = "Explain MEN-1 with respect to how it affects the pituitary gland. What is the other name for this syndrome?"
generated_text = generate_text(prompt)
print(generated_text)
đ Documentation
Model Details
ReidLM is a fine - tuned version of Meta's LLaMA 3 model, specifically optimized for generating high - quality, contextually accurate responses in the domain of rare diseases. Utilizing the Evol - Instruct methodology, this model was fine - tuned with a dataset of over 400 rare diseases.
Property |
Details |
Developed by |
MSRIT Students |
Model Type |
Transformer - based Large Language Model (LLM) |
Language(s) (NLP) |
English |
License |
Llama 3 Community License Agreement |
Finetuned from model |
Meta - Llama - 3 - 8B - Instruct |
Uses
ReidLM is designed for direct use in generating insightful and reliable information to support healthcare professionals and researchers in diagnosing and managing rare diseases. It can be used as an educational tool for training medical students and professionals about rare diseases.
Out - of - Scope Use
- Non - Medical Domains: ReidLM is optimized for rare disease information and may not perform well in other domains such as finance, law, general health conditions, or any other non - medical fields.
- General Conversational AI: While capable of generating detailed information on rare diseases, ReidLM may not be suitable for general conversational AI tasks that require a broad understanding of various topics.
Bias, Risks, and Limitations
ReidLM, like all large language models, has inherent biases and limitations that users should be aware of:
- Ethical Concerns: There is a risk of over - reliance on AI for medical decisions, which should always be validated by healthcare professionals.
- Accuracy: While the model strives for accuracy, it may generate incorrect or incomplete information, especially in highly specialized or novel cases.
Training Data
The Evol - Instruct question - and - answer dataset can be found at this link:
Evol - Instruct Dataset
Training Hyperparameters
- num_train_epochs = 3
- per_device_train_batch_size = 4
- gradient_accumulation_steps = 2
- optim = "paged_adamw_8bit"
- save_steps = 1000
- logging_steps = 30
- learning_rate = 2e - 4
- weight_decay = 0.01
- fp16 = True
- max_grad_norm = 1.0
- warmup_ratio = 0.1
đ§ Technical Details
Evaluation Metrics
Metrics |
Llama - 2 - 7b |
Mistral - 7b |
Mixtral - 47B |
ReidLM |
ROUGE - 1 |
0.3117 |
0.3188 |
0.2637 |
0.3281 |
ROUGE - 2 |
0.1867 |
0.1176 |
0.1573 |
0.1270 |
ROUGE - L |
0.1818 |
0.1449 |
0.2637 |
0.2031 |
ROUGE - LSUM |
0.1818 |
0.1449 |
0.2637 |
0.2031 |
METEOR |
0.0693 |
0.3088 |
0.4377 |
0.3662 |
BERTScore |
0.8262 |
0.8538 |
0.9070 |
0.8782 |
G - Eval |
0.35 |
0.42 |
0.78 |
0.87 |
QAG Score |
0.1046 |
0.2061 |
0.3762 |
0.2609 |
đ License
The model is licensed under the Llama 3 Community License Agreement.