File size: 8,053 Bytes
6814961 3bead65 7eaae52 3bead65 6814961 5a6ce06 5827056 2ab3710 6814961 2ab3710 3bead65 1109e5b 5827056 6814961 3bead65 6814961 3bead65 6814961 3bead65 6814961 85b6493 6814961 5827056 85b6493 40bcaaf 6814961 5827056 6814961 a74efb0 a011ae9 a74efb0 6814961 a74efb0 e2a7e86 7eaae52 6814961 44201ee 6814961 b67b098 6814961 44201ee 6814961 a011ae9 7eaae52 6814961 7eaae52 6814961 7eaae52 6814961 a74efb0 6814961 7eaae52 6814961 a74efb0 6814961 7eaae52 6814961 a74efb0 6814961 7eaae52 6814961 a74efb0 6814961 7eaae52 6814961 7eaae52 6814961 7eaae52 6814961 7eaae52 6814961 b67b098 44201ee b67b098 44201ee b67b098 44201ee b67b098 44201ee b67b098 44201ee b67b098 44201ee b67b098 44201ee b67b098 44201ee b67b098 44201ee b67b098 44201ee |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
---
library_name: transformers
tags:
- llm
- llama3
- rare disease
license: llama3
language:
- en
pipeline_tag: text-generation
---
## 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. <br>
Utilizing the Evol-Instruct methodology, this model was fine-tuned with a dataset of over 400 rare diseases.
### Model Description
- **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
ReidLM is specifically designed for generating information related to rare diseases and should not be used for the following purposes:
- **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.<br>
- **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. <br>
## Bias, Risks, and Limitations
ReidLM, like all large language models, has inherent biases and limitations that users should be aware of:<br>
- **Ethical Concerns:** There is a risk of over-reliance on AI for medical decisions, which should always be validated by healthcare professionals.<br>
- **Accuracy:** While the model strives for accuracy, it may generate incorrect or incomplete information, especially in highly specialized or novel cases.
## Getting Started with the Model
Use the code below to get started with the model.
## Use with Transformers AutoModelForCausalLM
```
import transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load the pre-trained model and tokenizer
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)
```
<!--## Training Details -->
### Training Data
This link provides the Evol-Instruct question-and-answer dataset
https://raw.githubusercontent.com/M-e-e-n-a/Synthetic-Dataset-Creation/main/combined_dataset.json
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
<!--### Training Procedure -->
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
#### Training Hyperparameters
num_train_epochs=3, <br>
per_device_train_batch_size=4,<br>
gradient_accumulation_steps=2,<br>
optim="paged_adamw_8bit",<br>
save_steps=1000,<br>
logging_steps=30,<br>
learning_rate=2e-4,<br>
weight_decay=0.01,<br>
fp16=True,<br>
max_grad_norm=1.0,<br>
warmup_ratio=0.1<br>
<!-- -->
<!---#### Speeds, Sizes, Times [optional]
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
<!---## Evaluation
<!-- This section describes the evaluation protocols and provides the results. -->
<!---### Testing Data, Factors & Metrics
#### Testing Data
<!-- This should link to a Dataset Card if possible. -->
<!--[More Information Needed] --->
<!---#### Factors
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
<!--[More Information Needed]
<!---#### Metrics
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
<!--[More Information Needed]
<!---### Results
[More Information Needed]
#### Summary
## Model Examination [optional]
<!-- Relevant interpretability work for the model goes here -->
<!--[More Information Needed]
<!---## Environmental Impact
Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
- **Hardware Type:** [More Information Needed]
- **Hours used:** [More Information Needed]
- **Cloud Provider:** [More Information Needed]
- **Compute Region:** [More Information Needed]
- **Carbon Emitted:** [More Information Needed]
## Technical Specifications [optional]
### Model Architecture and Objective
[More Information Needed]
### Compute Infrastructure
[More Information Needed]
#### Hardware
[More Information Needed]
#### Software
[More Information Needed]
## Citation [optional]
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
<!---**BibTeX:**
[More Information Needed]
**APA:**
[More Information Needed]
## Glossary [optional]
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
<!---[More Information Needed]
## More Information [optional]
[More Information Needed]
## Model Card Authors [optional]
[More Information Needed]
## Model Card Contact
[More Information Needed]--->
## Results
## Evaluation Metrics
<table>
<thead>
<tr>
<th>Metrics</th>
<th>Llama-2-7b</th>
<th>Mistral-7b</th>
<th>Mixtral-47B</th>
<th>ReidLM</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center">ROUGE-1</td>
<td align="center">0.3117</td>
<td align="center">0.3188</td>
<td align="center">0.2637</td>
<td align="center">0.3281</td>
</tr>
<tr>
<td align="center">ROUGE-2</td>
<td align="center">0.1867</td>
<td align="center">0.1176</td>
<td align="center">0.1573</td>
<td align="center">0.1270</td>
</tr>
<tr>
<td align="center">ROUGE-L</td>
<td align="center">0.1818</td>
<td align="center">0.1449</td>
<td align="center">0.2637</td>
<td align="center">0.2031</td>
</tr>
<tr>
<td align="center">ROUGE-LSUM</td>
<td align="center">0.1818</td>
<td align="center">0.1449</td>
<td align="center">0.2637</td>
<td align="center">0.2031</td>
</tr>
<tr>
<td align="center">METEOR</td>
<td align="center">0.0693</td>
<td align="center">0.3088</td>
<td align="center">0.4377</td>
<td align="center">0.3662</td>
</tr>
<tr>
<td align="center">BERTScore</td>
<td align="center">0.8262</td>
<td align="center">0.8538</td>
<td align="center">0.9070</td>
<td align="center">0.8782</td>
</tr>
<tr>
<td align="center">G-Eval</td>
<td align="center">0.35</td>
<td align="center">0.42</td>
<td align="center">0.78</td>
<td align="center">0.87</td>
</tr>
<tr>
<td align="center">QAG Score</td>
<td align="center">0.1046</td>
<td align="center">0.2061</td>
<td align="center">0.3762</td>
<td align="center">0.2609</td>
</tr>
</tbody>
</table>
|