Method and device for constructing traditional chinese medicine diagnosis and treatment knowledge model

By transforming a general-purpose large language model into a TCM-specific model through multi-stage training, the problem of insufficient diagnostic accuracy and clinical decision reliability in TCM diagnosis and treatment is solved. This enables the efficient construction of TCM diagnosis and treatment knowledge models and improves the accuracy and reliability of diagnosis and decision-making.

CN122133773APending Publication Date: 2026-06-02DONGFANG HOSPITAL BEIJING UNIV OF CHINESE MEDICINE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DONGFANG HOSPITAL BEIJING UNIV OF CHINESE MEDICINE
Filing Date
2026-02-28
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing medical AI models lack diagnostic accuracy and clinical decision-making reliability in TCM diagnosis and treatment, and are unable to effectively capture the professional knowledge system of expert physicians.

Method used

The general-purpose basic language model is transformed into a model specifically for the field of traditional Chinese medicine. Through a multi-stage training process, it learns the TCM diagnostic and treatment thinking, diagnostic reasoning path, and the unique knowledge and diagnostic and treatment thinking of the target famous doctor. It is trained using causal language model, cross-entropy, GRPO and KTO algorithms to construct a TCM diagnostic and treatment knowledge model.

Benefits of technology

This improves the diagnostic accuracy and clinical decision reliability of TCM diagnosis and treatment models, enabling the models to not only grasp general knowledge in the field of TCM but also to be biased towards the unique diagnostic and treatment thinking of the target renowned doctors, thereby enhancing the ability to generate personalized treatment plans.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122133773A_ABST
    Figure CN122133773A_ABST
Patent Text Reader

Abstract

This application discloses a method and apparatus for constructing a Traditional Chinese Medicine (TCM) diagnostic and treatment knowledge model. The method includes: transforming a general-purpose basic language model into a model specifically for the TCM field to obtain a basic TCM model; controlling the obtained basic TCM model to learn diagnostic and treatment thinking within the TCM field to obtain a basic TCM diagnostic and treatment model; aiming to enhance the flexibility of logical reasoning in the obtained basic TCM diagnostic and treatment model, controlling the obtained basic TCM diagnostic and treatment model to learn the diagnostic reasoning paths of clinical cases in the TCM field to obtain a TCM reasoning diagnostic and treatment model; controlling the obtained TCM reasoning diagnostic and treatment model to learn the unique TCM knowledge and unique diagnostic and treatment thinking of a target renowned physician to obtain a unique TCM diagnostic and treatment model; and controlling the obtained unique TCM diagnostic and treatment model to favor the unique diagnostic and treatment thinking of the target renowned physician to obtain a TCM diagnostic and treatment knowledge model. This improves the diagnostic accuracy and clinical decision-making reliability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the medical field, and more specifically, to a method and apparatus for constructing a knowledge model for traditional Chinese medicine diagnosis and treatment. Background Technology

[0002] Medicine is essentially an empirical science built upon centuries of accumulated practical experience. Clinical practice is the primary application area of ​​this knowledge system. It is a highly complex medical endeavor requiring precise and meticulous procedures. Its core challenge lies in individual patient differences; even when diagnosed with the same disease, symptoms can vary significantly. Unlike the standardized environment of a laboratory, clinicians must conduct in-depth analysis of each case, integrating symptom presentation with etiological characteristics to develop the optimal treatment plan. Mastering this diagnostic and treatment process requires years of accumulated clinical experience. Through this experience, doctors can utilize existing medical knowledge, identify its limitations, and develop personalized treatment plans for specific diseases and individual patients.

[0003] However, differences in cure rates among clinicians treating the same disease persist due to various factors, such as variations in experience, theoretical understanding, and case analysis skills. A physician's cure rate reflects their systematic understanding of the etiology of a specific disease, individual patient differences, and treatment strategies. A higher cure rate indicates more specialized and precise diagnostic and treatment capabilities, but the scarcity of renowned physicians severely restricts clinical practice. Training doctors requires extensive reading of professional books and participation in broad clinical practice, ultimately leading to the formation of unique clinical theories. Developing an excellent physician often takes more than a decade. Besides the significant time commitment required for professional knowledge accumulation, the dissemination and transmission of this personalized diagnostic and treatment knowledge system also faces inefficiencies and implementation difficulties. For example, top-tier traditional Chinese medicine practitioners typically pass on their experience through apprenticeships within small groups, resulting in a limited number of trainees who master the knowledge. This bottleneck exacerbates the uneven development of skills among frontline clinicians (especially inexperienced young physicians). Therefore, establishing standardized and scalable methods for archiving and transmitting personalized diagnostic and treatment knowledge is transformative for both clinical practice and medical education. Given the cognitive limitations of human physicians, constructing a "second brain" to systematically simulate the diagnostic reasoning, treatment principles, and case-specific adaptation strategies of elite physicians, and efficiently disseminating this knowledge in a standardized and scalable manner, remains an open challenge that urgently needs to be addressed. Integrating artificial intelligence into healthcare as a solution may offer a potential breakthrough in addressing these challenges. Recent research indicates that Large Language Models (LLMs) have now approached human-level performance in many tasks. However, tools such as GeneGPT, BioGPT, AlphaFold, Tianyi, and TCM-Chat have key shortcomings in diagnostic accuracy and the reliability of clinical decision-making. Current medical AI methods have failed to capture the holistic characteristics of expert physicians' professional knowledge systems.

[0004] Therefore, improving the diagnostic accuracy and clinical decision reliability of the model has become a technical problem that needs to be solved in this field. Summary of the Invention

[0005] In view of this, this application proposes a method and apparatus for constructing a TCM diagnosis and treatment knowledge model, so as to improve the diagnostic accuracy and clinical decision reliability of the model.

[0006] Firstly, this application provides a method for constructing a TCM diagnostic and treatment knowledge model. This method includes: transforming a general basic language model into a model specifically for the TCM field to obtain a basic TCM model; controlling the obtained basic TCM model to learn diagnostic and treatment thinking within the TCM field to obtain a basic TCM diagnostic and treatment model; aiming to enhance the flexibility of logical reasoning in the obtained basic TCM diagnostic and treatment model, controlling the obtained basic TCM diagnostic and treatment model to learn the diagnostic reasoning paths of clinical cases in the TCM field to obtain a TCM reasoning diagnostic and treatment model; controlling the obtained TCM reasoning diagnostic and treatment model to learn the unique TCM knowledge and unique diagnostic and treatment thinking of a target renowned physician to obtain a unique TCM diagnostic and treatment model; and controlling the obtained unique TCM diagnostic and treatment model to favor the unique diagnostic and treatment thinking of the target renowned physician to obtain a TCM diagnostic and treatment knowledge model.

[0007] Optionally, the general-purpose basic language model is transformed into a model specifically for the field of traditional Chinese medicine (TCM) to obtain a TCM basic model. This includes: performing unsupervised autoregressive training on the general-purpose basic language model based on a TCM corpus dataset, using the loss function of a causal language model as the training objective, to obtain the TCM basic model. The TCM corpus dataset is constructed based on TCM higher education textbooks, publications from various TCM schools, and TCM research papers.

