README.md 4.02 KB
Newer Older
shihm's avatar
shihm committed
1
# Baichuan-M3
shihm's avatar
shihm committed
2
3
4
5
6
## 论文
[Modeling Clinical Inquiry for Reliable Medical Decision-Making](https://arxiv.org/abs/2602.06570)

## 模型简介
Baichuan-M3 是百川智能推出的全新一代医疗增强大语言模型,是继 Baichuan-M2 之后的重要里程碑。
shihm's avatar
shihm committed
7
8
9
10
11
12
与以往主要聚焦于静态问答或表面角色扮演的方法不同,Baichuan-M3 经过专门训练,能够显式建模 临床决策过程,旨在提升模型在真实医疗场景中的可用性与可靠性。该模型并非仅生成“听起来合理”的答案,或频繁给出诸如“你应尽快就医”等模糊建议,而是被训练为能够 主动获取关键临床信息、构建连贯的医学推理路径,并 系统性地约束易产生幻觉的行为。<br>
具有以下的亮点:<br>
超越 GPT-5.2:在 HealthBench、HealthBench-Hard、幻觉评估和 SCAN-bench 等多项指标上全面超越 OpenAI 最新模型,树立医疗 AI 新的 SOTA。<br>
高保真临床问诊能力:唯一在 SCAN-bench 全部三个维度(临床问诊、实验室检查、诊断)均排名第一的模型。<br>
低幻觉率,高可靠性:通过 Fact-Aware RL,在无外部工具辅助的情况下,幻觉率低于 GPT-5.2。<br>
 高效部署:W4 量化将内存占用降至原始的 26%;Gated Eagle3 推测解码实现 96% 的加速。<br>
shihm's avatar
shihm committed
13
14
15
16
17
18
19
20
21
22

## 环境依赖

|     软件     |                      版本                      |
| :----------: | :--------------------------------------------: |
|     DTK      |                    26.04.2                     |
|    python    |                    3.10.12                     |
| transformers |                     4.57.6                     |
|     vllm     | 0.11.0+das.opt1.rc2.dtk2604.20260128.g0bf89b0c | 

shihm's avatar
shihm committed
23
推荐使用镜像:harbor.sourcefind.cn:5443/dcu/admin/base/vllm:0.11.0-ubuntu22.04-dtk26.04-0130-py3.10-20260204
shihm's avatar
shihm committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

- 挂载地址`-v`根据实际模型情况修改

```bash
docker run -it \
    --shm-size 200g \
    --network=host \
    --name baichuan_m3 \
    --privileged \
    --device=/dev/kfd \
    --device=/dev/dri \
    --device=/dev/mkfd \
    --group-add video \
    --cap-add=SYS_PTRACE \
    --security-opt seccomp=unconfined \
    -u root \
    -v /opt/hyhal/:/opt/hyhal/:ro \
    -v /path/your_code_data/:/path/your_code_data/ \
shihm's avatar
shihm committed
42
    harbor.sourcefind.cn:5443/dcu/admin/base/vllm:0.11.0-ubuntu22.04-dtk26.04-0130-py3.10-20260204 bash
shihm's avatar
shihm committed
43
44
```
更多镜像可前往[光源](https://sourcefind.cn/#/service-list)下载使用。
shihm's avatar
shihm committed
45

shihm's avatar
shihm committed
46
47
48
49
50
51
52
53
54
55
56
57
58
关于本项目DCU显卡所需的特殊深度学习库可从[光合](https://developer.sourcefind.cn/tool/)开发者社区下载安装。


## 数据集

`暂无`

## 训练

`暂无`

## 推理

shihm's avatar
shihm committed
59
60
61
### transformers
#### 单机推理
```bash
shihm's avatar
shihm committed
62
python inference.py
shihm's avatar
shihm committed
63
64
```

shihm's avatar
shihm committed
65
66
### vllm

shihm's avatar
shihm committed
67
#### 单机推理
shihm's avatar
shihm committed
68
69
70

启动vllm server
```bash
shihm's avatar
shihm committed
71
72
73
74
75
76
vllm serve /baichuan-inc/Baichuan-M3-235B
    --reasoning-parser qwen3 
    --tensor-parallel-size 8 
    --trust-remote-code
    --port 8000
    --gpu-memory-utilization 0.95 
shihm's avatar
shihm committed
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
    --served-model-name baichuan-m3 
```
启动完成后可通过以下方式访问:
```bash
curl http://localhost:8000/v1/chat/completions   \
    -H "Content-Type: application/json"  \
    -d '{
        "model": "baichuan-m3",
        "messages": [
            {
                "role": "user",
                "content": "下午头痛怎么办?"
            }
        ]
}'
```
## 效果展示
<div align=center>
    <img src="./doc/result1.png"/>
</div>





shihm's avatar
shihm committed
102
### 精度
shihm's avatar
shihm committed
103
`DCU与GPU精度一致,推理框架:transformers,vllm`
shihm's avatar
shihm committed
104
105
106
107

## 预训练权重
| 模型名称  | 权重大小  | DCU型号  | 最低卡数需求 |下载地址|
|:-----:|:----------:|:----------:|:---------------------:|:----------:|
shihm's avatar
shihm committed
108
| Baichuan-M3-235B | 235B | BW1000  | 8  | [Modelscope](https://modelscope.cn/models/baichuan-inc/Baichuan-M3-235B) |
shihm's avatar
shihm committed
109
| Baichuan-M3-235B-GPTQ-INT4 | 235B | BW1000  | 4  | [Modelscope](https://modelscope.cn/models/baichuan-inc/Baichuan-M3-235B-GPTQ-INT4) |
shihm's avatar
shihm committed
110

shihm's avatar
shihm committed
111
112
113
## 源码仓库及问题反馈
- https://developer.sourcefind.cn/codes/modelzoo/baichuan-m3-235b_vllm

shihm's avatar
shihm committed
114
115
## 参考资料
- https://www.baichuan-ai.com/blog/baichuan-M3