Model or dataset
SCIR-HI/Huatuo-Llama-Med-Chinese avatar
SCIR-HI/Huatuo-Llama-Med-Chinese

BenTsao: A Chinese Medical Instruction-Tuning Suite for LLaMA, Bloom, and Huozi

Repo for BenCao [original name: HuaTuo (华驼)], Instruction-tuning Large Language Models with Chinese Medical Knowledge. 本草(原名:华驼)模型仓库,基于中文医学知识的大语言模型指令微调

4,993 stars499 forksPythonApache-2.0

At a glance

What is it?
BenTsao (formerly HuaTuo) from SCIR-HI is a set of LoRA adapters and training recipes for instruction-tuning Chinese medical LLMs. It shows how to build and use knowledge-based QA data, but its documentation is thin on evaluation and maintenance.
Who is it for?
Adopt BenTsao if you need a concrete, reproducible starting point for instruction-tuning a Chinese medical LLM with LoRA, especially if you already run LLaMA, Alpaca, Bloom, or Huozi. Do not adopt it for production clinical use: the training data is openly acknowledged to contain errors, the models are research artifacts, and the evaluation shown is a single dated sample.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 74 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What BenTsao Solves and Who It Targets

BenTsao addresses a narrow but real problem: general-purpose Chinese LLMs give poor answers to medical questions because they lack domain knowledge and instruction-following ability in that field. The repository, maintained by SCIR-HI at Harbin Institute of Technology, offers instruction-tuned LoRA adapters that sit on top of several base models: LLaMA-7B, Chinese Alpaca-7B, Bloom-7B, and Huozi 1.0. The intended users are researchers and engineers who want to reproduce or extend a Chinese medical QA system without training from scratch. The project is not a standalone chatbot; it is a collection of weights, data, and scripts. The README states the goal directly: to improve the base models' question-answering performance in the medical domain through instruction tuning. That framing matters because it sets expectations. You are not getting a polished product, you are getting a method and the artifacts produced by that method.

How the Pipeline Works: From Knowledge Graph to QA Pairs

The core mechanism is dataset construction followed by instruction tuning. The authors built a Chinese medical knowledge base, drawing on cMeKG, with entries structured around a central term and fields such as related diseases, related symptoms, department, and affected site. They then used the GPT-3.5 API to convert that knowledge into question-answer pairs, using multiple prompt formats. The README gives an example entry for migraine and a sample QA pair about myocardial infarction. That QA data, roughly eight thousand entries, is the training set for the knowledge-based adapters. A separate track collected 2023 Chinese medical literature on liver cancer, used GPT-3.5 to build multi-turn QA from the conclusions, and released about one thousand training samples in ./data_literature/liver_cancer.json. The training data is openly acknowledged as imperfect. The README says errors and incompleteness remain and that better iteration strategies will come later. That honesty is useful, but it also means anyone using the released adapters must accept that the underlying data quality is not production-grade.

Getting It Running: Commands, Config, and Templates

The quick start requires Python 3.9 or later. You install dependencies with pip install -r requirements.txt. Then you download the LoRA weights for your chosen base model. The weights are hosted on Baidu Netdisk and Hugging Face. Each download contains adapter_config.json and adapter_model.bin. For inference, the README points to ./data/infer.json as a test set, and you run one of several scripts: bash ./scripts/infer.sh for the knowledge-base model, or the single-turn and multi-turn variants for the literature model. The infer.sh script calls infer.py with arguments for base_model, lora_weights, use_lora, instruct_dir, and prompt_template. The prompt template must match the base model family. Bloom and Huozi use templates/bloom_deploy.json, while LLaMA and Alpaca use templates/med_template.json for the knowledge base and templates/literature_template.json for literature. That distinction is easy to miss, and the README does not warn about the consequences of using the wrong template. The finetune path is similar: format your own data like ./data/llama_data.json and run bash ./scripts/finetune.sh. The commands are concrete and reproducible, which is a strength of this repository.

Knowledge Tuning: A Three-Stage Explicit Retrieval Approach

Beyond standard instruction tuning, the repository introduces a process called knowledge tuning. The idea is to make the model explicitly use the knowledge base during inference, rather than relying on implicit memorization. The README describes three stages: first, the model fills in retrieval parameters such as the central term and attributes from the question; second, it queries the knowledge base with those filled parameters; third, it generates an answer using the retrieved knowledge. A sample data file is linked as data/knowledge_tuning_data_sample.txt. This is the most distinctive part of the project. It tries to address a known weakness of LLMs in medicine: hallucination. By forcing the model to retrieve and then answer, the authors aim for more reliable outputs. The approach is documented in a paper accepted at ACM TKDD in 2024. However, the repository does not provide a complete implementation of the retrieval mechanism. There is no code for the knowledge retrieval step visible in the README. You see the data format and the conceptual pipeline, but not the inference code that ties the retrieval to the generation. That gap matters if you want to reproduce the knowledge tuning results. The documentation is a description, not a full system.

