MedScholar-Reasoning-1.5B

This is a merge of pre‑trained language models created with mergekit.
Purpose: compact model (β‰ˆ1.5B) tuned via model-merging for concise clinical recognition and short, structured rationales.
Disclaimer: Educational use only β€” not a substitute for professional medical judgment or emergency care.


🧬 Models Merged


πŸ”— Merge Details

Merge Method

  • SLERP (spherical linear interpolation).

πŸš€ Inference (Transformers)

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

MODEL = "yasserrmd/MedScholar-Reasoning-1.5B"

tok = AutoTokenizer.from_pretrained(MODEL, use_fast=True)
model = AutoModelForCausalLM.from_pretrained(
    MODEL,
    torch_dtype=(torch.float16 if torch.cuda.is_available() else torch.float32),
    device_map=("auto" if torch.cuda.is_available() else None),
    trust_remote_code=True,
).eval()

if tok.pad_token is None and tok.eos_token is not None:
    tok.pad_token = tok.eos_token

prompt = (
    "System: You are a concise medical reasoning assistant.\n"
    "User: 65-year-old with fever, neck stiffness, photophobia. Initial step?\n"
    "Assistant:"
)

inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(
    **inputs,
    max_new_tokens=64,
    do_sample=False,          # deterministic for recognition-style tasks
    eos_token_id=tok.eos_token_id,
    pad_token_id=tok.pad_token_id,
)
print(tok.decode(out[0], skip_special_tokens=True))

Recommended decoding

  • Recognition / MCQ: greedy (do_sample=False).
  • Free text: light sampling (temperatureβ‰ˆ0.2–0.4, top_pβ‰ˆ0.9) if needed.
  • Keep generations short (50–150 tokens) to reduce drift.

πŸ”’ Safety & Intended Use

  • Intended: education, exam‑style recognition, triage training, dataset bootstrapping.
  • Not intended: to diagnose, treat, or manage real patients; making dosing or emergent decisions.
  • Add guardrails for uncertainty (allow β€œuncertain”), unsafe action filters, and referral prompts.

πŸ“ License

  • The merged model inherits constraints from all upstream licenses.

  • Before distribution or commercial use, review the licenses of:

    • yasserrmd/MedScholar-1.5B
    • nvidia/OpenReasoning-Nemotron-1.5B
  • Your usage must comply with the most restrictive terms among the sources.


βš™οΈ Tips

  • If your tokenizer includes a chat template, you may use it; otherwise, plain prompts like the examples above are fine.
  • To shift personality/conciseness, prepend a system line (e.g., β€œUse 6–8 bullets; no repetition; say β€˜uncertain’ if unsure”).
  • For reproducible merges, pin mergekit version and keep your YAML under version control.

✍️ Citation

If you build on this work, please cite the original model authors and the mergekit project:

  • mergekit: cg123/mergekit (GitHub)
  • Upstream models: yasserrmd/MedScholar-1.5B, nvidia/OpenReasoning-Nemotron-1.5B
Downloads last month
37
Safetensors
Model size
1.54B params
Tensor type
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for yasserrmd/MedScholar-Reasoning-1.5B