🌟 模型概述
Baichuan-M2-32B是百川智能推出的医疗增强推理模型,也是百川发布的第二款医疗大模型。该模型专为真实医疗推理任务设计,基于Qwen2.5-32B架构创新性引入大型验证器系统(Large Verifier System)。通过对真实医疗问诊数据进行领域微调,在保持强大通用能力的同时实现了突破性的医疗性能表现。
模型特性:
Baichuan-M2融合三大核心技术突破:首先通过大型验证器系统,结合医疗场景特性设计包含患者模拟器、多维验证机制在内的完整医疗验证框架;其次采用Mid-Training医疗领域适配增强技术,在保留通用能力的同时实现轻量高效的医疗领域适配;最终运用多阶段强化学习策略,将复杂RL任务分解为层次化训练阶段,逐步提升模型的医学知识、推理能力和患者交互水平。
核心亮点:
- 🏆 全球领先开源医疗模型:在HealthBench基准上超越所有开源模型及多数闭源模型,医疗能力最接近GPT-5
- 🧠 医生思维对齐:基于真实临床病例和患者模拟器训练,具备临床诊断思维与强健的患者交互能力
- ⚡ 高效部署:支持4比特量化单卡RTX4090部署,MTP版本在单用户场景下token吞吐量提升58.5%
📊 性能指标
健康基准分数
Model Name | HealthBench | HealthBench-Hard | HealthBench-Consensus |
---|---|---|---|
Baichuan-M2 | 60.1 | 34.7 | 91.5 |
gpt-oss-120b | 57.6 | 30 | 90 |
Qwen3-235B-A22B-Thinking-2507 | 55.2 | 25.9 | 90.6 |
Deepseek-R1-0528 | 53.6 | 22.6 | 91.5 |
GLM-4.5 | 47.8 | 18.7 | 85.3 |
Kimi-K2 | 43 | 10.7 | 90.9 |
gpt-oss-20b | 42.5 | 10.8 | 82.6 |
一般性能
Benchmark | Baichuan-M2-32B | Qwen3-32B (Thinking) |
---|---|---|
AIME24 | 83.4 | 81.4 |
AIME25 | 72.9 | 72.9 |
Arena-Hard-v2.0 | 45.8 | 44.5 |
CFBench | 77.6 | 75.7 |
WritingBench | 8.56 | 7.90 |
Note: AIME uses max_tokens=64k, others use 32k; temperature=0.6 for all tests.
🔧 技术特性
📗 技术博客: Blog - 百川-M2
大验证系统
- 患者模拟器: 基于真实临床病例的虚拟患者系统
- 多维度验证: 包含医疗准确性、回答完整性、随访意识等8个维度
- 动态评分: 针对复杂临床场景实时生成自适应评估标准
医疗领域适配
- 中期训练: 在保持通用能力的同时注入医疗知识
- 强化学习: 多阶段强化学习策略优化
- 通用-专用平衡: 精心平衡医疗、通用与数学复合训练数据
⚙️ 快速开始
# 1. load model
from transformers import AutoTokenizer, AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("baichuan-inc/Baichuan-M2-32B", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("baichuan-inc/Baichuan-M2-32B")
# 2. Input prompt text
prompt = "Got a big swelling after a bug bite. Need help reducing it."
# 3. Encode the input text for the model
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
thinking_mode='on' # on/off/auto
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# 4. Generate text
generated_ids = model.generate(
**model_inputs,
max_new_tokens=4096
)
output_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
][0].tolist()
# 5. parsing thinking content
try:
# rindex finding 151668 (</think>)
index = len(output_ids) - output_ids[::-1].index(151668)
except ValueError:
index = 0
thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")
print("thinking content:", thinking_content)
print("content:", content)
部署时,您可以使用 sglang>=0.4.6.post1
或 vllm>=0.9.0
来创建兼容OpenAI的API端点:
- SGLang:
python -m sglang.launch_server --model-path baichuan-inc/Baichuan-M2-32B --reasoning-parser qwen3
- vLLM:
vllm serve baichuan-inc/Baichuan-M2-32B --reasoning-parser qwen3
基于SGLang的MTP推理
- 将sglang安装目录中的qwen2.py文件替换为draft/qwen2.py。
- 启动sglang:
python3 -m sglang.launch_server \
--model Baichuan-M2-32B \
--speculative-algorithm EAGLE3 \
--speculative-draft-model-path Baichuan-M2-32B/draft \
--speculative-num-steps 6 \
--speculative-eagle-topk 10 \
--speculative-num-draft-tokens 32 \
--mem-fraction 0.9 \
--cuda-graph-max-bs 2 \
--reasoning-parser qwen3 \
--dtype bfloat16
⚠️ 使用须知
- 医疗免责声明:仅供研究与参考使用,不能替代专业医疗诊断或治疗
- 适用场景:医学教育、健康咨询、临床决策支持
- 安全使用:建议在医疗专业人员指导下使用
📄 许可证
基于 Apache License 2.0 许可。允许研究及商业用途。
🤝 致谢
- 基座模型:Qwen2.5-32B
- 训练框架:verl
- 推理引擎:vLLM、SGLang
- 量化技术:AutoRound、GPTQ
感谢开源社区,我们承诺持续贡献并推动医疗AI发展。