Hardware Requirements and Training Cost

The training details section gives a concrete resource estimate. For LLaMA-based instruction tuning, the authors used a single A100-SXM-80GB GPU, trained for 10 epochs, and finished in about 2 hours and 17 minutes. At a batch size of 128, memory usage was around 40GB. The README suggests that a 3090 or 4090 with 24GB of VRAM can support training if you adjust the batch size. That is a useful data point, but it is only for the LLaMA base. No comparable figures are given for Bloom, Alpaca, or Huozi. The memory figure of 40GB at batch size 128 suggests that the LoRA approach keeps the memory footprint manageable, which is the point of using LoRA. Still, if your hardware is below a 24GB GPU, you will likely need to reduce batch size considerably, and the README does not say how far you can go before training quality degrades. The project also links to a Weights and Biases run for the LLaMA experiment, which can help you see the loss curves and hyperparameters, but that link is external and not summarized in the README.

Limitations and Wrong-Tool Cases

The most obvious limitation is the data quality. The README explicitly states that the training set, despite incorporating knowledge, still has errors and incompleteness. For a medical domain, that is not a minor caveat. A model trained on such data can produce confident but incorrect answers. The evaluation shown in the README is a single comparison table from March 2023, with only LLaMA output shown. There is no systematic benchmark, no accuracy metric, no comparison across the different base models, and no update for the newer Huozi or Bloom versions. That is a genuine gap. The project is also limited in scope: the literature-trained model covers only liver cancer, and the authors say they plan to expand to 16 diseases in the hepatobiliary and pancreatic area, but that expansion is not present in the repository. If you need a medical assistant that covers a broad range of conditions, this project will not give you that. If you need a model that can be deployed in a clinical setting, the lack of validation and the acknowledged data errors make it the wrong tool. The project is a research artifact, not a clinical product.

Alternatives and Different Approaches

A direct alternative is Med-ChatGLM, also from SCIR-HI, which the README links as a separate project. The difference is the base model: Med-ChatGLM is based on ChatGLM-6B, while BenTsao covers LLaMA, Alpaca, Bloom, and Huozi. That matters because ChatGLM is a different architecture and has its own Chinese language strengths. If you already use ChatGLM in your stack, Med-ChatGLM may integrate more easily. Another alternative is to use the original Huozi model without medical tuning, but that sacrifices the medical knowledge. The broader difference in approach is between instruction tuning on a static dataset versus retrieval-augmented generation. BenTsao's knowledge tuning is a step toward retrieval, but the mainline adapters are still static instruction tuning. A system like a RAG pipeline that queries a medical knowledge base at inference time would be a different approach, but the README does not compare against that. So the practical choice for a user is base model family. BenTsao gives you four options; Med-ChatGLM gives you one. That is a meaningful decision because your hardware, existing infrastructure, and the language quality of the base model will affect the outcome.

Maintenance, License, and Upgrade Cost

The repository is licensed under Apache-2.0, which is permissive for both research and commercial use, but the model weights and data may have separate terms; the README does not clarify that. The last push was in July 2026, and the project is not archived, but the news section shows the most recent activity is a paper acceptance in 2024 and a technical report in 2023. The 2023 news items are hidden behind a collapsible section, which suggests the project's active development phase has passed. The maintenance cost is low if you use the released adapters as-is, because you only need to download weights and run inference. The upgrade cost is higher if you want to retrain on your own data, because you must construct a dataset in the specified JSON format and have a GPU that meets the stated requirements. The repository does not provide a clear versioning scheme or a changelog, so tracking changes between the different base model releases is not straightforward. The data construction code is mentioned as 'still being organized' and not yet released, which means you cannot easily reproduce the dataset generation pipeline. That is a significant gap for anyone who wants to extend the data to new diseases or new knowledge sources.

Editorial conclusion

Adopt BenTsao if you need a concrete, reproducible starting point for instruction-tuning a Chinese medical LLM with LoRA, especially if you already run LLaMA, Alpaca, Bloom, or Huozi. Do not adopt it for production clinical use: the training data is openly acknowledged to contain errors, the models are research artifacts, and the evaluation shown is a single dated sample. Before use, verify the LoRA weights you download match the base model exactly, check the prompt template for your chosen base model, and inspect the data format in ./data/infer.json. Also confirm your GPU meets the 24GB minimum noted in the README, or plan to reduce batch_size. The project's value is as a documented method and dataset, not as a finished medical assistant.

Official sources

  1. Issues
  2. License: Apache-2.0
  3. README
  4. SCIR-HI/Huatuo-Llama-Med-Chinese on GitHub
Community notes

Community notes