LLaMA-3-8B-TP

This model is fine-tuned from Meta-Llama-3-8B-Instruct by using TrialPanorama dataset for clinical trials.

Model Details

  • Base Model: Meta-Llama-3-8B-Instruct
  • Fine-tuning Method: Two-stage training
    • Stage 1: Supervised Fine-Tuning (SFT) for knowledge injection
    • Stage 2: RLVR (Reinforcement Learning with Verifiable Reward)

Usage

Basic Usage with Transformers

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

# Load model and tokenizer
model_name = "TrialPanorama/LLaMA-3-8B-TP"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=torch.bfloat16,
    device_map="auto"
)

# Prepare input (a toy example)
prompt = """Given the following clinical trial information, estimate the required sample size:

[Input Information]

Please provide the estimated sample size and reasoning."""

# Generate response
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    temperature=0.6,
    top_p=0.95,
    do_sample=True
)

response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)

Usage with vLLM (Recommended for Production)

from vllm import LLM, SamplingParams

# Initialize vLLM
llm = LLM(
    model="TrialPanorama/LLaMA-3-8B-TP",
    tensor_parallel_size=1,
    dtype="bfloat16"
)

# Set sampling parameters
sampling_params = SamplingParams(
    temperature=0.6,
    top_p=0.95,
    max_tokens=512
)

# Generate
prompts = ["Your sample size estimation prompt here"]
outputs = llm.generate(prompts, sampling_params)

for output in outputs:
    print(output.outputs[0].text)

Citation

If you use this model in your research, please cite:

@article{wang2025trialpanorama,
  title     = {Developing Large Language Models for Clinical Research Using One Million Clinical Trials},
  author    = {Wang, Zifeng and Lin, Jiacheng and Jin, Qiao and Gao, Junyi and Pradeepkumar, Jathurshan and Jiang, Pengcheng and Lu, Zhiyong and Sun, Jimeng},
  journal   = {arXiv preprint arXiv:2505.16097},
  year      = {2025},
  url       = {https://arxiv.org/abs/2505.16097}
}
Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for TrialPanorama/LLaMA-3-8B-TP

Finetuned
(475)
this model