小道 Dao1-30b-a3b · 模型卡片 / Model Card

医哲未来人工智能研究院
IMPF-AI — Institute of Medical Philosophy & Future AI

HuggingFace License Base

以道御术,智汇岐黄,承古开新,济世惠民
Guided by the Tao, uniting classical wisdom with modern intelligence — to inherit the ancient and open the new, for the benefit of all.


目录 / Contents


一、中文介绍

模型简介

小道(Dao1-30b-a3b) 是由 医哲未来人工智能研究院(IMPF-AI) 自主研发的专业中医知识大语言模型,英文名 Tao,取义于"道"——中医理论体系之根本。

属性 详情
模型 ID CMLM/Dao1-30b-a3b
基础模型 Qwen3-30B-A3B(稀疏混合专家,激活参数 3B)
参数量 30B 总参数 / 3B 激活参数(MoE)
推理模式 非 Thinking 模式(节约 tokens,提升响应速度)
语言 中文(优先)/ 英文
专项能力 中医经典理论、本草方剂、辨证论治、古籍解读
精度 float16
许可证 非商业、非医疗研究用途

核心能力

  • 🌿 中医经典理论:《黄帝内经》《伤寒论》《金匮要略》《温病条辨》等经典原典解析
  • 📖 本草与方剂:药性归经、配伍原则、经典方剂组成与功效分析
  • 🔬 辨证论治:八纲辨证、脏腑辨证、六经辨证等多维度诊断思路
  • 🏺 古籍文献理解:具备古汉语医学文本的高精度语义理解与释义能力
  • 🤝 中西医融合:支持基础的中西医结合知识问答

研究院背景 · IMPF-AI

医哲未来人工智能研究院(IMPF-AI,Institute of Medical Philosophy & Future AI) 致力于在硅基芯片中重构碳基生命的医学智慧,构建可信医疗 AI 系统。

研究院核心研究方向涵盖:

  • 去敏医疗数据平台:基于联邦学习的隐私计算,实现多中心医疗数据的标准化清洗与安全共享
  • 虚拟细胞 & 人工线粒体:能量代谢建模与数字孪生类器官仿真,用于药物筛选与病理推演
  • 开源医疗模型:发布中医与通用医疗垂类基座模型,维护 OpenMedicalGym 仿真评估环境
  • 超级医疗 AI 智能体:开发具备自主决策能力的诊断辅助与手术规划 Agents,推进人机协同

研究院已荣获国家卫健委第二届全国数字健康创新应用大赛一等奖、英特尔中国学术峰会 Best Demo Award、百川·亚马逊云科技医疗大赛黑客松大赛亚军等奖项。

官方网站:https://impfai.github.io


训练详情

基础模型

Dao1-30b-a3b 基于 Qwen3-30B-A3B(阿里云通义团队)进行专项后训练。Qwen3-30B-A3B 采用稀疏混合专家(Sparse MoE)架构,全量参数 30B,每次推理仅激活约 3B 参数,在保持高性能的同时大幅降低推理开销。

后训练数据

本模型经过大批量中医古籍与专业文献数据的监督微调(SFT),数据来源包括但不限于:

  • 历代中医经典:《黄帝内经》《难经》《神农本草经》《伤寒论》《金匮要略》《温病条辨》《本草纲目》等
  • 历代名医医案与注释文献
  • 中医基础理论、诊断学、方剂学、针灸学等学科教材
  • 高质量中医问答与临床思辨语料

推理模式:非 Thinking(Non-Thinking)

为节约推理 tokens、提升响应速度,Dao1-30b-a3b 默认采用非 Thinking 模式,不输出中间推理链(<think>...</think> 块),直接生成高质量答案。如有需要深度推演的研究场景,可在 system prompt 中显式引导模型输出思维链。


推理参数说明

参数 推荐值 说明
temperature 0.6 – 0.8 控制输出多样性,建议中医问答使用 0.7
top_p 0.85 – 0.95 核采样,推荐 0.9
max_new_tokens 256 – 8192 根据任务复杂度调整
do_sample True 开启采样以获得更自然输出
repetition_penalty 1.05 – 1.15 适当惩罚重复,推荐 1.1

快速推理脚本

环境安装

pip install torch transformers accelerate

单轮推理

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer

MODEL_ID = "CMLM/Dao1-30b-a3b"

tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)

model = AutoModelForCausalLM.from_pretrained(
    MODEL_ID,
    torch_dtype=torch.float16,
    trust_remote_code=True,
    device_map="auto",
    attn_implementation="eager",
)

SYSTEM_PROMPT = (
    "你是小道(英文名 Tao),由医哲未来人工智能研究院自主研发的专业中医知识助手。"
    "请基于中医理论,以专业、准确、条理清晰的方式回答问题。"
)