[0008] Optionally, the obtained TCM basic model is controlled to learn the diagnostic and treatment thinking in the field of TCM to obtain a TCM basic diagnosis and treatment model. This includes: based on a TCM general instruction dataset, the obtained TCM basic model is trained by supervised learning with the goal of minimizing the cross-entropy between the model response and the supervision label to obtain a TCM basic diagnosis and treatment model. The TCM general instruction dataset is constructed based on TCM clinical cases, TCM doctor-patient consultation records, TCM knowledge monographs, and TCM knowledge graphs.

[0009] Optionally, with the goal of enhancing the flexibility of logical reasoning in the obtained TCM basic diagnosis and treatment model, the obtained TCM basic diagnosis and treatment model is controlled to learn the diagnostic reasoning path of clinical cases in the field of TCM to obtain a TCM reasoning diagnosis and treatment model. This includes: training the obtained TCM basic diagnosis and treatment model based on a TCM reasoning dataset using the GRPO algorithm to obtain a TCM reasoning diagnosis and treatment model, wherein the TCM reasoning dataset is constructed based on the diagnostic reasoning path of TCM clinical cases.

[0010] Optionally, the obtained TCM reasoning and diagnosis model is controlled to learn the unique TCM knowledge and unique diagnosis and treatment thinking of the target famous doctor to obtain a unique TCM diagnosis and treatment model. This includes: training the obtained TCM reasoning and diagnosis model based on a unique TCM instruction dataset using the GRPO algorithm to obtain a unique TCM diagnosis and treatment model. The unique TCM instruction dataset is constructed based on the systematic knowledge and clinical cases of the target famous doctor. The systematic knowledge includes books and papers.

[0011] Optionally, the obtained TCM unique diagnosis and treatment model is controlled to favor the unique diagnosis and treatment thinking of the target famous doctor in order to obtain a TCM diagnosis and treatment knowledge model, including: training the obtained TCM unique diagnosis and treatment model based on the TCM unique reasoning dataset using the KTO algorithm to obtain a TCM diagnosis and treatment knowledge model, wherein the TCM unique reasoning dataset is constructed based on the clinical cases of the target famous doctor.

[0012] Optionally, constructing a unique TCM reasoning dataset includes: for each clinical case of each target physician, performing the following steps: labeling the output items of the clinical case as true labels; using the input items of the clinical case as input, generating a preset number of responses based on a preset target model; for each generated response, determining the similarity between the response and the output items of the clinical case; if the determined similarity is greater than a first preset similarity, labeling the response as a true label; if the determined similarity is less than a second preset similarity, labeling the response as a false label; using the input items of the clinical case as input, the output items and responses labeled as true labels and the responses labeled as false labels as output, constructing training samples for the clinical cases; and constructing a unique TCM reasoning dataset based on all training samples corresponding to each target physician.

[0013] Secondly, this application also provides a device for constructing a TCM diagnosis and treatment knowledge model. The device includes: a conversion module for converting a general basic language model into a model specifically for the TCM field, to obtain a basic TCM model; a first learning module for controlling the obtained basic TCM model to learn diagnostic and treatment thinking in the TCM field, to obtain a basic TCM diagnosis and treatment model; a second learning module for controlling the obtained basic TCM diagnosis and treatment model to learn the diagnostic reasoning path of clinical cases in the TCM field, with the goal of enhancing the flexibility of logical reasoning, to obtain a TCM reasoning diagnosis and treatment model; a third learning module for controlling the obtained TCM reasoning diagnosis and treatment model to learn the unique TCM knowledge and unique diagnostic and treatment thinking of a target renowned physician, to obtain a unique TCM diagnosis and treatment model; and a preference module for controlling the obtained unique TCM diagnosis and treatment model to prefer the unique diagnostic and treatment thinking of the target renowned physician, to obtain a TCM diagnosis and treatment knowledge model.

[0014] Optionally, the general-purpose basic language model can be transformed into a model specifically for the field of traditional Chinese medicine (TCM) to obtain a TCM basic model. This includes: using a TCM corpus dataset and the loss function of a causal language model as the training objective, the general-purpose basic language model is trained using unsupervised autoregression to obtain the TCM basic model. The TCM corpus dataset is constructed based on TCM higher education textbooks, publications from various TCM schools, and TCM research papers.

[0015] Optionally, the obtained TCM basic model is controlled to learn the diagnostic and treatment thinking in the field of TCM to obtain a TCM basic diagnosis and treatment model. This includes: based on a TCM general instruction dataset, the obtained TCM basic model is trained by supervised learning with the goal of minimizing the cross-entropy between the model response and the supervision label to obtain a TCM basic diagnosis and treatment model. The TCM general instruction dataset is constructed based on TCM clinical cases, TCM doctor-patient consultation records, TCM knowledge monographs, and TCM knowledge graphs.

[0016] Optionally, with the goal of enhancing the flexibility of logical reasoning in the obtained TCM basic diagnosis and treatment model, the obtained TCM basic diagnosis and treatment model is controlled to learn the diagnostic reasoning path of clinical cases in the field of TCM to obtain a TCM reasoning diagnosis and treatment model. This includes: training the obtained TCM basic diagnosis and treatment model based on a TCM reasoning dataset using the GRPO algorithm to obtain a TCM reasoning diagnosis and treatment model, wherein the TCM reasoning dataset is constructed based on the diagnostic reasoning path of TCM clinical cases.

[0017] Optionally, the obtained TCM reasoning and diagnosis model is controlled to learn the unique TCM knowledge and unique diagnosis and treatment thinking of the target famous doctor to obtain a unique TCM diagnosis and treatment model. This includes: training the obtained TCM reasoning and diagnosis model based on a unique TCM instruction dataset using the GRPO algorithm to obtain a unique TCM diagnosis and treatment model. The unique TCM instruction dataset is constructed based on the systematic knowledge and clinical cases of the target famous doctor. The systematic knowledge includes books and papers.

[0018] Optionally, the obtained TCM unique diagnosis and treatment model is controlled to favor the unique diagnosis and treatment thinking of the target famous doctor in order to obtain a TCM diagnosis and treatment knowledge model, including: training the obtained TCM unique diagnosis and treatment model based on the TCM unique reasoning dataset using the KTO algorithm to obtain a TCM diagnosis and treatment knowledge model, wherein the TCM unique reasoning dataset is constructed based on the clinical cases of the target famous doctor.

[0019] Optionally, constructing a unique TCM reasoning dataset includes: for each clinical case of each target physician, performing the following steps: labeling the output items of the clinical case as true labels; using the input items of the clinical case as input, generating a preset number of responses based on a preset target model; for each generated response, determining the similarity between the response and the output items of the clinical case; if the determined similarity is greater than a first preset similarity, labeling the response as a true label; if the determined similarity is less than a second preset similarity, labeling the response as a false label; using the input items of the clinical case as input, the output items and responses labeled as true labels and the responses labeled as false labels as output, constructing training samples for the clinical cases; and constructing a unique TCM reasoning dataset based on all training samples corresponding to each target physician.

[0020] Thirdly, this application also provides a machine-readable storage medium storing instructions that cause a machine to execute the above-described construction method.

[0021] Fourthly, this application also provides an electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the executable instructions to implement the above-described construction method.

