Medical big language model training and reasoning method and device, equipment and medium
By constructing high-quality medical training data sets and using dynamic split training and tool call training methods, the problem of poor performance of medical large language models when dealing with complex medical problems is solved, and the analysis depth and accuracy of the model are improved.
Patent Information
- Application Number
- CN202510188886.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-05-27
AI Technical Summary
The existing large-language medical language models perform poorly when dealing with complex medical problems and lack high-quality medical corpus, resulting in insufficient models in depth and breadth.
By building high-quality medical training data sets, dynamic split training and tool call training methods are adopted to improve the analysis depth of the model and the ability to deal with complex problems.
It significantly improves the accuracy and reliability of the medical large language model, allowing it to more comprehensively understand and deal with complex medical problems and provide more accurate reasoning results.
Smart Images

Figure CN120046736A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and particularly to a training and inference method, device, equipment, medium and product of a medical large language model. Background Art
[0002] A generative large language model (LLM) is a natural language processing model based on deep learning technology.
[0003] The generative large language model has significant advantages in many fields. The generative large language model in the medical field (i.e., the medical large language model) can quickly process and understand a large amount of medical text data, helping relevant personnel quickly extract effective information from a large number of literatures, thereby accelerating medical research, shortening the new drug R & D cycle, etc., bringing significant development to the medical industry.
[0004] However, in practical applications, the existing medical large language models still have the following problems: (1) There is still a lack of high-quality medical corpora, resulting in the medical large language models often being more wide-ranging but lacking depth. (2) The fine-tuning of the medical large language model usually only includes the form of instruction answering, and the training process is relatively single, and it performs poorly when facing complex medical problems in practical applications.
[0005] Therefore, it is necessary to propose a training and inference method, device, equipment, medium and product of a medical large language model. Summary of the Invention
[0006] This specification provides a training and inference method, device, equipment, medium and product of a medical large language model. By constructing a high-quality medical training data set and performing model training, the accuracy and reliability of the medical large language model are significantly improved, so as to improve the analysis depth of the model; through dynamic splitting training, the model can split the original problem into multiple sub-problems and process them separately, so as to understand more comprehensively to obtain accurate inference results; through tool call training, the model can intelligently select and use appropriate tools to assist in answering questions according to different scenarios and requirements.
[0007] A training method of a medical large language model provided by this application adopts the following technical solutions, including:
[0008] Construct a medical training data set;
[0009] Train the medical large language model in combination with the medical training data set, including:
[0010] Construct target training data according to the medical data training set;
[0011] Substitute the target training data into the medical large language model for dynamic splitting training, which is used to split the input original question into several sub-questions, process each sub-question to obtain the sub-answer corresponding to the target sub-question, and summarize all the sub-answers to generate the reasoning result corresponding to the original question:
[0012] Conduct tool call training on the medical large language model for processing the sub-questions; among them, when the medical large language model corresponds to the first scenario type, use the first call tool for call training; when the medical large language model corresponds to the second scenario type, use the second call tool for call training.
[0013] Optionally, the construction of the medical training data set includes:
[0014] Obtain historical clinical data and construct target samples;
[0015] Combine the target samples and medical prompt words to construct training data to obtain the medical training data set;
[0016] Pre-train the medical large language model through the medical training data set;
[0017] Based on the data augmentation strategy, transform the training data to generate new training data and update the medical training data set.
[0018] Optionally, the obtaining of historical clinical data and constructing of target samples includes:
[0019] Obtain the historical clinical data; the historical clinical data includes several historical medical information;
[0020] Perform desensitization processing on the historical clinical data to obtain desensitized clinical data;
[0021] Based on the historical medical information in the desensitized clinical data, construct target samples; among them, according to the positive information, divide the historical medical information to determine positive samples and negative samples; screen out the target samples according to the preset screening conditions.
[0022] Optionally, the combining of the target samples and medical prompt words to construct training data to obtain the medical training data set includes:
[0023] Construct the medical prompt words;
[0024] According to the medical prompt words, modify the target samples to generate the training data;
[0025] Summarize all the training data to obtain the medical training data set.
[0026] Optionally, the transformation of the training data based on the data augmentation strategy to generate new training data and update the medical training data set includes:
[0027] Modifying the training data according to medical guidelines to generate the new training data;
[0028] And / or, inputting the training data into the medical large language model, and modifying the original input items of the training data according to preset output requirements to generate the new training data;
[0029] And / or, inputting the training data into the medical large language model, and modifying the original output items of the training data to generate the new training data.
[0030] An inference method of a medical large language model provided by this application adopts the following technical solutions, including:
[0031] Obtain a target medical problem;
[0032] Input the target medical problem into the medical large language model to obtain an inference result. When the target medical problem meets the preset splitting condition, split the target medical problem to obtain a number of target sub-problems; combine the target call tools to generate target sub-answers corresponding to each target sub-problem; summarize all the target sub-answers to generate a target medical answer as the inference result of the target medical problem.
[0033] Optionally, the combination of the target call tool to generate a target sub-answer corresponding to each target sub-problem includes:
[0034] Extract the problem code corresponding to the target sub-problem from the problem field corresponding to the target sub-problem;
[0035] When the current medical large language model corresponds to the first scenario type, call the first call tool to process the problem code corresponding to the target sub-problem to obtain the corresponding target sub-answer;
[0036] When the current medical large language model corresponds to the second scenario type, call the second call tool to process the problem code corresponding to the target sub-problem to obtain the corresponding target sub-answer.
[0037] Optionally, the extraction of the problem code corresponding to the target sub-problem from the problem field corresponding to the target sub-problem includes:
[0038] Obtain the problem field corresponding to the target sub-problem;
[0039] Extract the problem code from the problem field in combination with all the preset characters.
[0040] Optionally, when the current medical large language model corresponds to the first scenario type, call the first call tool to process the problem code corresponding to the target sub-problem to obtain the corresponding target sub-answer, including:
[0041] Input the problem code into a preset programming software through the first call tool for execution to obtain an answer code;
[0042] Return the answer code to the medical large language model;
[0043] Extract the corresponding target sub-answer from the answer code.
[0044] Optionally, when the current medical large language model corresponds to the second scenario type, call the second call tool to process the problem code corresponding to the target sub-problem to obtain the corresponding target sub-answer, including:
[0045] Input the problem code into the medical large language model to obtain a keyword field;
[0046] Extract the keywords from the keyword field in combination with all the preset characters;
[0047] Search for the keywords through the second call tool and return at least one piece of literature information found;
[0048] Input all the literature information into the medical large language model to obtain corresponding reference documents;
[0049] Screen out relevant reference documents from the reference documents; use the specific content of the relevant reference documents as reference materials for answering the target sub-problem, and determine the corresponding target sub-answer.
[0050] A training system for a medical large language model provided by the present application adopts the following technical solutions, including:
[0051] A data set construction module for constructing a medical training data set;
[0052] A training module for training a medical large language model in combination with the medical training data set;
[0053] The training module includes:
[0054] A target training data construction sub-module for constructing target training data according to the medical data training set;
[0055] A dynamic splitting training sub-module, which is used to substitute the target training data into the medical large language model for dynamic splitting training, and is used to split the input original problem into several sub-problems, process each sub-problem to obtain the sub-answers corresponding to the target sub-problems, and summarize all the sub-answers to generate an inference result corresponding to the original problem:
[0056] A calling training sub-module, which is used to perform tool calling training on the medical large language model and is used to process the sub-problems;
[0057] The calling training sub-module includes:
[0058] A first calling training unit, which is used to perform calling training using a first calling tool when the medical large language model corresponds to a first scenario type;
[0059] A second calling training unit, which is used to perform calling training using a second calling tool when the medical large language model corresponds to a second scenario type.
[0060] Optionally, the dataset construction module includes:
[0061] A target sample construction sub-module, which is used to obtain historical clinical data and construct target samples;
[0062] A dataset construction sub-module, which is used to combine the target samples and medical prompt words to construct training data and obtain the medical training dataset;
[0063] A pre-training sub-module, which is used to pre-train the medical large language model through the medical training dataset;
[0064] A data augmentation sub-module, which is used to transform the training data based on a data augmentation strategy, generate new training data, and update the medical training dataset.
[0065] Optionally, the target sample construction sub-module includes:
[0066] A historical clinical data acquisition unit, which is used to acquire the historical clinical data; the historical clinical data includes a number of historical medical information;
[0067] A desensitization unit, which is used to desensitize the historical clinical data to obtain desensitized clinical data;
[0068] A target sample construction unit, which is used to construct target samples based on the historical medical information in the desensitized clinical data;
[0069] Optionally, the target sample construction unit includes:
[0070] A sample division sub-unit, configured to divide the historical medical information according to positive information to determine positive samples and negative samples;
[0071] A sample screening sub-unit, configured to screen out the target samples according to preset screening conditions.
[0072] Optionally, the data set construction sub-module includes:
[0073] A prompt word construction unit, configured to construct the medical prompt words;
[0074] A training data generation unit, configured to modify the target samples according to the medical prompt words to generate the training data;
[0075] A summarization unit, configured to summarize all the training data to obtain the medical training data set.
[0076] Optionally, the data augmentation sub-module includes:
[0077] A first modification unit, configured to modify the training data according to medical guidelines to generate the new training data;
[0078] A second modification unit, configured to input the training data into the medical large language model and modify the original input items of the training data according to preset output requirements to generate the new training data;
[0079] A third modification unit, configured to input the training data into the medical large language model and modify the original output items of the training data to generate the new training data.
[0080] An inference system of a medical large language model provided by the present application adopts the following technical solutions, including:
[0081] A problem acquisition module, configured to acquire a target medical problem;
[0082] An inference module, configured to input the target medical problem into the medical large language model to obtain an inference result;
[0083] The inference module includes:
[0084] A splitting sub-module, configured to split the target medical problem into several target sub-problems when the target medical problem meets preset splitting conditions;
[0085] A calling answer sub-module, configured to generate a target sub-answer corresponding to each target sub-problem by combining target calling tools;
[0086] The comprehensive reasoning sub-module is used to summarize all the target sub-answers and generate a target medical answer as the reasoning result of the target medical question.
[0087] Optionally, the calling answer sub-module includes:
[0088] The question code extraction unit is used to extract the question code corresponding to the target sub-question from the question field corresponding to the target sub-question;
[0089] The first calling answer unit is used to call the first calling tool to process the question code corresponding to the target sub-question to obtain the corresponding target sub-answer when the current medical large language model corresponds to the first scenario type;
[0090] The second calling answer unit is used to call the second calling tool to process the question code corresponding to the target sub-question to obtain the corresponding target sub-answer when the current medical large language model corresponds to the second scenario type.
[0091] Optionally, the question code extraction unit includes:
[0092] The question field acquisition sub-unit is used to acquire the question field corresponding to the target sub-question;
[0093] The question code extraction sub-unit is used to extract the question code from the question field in combination with all the preset characters.
[0094] Optionally, the first calling answer unit includes:
[0095] The answer code acquisition sub-unit is used to input the question code into a preset programming software through the first calling tool for execution to obtain an answer code;
[0096] The answer code return sub-unit is used to return the answer code to the medical large language model;
[0097] The target sub-answer construction sub-unit is used to extract the corresponding target sub-answer from the answer code.
[0098] Optionally, the second calling answer unit includes:
[0099] The keyword field acquisition sub-unit is used to input the question code into the medical large language model to obtain a keyword field;
[0100] The keyword extraction unit is used to extract the keyword from the keyword field in combination with all the preset characters.
[0101] A literature information return sub-unit, configured to search for the keywords through a second call tool and return at least one piece of searched literature information;
[0102] A reference document acquisition sub-unit, configured to input all the literature information into the medical large language model to obtain corresponding reference documents;
[0103] A target sub-answer confirmation sub-unit, configured to screen out relevant reference documents from the reference documents; use the specific content of the relevant reference documents as reference materials for answering the target sub-question, and determine the corresponding target sub-answer.
[0104] This specification also provides a computer device, wherein the computer device includes:
[0105] A processor; and,
[0106] A memory storing computer-executable instructions, where the executable instructions, when executed, cause the processor to execute any of the above methods.
[0107] This specification also provides a computer-readable storage medium, wherein the computer-readable storage medium stores one or more programs / instructions, and when the one or more programs / instructions are executed by a processor, any of the above methods is implemented.
[0108] This specification also provides a computer program product, wherein the computer program product includes: a computer program / instructions, and when the computer program / instructions are executed by a processor, any of the above methods is implemented.
[0109] In the present invention, by constructing a medical training data set; training a medical large language model in combination with the medical training data set, including: constructing target training data according to a high-quality medical data training set; substituting the target training data into the medical large language model for dynamic splitting training, for splitting the input original question into several sub-questions, processing each sub-question, obtaining the sub-answer corresponding to the target sub-question, summarizing all the sub-answers, and generating an inference result corresponding to the original question: performing tool call training on the medical large language model for processing the sub-questions; wherein, when the medical large language model corresponds to a first scenario type, using a first call tool for call training; when the medical large language model corresponds to a second scenario type, using a second call tool for call training; by combining dynamic splitting training and tool call training, not only the efficiency and depth of the model are improved, but also more accurate and comprehensive inference results can be given when facing various medical problems. Description of the Drawings
[0110] Figure 1Schematic diagram of the principle of a training method for a medical large language model provided by an embodiment of this specification;
[0111] Figure 2 Schematic diagram of the principle of an inference method for a medical large language model provided by an embodiment of this specification;
[0112] Figure 3 Schematic diagram of the structure of a training system for a medical large language model provided by an embodiment of this specification;
[0113] Figure 4 Schematic diagram of the structure of an inference system for a medical large language model provided by an embodiment of this specification;
[0114] Figure 5 Schematic diagram of the structure of an electronic device provided by an embodiment of this specification;
[0115] Figure 6 Schematic diagram of the principle of a computer-readable storage medium provided by an embodiment of this specification. Detailed implementation manners
[0116] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments in the following description are only examples, and those skilled in the art can think of other obvious variations. The basic principles defined in the following description can be applied to other implementation manners, variations, improvements, equivalent manners, and other technical solutions that do not depart from the spirit and scope of the present invention.
[0117] Now, the exemplary embodiments of the present invention will be described more comprehensively with reference to the accompanying drawings. On the premise of conforming to the technical concept of the present invention, the features, structures, characteristics, or other details described in a specific embodiment do not exclude being combined in a suitable manner in one or more other embodiments.
[0118] The term "and / or" or "and / or" includes all combinations of any one or more of the associated listed items.
[0119] Figure 1 Schematic diagram of the principle of a processing method for a lightweight business quick query log based on Nodejs middleware provided by an embodiment of this specification. This method establishes a communication data middleware log generator based on a Nodejs framework server, including:
[0120] S2 Construct a medical training data set;
[0121] S3 Train a medical large language model in combination with the medical training data set;
[0122] The training of the medical large language model in combination with the medical training data set includes:
[0123] Construct target training data based on the medical data training set;
[0124] Substitute the target training data into the medical large language model for dynamic splitting training, which is used to split the input original question into several sub-questions, process each sub-question to obtain the sub-answer corresponding to the target sub-question, and summarize all sub-answers to generate an inference result corresponding to the original question:
[0125] Perform tool call training on the medical large language model to process the sub-questions; among them, when the medical large language model corresponds to the first scenario type, use the first call tool for call training; when the medical large language model corresponds to the second scenario type, use the second call tool for call training.
[0126] Medical large language models in the medical field can analyze patients' medical and health data to provide personalized advice for patients and real-time auxiliary decision-making support for doctors. To further promote research and applications in the medical field and further improve the model's ability to understand, generate, and process medical-related natural language information, medical large language models are usually based on the Transformer architecture and further fine-tuned using medical data. Specifically, its training process mainly includes:
[0127] (1) Training data construction: Usually determine the data sources based on public data sets and corpora, medical guidelines and books, medical case data, and various medical application task data, etc.
[0128] (2) Pre-training: General text data usually needs to be trained together with medical text data. During the training process, use a large amount of medical text data to train the medical large language model in the form of self-supervised learning through an autoregressive next-word prediction task to improve the model's basic medical knowledge.
[0129] (3) Fine-tuning: Use medical data for fine-tuning. In the fine-tuning stage, common training methods include: instruction fine-tuning, reinforcement learning training based on feedback.
[0130] Among them, instruction fine-tuning constructs various tasks in the form of a question-and-answer, where the question contains specific instruction requirements, and the model needs to generate an appropriate answer according to the instruction; its training method is usually also in the autoregressive form, but only the generation of the answer part can be considered. For reinforcement learning training based on feedback, a feedback mechanism needs to be set or constructed in advance; then, based on various questions, use the model to generate answers to the questions, and provide feedback for the answers based on the feedback mechanism, and use reinforcement learning algorithms such as PPO to adjust the parameters of the model.
[0131] Although the medical large language model obtained based on the above training and fine-tuning methods is capable of performing various tasks in the medical field, in actual applications, there are still inevitable problems with existing medical large language models:
[0132] (1) Lack of high-quality medical corpora, resulting in medical large language models often being more wide-ranging but lacking depth. For example: medical large language models perform excellently in shallow medical applications such as medical guidance, pre-consultation, and health knowledge consultation, but perform poorly in deep applications such as clinical assistant diagnosis and treatment.
[0133] (2) The solution process of real-world medical tasks is generally a complex process, while traditional fine-tuning of medical large language models usually only includes the form of instruction answering and performs poorly when facing complex medical problems in actual applications.
[0134] Based on this, in order to overcome the problems of insufficient high-quality corpora and insufficient application depth in the training of current medical large language models, and to improve the ability of medical large language models to handle complex medical applications, the present invention proposes a training and inference method for a medical large language model.
[0135] First, the present invention proposes a training method for a medical large language model, which specifically includes:
[0136] S1 Construct a medical large language model;
[0137] When constructing a medical large language model, in order to ensure that the model can understand and process complex information such as professional terms, disease symptoms, and treatment plans in the medical field, the medical large language model needs to have strong language understanding ability and knowledge reasoning ability.
[0138] S2 Construct a medical training data set;
[0139] In the prior art, high-quality training data mainly relies on manual annotation, which is time-consuming and laborious, and the obtained training quantity is usually small; when modifying the data, the accuracy of the training data is relatively low; since the data used is unsupervised data, the data quality is uneven. Based on this, in order to construct a high-quality medical training data set, this method specifically includes:
[0140] S21 Obtain historical clinical data and construct target samples;
[0141] S211 Obtain the historical clinical data;
[0142] The historical clinical data can be text information describing the user's medical treatment, disease diagnosis, disease examination, medical records, etc. Among them, the user can be the examinee or the patient.
[0143] Preferably, the historical clinical data includes a number of historical medical information. Each historical user corresponds to one piece of historical medical information.
[0144] S212 performs desensitization processing on the historical clinical data to obtain desensitized clinical data;
[0145] Perform desensitization processing on each piece of historical medical information in the historical clinical data to remove sensitive information in the historical medical information. After performing desensitization processing on all the historical medical information, desensitized clinical data is obtained.
[0146] Protect user privacy and ensure user data security through the above desensitization processing.
[0147] S213 constructs a target sample based on the historical medical information in the desensitized clinical data;
[0148] S213-1 divides the historical medical information according to positive information to determine positive samples and negative samples;
[0149] The positive information includes at least one of positive indicators and positive characteristics.
[0150] Among them, a positive indicator refers to a value that shows abnormality or is higher than the normal reference range in a medical examination or test. A positive characteristic refers to a positive finding in a medical examination or observation, such as abnormal physiological manifestations, pathological changes, or abnormalities in imaging.
[0151] Judge whether the historical medical information includes positive indicators and / or positive characteristics; if the historical medical information includes positive indicators and / or positive characteristics, then the historical medical information is identified as a positive sample; if the historical medical information does not include positive indicators and positive characteristics, then the historical medical information is identified as a negative sample.
[0152] Specific positive indicators and / or positive characteristics can be set according to actual needs.
[0153] S213-2 screens out the target sample according to preset screening conditions.
[0154] The preset screening conditions include: the preset ratio of positive samples to negative samples, and / or, the preset quantity of positive samples to negative samples. Its specific value can be set according to specific needs and is not limited here.
[0155] Based on the preset screening conditions, randomly select positive samples and negative samples that meet the quantity requirements as the target sample.
[0156] S22 combines the target sample and medical prompt words to construct training data to obtain the medical training data set;
[0157] S221 Construct the medical prompt words;
[0158] Specifically, according to different diagnosis and treatment guidelines or standards, construct prompt words suitable for the model to understand. The prompt words can be used as the input context of the model to guide the medical large language model to generate specific output text fragments, helping the model better understand the problem and give accurate reasoning results. For example, when judging whether a user is obese, the prompt words can be constructed based on the obesity judgment criteria.
[0159] S222 Modify the target sample according to the medical prompt words to generate the training data;
[0160] Identify the key information in the target sample. The key information includes but is not limited to the user's medical history, disease diagnosis, examination results, medical record descriptions, etc.
[0161] Match the constructed medical prompt words with the key information in the target sample. In an embodiment of the present specification, if the medical prompt word is about the diagnostic criteria of a certain disease, find the examination results and medical record descriptions related to the disease in the target sample and match them with the prompt word.
[0162] After the matching is completed, modify or reorganize the target sample according to the medical prompt words to form the training data. The training data includes: the original input item and the original output item. The original input item corresponds to the original output item one by one.
[0163] The specific content of the original input item and the original output item is not limited here. In an embodiment of the present specification, when the original input item includes the diagnosis result, the original output item includes the evaluation result corresponding to the diagnosis result; in another embodiment of the present specification, when the original input item includes a medical-related question, the original output item includes the answer corresponding to the medical-related question. In other embodiments of the present specification, the original input item and the original output item can also be other contents.
[0164] S223 Aggregate all the training data to obtain the medical training data set.
[0165] S23 Pre-train the medical large language model through the medical training data set;
[0166] S24 Transform the training data based on the data augmentation strategy to generate new training data and update the medical training data set.
[0167] In order to improve the training effect of the model, the training data is enhanced.
[0168] In one embodiment of this specification, S241 modifies the training data according to medical guidelines to generate the new training data;
[0169] Specifically, several training data are randomly selected, and the training data are modified according to the corresponding content of medical guidelines so that they correspond to different diagnostic or treatment results, and are used as the new training data. Modification is carried out based on rules such as medical guidelines to ensure the accuracy and effectiveness of the new training data.
[0170] In another embodiment of this specification, S242 inputs the training data into the medical large language model to transform the training data and construct new training data;
[0171] The transformation methods include: transforming the input based on the output, and obtaining the output based on the input. New training data can be generated based on at least one of the original input item or the original output item.
[0172] S242-1 inputs the training data into the medical large language model, and modifies the original input item of the training data according to the preset output requirements to generate the new training data;
[0173] The preset output requirements include but are not limited to: specific diagnostic results, treatment suggestions. The preset output requirements can be set according to actual needs.
[0174] Randomly select training data, based on the original input item in the training data, according to the corresponding preset output requirements, use the medical large language model to modify the original input item to obtain a new original input item, and combine the original output item and the new original input item to construct new training data.
[0175] In terms of transforming the input based on the output in the present invention, the real data is used as the original input, and according to different output requirements, the medical large language model is used to modify the original input to obtain a new output-input pair.
[0176] In order to make the model easier to understand and learn new data patterns, reference examples of output-input can also be given to improve the construction effect.
[0177] S242-2 inputs the training data into the medical large language model to modify the original output item of the training data to generate the new training data.
[0178] In the process of this modification, the training data without the original output item is mainly targeted. Therefore, the training data this time includes at least the original input item.
[0179] Input the original input item in the training data into the medical large language model to obtain a new original output item;
[0180] To improve the data quality of new training data, expert sampling verification is performed on the new evaluation results.
[0181] Specifically, according to different medical scenario types, a certain proportion of new original output items are sampled after random distribution.
[0182] Search for the original input items corresponding to the new original output items; have medical experts judge the authenticity of the new original output items, the consistency and correctness between the original input items and the corresponding new original output items, etc., to obtain the verification results.
[0183] If the verification results do not meet the preset verification requirements, medical experts will give corresponding error messages, and after combining the error messages, modify the preset output requirements or modify the prompt words and then perform rework. If the verification results meet the preset verification requirements, they can be used to generate new training data for subsequent model training.
[0184] If the verification results meet the preset verification requirements, new training data is constructed by combining the original input items and the new original output items.
[0185] In terms of obtaining output based on input, mainly for data without output annotations, through the combination of model prediction and expert verification, new and valuable training data can be generated.
[0186] Add the new training data to the medical training dataset to update the medical training dataset.
[0187] The present invention is based on real clinical data, combines a medical large language model with human experts (medical experts) for expansion, and constructs various types of high-quality training data with complete quantities. While increasing the data quantity, it improves the data quality and saves labor costs.
[0188] S3 Train the medical large language model in combination with the medical training dataset;
[0189] S31 Construct a training framework for the medical large language model;
[0190] The training framework includes: a planning and parsing layer, an external tool layer, and a model training layer.
[0191] Among them, the planning and parsing layer is used to perform step-by-step planning on complex problems, split them into several sub-problems, determine the solution logic and order of each sub-problem, and determine how to merge the sub-answers corresponding to the sub-problems to solve complex problems.
[0192] The external tool layer is used to pre-set external tools available for the model, such as calculators, code compilers, knowledge base retrievers, etc. Based on the external tool layer, the medical large language model can use external tools in the form of tool calls, thereby possessing the ability to solve multiple types of tasks.
[0193] The model training layer is used to add the problem splitting data and tool call data constructed by the first two layers during the instruction fine-tuning process, while ensuring the model's instruction execution ability, training the model's problem splitting and tool call abilities.
[0194] S32 Construct target training data according to the medical data training set;
[0195] In one embodiment of the present specification, a medical data training set is obtained, the original input items in the training data are used as the original questions, and the original output items in the training data are used as the original answers; according to medical knowledge and logic, the original questions are split into several sub-questions; for each sub-question, corresponding sub-answers are generated according to the medical knowledge base or expert opinions.
[0196] Construct target training data. The target training data includes: original questions, several sub-questions, several sub-answers, and original answers.
[0197] The sub-questions are obtained by disassembling the original questions, that is, the original questions correspond to all sub-questions; the sub-answers are the answers to the sub-questions, that is, the sub-answers correspond to the sub-questions one by one; the original answers are the answers to the original questions, and the original answers are obtained by summarizing all sub-answers, that is, all sub-answers correspond to the original answers.
[0198] S33 Substitute the target training data into the medical large language model for dynamic splitting training;
[0199] In the prior art, when dealing with problems, it is usually processed in an end-to-end mode, and it performs poorly for some complex medical problems. Based on this, the present invention conducts dynamic splitting training on the medical large language model to split the input original questions into several sub-questions, process each sub-question to obtain the sub-answers corresponding to the target sub-questions, and summarize all the sub-answers to generate the reasoning results corresponding to the original questions.
[0200] Through dynamic splitting training, complex problems can be distinguished and split for processing, improving the processing effect of complex problems.
[0201] Specifically, during the training process, by parsing the original questions, the original questions are split, reorganized or refined, and then a series of sub-questions are generated. While comprehensively covering all aspects of the original questions, it remains relatively simple and easy to process.
[0202] Then, the generated sub-questions are successively used as the input for training the medical large language model. According to the input sub-questions, combined with its internal knowledge base and training data, corresponding sub-answers are generated. Preferably, based on the logical relationships of the respective sub-questions, the sub-questions are sorted, and each sub-question is processed one by one based on the sorting result to ensure that the model can generate accurate and relevant sub-answers for each sub-question.
[0203] After all sub-answers are generated, based on the model's logical reasoning and information integration capabilities, all the sub-answers are integrated to obtain a complete original answer.
[0204] Combined with the target training data for model performance evaluation; based on the performance evaluation results, the parameters of the model are adjusted to improve the accuracy and generalization ability of the model.
[0205] Preferably, in the training phase, the above steps of training can be achieved through a forward attention mechanism in one inference process.
[0206] The present invention performs the above dynamic splitting training in three steps of the "thinking chain" method, namely "splitting the original question into multiple sub-questions", "answering each sub-question one by one", and "synthesizing the answers to all sub-questions to answer the original question", so as to improve the ability of the medical large language model to split questions.
[0207] After training the model, the medical large language model of the present invention has the ability to dynamically split questions, enabling it not only to directly handle simple questions, but also to split complex questions into sub-questions and call various tools to solve them, and can more reasonably and accurately solve various complex medical problems.
[0208] S34 performs tool call training on the medical large language model;
[0209] In some medical scenarios, it may be necessary to call external tools to better complete the scenario tasks. For example, when analyzing a physical examination report, a calculation tool is called to calculate the user's BMI index to more intuitively analyze the user's physical condition; in drug consultation, the drug description is retrieved from the drug library for reference to improve the accuracy and credibility of the consultation results.
[0210] However, some existing models do not include tool calls, or only include retrieval tools, and are not perfect in the more comprehensive tool call capabilities such as the model generating executable code and connecting to search functions.
[0211] In order to improve the problem handling ability, tool call training is performed on the medical large language model for processing the sub-questions. In an embodiment of the present specification, in the call training, the first call tool and the second call tool are mainly involved.
[0212] Determine the corresponding calling tool based on the scenario type of the medical large language model.
[0213] S341 When the medical large language model corresponds to the first scenario type, use the first calling tool for calling training;
[0214] In the first scenario type, the medical large language model is mainly used to output calculation results.
[0215] The first calling tool is preferably a code generation and calling tool. The code generation and calling tool refers to generating programming code through the medical large language model, and then inputting the generated programming code into a preset programming software, and returning the execution result of the programming code to the medical large language model.
[0216] Specifically, the programming code generated by the medical large language model includes two types, namely: pre-defined executable functions and executable code.
[0217] Among them, the pre-defined executable functions can be calculators, data analyzers, etc. Executable code is programming code directly used for execution, and it may contain the aforementioned pre-defined executable functions.
[0218] When performing the calling training of the first calling tool on the medical large language model, it specifically includes:
[0219] S341-1 Construct code samples;
[0220] The code samples include: the first question, the question code corresponding to the first question, and the answer code corresponding to the first question.
[0221] S341-2 Input the first question in the code sample into the medical large language model for generating training of the question code, so as to generate the code corresponding to the first question.
[0222] Through the above method, train the code generation ability of the medical large language model to improve the ability of "using the medical large language model combined with code to solve practical problems".
[0223] S341-3 Extract the question code corresponding to the first question, and use the preset programming software to generate the answer code corresponding to the question code.
[0224] In the process of using the preset programming software to generate the answer code, set the execution code in advance to facilitate answering the question code.
[0225] In order to ensure the generalization ability of the model, during the training process, it is necessary to ensure the quantity and diversity of code generation.
[0226] When the medical large language model corresponds to the second scenario type, use the second call tool for training;
[0227] In the second scenario type, the medical large language model is mainly used to search for and output literature results.
[0228] The second call tool is preferably a search tool. A search tool means that the medical large language model can generate keywords based on a question, and call an external knowledge base or the Internet to generate search results; use the search results as references for the question, so as to answer the question more appropriately and based on evidence.
[0229] Among them, the medical large language model has the capabilities of keyword generation, search content selection, and answering questions based on references.
[0230] When training the medical large language model for calling the second call tool, it specifically includes:
[0231] S342-1 Construct a literature sample;
[0232] The literature sample includes: a second question, a reference corresponding to the second question, and a second answer corresponding to the second question.
[0233] S342-2 Input the second question in the literature sample into the medical large language model for keyword code generation training to generate a keyword code corresponding to the second question and determine the keyword.
[0234] S342-3 Select a search tool based on the type of the second question; among them, the search tool is predefined, and the search tool can implement functions such as accessing the Internet and retrieving the knowledge base.
[0235] Search for keywords through the search tool and return the retrieved literature information; the literature information includes but is not limited to the title and abstract; according to the literature information, find the corresponding references and screen out relevant references from them to improve the relevance of the references to the original question and avoid using too long / too many references to exceed the upper limit of the model's context length.
[0236] Extract the specific content of the relevant references through an external literature reading tool; use the specific content as the reference material for the model to answer the original question. Preferably, when selecting the specific content of the relevant references, it can also be selected based on the paragraph screening function.
[0237] Based on the specific content of the reference, the medical large language model outputs an answer. Preferably, indicate the citation source of the reference.
[0238] Since the reference may be long, among which, the medical large language model has the ability to read long texts and certain understanding ability. Based on the above training, the ability of the model to "answer questions through references" is improved.
[0239] Through the above steps, the medical large language model is trained to enable it to generate code, call code execution tools and search tools. By endowing the model with various additional capabilities, more types of medical applications can be realized.
[0240] The medical large language model in the present invention can be applied to multiple specific scenario types related to medical treatment, such as: scenarios and products with medical knowledge Q&A, medical background conversation, medical follow-up, medical information structuring, medical text generation and completion, auxiliary diagnosis and treatment ability, medication consultation, physical examination report answering, etc. For different scenario types, the proportion of the calling tools used in the training is different.
[0241] In an embodiment of the present specification, if it is necessary to strengthen the performance of the model in the medication consultation scenario, the proportion of data of the type of searching the knowledge base included in the training is increased, that is, the proportion of literature samples is increased. If it is necessary to strengthen the performance of the model in the scenario of answering physical examination reports, the proportion of data for the model to generate code for data analysis is increased, that is, the proportion of code samples is increased.
[0242] Based on the training method of the present invention, relevant personnel can expand high-quality training data on the basis of existing data; based on the above training data set, the existing medical large language model is fine-tuned to enable it to have richer capabilities so as to be better applied to more medical scenario types. Based on the specific scenario type, the problem is dynamically split and the tool is called to improve the functionality of the model and the depth of analysis.
[0243] Figure 2 It is a schematic diagram of the principle of an inference method of a medical large language model provided by an embodiment of the present specification, including:
[0244] S4 Obtain the target medical problem;
[0245] S5 Input the target medical problem into the medical large language model to obtain an inference result. Among them, when the target medical problem meets the preset splitting condition, the target medical problem is split to obtain several target sub-problems; combine the target calling tools to generate target sub-answers corresponding to each target sub-problem; summarize all the target sub-answers to generate a target medical answer as the inference result of the target medical problem.
[0246] After training the medical large language model based on the specific scenario type, receive the target medical problem for inference. Specifically:
[0247] S4 Obtain the target medical problem;
[0248] Specifically, the target medical problem to be solved can be obtained from users, doctors, or other sources.
[0249] S5 Input the target medical problem into the medical large language model to obtain an inference result;
[0250] S51 Determine whether the target medical problem needs to be split;
[0251] Based on a preset splitting condition, determine whether the target medical problem needs to be split;
[0252] In an embodiment of this specification, the preset splitting condition includes: identifying whether the target medical problem contains multiple independent problems. It can be identified based on semantic understanding, punctuation, etc. to determine whether the target medical problem meets the preset splitting condition.
[0253] If the target medical problem contains multiple independent problems, it is determined that the target medical problem meets the preset splitting condition and needs to be split; otherwise, it is determined that the target medical problem does not meet the preset splitting condition and does not need to be split.
[0254] To improve the splitting ability, a splitting instruction is constructed to prompt the medical large language model to split when processing the target medical problem. In an embodiment of this specification, based on the splitting instruction and the target medical problem, it is determined whether the target medical problem needs to be split. The splitting instruction includes: analyzing the problem, and if the problem contains multiple sub-problems, splitting the problem and listing the sub-problems.
[0255] S52 When the target medical problem meets the preset splitting condition, split the target medical problem to obtain several target sub-problems;
[0256] When the target medical problem meets the preset splitting condition, it depends on the analysis of keywords, phrases, or sentence structures in the target medical problem to determine the splitting point. According to the splitting point, the target medical problem is split into multiple target sub-problems, and the problem fields corresponding to the target sub-problems are output.
[0257] S53 Combine the target call tool to generate a target sub-answer corresponding to each target sub-problem;
[0258] To improve the data processing ability, solve each target sub-problem one by one according to the analysis instruction. The analysis instruction includes: analyzing and solving each target sub-problem in sequence.
[0259] Of course, in order to facilitate the solution of target sub-problems one by one, the execution of the model can also be promoted through a continue instruction to iterate the solution of the target sub-problems until all target sub-problems have been solved. The continue instruction includes: continue to solve the next target sub-problem.
[0260] S531 Extract the problem code corresponding to the target sub-problem from the problem field corresponding to the target sub-problem;
[0261] Obtain the problem field corresponding to the target sub-problem; combine all the preset characters and extract the problem code from the problem field.
[0262] Specifically, obtain the problem field of the medical large language model; determine whether the problem field contains preset characters; in an embodiment of the present specification, the preset characters include: a first character and a second character. The first character is <startofcode>, the second character is <endofcode>。
[0263] If the problem field contains all the preset characters, it indicates that the medical large language model has generated a problem code;
[0264] Since this part of the code is located in <startofcode>With <endofcode>The middle part. Therefore, by locating the first character and the second character, the content between the first character and the second character is extracted to obtain the problem code.
[0265] S532 Determine the corresponding target call tool based on the scenario type corresponding to the current medical large language model;
[0266] When answering questions, the call situation and the corresponding call tool can be determined based on the actual situation, and the results returned by the call tool are processed.
[0267] The corresponding relationship between the type of the medical large language model and the call tool can be preset. In an embodiment of this specification, the first scenario type corresponds to using the first call tool; the second scenario type corresponds to using the second call tool.
[0268] S532-1 When the current medical large language model corresponds to the first scenario type, the first call tool is called to process the problem code corresponding to the target sub-question to obtain the corresponding target sub-answer;
[0269] The problem code is input into a preset programming software through the first call tool for execution to obtain an answer code; the answer code is returned to the medical large language model; after the medical large language model obtains the answer code, the corresponding target sub-answer is extracted from the answer code, and the operation of answering the next question or continuing to generate code is continued.
[0270] S532-2 When the current medical large language model corresponds to the second scenario type, the second call tool is called to process the problem code corresponding to the target sub-question to obtain the corresponding target sub-answer.
[0271] The problem code is input into the medical large language model to obtain a keyword field; the keyword field includes: <startofcode>search({keyword}) <endofcode>。
[0272] Combined with all the preset characters described above, extract the keyword from the keyword field; specifically, obtain the keyword field; determine whether the keyword field contains the preset characters; if the keyword field contains all the preset characters, it indicates that the medical large language model has generated a keyword. In an embodiment of this specification, the preset characters include: a first character and a second character. The first character is <startofcode>, the second character is <endofcode>. Since this code part is located in <startofcode>and <endofcode>The middle part of, therefore, by positioning the first character and the second character, extracting the content between the first character and the second character, the keyword is obtained;
[0273] Search for the keyword through the second call tool and return at least one piece of literature information found; among them, search for the keyword through the search tool and return at least one piece of literature information found; the literature information includes but is not limited to: title and abstract.
[0274] Input all the literature information into the medical large language model to obtain the corresponding reference documents;
[0275] According to each piece of literature information, search for the reference documents; specifically, input the literature information into the medical large language model to obtain the literature fields of the reference documents. The literature fields include: <startofcode>select({Document Serial Number}) <endofcode>。
[0276] Obtain the literature field and determine whether the preset characters are included in the literature field; if all the preset characters are included in the literature field, it indicates that the medical large language model has generated a literature serial number. In an embodiment of this specification, the preset characters include: a first character and a second character. The first character is <startofcode>, the second character is <endofcode>。Since this code part is located in <startofcode>And <endofcode>The middle part. Therefore, by positioning the first character and the second character, the content between the first character and the second character is extracted to obtain the literature number.
[0277] Based on multiple literature information, multiple references corresponding to the literature numbers are obtained.
[0278] Relevant references are screened out from the references; the specific content of the relevant references is used as reference materials for answering the target sub-question, and the corresponding target sub-answer is determined.
[0279] Specifically, relevant references are screened out from multiple references; all the content of the relevant references is obtained through an external literature reading tool, and the specific content of the relevant references is obtained based on the paragraph screening function; the specific content is used as reference materials for the model to answer the target medical question, and the corresponding sub-answer is determined.
[0280] In the process of solving sub-questions in the present invention, multiple functions such as tool invocation are combined to better complete the answering tasks of various target sub-questions through composite operations.
[0281] S54 Aggregate all the target sub-answers to generate a target medical answer as the inference result of the target medical question.
[0282] After all the target sub-answers are obtained, a target medical answer is generated based on the aggregation instruction and the target medical question. In an embodiment of the present specification, the aggregation instruction includes: after summarizing all sub-questions and their corresponding sub-answers, the original question is re-answered to generate a target medical answer.
[0283] In the present invention, after receiving a question, the medical large language model will intelligently judge whether it meets the preset splitting conditions. If the question is complex and contains multiple independent or related sub-questions, the model will automatically split it to ensure that each sub-question can be carefully processed. After splitting, the model uses specific target call tools to generate accurate sub-answers for each sub-question for generating the inference result. This process not only improves the accuracy and comprehensiveness of the answer, but also optimizes the inference efficiency of the model through the method of splitting and integration, enabling complex medical questions to be analyzed more quickly and deeply.
[0284] Figure 3 It is a schematic structural diagram of a training system of a medical large language model provided by an embodiment of the present specification, including:
[0285] A dataset construction module 320 for constructing a medical training dataset;
[0286] A training module 330 for training the medical large language model in combination with the medical training dataset;
[0287] The training module 330 includes:
[0288] A target training data construction sub-module 332, configured to construct target training data according to the medical data training set;
[0289] A dynamic splitting training sub-module 333, configured to substitute the target training data into the medical large language model for dynamic splitting training, for splitting the input original problem into several sub-problems, processing each sub-problem to obtain sub-answers corresponding to the target sub-problems, and summarizing all the sub-answers to generate an inference result corresponding to the original problem:
[0290] A call training sub-module 334, configured to perform tool call training on the medical large language model for processing the sub-problems;
[0291] The call training sub-module 334 includes:
[0292] A first call training unit, configured to perform call training using a first call tool when the medical large language model corresponds to a first scenario type;
[0293] A second call training unit, configured to perform call training using a second call tool when the medical large language model corresponds to a second scenario type.
[0294] Optionally, the dataset construction module 320 includes:
[0295] A target sample construction sub-module, configured to obtain historical clinical data and construct target samples;
[0296] A dataset construction sub-module, configured to combine the target samples and medical prompt words to construct training data to obtain the medical training dataset;
[0297] A pre-training sub-module, configured to perform pre-training on the medical large language model through the medical training dataset;
[0298] A data augmentation sub-module, configured to transform the training data based on a data augmentation strategy to generate new training data and update the medical training dataset.
[0299] Optionally, the target sample construction sub-module includes:
[0300] A historical clinical data acquisition unit, configured to acquire the historical clinical data; the historical clinical data includes a number of historical medical information;
[0301] A desensitization unit, configured to perform desensitization processing on the historical clinical data to obtain desensitized clinical data;
[0302] A target sample construction unit, configured to construct a target sample based on the historical medical information in the de-identified clinical data;
[0303] Optionally, the target sample construction unit includes:
[0304] A sample division sub-unit, configured to divide the historical medical information according to positive information to determine positive samples and negative samples;
[0305] A sample screening sub-unit, configured to screen out the target sample according to preset screening conditions.
[0306] Optionally, the data set construction sub-module includes:
[0307] A prompt word construction unit, configured to construct the medical prompt word;
[0308] A training data generation unit, configured to modify the target sample according to the medical prompt word to generate the training data;
[0309] A summarization unit, configured to summarize all the training data to obtain the medical training data set.
[0310] Optionally, the data augmentation sub-module includes:
[0311] A first modification unit, configured to modify the training data according to medical guidelines to generate the new training data;
[0312] A second modification unit, configured to input the training data into the medical large language model and modify the original input item of the training data according to preset output requirements to generate the new training data;
[0313] A third modification unit, configured to input the training data into the medical large language model and modify the original output item of the training data to generate the new training data.
[0314] Figure 4 The figure is a schematic structural diagram of an inference system of a medical large language model provided by an embodiment of this specification, including:
[0315] A problem acquisition module 440, configured to acquire a target medical problem;
[0316] An inference module 450, configured to input the target medical problem into the medical large language model to obtain an inference result;
[0317] The inference module 450 includes:
[0318] The splitting sub-module 452 is used to split the target medical problem into several target sub-problems when the target medical problem meets the preset splitting conditions;
[0319] The calling answer sub-module 453 is used to generate a target sub-answer corresponding to each of the target sub-problems by combining with a target calling tool;
[0320] The comprehensive reasoning sub-module 454 is used to summarize all the target sub-answers and generate a target medical answer as the reasoning result of the target medical problem.
[0321] Optionally, the calling answer sub-module 453 includes:
[0322] The problem code extraction unit is used to extract the problem code corresponding to the target sub-problem from the problem field corresponding to the target sub-problem;
[0323] The first calling answer unit is used to call the first calling tool to process the problem code corresponding to the target sub-problem to obtain the corresponding target sub-answer when the current medical large language model corresponds to the first scenario type;
[0324] The second calling answer unit is used to call the second calling tool to process the problem code corresponding to the target sub-problem to obtain the corresponding target sub-answer when the current medical large language model corresponds to the second scenario type.
[0325] Optionally, the problem code extraction unit includes:
[0326] The problem field acquisition sub-unit is used to acquire the problem field corresponding to the target sub-problem;
[0327] The problem code extraction sub-unit is used to extract the problem code from the problem field in combination with all the preset characters.
[0328] Optionally, the first calling answer unit includes:
[0329] The answer code acquisition sub-unit is used to input the problem code into a preset programming software through the first calling tool for execution to obtain an answer code;
[0330] The answer code return sub-unit is used to return the answer code to the medical large language model;
[0331] The target sub-answer construction sub-unit is used to extract the corresponding target sub-answer from the answer code.
[0332] Optionally, the second calling answer unit includes:
[0333] A keyword field acquisition subunit for inputting the problem code into the medical large language model to obtain a keyword field;
[0334] A keyword extraction unit for extracting the keyword from the keyword field in combination with all the preset characters;
[0335] A literature information return subunit for searching for the keyword through a second call tool and returning at least one piece of searched literature information;
[0336] A reference acquisition subunit for inputting all the literature information into the medical large language model to obtain corresponding references;
[0337] A target sub-answer confirmation subunit for screening relevant references from the references; using the specific content of the relevant references as reference materials for answering the target sub-question, and determining the corresponding target sub-answer.
[0338] The functions of the system according to the embodiments of the present invention have been described in the above method embodiments. Therefore, for the parts not elaborated in the description of this embodiment, reference may be made to the relevant descriptions in the foregoing embodiments, and details will not be repeated here.
[0339] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0340] The present invention is described with reference to the flowcharts and / or block diagrams of methods, systems (devices), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer programs / instructions. These computer programs / instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer device or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0341] These computer programs / instructions can also be stored in a readable memory of a computer device that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the readable memory of the computer device produce a manufactured article including an instruction device, and the instruction device implements the process Figure 1 one process or multiple processes and / or blocks Figure 1 the functions specified in one block or multiple blocks.
[0342] These computer programs / instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are executed on the computer device or other programmable device to produce a computer-implemented process. Thus, the instructions executed on the computer device or other programmable device provide steps for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0343] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these changes and modifications.< / endofcode> < / startofcode> < / endofcode> < / startofcode> < / endofcode> < / startofcode> < / endofcode> < / startofcode> < / endofcode> < / startofcode> < / endofcode> < / startofcode> < / endofcode> < / startofcode> < / endofcode> < / startofcode>
Claims
1. A method for training a large medical language model, characterized in that: include: Construct medical training datasets; The medical large language model is trained in combination with the medical training data set, including: constructing target training data according to the medical data training set; Substitute the target training data into the medical large language model and perform dynamic split training to split the input original question into several sub-questions, process each sub-question, obtain the sub-answer corresponding to the target sub-question, summarize all the sub-answers, and generate an inference result corresponding to the original question: The medical big language model is trained by tool calling to process the sub-problem; wherein, when the medical big language model corresponds to a first scenario type, a first calling tool is used for calling training; and when the medical big language model corresponds to a second scenario type, a second calling tool is used for calling training.
2. A method for training a large medical language model as claimed in claim 1, characterized in that: The constructing of the medical training data set comprises: Obtain historical clinical data and construct target samples; constructing training data by combining the target sample and the medical prompt words to obtain the medical training data set; Pre-training the medical large language model using the medical training data set; The training data is transformed based on a data enhancement strategy to generate new training data, and the medical training data set is updated.
3. A method for training a large medical language model as claimed in claim 2, characterized in that: The obtaining of historical clinical data and construction of target samples includes: Acquiring the historical clinical data; the historical clinical data includes a number of historical medical information; Performing desensitization processing on the historical clinical data to obtain desensitized clinical data; Based on the historical medical information in the desensitized clinical data, a target sample is constructed; wherein, according to the positive information, the historical medical information is divided to determine positive samples and negative samples; and the target sample is screened out according to preset screening conditions.
4. A method for training a large medical language model as claimed in claim 2, characterized in that: The step of combining the target sample and the medical prompt word to construct training data to obtain the medical training data set includes: Constructing the medical prompt word; Modifying the target sample according to the medical prompt word to generate the training data; All the training data are aggregated to obtain the medical training data set.
5. A method for training a large medical language model as claimed in claim 2, characterized in that: The step of transforming the training data based on the data enhancement strategy to generate new training data and updating the medical training data set includes: Modifying the training data according to medical guidelines to generate new training data; and / or, inputting the training data into the medical large language model, modifying the original input items of the training data according to preset output requirements, and generating the new training data; And / or, the training data is input into the medical large language model, the original output items of the training data are modified to generate the new training data.
6. A method for inference of a large medical language model, characterized in that: include: Get the target medical question; Input the target medical question into the medical big language model to obtain an inference result, wherein when the target medical question meets the preset splitting condition, split the target medical question to obtain a plurality of target sub-questions; and generate a target sub-answer corresponding to each target sub-question in combination with a target calling tool; All of the target sub-answers are aggregated to generate a target medical answer as the reasoning result of the target medical question.
7. The inference method of a medical large language model as claimed in claim 6, characterized in that: The combined target calling tool generates a target sub-answer corresponding to each target sub-question, including: Extracting the question code corresponding to the target sub-question from the question field corresponding to the target sub-question; When the current medical large language model corresponds to the first scenario type, a first calling tool is called to process the question code corresponding to the target sub-question to obtain the corresponding target sub-answer; When the current large medical language model corresponds to the second scenario type, the second calling tool is called to process the question code corresponding to the target sub-question to obtain the corresponding target sub-answer.
8. The inference method of a medical large language model as claimed in claim 7, characterized in that: The step of extracting the question code corresponding to the target sub-question from the question field corresponding to the target sub-question includes: Obtain the question field corresponding to the target sub-question; The question code is extracted from the question field in combination with all the preset characters.
9. The inference method of a medical large language model as claimed in claim 7, characterized in that: When the current medical large language model corresponds to the first scenario type, calling the first calling tool to process the question code corresponding to the target sub-question to obtain the corresponding target sub-answer includes: The question code is input into the preset programming software through the first calling tool to execute and obtain the answer code; Returning the answer code to the medical large language model; From the answer code, extract the corresponding target sub-answer.
10. The inference method of a medical large language model as claimed in claim 7, characterized in that: When the current medical large language model corresponds to the second scenario type, calling the second calling tool to process the question code corresponding to the target sub-question to obtain the corresponding target sub-answer includes: Input the question code into the medical large language model to obtain a keyword field; Combining all the preset characters, extracting the keyword from the keyword field; Searching the keyword through a second calling tool, and returning at least one document information found in the search; Input all the literature information into the medical big language model to obtain corresponding references; Relevant references are selected from the references; specific contents of the relevant references are used as reference materials for answering the target sub-questions, and corresponding target sub-answers are determined.
11. A training system for a large medical language model, characterized in that: include: Dataset construction module, used to construct medical training dataset; A training module, used for training a large medical language model in combination with the medical training data set; The training module comprises: A target training data construction submodule, used to construct target training data according to the medical data training set; The dynamic split training submodule is used to substitute the target training data into the medical large language model to perform dynamic split training, to split the input original question into several sub-questions, to process each sub-question, to obtain the sub-answer corresponding to the target sub-question, to summarize all the sub-answers, and to generate an inference result corresponding to the original question: A calling training submodule is used to perform tool calling training on the medical large language model to handle the sub-problem; The calling training submodule comprises: A first calling training unit, configured to use a first calling tool to perform calling training when the medical large language model corresponds to a first scenario type; The second call training unit is used to use a second call tool to perform call training when the medical large language model corresponds to a second scenario type.
12. A medical large language model reasoning system, characterized in that: include: A question acquisition module, used to acquire target medical questions; A reasoning module, used for inputting the target medical question into the medical large language model to obtain a reasoning result; The reasoning module comprises: A splitting submodule, used for splitting the target medical problem into several target sub-problems when the target medical problem meets the preset splitting conditions; A calling answer submodule, used for generating a target sub-answer corresponding to each target sub-question in combination with a target calling tool; The comprehensive reasoning submodule is used to summarize all the target sub-answers and generate a target medical answer as the reasoning result of the target medical question.
13. A computer device, characterized in that: The computer equipment includes: processor; and, A memory storing computer executable instructions, which when executed cause the processor to perform the method of any one of claims 1-10.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs / instructions, and when the one or more programs / instructions are executed by a processor, the method according to any one of claims 1 to 10 is implemented.
15. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the method according to any one of claims 1 to 10.