kiranr commited on
Commit
2127d5a
·
verified ·
1 Parent(s): 87ce09a

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +102 -233
README.md CHANGED
@@ -1,7 +1,5 @@
1
  ---
2
- language:
3
- - en
4
- license: other
5
  tags:
6
  - instruct
7
  - finetune
@@ -14,291 +12,162 @@ tags:
14
  - lifescience
15
  - Pharmaceutical
16
  - Pharma
17
- base_model: Writer/Palmyra-x-004
 
 
 
18
  license_name: writer-open-model-license
19
  license_link: https://writer.com/legal/open-model-license/
 
 
20
  widget:
21
- - example_title: Palmyra-Med-70B
22
  messages:
23
  - role: system
24
- content: You are a highly knowledgeable and experienced expert in the healthcare
25
- and biomedical field, possessing extensive medical knowledge and practical expertise.
26
  - role: user
27
- content: Does danzhi Xiaoyao San ameliorate depressive-like behavior by shifting
28
- toward serotonin via the downregulation of hippocampal indoleamine 2,3-dioxygenase?
29
  output:
30
- text: Danzhi Xiaoyao San (DXS) exhibited significant antidepressant-like effects
31
- in rats subjected to chronic unpredictable mild stress (CUMS), a commonly used
32
- model for inducing depressive-like behavior. The administration of DXS led to
33
- a notable reduction in the activity of indoleamine 2,3-dioxygenase (IDO) in
34
- the hippocampus. This reduction in IDO activity is crucial because IDO is an
35
- enzyme that catalyzes the degradation of tryptophan into kynurenine (Kyn), thereby
36
- diverting tryptophan away from the serotonin (5-HT) synthesis pathway. By downregulating
37
- IDO, DXS effectively shifts the balance of tryptophan metabolism towards increased
38
- serotonin production, thereby enhancing the availability of serotonin. This
39
- shift in the Kyn/5-HT pathway favoring serotonin is likely a key mechanism underlying
40
- the antidepressant effects observed with DXS treatment. Enhanced serotonin levels
41
- in the hippocampus are associated with improved mood and reduction of depressive
42
- symptoms, suggesting that DXS could be a promising therapeutic agent for managing
43
- depression.
44
- model-index:
45
- - name: Palmyra-Med-70B
46
- results: []
47
  ---
48
 
49
 
50
-
51
  <div align="center">
52
-
53
  <h1>Palmyra-Med, a powerful LLM designed for healthcare</h1>
54
  </div>
55
 
56
  ## Model Details
57
 
58
- Palmyra-Med is a model built by Writer specifically to meet the needs of the healthcare industry. The leading LLM on biomedical benchmarks, with an average score of 85.87%, outperforming GPT-4, claude Opus, Gemini and Med-PaLM-2 base model and a medically trained human test-taker.
 
59
 
60
 
61
  #### Specialized for Biomedical Applications
62
- Palmyra-Med-70B is meticulously designed to meet the unique linguistic and knowledge demands of the medical and life sciences sectors. It has been fine-tuned on an extensive collection of high-quality biomedical data, ensuring it can comprehend and generate text with precise domain-specific accuracy and fluency.
63
 
 
64
 