[0022] According to the technical solution of this application, a general basic language model is transformed into a model specializing in the field of Traditional Chinese Medicine (TCM) to obtain a TCM basic model. The obtained TCM basic model is then controlled to learn the diagnostic and treatment thinking in the field of TCM to obtain a TCM basic diagnostic and treatment model. With the goal of enhancing the flexibility of logical reasoning in the obtained TCM basic diagnostic and treatment model, the obtained TCM basic diagnostic and treatment model is then controlled to learn the diagnostic reasoning path of clinical cases in the field of TCM to obtain a TCM reasoning diagnostic and treatment model. The obtained TCM reasoning diagnostic and treatment model is then controlled to learn the unique TCM knowledge and unique diagnostic and treatment thinking of the target renowned doctor to obtain a TCM unique diagnostic and treatment model. The obtained TCM unique diagnostic and treatment model is then controlled to favor the unique diagnostic and treatment thinking of the target renowned doctor to obtain a TCM diagnostic and treatment knowledge model. In this way, the construction of a TCM diagnostic and treatment knowledge model is achieved. Furthermore, the constructed TCM diagnosis and treatment knowledge model not only learns the diagnostic and treatment thinking and clinical case diagnosis reasoning path in the field of TCM, but also learns the unique TCM knowledge and unique diagnostic and treatment thinking of the target renowned physician. Moreover, the constructed TCM diagnosis and treatment knowledge model is more biased towards the unique diagnostic and treatment thinking of the target renowned physician. In this way, the constructed TCM diagnosis and treatment knowledge model can capture both general knowledge in the field of TCM and professional knowledge of expert physicians, and is more inclined to make diagnoses and decisions based on the target renowned physician, thereby improving the accuracy of diagnosis and the reliability of clinical decisions.

[0023] Other features and advantages of this application will be described in detail in the following detailed description section. Attached Figure Description

[0024] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application, and the illustrative embodiments and descriptions thereof are used to explain this application. In the drawings: Figure 1 A flowchart of a method for constructing a TCM diagnosis and treatment knowledge model according to a preferred embodiment of this application; Figure 2 This is a structural block diagram of a device for constructing a traditional Chinese medicine diagnosis and treatment knowledge model according to a preferred embodiment of this application. Detailed Implementation

[0025] The technical solution of this application will now be described in detail with reference to the accompanying drawings and embodiments.

[0026] Firstly, this application provides a method for constructing a knowledge model for TCM diagnosis and treatment.

[0027] Figure 1 This is a flowchart illustrating a method for constructing a traditional Chinese medicine diagnostic and treatment knowledge model according to a preferred embodiment of this application. Figure 1 As shown, the construction method includes the following.

[0028] In step S10, the general-purpose basic language model is transformed into a model specifically for the field of Traditional Chinese Medicine (TCM) to obtain the TCM basic model. This TCM basic model can be named the TCM-SC-base model. This stage constitutes the construction of the basic model for the medical field.

[0029] Optionally, the general-purpose foundational language model could be the Qwen-2.5 series. The training corpus of the Qwen-2.5 series contains 18 trillion general-purpose tags. Specifically, the general-purpose foundational language model could be the Qwen2.5-1.5B model. Among them, the Qwen2.5-1.5B model is currently the largest open-source Chinese model, capable of running efficiently with extremely limited computing resources. It possesses strong Chinese understanding capabilities and a certain level of basic knowledge of Traditional Chinese Medicine (TCM), making it very suitable as a foundational model for building TCM-related systems. At this stage, our goal is to significantly improve the Qwen2.5-1.5B model's understanding of TCM knowledge while preserving its general-purpose capabilities as much as possible.

[0030] Alternatively, it could be transformed into a model specializing in the field of Traditional Chinese Medicine by controlling a general-purpose basic large language model to learn professional knowledge in the field of Traditional Chinese Medicine.

[0031] In step S11, the obtained TCM basic model is controlled to learn diagnostic and treatment thinking in the field of TCM to obtain a TCM basic diagnostic and treatment model. This TCM basic diagnostic and treatment model can be named the TCM-SC-normal-instruct model. This stage involves learning standard TCM diagnostic and treatment strategies and adopting standard TCM diagnostic and treatment thinking.

[0032] In step S12, with the goal of enhancing the flexibility of logical reasoning in the obtained TCM basic diagnostic and treatment model, the model is controlled to learn the diagnostic reasoning path of clinical cases in the field of TCM to obtain a TCM reasoning diagnostic and treatment model. This TCM reasoning diagnostic and treatment model can be named the TCM-SC-normal-reasoning model. This stage is a reasoning-based diagnostic and treatment enhancement fine-tuning, which enhances the model's reasoning and deductive abilities based on standard TCM diagnostic and treatment thinking.

[0033] In step S13, the obtained TCM reasoning and diagnosis model is controlled to learn the unique TCM knowledge and unique diagnostic thinking of the target renowned physician, thereby obtaining a unique TCM diagnosis and treatment model. This unique TCM diagnosis and treatment model can be named the TCM-SC-unique instruction model. Furthermore, the unique TCM knowledge of the target renowned physician represents their understanding of the field of TCM and is the TCM knowledge summarized and generalized by the physician; the unique diagnostic thinking of the target renowned physician is the diagnostic thinking summarized and generalized by the physician. This stage involves fine-tuning the unique medical knowledge, enabling the model to learn the physician's diagnostic knowledge system after acquiring standard TCM reasoning logic. Moreover, the target renowned physician is an outstanding physician in the field. In this application, the number of target renowned physicians can be determined according to specific circumstances and is not limited thereto.

[0034] In step S14, the obtained TCM unique diagnosis and treatment model is controlled to favor the unique diagnostic and treatment thinking of the target renowned doctor, so as to obtain a TCM diagnosis and treatment knowledge model. This stage is a unique diagnosis and treatment strategy reinforcement learning based on reasoning, which enables the model to refine its diagnostic and treatment thinking in order to imitate the diagnosis and treatment methods of renowned doctors.

[0035] Furthermore, in this embodiment, the target specialist can also correspond to a specific disease, with treatment for a particular disease based on its corresponding target specialist. For example, an interactive interface can be set up where users can select a target specialist; or a disease name can be set, and the model automatically matches the corresponding target specialist based on the disease name.

[0036] Optionally, in this embodiment of the application, the general basic language model is transformed into a model specifically for the field of traditional Chinese medicine to obtain a basic model of traditional Chinese medicine, which may include the following:

[0037] Based on a Traditional Chinese Medicine (TCM) corpus dataset, and using the loss function of a causal language model as the training objective, an unsupervised autoregressive training method is employed to train a general-purpose basic language model, thereby obtaining a TCM basic model. The TCM corpus dataset was constructed from TCM higher education textbooks, publications from various TCM schools, and TCM research papers. Furthermore, the loss function can be the minimization of the negative log-likelihood function.

[0038] The Traditional Chinese Medicine Corpus dataset represents a collection of TCM samples, each sample consisting of tokenized semantic units of TCM text.

