Downloads · 30 days
29
7% of all-time downloads
che111/AlphaMed-8B-instruct-rl
AlphaMed-8B-instruct-rl is a machine learning model from che111. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
This is the official model checkpoint for the paper: AlphaMed: Incentivizing Medical Reasoning with minimalist Rule-Based RL AlphaMed is a medical large language model trained without supervised fine-tuning on chain-o…
Downloads · 30 days
29
7% of all-time downloads
All-time downloads
434
Public
Parameters
8B
64.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors32.1 GB · 100%
From the Hugging Face model README
This is the official model checkpoint for the paper:
AlphaMed: Incentivizing Medical Reasoning with minimalist Rule-Based RL
AlphaMed is a medical large language model trained without supervised fine-tuning on chain-of-thought (CoT) data,
relying solely on reinforcement learning to elicit step-by-step reasoning in complex medical tasks.
To use the model, format your input prompt as:
Question: [your medical question here]
Please reason step by step, and put the final answer in \boxed{}
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
# Load model and tokenizer
model_id = "che111/AlphaMed-3B-instruct-rl" # Replace with actual repo path
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
# Format question
prompt = (
"Question: A 45-year-old patient presents with chest pain radiating to the left arm and elevated troponin levels. "
"What is the most likely diagnosis?\n"
"Please reason step by step, and put the final answer in \\boxed{}"
)
# Generate output
max_new_tokens=8196
output = pipe(prompt, max_new_tokens=max_new_tokens, do_sample=False)[0]["generated_text"]
print(output)