65
- - **Policy Optimization**: [Direct Preference Optimization: Your Language Model is Secretly a Reward Model (DPO)](https://arxiv.org/abs/2305.18290)
66
  - **Fine-tuning dataset**: Custom Medical Instruct dataset (Writer in-house build)
67
 
68
-
69
  ### Model Description
70
 
71
  - **Developed by:** Writer
72
  - **Model type:** Llama
73
  - **Language(s) (NLP):** English
74
- - **License:** Writer
75
  - **Finetuned from model:** Palmyra-X-004
 
76
 
77
 
78
  ## Intended Use
79
 
80
- **Intended Use Cases** Palmyra-X-Med is intended for commercial and research use in English. Instruction tuned models are intended for assistant-like chat, whereas pretrained models can be adapted for a variety of natural language generation tasks.
81
 
82
  **Out-of-scope** Use in any manner that violates applicable laws or regulations (including trade compliance laws). Use in any other way that is prohibited by the Acceptable Use Policy and Writer Open source License. Use in languages other than English**.
83
 
84
- **Note: Developers may fine-tune Palmyra-X-Med models for languages beyond English provided they comply with the Writer Open source License and the Acceptable Use Policy.
85
 
86
 
87
  ### Use with transformers
88
 
89
- You can run conversational inference using the Transformers pipeline abstraction, or by leveraging the Auto classes with the `generate()` function. Let's see examples of both.
90
 
91
 
92
- ```
93
- import transformers
94
  import torch
 
 
 
95
 
96
- model_id = "Writer/Palmyra-Med-70B"
97
 
98
- pipeline = transformers.pipeline(
99
- "text-generation",
100
- model=model_id,
101
- model_kwargs={"torch_dtype": torch.bfloat16},
102
- device="auto",
103
  )
104
 
105
  messages = [
106
- {"role": "system", "content": "You are a highly knowledgeable and experienced expert in the healthcare and biomedical field, possessing extensive medical knowledge and practical expertise."},
107
- {"role": "user", "content": "Does danzhi Xiaoyao San ameliorate depressive-like behavior by shifting toward serotonin via the downregulation of hippocampal indoleamine 2,3-dioxygenase?"},
 
 
 
 
 
 
108
  ]
109
 
110
- prompt = pipeline.tokenizer.apply_chat_template(
111
- messages,
112
- tokenize=False,
113
- add_generation_prompt=True
114
  )
115
 
116
- terminators = [
117
- pipeline.tokenizer.eos_token_id,
118
- pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
119
- ]
 
 
120
 
121
- outputs = pipeline(
122
- prompt,
123
- max_new_tokens=256,
124
- eos_token_id=terminators,
125
- do_sample=True,
126
- temperature=0.0,
127
- top_p=0.9,
128
- )
129
- print(outputs[0]["generated_text"][len(prompt):])
130
 
131
 
 
132
 
 
133
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  ```
135
- ### Direct Use
136
-
137
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
138
-
139
-
140
-
141
- ## Bias, Risks, and Limitations
142
-
143
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
144
-
145
- [More Information Needed]
146
-
147
- ### Recommendations
148
-
149
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
150
-
151
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
152
-
153
- ## How to Get Started with the Model
154
-
155
- Use the code below to get started with the model.
156
-
157
- [More Information Needed]
158
-
159
-
160
- ## Evaluation
161
-
162
-
163
- <figure class="table">
164
- <table class="ck-table-resized" style="border-collapse:collapse;font-family:Arial;font-size:10pt;table-layout:fixed;" cellspacing="0" cellpadding="0" dir="ltr" border="1" data-sheets-root="1">
165
- <colgroup>
166
- <col style="width:9.09%;" width="185">
167
- <col style="width:9.09%;" width="100">
168
- <col style="width:9.09%;" width="100">
169
- <col style="width:9.09%;" width="100">
170
- <col style="width:9.09%;" width="100">
171
- <col style="width:9.09%;" width="129">
172
- <col style="width:9.09%;" width="145">
173
- <col style="width:9.09%;" width="100">
174
- <col style="width:9.09%;" width="100">
175
- <col style="width:9.09%;" width="100">
176
- <col style="width:9.1%;" width="100">
177
- </colgroup>
178
- <tbody>
179
- <tr style="height:21px;">
180
- <td style="background-color:#ffffff;overflow:hidden;padding:2px 3px;vertical-align:bottom;">&nbsp;</td>
181
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:center;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Clinical KG&quot;}">Clinical KG</td>
182
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:center;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Medical Genetics&quot;}">Medical Genetics</td>
183
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:center;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Anatomy&quot;}">Anatomy</td>
184
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:center;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Pro Medicine&quot;}">Pro Medicine</td>
185
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:center;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;College Biology&quot;}">College Biology</td>
186
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:center;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;College Medicine&quot;}">College Medicine</td>
187
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:center;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;MedQA 4 opts&quot;}">MedQA 4 opts</td>
188
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:center;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;PubMedQA&quot;}">PubMedQA</td>
189
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:center;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;MedMCQA&quot;}">MedMCQA</td>
190
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:center;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Avg&quot;}">Avg</td>
191
- </tr>
192
- <tr style="height:21px;">
193
- <td style="background-color:#ffffff;font-family:Source Sans Pro;overflow:hidden;padding:2px 3px;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Palmyra-Med-70B&quot;}"><strong>Palmyra-Med-70B</strong></td>
194
- <td style="background-color:#ffffff;font-family:Source Sans Pro;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:90.94}"><strong>90.94</strong></td>
195
- <td style="background-color:#ffffff;font-family:Source Sans Pro;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:94}"><strong>94</strong></td>
196
- <td style="background-color:#ffffff;font-family:Source Sans Pro;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:83.7}"><strong>83.7</strong></td>
197
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:92.65}">92.65</td>
198
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:94.44}">94.44</td>
199
- <td style="background-color:#ffffff;font-family:Source Sans Pro;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:84.39}"><strong>84.39</strong></td>
200
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:78.63}">78.63</td>
201
- <td style="background-color:#ffffff;font-family:Source Sans Pro;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:79.6}"><strong>79.6</strong></td>
202
- <td style="background-color:#ffffff;font-family:Source Sans Pro;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:74.44}"><strong>74.44</strong></td>
203
- <td style="background-color:#ffffff;font-family:Source Sans Pro;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:85.87}"><strong>85.87</strong></td>
204
- </tr>
205
- <tr style="height:21px;">
206
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Med-PaLM-2 (5-shot)&quot;}">Med-PaLM-2 (5-shot)</td>
207
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:88.3}">88.3</td>
208
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:90}">90</td>
209
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:77.8}">77.8</td>
210
- <td style="background-color:#ffffff;font-family:Source Sans Pro;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:95.2}"><strong>95.2</strong></td>
211
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:94.4}">94.4</td>
212
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:80.9}">80.9</td>
213
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:79.7}">79.7</td>
214
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:79.2}">79.2</td>
215
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:71.3}">71.3</td>
216
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:84.08}">84.08</td>
217
- </tr>
218
- <tr style="height:21px;">
219
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;GPT-4&quot;}">GPT-4</td>
220
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:86.04}">86.04</td>
221
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:91}">91</td>
222
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:80}">80</td>
223
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:93.01}">93.01</td>
224
- <td style="background-color:#ffffff;font-family:Source Sans Pro;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:95.14}"><strong>95.14</strong></td>
225
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:76.88}">76.88</td>
226
- <td style="background-color:#ffffff;font-family:Source Sans Pro;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:78.87}"><strong>78.87</strong></td>
227
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:75.2}">75.2</td>
228
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:69.52}">69.52</td>
229
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:82.85}">82.85</td>
230
- </tr>
231
- <tr style="height:21px;">
232
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Med-PaLM-1 (Flan-PaLM, 5-shot)&quot;}">Med-PaLM-1 (Flan-PaLM, 5-shot)</td>
233
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:80.4}">80.4</td>
234
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:75}">75</td>
235
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:63.7}">63.7</td>
236
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:83.8}">83.8</td>
237
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:88.9}">88.9</td>
238
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:76.3}">76.3</td>
239
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:67.6}">67.6</td>
240
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:79}">79</td>
241
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:57.6}">57.6</td>
242
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:74.7}">74.7</td>
243
- </tr>
244
- <tr style="height:21px;">
245
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Gemini&quot;}">Gemini</td>
246
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:76.7}">76.7</td>
247
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:75.8}">75.8</td>
248
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:66.7}">66.7</td>
249
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:77.7}">77.7</td>
250
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:88}">88</td>
251
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:69.2}">69.2</td>
252
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:58}">58</td>
253
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:70.7}">70.7</td>
254
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:54.3}">54.3</td>
255
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:70.79}">70.79</td>
256
- </tr>
257
- <tr style="height:21px;">
258
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;GPT-3.5 Turbo 1106&quot;}">GPT-3.5 Turbo 1106</td>
259
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:74.71}">74.71</td>
260
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:74}">74</td>
261
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:72.79}">72.79</td>
262
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:72.79}">72.79</td>
263
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:72.91}">72.91</td>
264
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:64.73}">64.73</td>
265
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:57.71}">57.71</td>
266
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:72.66}">72.66</td>
267
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:53.79}">53.79</td>
268
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:66}">66</td>
269
- </tr>
270
- <tr style="height:21px;">
271
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Meditron-70B (Llama)&quot;}">Meditron-70B (Llama)</td>
272
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:66.79}">66.79</td>
273
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:69}">69</td>
274
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:53.33}">53.33</td>
275
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:71.69}">71.69</td>
276
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:76.38}">76.38</td>
277
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:63}">63</td>
278
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:57.1}">57.1</td>
279
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:76.6}">76.6</td>
280
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:46.85}">46.85</td>
281
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:64.52}">64.52</td>
282
- </tr>
283
- <tr style="height:21px;">
284
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:2,&quot;2&quot;:&quot;Mistral-7B-v0.1&quot;}">Mistral-7B-v0.1</td>
285
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:68.68}">68.68</td>
286
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:71}">71</td>
287
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:55.56}">55.56</td>
288
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:68.38}">68.38</td>
289
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:68.06}">68.06</td>
290
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:59.54}">59.54</td>
291
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:50.82}">50.82</td>
292
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:75.4}">75.4</td>
293
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:48.2}">48.2</td>
294
- <td style="background-color:#ffffff;font-family:Source Sans Pro;font-weight:normal;overflow:hidden;padding:2px 3px;text-align:right;vertical-align:bottom;" data-sheets-value="{&quot;1&quot;:3,&quot;3&quot;:62.85}">62.85</td>
295
- </tr>
296
- </tbody>
297
- </table>
298
- </figure>`
299
-
300
-
301
-
302
- ### Results
303
-
304
- [More Information Needed]
 
1
  ---
2
+ base_model: Writer/Palmyra-x-004
 
 
3
  tags:
4
  - instruct
5
  - finetune
 
12
  - lifescience
13
  - Pharmaceutical
14
  - Pharma
15
+ model-index:
16
+ - name: Palmyra-Med-70B-32k
17
+ results: []
18
+ license: other
19
  license_name: writer-open-model-license
20
  license_link: https://writer.com/legal/open-model-license/
21
+ language:
22
+ - en
23
  widget:
24
+ - example_title: Palmyra-Med-70B-32k
25
  messages:
26
  - role: system
27
+ content: >-
28
+ You are a highly knowledgeable and experienced expert in the healthcare and biomedical field, possessing extensive medical knowledge and practical expertise.
29
  - role: user
30
+ content: Does danzhi Xiaoyao San ameliorate depressive-like behavior by shifting toward serotonin via the downregulation of hippocampal indoleamine 2,3-dioxygenase?
 
31
  output:
32
+ text: >-
33
+ Danzhi Xiaoyao San (DXS) exhibited significant antidepressant-like effects in rats subjected to chronic unpredictable mild stress (CUMS), a commonly used model for inducing depressive-like behavior. The administration of DXS led to a notable reduction in the activity of indoleamine 2,3-dioxygenase (IDO) in the hippocampus. This reduction in IDO activity is crucial because IDO is an enzyme that catalyzes the degradation of tryptophan into kynurenine (Kyn), thereby diverting tryptophan away from the serotonin (5-HT) synthesis pathway. By downregulating IDO, DXS effectively shifts the balance of tryptophan metabolism towards increased serotonin production, thereby enhancing the availability of serotonin. This shift in the Kyn/5-HT pathway favoring serotonin is likely a key mechanism underlying the antidepressant effects observed with DXS treatment. Enhanced serotonin levels in the hippocampus are associated with improved mood and reduction of depressive symptoms, suggesting that DXS could be a promising therapeutic agent for managing depression.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  ---
35
 
36
 
 
37
  <div align="center">
 
38
  <h1>Palmyra-Med, a powerful LLM designed for healthcare</h1>
39
  </div>
40
 
41
  ## Model Details
42
 
43
+
44
+ Palmyra-Med-70b-32k, created by Writer, builds upon the foundation of Palmyra-Med-70b and offers an extended context length and meets the needs of the healthcare industry. The leading LLM on biomedical benchmarks, with an average score of 85.87%, outperforming GPT-4, claude Opus, Gemini and Med-PaLM-2 base model and a medically trained human test-taker.
45
 
46
 
47
  #### Specialized for Biomedical Applications
48
+ Palmyra-Med-70B-32k is meticulously designed to meet the unique linguistic and knowledge demands of the medical and life sciences sectors. It has been fine-tuned on an extensive collection of high-quality biomedical data, ensuring it can comprehend and generate text with precise domain-specific accuracy and fluency.
49
 
50
+ Our system integrates the DPO dataset and a well-crafted fine-tuning recipe along with a custom diverse medical instruction dataset, making it highly adept at handling the specific needs of this field. Key components of our training pipeline include:
51
 
52
+ - **Policy Optimization**: Utilizing Direct Preference Optimization to enhance the model's performance. [DPO](https://arxiv.org/abs/2305.18290).
53
  - **Fine-tuning dataset**: Custom Medical Instruct dataset (Writer in-house build)
54
 
 
55
  ### Model Description
56
 
57
  - **Developed by:** Writer
58
  - **Model type:** Llama
59
  - **Language(s) (NLP):** English
60
+ - **License:** Writer License
61
  - **Finetuned from model:** Palmyra-X-004
62
+ - **Context window:** 8192
63
 
64
 
65
  ## Intended Use
66
 
67
+ **Intended Use Cases** Palmyra-Med-70B-32k is intended for commercial and research use in English. Instruction tuned models are intended for assistant-like chat, whereas pretrained models can be adapted for a variety of natural language generation tasks.
68
 
69
  **Out-of-scope** Use in any manner that violates applicable laws or regulations (including trade compliance laws). Use in any other way that is prohibited by the Acceptable Use Policy and Writer Open source License. Use in languages other than English**.
70
 
71
+ **Note:** Developers may fine-tune Palmyra-Med-70B-32k models for languages beyond English provided they comply with the Writer Open source License and the Acceptable Use Policy.
72
 
73
 
74
  ### Use with transformers
75
 
76
+ You can run conversational inference using the Transformers Auto classes with the `generate()` function. Let's see an example.
77
 
78
 
79
+ ```py
 