[0039] The TCM Corpus is a corpus covering TCM medical and clinical texts, designed specifically for TCM pre-training. For example, the corpus can integrate 1.65 million samples from three sources, totaling 3.4 billion tags. The specific sources are as follows: (1) TCM higher education textbooks planned by the Chinese government, including 126 TCM higher education textbooks planned, covering disciplines such as TCM research, Chinese materia medica, acupuncture, massage, integrated TCM and Western medicine clinical medicine and nursing. These textbooks were compiled by more than 3,500 experts from more than 30 universities across the country, representing authoritative achievements in the field of TCM higher education. (2) Publications from various TCM schools, this collection includes publications from ten major schools, namely the Classical Medicine School, Classical Formula School, Cold Injury School, Harmonizing School, Purgative School, Yin-tonifying School, Yishui School, Warming and Tonifying School, Warm Disease School and Integration School, with a sample size of 1.5 million entries. (3) Research papers on traditional Chinese medicine: a total of 99,000 samples were collected from various clinical studies and case analyses written by many famous TCM doctors (including our research subjects: Gu Xiaohong, Du Huaitang, Wang Fengchun, Zhao Shaoqin and Qin Bowei).

[0040] Optionally, the TCM corpus dataset can be preprocessed first, including removing special tags and characters, and undergoing structuring to ensure data quality.

[0041] Optionally, in the embodiments of this application, controlling the obtained TCM basic model to learn the diagnostic and treatment thinking in the field of TCM to obtain a TCM basic diagnostic and treatment model may include the following:

[0042] Based on the TCM general instruction dataset, with the goal of minimizing the cross-entropy between the model response and the supervision label, the obtained TCM basic model is trained by supervised learning to obtain a TCM basic diagnosis and treatment model. The TCM general instruction dataset is constructed based on TCM clinical cases, TCM doctor-patient consultation records, TCM knowledge monographs, and TCM knowledge graphs.

[0043] In the stage of transforming the general-purpose basic language model into a model specifically for the field of Traditional Chinese Medicine (TCM), incremental training was performed on the general-purpose basic language model using medical knowledge, enabling it to gain a deeper and more comprehensive understanding of TCM knowledge. Subsequently, based on a TCM basic database, we used a TCM general instruction dataset to focus on training the model's conventional TCM diagnostic and treatment reasoning logic and its ability to answer questions related to TCM knowledge. This stage employed a supervised learning method, which involved two rounds of training on all samples from the TCM general instruction dataset. The training objective was to minimize the cross-entropy between the model's response and the supervision label.

[0044] In this application, a general TCM instruction dataset can be constructed based on the following: To enable the model to master the basic diagnostic and treatment thinking of TCM, a high-quality Chain of Thought (CoT) reasoning model is integrated to construct training samples. The dataset contains 302,000 samples, totaling 8 million words, and mainly includes the following: (1) TCM clinical medical records, 30,000 samples are derived from real-world TCM electronic medical records, covering a variety of diseases in different systems, such as respiratory febrile diseases and gastrointestinal diseases. (2) TCM doctor-patient consultation records. 2,000 samples are derived from audio records of actual diagnosis and treatment by well-known TCM doctors, including doctor-patient dialogues, disease etiology and mechanism analysis, syndrome diagnosis, syndrome differentiation and treatment thinking, Chinese medicine prescriptions and prescription descriptions. (3) TCM knowledge monographs. In addition to the above data types with essential theoretical characteristics, the content is also reconstructed from TCM knowledge monographs (such as "Compilation of xxx Syndromes", "xxx Prescriptions", etc.). These books typically include descriptions of syndromes, analyses of prescriptions, analyses of the causes of syndromes and their etiologies, explanations of indications, treatment principles, and the composition of commonly used prescriptions. They also include a Traditional Chinese Medicine (TCM) knowledge graph. Based on the logic of TCM clinical practice, a reasoning chain was designed to organize these entries through a specific logical sequence, thereby generating a batch of standardized TCM syndrome differentiation and treatment theory samples with a unified structure and writing style. By introducing the theoretical structure into TCM guidance samples, the model can systematically learn how to perform reasoning and analysis based on this knowledge and clinical symptoms, laying the foundation for subsequent tasks.

[0045] Optionally, in the embodiments of this application, with the goal of enhancing the flexibility of logical reasoning in the obtained TCM basic diagnosis and treatment model, controlling the obtained TCM basic diagnosis and treatment model to learn the diagnostic reasoning path of clinical cases in the field of TCM to obtain a TCM reasoning diagnosis and treatment model may include the following:

[0046] Based on the TCM reasoning dataset, the GRPO algorithm is used to train the obtained TCM basic diagnosis and treatment model to obtain the TCM reasoning diagnosis and treatment model. The TCM reasoning dataset is constructed based on the diagnostic reasoning path of TCM clinical cases.

[0047] The TCM basic diagnostic and treatment model, based on learned TCM diagnostic knowledge and reasoning logic from routine clinical cases, utilizes relevant patient case information to generate complete diagnostic and treatment plans. However, due to limitations in the training method, the diagnostic and treatment plans generated by the TCM basic diagnostic and treatment model have a significant drawback: the content is often too rigid, lacking sufficient flexibility for personalized case analysis and contextual association. To address this issue and enhance the logical reasoning flexibility and innovation capability of the TCM basic diagnostic and treatment model, we use a TCM reasoning dataset and employ the GRPO algorithm through reinforcement learning to improve its logical reasoning adaptability. The model trained in this stage is named the TCM-SC-normal-reasoning model.

[0048] In the stage of defining the TCM reasoning and diagnosis model, to enhance the model's generalization ability and flexibility in seven TCM tasks (including etiology and pathogenesis analysis, syndrome differentiation, treatment methods, prescriptions, prescription interpretation, prescription modification, and nursing care based on TCM knowledge), output diversification was performed on all samples containing CoT reasoning logic. This included generating multiple outputs for the same input using the model from the previous stage. A rejection sampling strategy was used to retain outputs highly consistent with the input question, TCM theory, and TCM logic, while filtering out erroneous outputs. This model-based diversification approach enhanced the model's ability to generate diverse and universally correct outputs while ensuring adherence to the TCM thought process. Subsequently, the Group Relative Policy Optimization (GRPO) algorithm was applied to guide the model to explore personalized reasoning paths, learn from errors, and gradually converge to the correct logical process.

[0049] Specifically, a TCM reasoning dataset is constructed based on the following: (1) The model trained using the GRPO algorithm infers the “instruction” field of the CoT (Chain-of-Thought) samples in the TCM general instruction dataset using the vLLM framework, generating 10 responses for each sample. The CoT samples correspond to clinical medical records. In addition, the “instruction” field corresponds to the part of the clinical medical record that describes the patient’s condition. The content consisting of the instruction, medical history, current symptoms, signs, tongue and pulse conditions, etc., which are the types of operations to be performed by the instruction model, is called “instruction”. In addition, the model trained using the GRPO algorithm is a model obtained by training the TCM-SC-normal-instruct model based on manually labeled CoT samples. (2) The best N method is used to score the responses to specific prompts using Deepseek-V3.2. (3) Samples with scores greater than 8.5 are selected to form the final augmented dataset, namely, the TCM reasoning dataset, which includes 96,000 samples and a total of 2.18 million labels. The reasoning process includes obtaining the following information: based on Traditional Chinese Medicine (TCM) knowledge, analysis of etiology and pathogenesis, differentiation of syndromes, treatment methods, prescriptions, explanations of prescriptions, modifications to prescriptions, and nursing care. Specifically, this involves: 1) obtaining the patient's current symptoms; 2) analyzing the TCM pathogenesis by combining different symptom combinations; 3) forming a current symptom diagnosis based on the results of the pathogenesis analysis; 4) selecting treatment methods based on the symptom diagnosis and pathogenesis analysis; 5) selecting the main prescription based on the symptom diagnosis and treatment methods; 6) generating a drug combination based on the main prescription; 7) analyzing the prescription (explanation of prescriptions); 8) predicting symptom changes and possible modifications to prescriptions; and 9) nursing care.