user_prompt = "请从中医角度简要说明肾主骨的含义。"

text = (
    f"<|im_start|>system\n{SYSTEM_PROMPT}<|im_end|>\n"
    f"<|im_start|>user\n{user_prompt}<|im_end|>\n"
    "<|im_start|>assistant\n"
)

inputs = tokenizer(text, return_tensors="pt", add_special_tokens=False).to(model.device)
streamer = TextStreamer(tokenizer, skip_prompt=True)

_ = model.generate(
    **inputs,
    max_new_tokens=512,
    do_sample=True,
    temperature=0.7,
    top_p=0.9,
    repetition_penalty=1.1,
    use_cache=True,
    streamer=streamer,
)

多轮对话

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
from threading import Thread

MODEL_ID = "CMLM/Dao1-30b-a3b"

tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    MODEL_ID,
    torch_dtype=torch.float16,
    trust_remote_code=True,
    device_map="auto",
    attn_implementation="eager",
)

SYSTEM_PROMPT = (
    "你是小道(英文名 Tao),由医哲未来人工智能研究院自主研发的专业中医知识助手。"
    "请基于中医理论,以专业、准确、条理清晰的方式回答问题。"
)

def build_prompt(history: list[dict], user_input: str) -> str:
    text = f"<|im_start|>system\n{SYSTEM_PROMPT}<|im_end|>\n"
    for turn in history:
        text += f"<|im_start|>{turn['role']}\n{turn['content']}<|im_end|>\n"
    text += f"<|im_start|>user\n{user_input}<|im_end|>\n<|im_start|>assistant\n"
    return text

def chat(history: list[dict], user_input: str) -> str:
    prompt = build_prompt(history, user_input)
    inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
    streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
    thread = Thread(target=model.generate, kwargs=dict(
        **inputs,
        max_new_tokens=512,
        do_sample=True,
        temperature=0.7,
        top_p=0.9,
        repetition_penalty=1.1,
        use_cache=True,
        streamer=streamer,
    ))
    thread.start()
    response = ""
    for token in streamer:
        print(token, end="", flush=True)
        response += token
    thread.join()
    print()
    return response

# 使用示例
history = []
while True:
    user_input = input("用户: ").strip()
    if not user_input:
        continue
    if user_input in ("退出", "exit", "quit"):
        break
    reply = chat(history, user_input)
    history.append({"role": "user",      "content": user_input})
    history.append({"role": "assistant", "content": reply})

使用 transformers pipeline(简洁版)

from transformers import pipeline
import torch

pipe = pipeline(
    "text-generation",
    model="CMLM/Dao1-30b-a3b",
    torch_dtype=torch.float16,
    device_map="auto",
    trust_remote_code=True,
)

messages = [
    {"role": "system", "content": "你是小道,由医哲未来人工智能研究院研发的专业中医知识助手。"},
    {"role": "user",   "content": "五行与五脏的对应关系是什么?"},
]

output = pipe(messages, max_new_tokens=512, temperature=0.7, top_p=0.9, do_sample=True)
print(output[0]["generated_text"][-1]["content"])

性能与局限

擅长场景

  • ✅ 中医经典理论阐释与典籍解读
  • ✅ 本草药性、方剂分析、配伍讨论
  • ✅ 辨证论治的理论推演与知识问答
  • ✅ 中医文化、历史与学术研究辅助

局限性

  • ⚠️ 本模型不适用于真实临床诊断,其输出不构成任何医疗建议
  • ⚠️ 对于极稀见的古籍版本或方言性文献,理解能力可能有限
  • ⚠️ 非 Thinking 模式下,复杂多步推演可能不及 Thinking 模式精确
  • ⚠️ 中西医融合场景下,西医专科能力弱于中医专科能力

许可证与免责声明

⚠️ 严重声明

本模型及其所有衍生物:

  1. 禁止商业用途:不得用于任何商业产品、收费服务或盈利目的。
  2. 禁止医疗场景使用:不得用于临床诊断、处方开具、手术规划、医疗设备控制或任何直接影响患者健康决策的场景。
  3. 仅限学术研究:本模型仅供学术研究、教育学习与非盈利探索使用。
  4. 无医疗责任:医哲未来人工智能研究院对任何因使用本模型而产生的直接或间接医疗后果不承担任何法律责任。

使用本模型即表示您已阅读、理解并同意以上条款。


引用

如您在研究中使用了本模型,请引用以下文献:

@misc{dao1-30b-a3b-2025,
  title        = {Dao1: Achieving Expert-Level Traditional Chinese Medicine Reasoning},
  author       = {Yanlan Kang and Xin Li and Yue Chen and Yide Fang},
  year         = {2025},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/CMLM/Dao1-30b-a3b}},
  note         = {Institute of Medical Philosophy \& Future AI (IMPF-AI)}
}


二. English Introduction

