Planned: full supervised fine-tune of
Qwen/Qwen2.5-7B-Instruct on the
FreedomIntelligence/medical-o1-reasoning-SFT (
en split, 19.7K reasoning-style medical QA examples).
Based on HuatuoGPT-o1 (
arXiv:2412.18925, 107 upvotes on HF papers).
HuatuoGPT-o1 uses this dataset for its SFT stage and the HuggingFace TRL documentation uses the
identical preprocessing block as its canonical example.
1def preprocess_function(example):
2 return {
3 "prompt": [{"role": "user", "content": example["Question"]}],
4 "completion": [{
5 "role": "assistant",
6 "content": f"<think>{example['Complex_CoT']}</think>{example['Response']}",
7 }],
8 }
1hf_jobs.run(
2 script="train_medical_qwen.py",
3 dependencies=["transformers", "trl", "datasets", "accelerate", "trackio", "kernels", "bitsandbytes", "torch"],
4 hardware_flavor="a100-large",
5 timeout="45m",
6 env={"MEDICAL_SMOKE": "1"},
7 trackio_space_id="akshaypulusu/ml-intern-medqao1s",
8 trackio_project="qwen-medical-o1-sft",
9)
1hf_jobs.run(
2 script="eval_medqa.py",
3 dependencies=["transformers", "datasets", "trackio", "kernels", "torch"],
4 hardware_flavor="a10g-large",
5 timeout="3h",
6 trackio_space_id="akshaypulusu/ml-intern-medqao1s",
7 trackio_project="qwen-medical-o1-sft",
8)
Our 7B SFT run should land roughly in the 65–72% range — above the base model, in the same ballpark as the larger published baselines.
If results plateau, swap in
UCSC-VLAA/MedReason (32.6K KG-grounded CoT,
arXiv:2504.00993). MedReason-8B reportedly beats HuatuoGPT-o1-8B by up to 4.2% on MedBullets. Schema is different (
question /
answer /
reasoning /
options) so preprocessing must be adapted.
1@article{huatuogpt-o1,
2 title = {HuatuoGPT-o1, Towards Medical Complex Reasoning with LLMs},
3 author = {Chen, Junying and Cai, Zhenyang and Ji, Ke and Wang, Xidong and Liu, Wanlong and Wang, Rongsheng and Hou, Jianye and Wang, Benyou},
4 journal = {arXiv preprint arXiv:2412.18925},
5 year = {2024},
6 url = {https://arxiv.org/abs/2412.18925}
7}
1@article{qwen2.5,
2 title = {Qwen2.5 Technical Report},
3 author = {Qwen Team},
4 journal = {arXiv preprint arXiv:2412.15115},
5 year = {2024}
6}