[0050] Optionally, in the embodiments of this application, controlling the obtained TCM reasoning and diagnosis model to learn the unique TCM knowledge and unique diagnosis and treatment thinking of the target famous doctor in order to obtain a unique TCM diagnosis and treatment model may include the following:

[0051] Based on a unique TCM instruction dataset, the GRPO algorithm is used to train the resulting TCM reasoning and diagnosis model, thus obtaining a unique TCM diagnosis and treatment model. The unique TCM instruction dataset is constructed based on the knowledge system and clinical cases of the target renowned physicians, including books and papers. It should be noted that the data from the target renowned physicians included can be determined based on specific circumstances, and there are no restrictions on this.

[0052] After completing the above stages, the TCM reasoning and diagnosis model possesses relatively flexible TCM diagnostic reasoning capabilities. This model can dynamically integrate learned general TCM knowledge with the patient's clinical condition, providing personalized treatment plans, including etiological analysis, syndrome diagnosis, treatment principle suggestions, TCM prescription generation, prescription interpretation, post-medication symptom prediction, TCM adjustment, and precautions. To enable the TCM reasoning and diagnosis model to learn and master the unique diagnostic methods or treatment philosophies and logic of multiple target TCM physicians, it underwent fine-tuning using a unique TCM instruction dataset. This stage focuses on TCM specialty knowledge and diagnostic philosophy. Unlike the second stage, we retained knowledge-based samples, traditional TCM case reasoning samples, and newly constructed target renowned physician reasoning samples. This ensures that the TCM reasoning and diagnosis model maintains its general clinical reasoning capabilities and knowledge-based question-answering abilities within the TCM field.

[0053] The purpose of constructing a unique TCM instruction dataset is to enable the model to comprehensively learn the clinical diagnostic and treatment characteristics, experience, and theoretical systems of renowned TCM experts. Based on a grasp of traditional TCM diagnostic and treatment thinking and abilities derived from the target physicians' real clinical cases, we analyzed their published papers to summarize their clinical characteristics and designed logical reasoning samples reflecting their unique style according to the Theoretical Structure of Technology (CoT) and TCM diagnostic and treatment thinking. In addition to the theoretical structure of the dataset, we also incorporated Retrieval Augmentation (RAG) methods during model training and optimization to enhance the model's ability to apply these theoretical systems in clinical practice.

[0054] Specifically, expert knowledge bases were constructed for five renowned doctors. Each knowledge base consists of a set of text sequences, each containing 512 tags after word segmentation. For each clinical case of these renowned doctors, their content was matched against the knowledge bases. The three expert knowledge fragments with the highest matching degree were concatenated with the clinical case information in a specific format and used as model input. In addition, at this stage, we can also integrate non-reasoning samples, especially knowledge-based samples, including: 1) TCM knowledge question-and-answer data, 100,000 samples from real TCM exam questions (including the TCM physician qualification exam and the TCM postgraduate entrance exam); 2) TCM knowledge graph, 20,000 samples from the (TCM multimodal knowledge graph) constructed in previous research. The purpose of adding these samples is to enable the model to perform other conventional tasks, such as knowledge question answering, while maintaining its logical reasoning ability based on TCM knowledge.

[0055] Specifically, inference samples in a dataset of unique TCM instructions can be constructed based on the following:

[0056] Based on the clinical records of the target renowned physician, determine the content of the "input" and "output" fields respectively.

[0057] We collected published books and papers by the target renowned physicians, extracted their main content, and constructed a knowledge base. We then used the obtained TCM reasoning and diagnosis model to segment the knowledge base, generating segmented word sequences. These word sequences were further divided into knowledge blocks containing multiple lexical units (e.g., blocks of 512 lexical units). During segmentation, punctuation marks in complete sentences were segmented to ensure the semantic integrity of each expert knowledge block. We used the Gte-Qwen1.5-7B Chinese text embedding model to calculate the similarity between the segmented knowledge blocks and the clinical cases of the target renowned physicians. The three knowledge blocks with the highest scores were selected and populated into the "Input" field of the dataset.

[0058] The missing data in the target renowned physician's case studies are supplemented to make the "output" fields more complete. 1) Obtain the clinical case studies of the target renowned physician; 2) Use the obtained TCM reasoning and diagnosis model to analyze the pathogenesis, explain the prescription, predict symptoms, and adjust the medication to complete the output.

[0059] Furthermore, in this application, the supplemented and complete sample can be submitted to the target renowned doctor or his disciple for modification, and the final verified content can be used as the output to construct a unique TCM instruction dataset.

[0060] Optionally, in the embodiments of this application, controlling the obtained TCM unique diagnosis and treatment model to favor the unique diagnosis and treatment thinking of the target famous doctor in order to obtain a TCM diagnosis and treatment knowledge model may include the following:

[0061] Based on a unique TCM reasoning dataset, the KTO algorithm is used to train the obtained unique TCM diagnosis and treatment model to obtain a TCM diagnosis and treatment knowledge model. The unique TCM reasoning dataset is constructed based on the clinical cases of the target famous doctors.

[0062] After learning the unique TCM knowledge and diagnostic thinking of the target renowned TCM doctors, this study further consolidates the consistency between the unique TCM diagnostic and treatment model and the characteristic knowledge system and diagnostic reasoning preferences of these outstanding TCM doctors, while enhancing their flexible diagnostic reasoning ability. To this end, an independently constructed TCM unique reasoning dataset was used, and the KTO algorithm was employed for reinforcement learning to strengthen the capabilities of the aforementioned unique TCM diagnostic and treatment model.

[0063] Optionally, the TCM-specific inference dataset includes real and fake labels, and the training objective is to make the TCM-specific diagnosis and treatment model more biased towards real labels.

[0064] Optionally, in embodiments of this application, constructing a unique TCM reasoning dataset may include the following.

[0065] For each clinical case of a target physician, the following steps are performed: The output items of the clinical case are labeled as true labels. Using the input items of the clinical case as input, a preset number of responses are generated based on a preset target model. In this application, the preset value can be determined according to specific circumstances; for example, the preset value can be 5. For example, the preset target model can be a general basic large language model, specifically, the preset target model can be the Qwen2.5-1.5B model. For each generated response, the similarity between the response and the output items of the clinical case is determined. If the determined similarity is greater than a first preset similarity, the response is labeled as a true label; if the determined similarity is less than a second preset similarity, the response is labeled as a false label. Optionally, a binary classifier can be used to calculate the similarity using the obtained unique TCM diagnosis and treatment model. Furthermore, the first preset similarity can be 90%, and the second preset similarity can be 60%. Using the input items of the clinical case as input, the output items and responses labeled as true labels and the responses labeled as false labels as output, a training sample of the clinical case is constructed.