80
  import torch
81
+ from transformers import AutoTokenizer, AutoModelForCausalLM
82
+
83
+ model_id = "Writer/Palmyra-Med-70B-32k"
84
 
85
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
86
 
87
+ model = AutoModelForCausalLM.from_pretrained(
88
+ model_id,
89
+ torch_dtype=torch.float16,
90
+ device_map="auto",
91
+ attn_implementation="flash_attention_2",
92
  )
93
 
94
  messages = [
95
+ {
96
+ "role": "system",
97
+ "content": "You are a highly knowledgeable and experienced expert in the healthcare and biomedical field, possessing extensive medical knowledge and practical expertise.",
98
+ },
99
+ {
100
+ "role": "user",
101
+ "content": "Does danzhi Xiaoyao San ameliorate depressive-like behavior by shifting toward serotonin via the downregulation of hippocampal indoleamine 2,3-dioxygenase?",
102
+ },
103
  ]
104
 
105
+ input_ids = tokenizer.apply_chat_template(
106
+ messages, tokenize=True, add_generation_prompt=True, return_tensors="pt"
 
 
107
  )
108
 
109
+ gen_conf = {
110
+ "max_new_tokens": 256,
111
+ "eos_token_id": [tokenizer.eos_token_id, tokenizer.convert_tokens_to_ids("<|eot_id|>")],
112
+ "temperature": 0.0,
113
+ "top_p": 0.9,
114
+ }
115
 
