Llama3 OpenBioLLM 8B
Model Overview
Model Features
Model Capabilities
Use Cases
đ OpenBioLLM-8B
OpenBioLLM-8B is a state-of-the-art open source biomedical large language model, designed to excel in a wide range of biomedical tasks with high accuracy and fluency.

Advancing Open-source Large Language Models in Medical Domain
Online Demo
|
GitHub
|
Paper
|
Discord
đ Quick Start
OpenBioLLM-8B is an advanced open source language model designed specifically for the biomedical domain. Developed by Saama AI Labs, this model leverages cutting-edge techniques to achieve state-of-the-art performance on a wide range of biomedical tasks.
⨠Features
đĨ Biomedical Specialization
OpenBioLLM-8B is tailored for the unique language and knowledge requirements of the medical and life sciences fields. It was fine-tuned on a vast corpus of high-quality biomedical data, enabling it to understand and generate text with domain-specific accuracy and fluency.
đ Superior Performance
With 8 billion parameters, OpenBioLLM-8B outperforms other open source biomedical language models of similar scale. It has also demonstrated better results compared to larger proprietary & open-source models like GPT-3.5 and Meditron-70B on biomedical benchmarks.
đ§ Advanced Training Techniques
OpenBioLLM-8B builds upon the powerful foundations of the Meta-Llama-3-8B and Meta-Llama-3-8B models. It incorporates the DPO dataset and fine-tuning recipe along with a custom diverse medical instruction dataset. Key components of the training pipeline include:

- Policy Optimization: Direct Preference Optimization: Your Language Model is Secretly a Reward Model (DPO)
- Ranking Dataset: berkeley-nest/Nectar
- Fine-tuning dataset: Custom Medical Instruct dataset (We plan to release a sample training dataset in our upcoming paper; please stay updated)
This combination of cutting-edge techniques enables OpenBioLLM-8B to align with key capabilities and preferences for biomedical applications.
đĻ Installation
The model can be accessed on Hugging Face. Optimized quantized versions are available Here.
đģ Usage Examples
Basic Usage
Important: Please use the exact chat template provided by Llama-3 instruct version. Otherwise there will be a degradation in the performance. The model output can be verbose in rare cases. Please consider setting temperature = 0 to make this happen less.
See the snippet below for usage with Transformers:
import transformers
import torch
model_id = "aaditya/OpenBioLLM-Llama3-8B"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device="auto",
)
messages = [
{"role": "system", "content": "You are an expert and experienced from the healthcare and biomedical domain with extensive medical knowledge and practical experience. Your name is OpenBioLLM, and you were developed by Saama AI Labs. who's willing to help answer the user's query with explanation. In your explanation, leverage your deep medical expertise such as relevant anatomical structures, physiological processes, diagnostic criteria, treatment guidelines, or other pertinent medical concepts. Use precise medical terminology while still aiming to make the explanation clear and accessible to a general audience."},
{"role": "user", "content": "How can i split a 3mg or 4mg waefin pill so i can get a 2.5mg pill?"},
]
prompt = pipeline.tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
terminators = [
pipeline.tokenizer.eos_token_id,
pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
]
outputs = pipeline(
prompt,
max_new_tokens=256,
eos_token_id=terminators,
do_sample=True,
temperature=0.0,
top_p=0.9,
)
print(outputs[0]["generated_text"][len(prompt):])
đ Documentation
âī¸ Release Details
Property | Details |
---|---|
Model Size | 8 billion parameters |
Quantization | Optimized quantized versions available Here |
Language(s) (NLP) | en |
Developed By | Ankit Pal (Aaditya Ura) from Saama AI Labs |
License | Meta-Llama License |
Fine-tuned from models | meta-llama/Meta-Llama-3-8B |
Resources for more information | Paper: Coming soon |
Community & Resources
đĨ Your Daily Dose of Medical AI Breakthroughs đ
We turn hours of the latest research papers into minutes. Get daily tweets and news on the latest medical AI breakthroughs, dataset releases, and benchmark results â all carefully curated to save you time while keeping you informed.
Daily updates on Medical LLMs, datasets & benchmarks |
Daily news on Medical LLMs, datasets & benchmarks |
Video & audio summaries of latest research |
Connect with researchers & discuss latest developments |
Training procedure
Training hyperparameters
Click to see details
- learning_rate: 0.0002
- lr_scheduler: cosine
- train_batch_size: 12
- eval_batch_size: 8
- GPU: H100 80GB SXM5
- num_devices: 1
- optimizer: adamw_bnb_8bit
- lr_scheduler_warmup_steps: 100
- num_epochs: 4
Peft hyperparameters
Click to see details
-
adapter: qlora
-
lora_r: 128
-
lora_alpha: 256
-
lora_dropout: 0.05
-
lora_target_linear: true
-
lora_target_modules:
- q_proj
- v_proj
- k_proj
- o_proj
- gate_proj
- down_proj
- up_proj
Training results
Framework versions
- Transformers 4.39.3
- Pytorch 2.1.2+cu121
- Datasets 2.18.0
- Tokenizers 0.15.1
- Axolotl
- Lm harness for evaluation
đ§ Technical Details
Benchmark Results
đĨ OpenBioLLM-8B demonstrates superior performance compared to larger models, such as GPT-3.5, Meditron-70B across 9 diverse biomedical datasets, achieving state-of-the-art results with an average score of 72.50%, despite having a significantly smaller parameter count. The model's strong performance in domain-specific tasks, such as Clinical KG, Medical Genetics, and PubMedQA, highlights its ability to effectively capture and apply biomedical knowledge.
đ¨ The GPT-4, Med-PaLM-1, and Med-PaLM-2 results are taken from their official papers. Since Med-PaLM doesn't provide zero-shot accuracy, we are using 5-shot accuracy from their paper for comparison. All results presented are in the zero-shot setting, except for Med-PaLM-2 and Med-PaLM-1, which use 5-shot accuracy.
Clinical KG | Medical Genetics | Anatomy | Pro Medicine | College Biology | College Medicine | MedQA 4 opts | PubMedQA | MedMCQA | Avg | |
---|---|---|---|---|---|---|---|---|---|---|
OpenBioLLM-70B | 92.93 | 93.197 | 83.904 | 93.75 | 93.827 |
đ License
The model is under the Meta-Llama License.