[0066] Based on all the training samples corresponding to each target doctor, a unique inference dataset for traditional Chinese medicine is constructed.

[0067] In this application, in order to guide the model to favor the unique clinical experience of the target renowned doctors, we constructed a new dataset with “real” or “fake” labels based on the TCM doctor-four-city-teaching dataset containing 381,000 samples and a total of 9.353 million labels.

[0068] In this application, the optimization of multiple preference objectives can be unified through Knowledge Transfer Optimization (KTO). Compared with traditional reinforcement learning, KTO shows stronger robustness to noisy data and can effectively handle imbalanced data scenarios (e.g., 90% of the samples are high-quality data).

[0069] This application provides a general framework that enables a general-purpose large language model to systematically learn various types of knowledge. The model requires the simultaneous generation of seven TCM tasks and the target TCM physician's knowledge system, including etiology and pathogenesis analysis, syndrome differentiation, treatment methods, prescriptions, prescription explanations, prescription modifications, and nursing care based on TCM knowledge. The construction of the general framework comprises five stages: building a basic medical model, learning conventional TCM diagnostic and treatment strategies, fine-tuning and reinforcement of diagnostic and treatment based on reasoning, fine-tuning of unique medical knowledge, and reinforcement learning of unique diagnostic and treatment strategies based on reasoning. To achieve the complete transfer of the target knowledge system, various resources are systematically integrated to present clinical theories, treatment paradigms, traditional medical thought, and clinical diagnostic and treatment reasoning logic, and applied to each of the above stages. The research results of outstanding TCM physicians are usually summarized and verified by their students. These knowledge systems contain systematic knowledge of syndrome differentiation and treatment for specific diseases or typical symptom clusters, as well as how to apply such knowledge to clinical cases, thus forming the most authoritative and comprehensive knowledge system of the target physician. The combination of clinical cases from the target physician constitutes primary evidence, truthfully recording the process by which they applied characteristic clinical reasoning logic in syndrome differentiation and personalized treatment intervention. The systematic nature and completeness of these two types of content are sufficient to demonstrate the diagnostic and treatment philosophy and practice of TCM masters. The main challenge lies in how to achieve optimal utilization of these resources. To fully explore these resources, we designed five different tasks in five stages and organized these resources accordingly in various formats.

[0070] Furthermore, in this application, a series of customized datasets were developed to support a multi-stage general framework. All evaluation data used for comparing models were collected independently. The construction of the datasets may include the following.

[0071] First, the general-purpose basic language model was incrementally pre-trained using a Traditional Chinese Medicine (TCM) corpus. The TCM corpus contains a large-scale collection of TCM literature, covering standardized textbooks, classic works, professional books, and clinical research papers. Specifically, it was constructed based on TCM higher education textbooks, publications from various TCM schools, and TCM research papers.

[0072] Secondly, in order to enable the model to have conventional diagnosis and treatment strategies and clinical reasoning capabilities, various TCM resources are integrated into a TCM general instruction dataset, which is then applied to the second stage, namely, TCM conventional diagnosis and treatment strategy learning. The integrated TCM resources include TCM clinical case records, TCM doctor-patient consultation records, TCM knowledge monographs, and TCM knowledge graphs.

[0073] Third, to cultivate comprehensive diagnostic reasoning abilities encompassing etiological analysis, syndrome diagnosis, treatment principles, TCM prescription generation, interpretation, efficacy prediction, and medical advice, a third stage is designed: reasoning-based diagnostic enhancement and fine-tuning. This involves constructing a TCM reasoning dataset, which is built based on the diagnostic reasoning paths of TCM clinical cases. The TCM reasoning dataset is generated by annotating the complete diagnostic reasoning paths of real clinical cases.

[0074] Subsequently, in the fourth stage, the fine-tuning of TCM-specific knowledge, a unique TCM instruction dataset was introduced. This dataset was constructed based on the clinical cases and systematic knowledge of outstanding TCM physicians, enabling the model to internalize unique diagnostic and treatment philosophies and prescribing habits. The systematic knowledge of the target renowned physicians includes their published books and papers.

[0075] Finally, in the fifth stage, a unique policy reinforcement learning based on reasoning, the physician's cases were expanded and inconsistent treatment plans were filtered out. These plans, mixed with the original samples, were formatted into a TCM-specific reasoning dataset. Reinforcement learning was performed using the KTO algorithm, employing preferred samples generated during fine-tuning and model rejection samples. All electronic medical records were de-identified to protect patient privacy.

[0076] This application provides a general framework for constructing a large language model capable of systematically learning and inheriting the unique diagnostic and treatment knowledge of human physicians. This framework has been validated in tasks involving the preservation and transmission of clinical experience from renowned TCM doctors. It includes five training phases and can be based on the Qwen-2.5-1.5B model. Through diverse TCM task designs, the general-purpose basic large language model is adapted to the medical field, transforming it into a diagnostic and treatment "expert" to achieve optimal performance in the target task.

[0077] A physician's expertise is not merely a simple aggregation of classification / generation tasks, but a comprehensive framework. This framework originates from the physician's mastery and understanding of basic medical knowledge, evolves through reflective refinement of diagnostic principles to adapt to the medical knowledge system, and matures through continuous harmonization of theoretical knowledge and clinical practice. To realistically reproduce this process, an AI system must integrate diverse medical knowledge through a reasoning-consistent architecture, constructing an internal reasoning path that matches the target physician's decision-making logic. Only this anthropomorphic modeling can simulate expert-level diagnostic and treatment practices in real-world scenarios. The general framework provided in this application can achieve this anthropomorphic modeling.

[0078] The dataset constructed in this application is shown in Table 1.

[0079] Table 1 This application uses the experience and knowledge of five renowned traditional Chinese medicine practitioners as examples to demonstrate the effectiveness and efficiency of the constructed general framework. The general framework constructed in this application is named Med-shicheng.

[0080] 1) Machine Testing The evaluation results of deepseek-V3.2 show that Med-shicheng, GPT-5, deepseek-R1, and Qwen3-235B-A22B-Thinking ranked among the top four in all comparative models. However, no model consistently achieved the highest score across all cases involving the target renowned physicians. deepseek-R1 achieved the highest scores in the theoretical application, etiology and pathogenesis analysis, treatment principles, and syndrome differentiation and treatment of Du Huaitang, Wang Fengchun, and Zhao Shaoqin. Qwen3-235B-A22B-Thinking achieved the highest scores in these areas in the case of Dr. Gu Xiaohong, while GPT-5 performed similarly in the case of Dr. Qin Bowei. Med-shicheng outperformed Gemini-2.5-pro and GPT-5 in most models, indicating that Med-shicheng, requiring only 1.5 billion parameters, can accurately explain the causes of current symptoms through the knowledge system of the target renowned physicians, thanks to its stable reasoning ability. Based on the training strategy and dataset, this ability is primarily built upon sufficient pre-training with TCM knowledge and a carefully designed strategy to learn the specific knowledge systems of TCM experts that differentiate the target, while also benefiting from the fact that these specific knowledge systems originate from the same theoretical foundation. For Qwen2.5-1.5B-instruct, Tianyi, and Huatuo GPT2-7B, the total scores of these three large models are all below 10, indicating that regardless of the parameter size (from 1.5B to 7B), they have limited ability to grasp the special knowledge system that distinguishes TCM experts.