116
+ with torch.inference_mode():
117
+ output_id = model.generate(input_ids, **gen_conf)
118
+
119
+ output_text = tokenizer.decode(output_id[0][input_ids.shape[1] :])
120
+
121
+ print(output_text)
122
+ ```
 
 
123
 
124
 
125
+ ## Evaluation Results
126
 
127
+ Palmyra-Med-70B-32k outperforms larger models like GPT-4, Gemini and Med-PaLM-1 across 9 diverse biomedical datasets, achieving state-of-the-art results with an average score of 85.9% despite having fewer parameters. Its strong performance in tasks like Clinical KG, Medical Genetics, and PubMedQA underscores its effective grasp of biomedical knowledge.
128
 
129
+
130
+ ### Performance on Biomedical Benchmarks
131
+
132
+ ![Palmyra-Med-70B-32k Performance](img/med_models_chart_32k.png)
133
+
134
+ ![Palmyra-Med-70B-32k Performance Heat Map](img/med_models_heatmap_32k.png)
135
+
136
+
137
+ we ran the needle-in-haystack for Palmyra-Med-70B-32k and the results are as follows:
138
+
139
+ ![Palmyra-Med-70B-32k Performance NIH](img/nih_results_of_palmyra_med_70b_32k.png)
140
+
141
+ Following its evaluation on NIH, the Palmyra-Med-70B-32k model achieved almost perfect scores, highlighting its robust capability in efficiently processing extensive medical documents.
142
+
143
+
144
+ ### Medical Use Cases
145
+
146
+ Palmyra-Med-70B-32k excels in analyzing and summarizing complex clinical notes, EHR data, and discharge summaries, extracting key information to generate concise, structured summaries. It can answer a wide range of medical questions and perform advanced clinical entity recognition, identifying key medical concepts such as diseases, symptoms, medications, procedures, and anatomical structures from unstructured text.
147
+
148
+ By leveraging its deep understanding of medical terminology, the model enhances information retrieval, data analysis, and knowledge discovery from EHRs, research articles, and other biomedical sources. These capabilities support applications like clinical decision support, pharmacovigilance, and medical research.
149
+
150
+
151
+ ### Bias, Risks, and Limitations
152
+
153
+ Palmyra-Med-70B-32k, despite leveraging high-quality data, may contain inaccuracies, biases, or misalignments and has not been rigorously evaluated in clinical trials or real-world healthcare settings. It is advised not to use the model for direct patient care, clinical decision support, or professional medical purposes. Instead, its use should be confined to research by qualified individuals who understand its limitations. Palmyra-Med-70B-32k should not replace professional medical judgment, and adapting it for medical use would require extensive additional work, including thorough testing, guideline alignment, bias mitigation, human oversight, and regulatory compliance. Always consult a qualified healthcare provider for personal medical needs.
154
+
155
+
156
+ ### Citation and Related Information
157
+
158
+ To cite this model:
159
+
160
+ ```
161
+ @misc{Palmyra-Med-70B,
162
+ author = {Writer Engineering team},
163
+ title = {{Palmyra-Med-70B: A powerful LLM designed for healthcare}},
164
+ howpublished = {\url{https://dev.writer.com}},
165
+ year = 2023,
166
+ month = March
167
+ }
168
  ```
169
+
170
+ Contact
171
+ Hello@writer.com
172
+
173
+