Views
No views yet
meta-llama/Llama-3.1-8B-Instruct, trained via the HELIX-FT v2 curriculum on a single
RunPod L40S GPU.meta-llama/Llama-3.1-8B-Instruct (gated)BrainHealthAI/MedQA-Llama3.1-8B-SFT-Big — merged into the
base to produce a dense intermediate BrainMed-Base-v1BrainHealthAI/MedUnified (23K trilingual,
decontaminated against MedQA-USMLE / MedMCQA / PubMedQA / MMLU-medical via MinHash LSH)BrainHealthAI/BrainMedCoT (3K with structured
<think>...</think>{answer} format)1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3import torch
4
5BASE = "meta-llama/Llama-3.1-8B-Instruct"
6SFT_BIG = "BrainHealthAI/MedQA-Llama3.1-8B-SFT-Big"
7HELIX_V2 = "BrainHealthAI/MedQA-Llama3.1-8B-HELIX-v2"
8
9# Step 1: load the base + merge the SFT-Big intermediate adapter
10base = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.bfloat16, device_map="auto")
11m = PeftModel.from_pretrained(base, SFT_BIG)
12m = m.merge_and_unload()
13
14# Step 2: attach the HELIX-v2 adapter
15model = PeftModel.from_pretrained(m, HELIX_V2)
16tok = AutoTokenizer.from_pretrained(BASE)
17
18# Generate (with the <think> structure trained in Stage C)
19prompt = tok.apply_chat_template(
20 [{"role": "system", "content": "You are a medical reasoning assistant."},
21 {"role": "user", "content": "Patient presents with..."}],
22 tokenize=False, add_generation_prompt=True,
23)
24out = model.generate(**tok(prompt, return_tensors="pt").to(model.device),
25 max_new_tokens=1024, do_sample=False)
26print(tok.decode(out[0], skip_special_tokens=True))| Benchmark | Accuracy | n |
|---|---|---|
| MedQA-USMLE | 52.50% | 200 |
| MedMCQA | 41.50% | 200 |
| PubMedQA | 53.50% | 200 |
| MMLU-clinical_knowledge | 61.00% | 200 |
| MMLU-medical_genetics | 67.00% | 100 |
| MMLU-professional_medicine | 54.00% | 200 |
| MMLU-college_medicine | 57.23% | 173 |
| Darija-MCQ-500 | 55.00% | 200 |
| Language | SB_CS | ROUGE-L | n |
|---|---|---|---|
| EN | 0.695 | 0.163 | 100 |
| FR | 0.630 | 0.123 | 100 |
| DARIJA | 0.581 | 0.031 | 100 |
eval_v2.json in this repo for the full breakdown (raw scores + parser version).max_new_tokens settings. Use max_new_tokens ≥ 1024 for MCQ
evaluation to give the model room to complete the reasoning AND state the final letter.meta-llama/Llama-3.1-8B-Instruct
has its own Meta Llama 3 Community License; users must comply with both.1@misc{medqa_llama3_helix_v2_2026,
2 author = {BrainHealthAI},
3 title = {MedQA-Llama3.1-8B-HELIX-v2: Trilingual Medical Reasoning Adapter},
4 year = 2026,
5 publisher = {HuggingFace},
6 howpublished = {\url{https://huggingface.co/BrainHealthAI/MedQA-Llama3.1-8B-HELIX-v2}},
7}BrainHealthAI/MedUnified (training data), BrainHealthAI/BrainMedCoT
(CoT corpus), BrainHealthAI/MedQA-Darija-MCQ-500 (Darija eval).