[0081] The ability of general-purpose large language models (LLMs) to some extent outperforms that of specially trained Traditional Chinese Medicine Large Language Models (TCM LLMs), indicating that adequate and efficient training strategies and methods are helpful and promising for the construction of domain-specific large language models.

[0082] 2) Human evaluation Eighteen experienced TCM practitioners were invited to evaluate the responses generated by all comparative models. DeepSeek, Qwen2.5, Qwen3, Tianyi, GPT5, Huatuo model, and Gemini model were selected for comparison. The results showed that the Med-shicheng model performed superiorly in almost all tasks. After the human TCM practitioners completed their evaluations of all models, we conducted brief interviews with each model. All TCM practitioners agreed that while some general-purpose language models (such as DeepSeek and Gemini) exhibit rigorous analytical logic in their expression, aligning with TCM diagnostic and treatment approaches, their content still significantly differs from the practitioners' professional diagnostic and treatment concepts and medication habits. Furthermore, these models often generate lengthy and redundant content. In contrast, the Med-shicheng model showed a high degree of consistency in writing style, content length, diagnostic and treatment concepts, and medication habits, more closely resembling the traditional expression standards of TCM medical records.

[0083] In summary, the Med-shicheng framework demonstrates performance comparable to that of language models with extremely large parameters.

[0084] In addition, the beneficial effects that the technical solutions provided by the embodiments of this application can achieve also include the following aspects.

[0085] 1) The Med-shicheng framework provided in this application is used to standardize the transmission of knowledge from renowned traditional Chinese medicine practitioners in a unified manner. It can efficiently integrate labeled and unlabeled data to achieve bidirectional utilization of information. Although it is trained on only a small number of labeled samples (only a few hundred valid original cases in this study), it can still achieve performance comparable to general LLM through a lightweight large language model (LLM).

[0086] 2) The Qwen2.5-1.5B model used in this application is implemented within the Med-Shicheng framework. Its parameter count is only 1 / 447 that of DeepSeek-R1-671B, yet it achieves comparable performance and can be trained and deployed on resource-constrained GPUs (such as consumer-grade GPUs). This demonstrates that even with a very limited model size, large language models can still achieve superior performance and solve complex tasks in specialized domains, as long as researchers design tasks according to the domain problem, showcasing the potential for cost-effective LLM research within the field.

[0087] 3) This application provides an effective strategy for integrating diverse medical knowledge systems into a single model, avoiding misleading interference or negative interactions between them. This method eliminates the significant human investment required to transfer the knowledge of outstanding medical experts to independent models.

[0088] 4) This application provides a detailed analysis of the feasibility of using LLM as a judge paradigm in evaluating lengthy, informative responses generated by professional domain models. Based on the analysis, it proposes that even though state-of-the-art LLM models (such as GPT-5, Deepseek, and Gemini) can evaluate such responses to some extent, human physicians are still required to participate in model evaluation when relevant real-world data is lacking.

[0089] Secondly, this application also provides a device for constructing a knowledge model for traditional Chinese medicine diagnosis and treatment.

[0090] Figure 2 This is a structural block diagram of a device for constructing a traditional Chinese medicine diagnosis and treatment knowledge model according to a preferred embodiment of this application. The device includes a conversion module 10, a first learning module 20, a second learning module 30, a third learning module 40, and a preference module 50.

[0091] The transformation module 10 converts the general basic language model into a model specifically for the field of Traditional Chinese Medicine (TCM), resulting in a basic TCM model. The first learning module 20 controls the obtained basic TCM model to learn diagnostic and treatment thinking within the TCM field, resulting in a basic TCM diagnostic and treatment model. The second learning module 30, aiming to enhance the flexibility of logical reasoning in the obtained basic TCM diagnostic and treatment model, controls it to learn the diagnostic reasoning paths of clinical cases in the TCM field, resulting in a TCM reasoning diagnostic and treatment model. The third learning module 40 controls the obtained TCM reasoning diagnostic and treatment model to learn the unique TCM knowledge and unique diagnostic and treatment thinking of the target renowned physician, resulting in a unique TCM diagnostic and treatment model. The preference module 50 controls the obtained unique TCM diagnostic and treatment model to favor the unique diagnostic and treatment thinking of the target renowned physician, resulting in a TCM diagnostic and treatment knowledge model.

[0092] Optionally, the general-purpose basic language model can be transformed into a model specifically for the field of traditional Chinese medicine (TCM) to obtain a TCM basic model. This includes: using a TCM corpus dataset and the loss function of a causal language model as the training objective, the general-purpose basic language model is trained using unsupervised autoregression to obtain the TCM basic model. The TCM corpus dataset is constructed based on TCM higher education textbooks, publications from various TCM schools, and TCM research papers.

[0093] Optionally, the obtained TCM basic model is controlled to learn the diagnostic and treatment thinking in the field of TCM to obtain a TCM basic diagnosis and treatment model. This includes: based on a TCM general instruction dataset, the obtained TCM basic model is trained by supervised learning with the goal of minimizing the cross-entropy between the model response and the supervision label to obtain a TCM basic diagnosis and treatment model. The TCM general instruction dataset is constructed based on TCM clinical cases, TCM doctor-patient consultation records, TCM knowledge monographs, and TCM knowledge graphs.

[0094] Optionally, with the goal of enhancing the flexibility of logical reasoning in the obtained TCM basic diagnosis and treatment model, the obtained TCM basic diagnosis and treatment model is controlled to learn the diagnostic reasoning path of clinical cases in the field of TCM to obtain a TCM reasoning diagnosis and treatment model. This includes: training the obtained TCM basic diagnosis and treatment model based on a TCM reasoning dataset using the GRPO algorithm to obtain a TCM reasoning diagnosis and treatment model, wherein the TCM reasoning dataset is constructed based on the diagnostic reasoning path of TCM clinical cases.

[0095] Optionally, the obtained TCM reasoning and diagnosis model is controlled to learn the unique TCM knowledge and unique diagnosis and treatment thinking of the target famous doctor to obtain a unique TCM diagnosis and treatment model. This includes: training the obtained TCM reasoning and diagnosis model based on a unique TCM instruction dataset using the GRPO algorithm to obtain a unique TCM diagnosis and treatment model. The unique TCM instruction dataset is constructed based on the systematic knowledge and clinical cases of the target famous doctor. The systematic knowledge includes books and papers.

[0096] Optionally, the obtained TCM unique diagnosis and treatment model is controlled to favor the unique diagnosis and treatment thinking of the target famous doctor in order to obtain a TCM diagnosis and treatment knowledge model, including: training the obtained TCM unique diagnosis and treatment model based on the TCM unique reasoning dataset using the KTO algorithm to obtain a TCM diagnosis and treatment knowledge model, wherein the TCM unique reasoning dataset is constructed based on the clinical cases of the target famous doctor.