Model Overview

Dao1-30b-a3b (Chinese name: 小道 Xiǎo Dào, English name: Tao) is a professional Traditional Chinese Medicine (TCM) large language model developed by the Institute of Medical Philosophy & Future AI (IMPF-AI). The name Tao (道) — meaning "the Way" — reflects the philosophical foundation of TCM theory.

Attribute Details
Model ID CMLM/Dao1-30b-a3b
Base Model Qwen3-30B-A3B (Sparse MoE, 3B activated parameters)
Parameters 30B total / 3B activated (MoE architecture)
Inference Mode Non-Thinking (token-efficient, faster response)
Languages Chinese (primary) / English
Specialization Classical TCM theory, materia medica, syndrome differentiation, classical texts
Precision float16
License Non-commercial, non-clinical research only

Core Capabilities

  • 🌿 Classical TCM Theory: Interpretation of foundational texts including Huangdi Neijing, Shang Han Lun, Jin Gui Yao Lue, Wen Bing Tiao Bian, and more
  • 📖 Materia Medica & Formulae: Herb properties, meridian tropism, compatibility principles, and classical formula analysis
  • 🔬 Syndrome Differentiation: Eight-principle pattern identification, organ-system differentiation, Six-channel differentiation (Liujing Bianzheng)
  • 🏺 Classical Text Comprehension: High-precision semantic understanding of classical Chinese medical literature
  • 🤝 Integrative Medicine: Basic integrative TCM–Western medicine Q&A support

Institute Background · IMPF-AI

The Institute of Medical Philosophy & Future AI (IMPF-AI 医哲未来人工智能研究院) is dedicated to reconstructing the wisdom of carbon-based life within silicon-based chips — building trustworthy medical AI systems that bridge ancient philosophy with cutting-edge computation.

Core research pillars:

  • De-identified Medical Data Platform: Federated learning-based privacy computation enabling standardized multi-center data sharing that is "usable but invisible"
  • Virtual Cells & Artificial Mitochondria: Energy metabolism modeling and digital twin organoid simulation for drug screening and pathological inference
  • Open-Source Medical Models: Publishing domain-specific base models and maintaining the OpenMedicalGym simulation evaluation environment
  • Super Medical AI Agents: Developing autonomous decision-making agents for diagnostic assistance, surgical planning, and digital organ maintenance — pursuing genuine human-machine symbiosis

IMPF-AI has received the 1st Prize at the National Health Commission's 2nd National Digital Health Innovation Competition, Best Demo at the Intel China Academic Summit, and 2nd Place at the AWS Healthcare Hackathon. The institute operates a 10PB+ de-identified medical data platform and simulates 10M+ virtual cells daily.

Official website: https://impfai.github.io


Training Details

Base Model

Dao1-30b-a3b is built upon Qwen3-30B-A3B (Alibaba Cloud Tongyi Team), a Sparse Mixture-of-Experts (MoE) architecture with 30B total parameters and approximately 3B activated parameters per forward pass — achieving high performance while substantially reducing inference cost.

Post-Training Data

The model underwent Supervised Fine-Tuning (SFT) on a large-scale corpus of classical TCM texts and professional medical literature, including but not limited to:

  • Classical TCM canons: Huangdi Neijing, Nanjing, Shennong Bencao Jing, Shang Han Lun, Jin Gui Yao Lue, Wen Bing Tiao Bian, Bencao Gangmu, and others
  • Annotated case records (Yian) of historical TCM masters
  • Standard textbooks in TCM fundamentals, diagnostics, formulary, and acupuncture
  • High-quality TCM Q&A and clinical reasoning corpora

Non-Thinking Inference Mode

To reduce token consumption and improve response latency, Dao1-30b-a3b defaults to Non-Thinking mode — suppressing intermediate chain-of-thought blocks (<think>...</think>) and generating high-quality answers directly. For research scenarios requiring deep multi-step reasoning, chain-of-thought can be explicitly prompted via the system prompt.


Inference

Installation

pip install torch transformers accelerate

Single-turn Inference

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer

MODEL_ID = "CMLM/Dao1-30b-a3b"

tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    MODEL_ID,
    torch_dtype=torch.float16,
    trust_remote_code=True,
    device_map="auto",
    attn_implementation="eager",
)

SYSTEM_PROMPT = (
    "You are Tao (小道), a professional TCM knowledge assistant developed by "
    "the Institute of Medical Philosophy & Future AI (IMPF-AI). "
    "Please answer questions based on Traditional Chinese Medicine theory "
    "in a professional, accurate, and well-organized manner."
)

user_prompt = "Briefly explain the TCM concept that 'the kidney governs bones'."

text = (
    f"<|im_start|>system\n{SYSTEM_PROMPT}<|im_end|>\n"
    f"<|im_start|>user\n{user_prompt}<|im_end|>\n"
    "<|im_start|>assistant\n"
)

inputs = tokenizer(text, return_tensors="pt", add_special_tokens=False).to(model.device)
streamer = TextStreamer(tokenizer, skip_prompt=True)

_ = model.generate(
    **inputs,
    max_new_tokens=512,
    do_sample=True,
    temperature=0.7,
    top_p=0.9,
    repetition_penalty=1.1,
    use_cache=True,
    streamer=streamer,
)

Multi-turn Conversation

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStreamer
from threading import Thread

MODEL_ID = "CMLM/Dao1-30b-a3b"

tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
    MODEL_ID,
    torch_dtype=torch.float16,
    trust_remote_code=True,
    device_map="auto",
    attn_implementation="eager",
)

SYSTEM_PROMPT = (
    "You are Tao (小道), a professional TCM knowledge assistant developed by IMPF-AI."
)

def build_prompt(history: list[dict], user_input: str) -> str:
    text = f"<|im_start|>system\n{SYSTEM_PROMPT}<|im_end|>\n"
    for turn in history:
        text += f"<|im_start|>{turn['role']}\n{turn['content']}<|im_end|>\n"
    text += f"<|im_start|>user\n{user_input}<|im_end|>\n<|im_start|>assistant\n"
    return text

def chat(history: list[dict], user_input: str) -> str:
    prompt = build_prompt(history, user_input)
    inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
    streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
    thread = Thread(target=model.generate, kwargs=dict(
        **inputs, max_new_tokens=512, do_sample=True,
        temperature=0.7, top_p=0.9, repetition_penalty=1.1,
        use_cache=True, streamer=streamer,
    ))
    thread.start()
    response = ""
    for token in streamer:
        print(token, end="", flush=True)
        response += token
    thread.join()
    print()
    return response

history = []
while True:
    user_input = input("User: ").strip()
    if not user_input or user_input in ("exit", "quit"):
        break
    reply = chat(history, user_input)
    history.append({"role": "user",      "content": user_input})
    history.append({"role": "assistant", "content": reply})

Recommended Inference Parameters

Parameter Recommended Notes
temperature 0.6 – 0.8 Use ~0.7 for TCM Q&A
top_p 0.85 – 0.95 Nucleus sampling, recommend 0.9
max_new_tokens 256 – 8192 Adjust by task complexity
do_sample True Enable for natural output
repetition_penalty 1.05 – 1.15 Recommend 1.1 to reduce repetition

Limitations

Well-suited for:

  • ✅ Classical TCM theory explanation and canonical text interpretation
  • ✅ Herb properties, formula analysis, and compatibility discussion
  • ✅ Theoretical syndrome differentiation and knowledge Q&A
  • ✅ TCM cultural, historical, and academic research assistance

Limitations:

  • ⚠️ Not suitable for real clinical diagnosis — outputs do not constitute any medical advice
  • ⚠️ May have limited understanding of rare dialect variants or obscure manuscript editions
  • ⚠️ Non-Thinking mode may be less precise than Thinking mode for complex multi-step inference
  • ⚠️ In integrative medicine contexts, TCM-domain capability exceeds Western medicine-domain capability

License & Disclaimer

⚠️ Important Notice

This model and all its derivatives:

  1. Commercial use prohibited: Must not be used in any commercial product, paid service, or revenue-generating context.
  2. Clinical/medical use prohibited: Must not be used for clinical diagnosis, prescription generation, surgical planning, medical device control, or any context directly influencing patient health decisions.
  3. Academic research only: This model is provided solely for academic research, education, and non-profit exploration.
  4. No medical liability: IMPF-AI bears no legal responsibility for any direct or indirect medical consequences arising from the use of this model.

By using this model, you confirm that you have read, understood, and agreed to the above terms.


Citation

If you use this model in your research, please cite:

@misc{dao1-30b-a3b-2025,
  title        = {Dao1: Achieving Expert-Level Traditional Chinese Medicine Reasoning},
  author       = {Yanlan Kang and Xin Li and Yue Chen and Yide Fang},
  year         = {2025},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/CMLM/Dao1-30b-a3b}},
  note         = {Institute of Medical Philosophy \& Future AI (IMPF-AI).
                  Non-Thinking mode SFT on large-scale classical TCM corpora,
                  based on Qwen3-30B-A3B.}
}

医哲未来人工智能研究院 · IMPF-AI
Institute of Medical Philosophy & Future AI
https://impfai.github.io

以道御术,智汇岐黄,承古开新,济世惠民

© 2025 IMPF-AI. All rights reserved. Non-commercial research use only.

Downloads last month
63
Safetensors
Model size
31B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for CMLM/Dao1-30b-a3b

Finetuned
Qwen/Qwen3-30B-A3B
Finetuned
(36)
this model