[0097] Optionally, constructing a unique TCM reasoning dataset includes: for each clinical case of each target physician, performing the following steps: labeling the output items of the clinical case as true labels; using the input items of the clinical case as input, generating a preset number of responses based on a preset target model; for each generated response, determining the similarity between the response and the output items of the clinical case; if the determined similarity is greater than a first preset similarity, labeling the response as a true label; if the determined similarity is less than a second preset similarity, labeling the response as a false label; using the input items of the clinical case as input, the output items and responses labeled as true labels and the responses labeled as false labels as output, constructing training samples for the clinical cases; and constructing a unique TCM reasoning dataset based on all training samples corresponding to each target physician.

[0098] The working principle and benefits of the device for constructing a TCM diagnosis and treatment knowledge model provided in this application are similar to those of the method for constructing a TCM diagnosis and treatment knowledge model provided in this application, and will not be repeated here.

[0099] Thirdly, this application also provides a machine-readable storage medium storing instructions that cause a machine to execute the above-described construction method.

[0100] Fourthly, this application also provides an electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the executable instructions to implement the above-described construction method.

[0101] The preferred embodiments of this application have been described in detail above. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solution of this application, and these simple modifications all fall within the protection scope of this application.

[0102] It should also be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this application will not describe the various possible combinations separately.

[0103] Furthermore, various different implementations of this application can be combined in any way, as long as they do not violate the spirit of this application, they should also be regarded as the content disclosed in this application.

Claims

1. A method for constructing a knowledge model for traditional Chinese medicine diagnosis and treatment, characterized in that, The construction method includes: The general-purpose basic language model is transformed into a model specifically for the field of traditional Chinese medicine to obtain the basic model of traditional Chinese medicine. The obtained basic TCM model is used to learn diagnostic and treatment thinking in the field of TCM in order to obtain a basic TCM diagnostic and treatment model. With the goal of enhancing the flexibility of logical reasoning in the obtained TCM basic diagnosis and treatment model, the obtained TCM basic diagnosis and treatment model is controlled to learn the diagnostic reasoning path of clinical cases in the field of TCM, so as to obtain a TCM reasoning diagnosis and treatment model. The obtained TCM reasoning and diagnosis model learns the unique TCM knowledge and diagnosis thinking of the target famous doctor in order to obtain a unique TCM diagnosis and treatment model. By controlling the unique diagnostic and treatment model of TCM obtained, the unique diagnostic and treatment thinking of the target famous doctor is preferred, so as to obtain a TCM diagnostic and treatment knowledge model.

2. The construction method according to claim 1, characterized in that, The general-purpose basic language model is transformed into a model specifically for the field of Traditional Chinese Medicine (TCM) to obtain a basic TCM model, including: Based on the TCM corpus dataset, the general basic language model is trained using unsupervised autoregression with the loss function of the causal language model as the training objective to obtain the TCM basic model. The TCM corpus dataset is constructed based on TCM higher education textbooks, publications of various TCM schools, and TCM research papers.

3. The construction method according to claim 1, characterized in that, The obtained basic TCM model is used to learn diagnostic and treatment thinking in the field of TCM, in order to obtain a basic TCM diagnostic and treatment model, including: Based on a general TCM instruction dataset, and with the goal of minimizing the cross-entropy between the model response and the supervision label, the obtained TCM basic model is trained using supervised learning to obtain a TCM basic diagnosis and treatment model. The general TCM instruction dataset is constructed based on TCM clinical cases, TCM doctor-patient consultation records, TCM knowledge monographs, and TCM knowledge graphs.

4. The construction method according to claim 1, characterized in that, With the goal of enhancing the flexibility of logical reasoning in the obtained TCM basic diagnostic and treatment model, the model is controlled to learn the diagnostic reasoning path of clinical cases in the field of TCM, in order to obtain a TCM reasoning diagnostic and treatment model, including: Based on the TCM reasoning dataset, the GRPO algorithm is used to train the obtained TCM basic diagnosis and treatment model to obtain the TCM reasoning diagnosis and treatment model. The TCM reasoning dataset is constructed based on the diagnostic reasoning path of TCM clinical cases.

5. The construction method according to claim 1, characterized in that, The obtained TCM reasoning and diagnosis model learns from the unique TCM knowledge and diagnostic thinking of the target renowned physician to obtain a unique TCM diagnosis and treatment model, including: Based on a unique TCM instruction dataset, the GRPO algorithm is used to train the obtained TCM reasoning and diagnosis model to obtain a unique TCM diagnosis and treatment model. The unique TCM instruction dataset is constructed based on the systematic knowledge and clinical cases of the target famous doctor, and the systematic knowledge includes books and papers.

6. The construction method according to claim 1, characterized in that, The obtained TCM unique diagnosis and treatment model is controlled to favor the unique diagnosis and treatment thinking of the target renowned doctor, in order to obtain a TCM diagnosis and treatment knowledge model, including: Based on a unique TCM reasoning dataset, the KTO algorithm is used to train the obtained unique TCM diagnosis and treatment model to obtain a TCM diagnosis and treatment knowledge model. The unique TCM reasoning dataset is constructed based on the clinical cases of the target renowned doctor.

7. The construction method according to claim 6, characterized in that, The construction of the unique TCM reasoning dataset includes: For each clinical case of a target specialist, the following procedures will be followed: Mark the output entries of the aforementioned clinical cases with real labels; Using the input items from the clinical case as input, and based on a preset target model, a preset number of responses are generated; For each generated response, the similarity between the response and the output item of the clinical case is determined. If the determined similarity is greater than a first preset similarity, the response is marked as a real label. If the determined similarity is less than a second preset similarity, the response is marked as a fake label. The training sample of the clinical case is constructed by taking the input items of the clinical case as input, the output items and responses that will be labeled as real labels and the responses that will be labeled as fake labels as output. Based on all training samples corresponding to each target doctor, the unique inference dataset of traditional Chinese medicine is constructed.

8. A device for constructing a knowledge model of traditional Chinese medicine diagnosis and treatment, characterized in that, The construction device includes: The conversion module is used to convert the general basic language model into a model specifically for the field of traditional Chinese medicine, so as to obtain the basic model of traditional Chinese medicine. The first learning module is used to control the obtained TCM basic model to learn the diagnostic and treatment thinking in the field of TCM, so as to obtain the TCM basic diagnostic and treatment model. The second learning module aims to enhance the flexibility of logical reasoning in the obtained TCM basic diagnosis and treatment model by controlling the obtained TCM basic diagnosis and treatment model to learn the diagnostic reasoning path of clinical cases in the field of TCM, so as to obtain a TCM reasoning diagnosis and treatment model. The third learning module is used to control the learning of the unique TCM knowledge and unique diagnostic thinking of the target famous doctor in order to obtain a unique TCM diagnostic model. The preference module is used to control the unique diagnostic and treatment model of the obtained TCM, which favors the unique diagnostic and treatment thinking of the target famous doctor, so as to obtain a TCM diagnostic and treatment knowledge model.

9. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores instructions that cause the machine to perform the construction method according to any one of claims 1-7.

10. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the construction method according to any one of claims 1-7.