Low-resource multi-scene cooperative medical intelligent question and answer method, electronic device and medium
By dynamically switching between the base model and the fine-tuning sub-model, combined with the medical question-answering thinking chain, the professional needs and multi-task adaptation problems of large models in the medical field are solved, and the efficiency and accuracy of medical intelligent question-answering are improved.
Patent Information
- Application Number
- CN202510551840.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-04-29
AI Technical Summary
Existing large models are difficult to meet specialized needs while ensuring general capabilities in medical applications, resulting in a decline in the model's capabilities in other fields. In addition, a single model is difficult to efficiently adapt to multi-task scenarios and handle intersections or dependencies between tasks.
It adopts a low-resource, multi-scenario collaborative medical intelligent question-answering method. By dynamically switching between pre-trained base models and fine-tuning sub-models, combined with the medical question-answering thinking chain and the general question-answering thinking chain, it dynamically identifies the medical stage and performs fine-tuning to achieve flexible switching and efficient answers.
It improves the efficiency and accuracy of medical intelligent question answering, solves the adaptation problem of a single model in multi-task scenarios, avoids catastrophic forgetting, and achieves a dynamic balance between the model's professionalism and versatility.
Smart Images

Figure CN120067277B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a low-resource, multi-scenario collaborative medical intelligent question-answering method, electronic equipment, and medium. Background Art
[0002] Large models are widely used in the medical question-answering field. For their application in this field, performance is typically improved through full-model fine-tuning or domain-specific adaptation. However, medical data is highly specialized and complex, containing a large amount of specialized terminology and complex logical relationships. Existing large models struggle to maintain general model capabilities while meeting the specialized requirements of multiple medical tasks. This lack of general model performance protection can easily lead to a decline in the model's performance in other areas, or even catastrophic forgetting.
[0003] In the medical field, the types of tasks involved are diverse, and using a single model is difficult to efficiently adapt to multiple tasks, and it consumes a lot of resources. Moreover, in medical scenarios, tasks may overlap or have dependencies, which a single model cannot solve.
[0004] In view of this, the present invention is proposed. Summary of the Invention
[0005] In order to solve the above technical problems, the present invention provides a low-resource, multi-scenario collaborative medical intelligent question-answering method, electronic device and medium, which realizes the flexible switching of fine-tuning sub-models for dynamic identification of medical stages, thereby improving the efficiency and accuracy of medical intelligent question-answering.
[0006] An embodiment of the present invention provides a low-resource, multi-scenario collaborative medical intelligent question-answering method, the method comprising:
[0007] Determining at least one target medical stage and a fine-tuning sub-model corresponding to each target medical stage based on a pre-trained base model, a target problem, and reference information corresponding to the target problem;
[0008] Determining an intermediate answer and an intermediate thinking chain corresponding to the intermediate answer based on the target question, reference information corresponding to the target question, the base model, and the fine-tuning sub-models corresponding to each target medical stage;
[0009] Determining whether the intermediate answer meets a termination condition based on the base model, the target question, the historical conversation summary corresponding to the target question, the intermediate answer, and the intermediate thought chain;
[0010] In response to the termination condition being met, determining target output information corresponding to the target question according to the intermediate answer and the intermediate thinking chain;
[0011] In response to the termination condition not being met, updating the reference information corresponding to the target question according to the intermediate answer and the intermediate thought chain, and returning to the step of determining at least one target medical stage and a fine-tuning sub-model corresponding to each target medical stage according to the pre-trained base model, the target question, and the reference information corresponding to the target question;
[0012] Among them, the base model and each fine-tuning sub-model are trained based on the pre-built medical question-answering thinking chain and the general question-answering thinking chain.
[0013] An embodiment of the present invention provides an electronic device, comprising:
[0014] processor and memory;
[0015] The processor is used to execute the steps of the low-resource multi-scenario collaborative medical intelligent question-answering method described in any embodiment by calling the program or instructions stored in the memory.
[0016] An embodiment of the present invention provides a computer-readable storage medium, which stores a program or instruction, and the program or instruction enables a computer to execute the steps of the low-resource multi-scenario collaborative medical intelligent question-answering method described in any embodiment.
[0017] The embodiments of the present invention have the following technical effects:
[0018] By determining at least one target medical stage and the fine-tuning sub-model corresponding to each target medical stage based on the pre-trained base model, target question, and reference information corresponding to the target question, the target question is analyzed in medical stage within the current loop analysis, and the corresponding fine-tuning sub-module is called. Then, based on the target question, the reference information corresponding to the target question, the base model, and the fine-tuning sub-model corresponding to the target medical stage, the intermediate answer and the intermediate thinking chain corresponding to the intermediate answer are determined to perform the current loop analysis to answer the target question. Based on the base model, target question, the historical conversation summary corresponding to the target question, the intermediate answer, and the intermediate thinking chain, it is judged whether the intermediate answer meets the termination condition to determine whether the answer to the target question can be completed. In response to meeting the termination condition, the target output information corresponding to the target question is determined based on the intermediate answer and the intermediate thinking chain. In response to not meeting the termination condition, the reference information corresponding to the target question is updated based on the intermediate answer and the intermediate thinking chain, and the next round of loop analysis is performed. This realizes the flexible switching of fine-tuning sub-models for dynamic identification of medical stages, and improves the efficiency and accuracy of medical intelligent question answering. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 This is a flow chart of a low-resource, multi-scenario collaborative medical intelligent question-answering method provided by an embodiment of the present invention;
[0021] Figure 2 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0022] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention are described clearly and completely below. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are also within the scope of protection of the present invention.
[0023] The low-resource, multi-scenario collaborative medical intelligent question-answering method provided by the embodiments of the present invention is primarily applicable to analyzing and answering medical questions in phased scenarios, thereby improving the effectiveness of question-answering. The low-resource, multi-scenario collaborative medical intelligent question-answering method provided by the embodiments of the present invention can be executed by an electronic device.
[0024] Example 1
[0025] Figure 1 This is a flowchart of a low-resource, multi-scenario collaborative medical intelligent question-answering method provided by an embodiment of the present invention. Figure 1 The low-resource, multi-scenario collaborative medical intelligent question-answering method specifically includes:
[0026] S110. Determine at least one target medical stage and a fine-tuning sub-model corresponding to each target medical stage based on a pre-trained base model, a target problem, and reference information corresponding to the target problem.
[0027] The base model is a general analysis and recognition model. It is a large language model trained based on a pre-built general question-answering thinking chain. It can be a LoRA (Low-Rank Adaptation of Large Language Models). The general question-answering thinking chain includes questions in a general domain, their corresponding answers, and the corresponding thinking process. The target question is the medical question to be answered. Reference information is other information related to answering the target question. It can include information about previous questions and answers, as well as information about intermediate results during the analysis process. The target medical stage is the medical stage involved in the target question. For example, a medical stage may include initial diagnosis, follow-up diagnosis, recommended tests, recommended medications, and treatment plans. The fine-tuning sub-model is a low-rank matrix in LoRA obtained by training based on the pre-built medical question-answering thinking chain and the pre-trained base model. It can serve as an incremental sub-model of the base model. The medical question-answering thinking chain includes questions in the medical field, their corresponding answers, and the corresponding thinking process.
[0028] Specifically, the target problem and the corresponding reference information are combined with pre-set medical stage analysis instructions. Using a pre-trained base model, at least one target medical stage can be obtained. Then, for each target medical stage, a fine-tuned sub-model corresponding to each target medical stage is determined from the pre-trained fine-tuned sub-models. The medical stage analysis instructions can be guidance information for directing the base model to analyze the target problem and the medical stage currently associated with the corresponding reference information.
[0029] Based on the above example, the base model and each fine-tuning sub-model are trained based on the following method:
[0030] Based on the pre-built general question-answering thinking chain, the large language model is trained with low-rank fine-tuning to obtain the base model;
[0031] For each medical stage to be selected, the incremental model is low-rank fine-tuned according to the medical question-answering thinking chain, general question-answering thinking chain, preset mixing ratio and base model corresponding to the medical stage to obtain the fine-tuning sub-model corresponding to the medical stage to be selected.
[0032] The preset mixing ratio is the ratio of medical Q&A thinking chains to general Q&A thinking chains, for example, a 1:1 ratio. The selected medical stages are different fine-tuning stages divided according to different medical tasks. The incremental model is a model composed of a low-rank matrix connected to the base model, serving as an increment to the base model.
[0033] Specifically, open-source general-domain question-and-answer data can be used to pre-build a general-purpose question-and-answer thinking chain, and then the general-purpose question-and-answer thinking chain can be used to perform low-rank fine-tuning training on the large language model, that is, full-parameter training, thereby activating its complex reasoning and structured output capabilities, and obtaining a base model. For each medical stage to be selected, a corresponding fine-tuning sub-model is trained for each medical stage to be selected, that is, a small model for each stage is trained separately. Taking one of the medical stages to be selected as an example, the medical question-and-answer thinking chain corresponding to the medical stage to be selected and the general question-and-answer thinking chain are mixed according to a preset mixing ratio to prevent the model from having stage-by-stage forgetting, and then the mixed data is used to freeze the parameters of the base model on the basis of the base model, and the incremental model is subjected to low-rank fine-tuning training to obtain the fine-tuning sub-model corresponding to the medical stage to be selected.
[0034] It is understandable that in multi-task scenarios, LoRA technology is used to achieve lightweight fine-tuning for different medical tasks (such as disease diagnosis and drug recommendations) to generate independent fine-tuning sub-models. The base model serves as the hub, retaining its extensive knowledge and capabilities for daily interactions and basic task processing. In specific task scenarios, highly specialized services are provided by dynamically loading specialized LoRA modules (fine-tuning sub-modules). Through a balancing mechanism between general and specialized data, the fine-tuning sub-models are ensured to adapt to specialized tasks while avoiding overfitting and catastrophic forgetting. This achieves a dynamic balance between specialization and generality, improving their long-term stability and generalization capabilities.
[0035] Based on the above example, it is also necessary to pre-generate the medical question-and-answer thinking chain corresponding to each selected medical stage, which can be:
[0036] Obtaining initial question-and-answer data and medical non-question-and-answer data for each medical stage to be selected, and determining auxiliary medical information for each medical stage to be selected based on the medical non-question-and-answer data;
[0037] For each medical stage to be selected, determining the converted question and answer data for the medical stage to be selected based on the medical non-question and answer data for the medical stage to be selected, the auxiliary medical information corresponding to the medical non-question and answer data, and the question and answer generation instruction template for the medical stage to be selected; and determining the medical question and answer data for the medical stage to be selected based on the converted question and answer data for the medical stage to be selected and the initial question and answer data;
[0038] For each medical stage to be selected, the medical question and answer thinking chain corresponding to the medical stage to be selected is determined based on the medical question and answer data of the medical stage to be selected, the auxiliary medical information corresponding to the medical question and answer data, and the thinking chain question and answer instruction template of the medical stage to be selected.
[0039] Initial Q&A data can be doctor-patient Q&A data. For example, this data can be obtained by developing online search and data crawling tools and extracting doctor-patient Q&A data from open-source internet medical Q&A platforms, such as online doctors. Non-medical Q&A data is acquired medical-related information, but not Q&A data. It can include electronic medical records, medical atlas data, medical guidelines, and literature. Electronic medical record data can be extracted by developing information system call interfaces from hospital information systems (HIS), electronic medical records (EMR), and picture archiving and communication systems (PACS). Medical graph data can be developed by developing data crawling and structured parsing tools to crawl structured medical data from medical encyclopedias, including diseases, departments, clinical manifestations, differential examinations, differential diagnoses, treatment medications, and treatment plans. Using a medical entity extraction module, these tools extract entity nodes and construct triples such as disease-symptom, disease-department, disease-examination, disease-medication, and disease-differential diagnosis (for other diseases) to build a disease knowledge graph. Medical guideline and literature data can be developed by developing multi-format document parsing and OCR (Optical Character Recognition) tools to parse large amounts of scanned medical literature and document guidelines into uniformly formatted, non-redundant text files. Auxiliary medical information is reference information for each candidate medical stage, obtained by concatenating and integrating non-question-and-answer medical data according to preset rules. Question-and-answer generation instruction templates are pre-set instruction templates used to guide the generation of question-and-answer data for the candidate medical stage. Transformed question-and-answer data is generated by extracting question-and-answer pairs from auxiliary medical information using an existing large language model. The thinking chain question and answer instruction template is a pre-set instruction template used to guide the thinking process of generating question and answer data corresponding to the selected medical stage.
[0040] Specifically, initial question-and-answer data and non-medical question-and-answer data for each candidate medical stage can be obtained from open-source online information and authorized medical system information. The non-medical question-and-answer data can then be spliced and integrated to obtain supplementary medical information for each candidate medical stage. For example, for medical graph data, related entity nodes can be extracted to construct triples such as disease-symptom, disease-department, disease-examination, disease-medication, and disease-related diseases (differential diagnosis). These triples are then spliced and integrated into supplementary medical information. For electronic medical record data, patient information such as the patient's chief complaint and examination and test results can be spliced and integrated into supplementary medical information. For each candidate medical stage, the supplementary medical information is substituted into the question-and-answer generation instruction template for that stage. Analysis using an existing large language model can yield transformed question-and-answer data for that stage. Furthermore, the transformed question-and-answer data for that stage is combined with the initial question-and-answer data to construct the medical question-and-answer data for that stage. For each medical stage to be selected, the medical question and answer data of the medical stage to be selected and the auxiliary medical information corresponding to the medical question and answer data are substituted into the thinking chain question and answer instruction template of the medical stage to be selected. Using the existing large language model for analysis, the medical question and answer thinking chain corresponding to the medical stage to be selected can be obtained.
[0041] For example, pre-built Q&A instruction templates for different candidate medical stages can be used to generate question-and-answer pairs for each medical stage based on supplementary medical information. Subsequently, the supplementary medical information is sequentially loaded into the Q&A instruction templates for each candidate medical stage (including initial diagnosis, follow-up diagnosis, recommended tests, recommended medications, and treatment plans). Using instruction generation, the converted Q&A data for each candidate medical stage is extracted and, combined with the initial Q&A data for each candidate medical stage, the medical Q&A data for each candidate medical stage is constructed.
[0042] For the initial question and answer data and medical non-question and answer data obtained for each candidate medical stage, the missing value processing tool can be used to process the missing value data, the outlier filtering tool can be used to filter out special data such as security and sensitive information, the English character ratio filtering tool can be used to filter out instruction data with a high English character ratio, and the functional word deduplication tool can be used to filter out instruction data containing a large number of repeated words. After obtaining the medical question and answer thinking chain corresponding to each candidate medical stage, the missing value processing tool, the outlier filtering tool, and the English character ratio filtering tool can also be used to process the medical question and answer thinking chain. By cleaning and denoising the above data, the quality of the data structure can be improved.
[0043] Based on the above example, the following method can be used to determine the medical question and answer thinking chain corresponding to the selected medical stage based on the medical question and answer data of the selected medical stage, the auxiliary medical information corresponding to the medical question and answer data, and the thinking chain question and answer instruction template of the selected medical stage:
[0044] For each set of medical question and answer data in the selected medical stage, determine the key focus features corresponding to the medical question and answer data based on the question data in the medical question and answer data, the auxiliary medical information corresponding to the medical question and answer data, and the key focus feature instruction template in the thinking chain question and answer instruction template;
[0045] Construct a combination of focus features based on the focus features;
[0046] For each focus feature combination, determine the candidate thinking process and candidate answer corresponding to the focus feature combination based on the focus feature combination, question data, and the thinking process result instruction template in the thinking chain question and answer instruction template;
[0047] In response to the answer data in the medical question-and-answer data containing a candidate answer, the candidate thinking process corresponding to the candidate answer is used as a thinking chain to be combined;
[0048] Determine the medical question and answer thinking chain of the medical question and answer data according to each to-be-combined thinking chain corresponding to the medical question and answer data;
[0049] The medical question and answer thinking chain of each medical question and answer data corresponding to the medical stage to be selected is used as the medical question and answer thinking chain corresponding to the medical stage to be selected.
[0050] Among them, the key focus feature instruction template is an instruction template in the thinking chain question and answer instruction template. It is a pre-set instruction template used to guide the generation of key features (such as positive features, etc.) corresponding to the corresponding question data. Key focus features are various data related to disease analysis, such as positive test values, positive symptoms, test symptoms, etc. The focus feature combination is a combination of one or more key focus features, used to establish the association between the key focus features. The thinking process result instruction template is an instruction template in the thinking chain question and answer instruction template. It is a pre-set instruction template used to guide the generation of the thinking process and results of using the focus feature combination to answer the question data. The candidate thinking process and candidate answer are the answers and corresponding thinking processes obtained by analyzing the question data using the focus feature combination. The thinking chain to be combined is a thinking chain composed of candidate answers and corresponding candidate thinking processes when the candidate answers belong to part or all of the original answer data.
[0051] Specifically, for each candidate medical stage, the corresponding medical question and answer thinking chain can be independently extracted. Taking one of the candidate medical stages as an example for illustration. For each group of medical question and answer data of the candidate medical stage, the question data in the medical question and answer data and the auxiliary medical information corresponding to the medical question and answer data are obtained, which are substituted into the key attention feature instruction template in the thinking chain question and answer instruction template. Using an existing large language model for analysis, the key attention features corresponding to the medical question and answer data can be obtained. Randomly combining the key attention features to construct multiple attention feature combinations. It can be understood that each attention feature combination contains at least one attention feature combination. Further, for each attention feature combination, the attention feature combination and the question data are substituted into the thinking process result instruction template in the thinking chain question and answer instruction template. Using an existing large language model for analysis, the candidate thinking process and the candidate answer corresponding to the attention feature combination can be obtained. If the answer data in the medical question and answer data contains the candidate answer, it means that the analysis is correct, and the candidate thinking process corresponding to the candidate answer can be used as the combined thinking chain, otherwise, it can be directly excluded. Integrating the answer data and each combined thinking chain corresponding to the medical question and answer data can obtain the complete medical question and answer thinking chain of the group of medical question and answer data. Finally, the medical question and answer thinking chains of each medical question and answer data corresponding to the candidate medical stage can be integrated as the medical question and answer thinking chain corresponding to the candidate medical stage.
[0052] For example, the thinking chain question and answer instruction templates of different candidate medical stages can be constructed in advance, and the task is to generate reasoning thinking processes according to the input and output. That is, the medical question and answer data and the corresponding auxiliary medical information C are input into the thinking chain question and answer instruction template to construct instructions. The overall link is as follows: First, obtain the information related to the question data Q from the auxiliary medical information C, and analyze the key attention feature list (such as positive examination and test value / positive symptoms / test and symptom combination), that is, the list composed of key attention features. Second, randomly combine the key attention feature list to sequentially construct the thinking process and the result (candidate thinking process and candidate answer). Compare whether the generated result is consistent with the information in the answer data (answer data). If consistent, keep it, if not, discard it. The retained thinking process (combined thinking chain) is combined and spliced into the overall thinking process (medical question and answer thinking chain), which can be placed in the corresponding label, such as <think>The label and the corresponding answer data A together construct the final output, which is the medical question and answer thinking chain corresponding to the selected medical stage. Repeating the above process can complete the construction of medical question and answer thinking chains for different selected medical stages.
[0053] Based on the above example, after determining the medical question-and-answer thinking chain corresponding to the selected medical stage, the data quality of the medical question-and-answer thinking chain can also be evaluated and screened. Specifically, the following can be done:
[0054] For each medical question-and-answer thinking chain in the selected medical stage, determine at least one corresponding quality assessment indicator;
[0055] Determine the effectiveness of each medical question-and-answer thinking chain based on its quality assessment indicators;
[0056] According to each valid status, update the medical question and answer thinking chain corresponding to the selected medical stage.
[0057] Among them, the quality assessment indicators are evaluation indicators for each quality dimension of the medical question-and-answer thinking chain, including length assessment value, diversity assessment value, and instruction following difficulty assessment value. The length assessment value is used to evaluate the text length of the medical question-and-answer thinking chain. The diversity assessment value is used to evaluate the semantic diversity covered by the data, such as coverage of multiple scenarios, task types, and semantic features. The instruction following difficulty assessment value is used to evaluate the learning value and ensure the effectiveness of the medical question-and-answer thinking chain. The effective status includes valid and invalid. The effective status of the medical question-and-answer thinking chain whose quality assessment indicators meet the preset requirements can be set to valid; otherwise, it is set to invalid.
[0058] Specifically, for each medical question-and-answer thinking chain in the selected medical stage, the length evaluation value, diversity evaluation value and instruction following difficulty evaluation value are calculated respectively, and one of the medical question-and-answer thinking chains is used as an example for explanation. It is determined whether the data length of the medical question-and-answer thinking chain is within the preset length range. If not, the length evaluation value can be directly determined to be 0. Among them, the preset length range is a predetermined reasonable text length range. Each sentence in the medical question-and-answer thinking chain is embedded and represented respectively, and the embedding vector corresponding to each sentence can be obtained. Then, the cosine similarity between the embedding vectors of any two sentences is calculated, and a similarity matrix is constructed. The cosine similarities in the similarity matrix are processed according to a preset method to obtain the diversity evaluation value of the medical question-and-answer thinking chain. The medical question-and-answer thinking chain is input into the preset instruction following model to calculate the perplexity with instructions and the perplexity without instructions, and the ratio of the perplexity with instructions to the perplexity without instructions is used as the instruction following difficulty evaluation value. The effective status of each medical question and answer thinking chain with a median length evaluation value of 0 is set to invalid. The diversity evaluation value and the instruction following difficulty evaluation value are then combined to screen again. The effective status of each medical question and answer thinking chain that does not meet the preset requirements is set to invalid, while the remaining effective status remains valid. The medical question and answer thinking chains with effective status are retained, and the medical question and answer thinking chains with invalid status are eliminated to update the medical question and answer thinking chain corresponding to the selected medical stage.
[0059] For example, regarding the diversity evaluation value: its core goal is to ensure that the data covers a variety of scenarios, task types, and semantic features, thereby enhancing the generalization ability of the model. First, a pre-trained language model is used to generate a sentence-level embedding representation, i.e., an embedding vector, for each medical question-and-answer thought chain. The embedding representation is a vector of fixed dimension that can capture the semantic features of the sentence. For each sentence embedding vector, the cosine similarity is calculated:
[0060]
[0061] Among them, v1 and v2 are the embedding vectors of the two sentences respectively, and ‖v1‖ and ‖v2‖ represent the Euclidean norm of the vector.
[0062] By analyzing the semantic distribution of sentences, we can avoid data with too little information, thereby improving the generalization ability of the model. By constructing a similarity matrix using cosine similarity, we can easily calculate the sparsity of the semantic distribution of the data as a whole and measure the data diversity. The diagonal of the similarity matrix represents self-similarity, with a value of 1. The average of the off-diagonal elements of the similarity matrix is calculated to obtain the overall semantic similarity, i.e., the mean s. The diversity assessment value can be calculated using the following formula:
[0063]
[0064] in, is the diversity evaluation value of the medical question-answering thinking chain, and s is the semantic similarity.
[0065] Among them, the higher the s is, the higher the semantic repetition rate is. d On the contrary, the lower the s, the higher the semantic diversity. d The higher.
[0066] For example, regarding the command-following difficulty evaluation value, the command-following difficulty quantifies the impact of commands on model generation behavior, assessing the learning value of commands and ensuring the effectiveness of the medical question-answering thinking chain. Its core is to calculate the effect of command context on model output based on perplexity. The perplexity of the medical question-answering thinking chain generated responses with and without commands is calculated. The calculated perplexity assesses the command-following difficulty of the data and filters out noisy or low-quality data.
[0067]
[0068] Among them, w i is the i-th word in the medical question-answering thinking chain, P(w i ) is the probability of the model predicting the word, N is the total number of words in the medical question-answering thinking chain, and PPL is the perplexity.
[0069] When calculating the instruction following difficulty evaluation value, two kinds of perplexity are calculated for each medical question-answering thinking chain: perplexity PPL when there is instruction context with (with instruction perplexity) and perplexity PPL without instruction context without (no instruction confusion), the ratio of the two is defined as the instruction following difficulty evaluation value S i :
[0070]
[0071] If S i Greater than 0 and less than 1. Higher values indicate a greater impact of the instruction on the generation process and a higher difficulty in following the instruction. This indicates a significant impact on generation and the model should prioritize learning that instruction. Values below 0 and above 1 are considered outliers, indicating that the instruction has no positive effect on fine-tuning and should be filtered out. This method uses a unified evaluation model to calculate perplexity, and the perplexity ratio eliminates the influence of different models on the score. Therefore, this method allows for high-quality data screening using models with smaller parameters, reducing computational overhead.
[0072] Exemplarily, the comprehensive analysis of the diversity evaluation value and the instruction following difficulty evaluation value can be performed by setting corresponding thresholds (available ranges) for the diversity evaluation value and the instruction following difficulty evaluation value, respectively. If any one of the thresholds does not meet the threshold requirements, the effective state is determined to be invalid; if both meet the threshold requirements, the effective state is determined to be valid. Alternatively, the diversity evaluation value and the instruction following difficulty evaluation value are normalized, and then weighted with corresponding preset weights to obtain a comprehensive evaluation value. The comprehensive evaluation value is compared with the preset evaluation value threshold. If the threshold requirements are met, the effective state is determined to be valid; otherwise, the effective state is determined to be invalid. Of course, other methods for determining the effective state are also possible and are not limited here.
[0073] Based on the above example, if the reference information corresponding to the target question includes historical conversation summaries, the historical conversation summaries can be obtained in the following way:
[0074] Get the historical message records corresponding to the target issue;
[0075] The historical summary information is determined according to the historical message records, the preset summary extraction instruction template and the base model.
[0076] The historical message record is a conversation record before the current target question is asked. The preset summary extraction instruction template is a pre-set instruction template for extracting information related to the medical record from the conversation record.
[0077] Specifically, the conversation content before the target question is used as the historical message record corresponding to the target question. The historical message record is substituted into the summary extraction instruction template, and the instruction is analyzed through the base model to output the historical summary information corresponding to the target question.
[0078] For example, after receiving the user's target question, the system first parses and obtains the user's historical message records. This information can be combined with the previously analyzed summary medical record information (determined through the first n rounds of analysis) to extract or update the corresponding core electronic medical record information, which can include past medical history, allergies, and test results. The updated core electronic medical record information is then input into a preset summary extraction instruction template, and the base model is used to automatically generate a historical conversation summary. This historical conversation summary can be used as contextually known information for reference by the subsequent LoRA module (fine-tuning submodule) when answering, improving the coherence of the question and answer.
[0079] Based on the above example, to facilitate the use of fine-tuning sub-models, after determining at least one target medical stage and the corresponding fine-tuning sub-model for each target medical stage based on the pre-trained base model, target problem, and reference information corresponding to the target problem, it is necessary to load the fine-tuning sub-model corresponding to each target medical stage for easy call:
[0080] The fine-tuned sub-model corresponding to each target medical stage is loaded from the graphics processor to the central processing unit.
[0081] Specifically, the base model can be kept loaded in the central processing unit, and the unused fine-tuning sub-models can be saved in the graphics processing unit. When needed, that is, when involved in each target medical stage, the corresponding fine-tuning sub-models can be loaded from the graphics processing unit to the central processing unit to facilitate the use of the fine-tuning sub-models.
[0082] Alternatively, efficient LoRA switching can be achieved by loading the corresponding LoRA components (fine-tuning sub-models) from storage only when required by the task, combined with GPU (Graphics Processing Unit) memory optimization strategies. Frequently used LoRA components reside in graphics memory, while less frequently used components are stored in the CPU (Central Processing Unit) or host memory, reducing latency through asynchronous loading.
[0083] S120. Determine the intermediate answer and the intermediate thinking chain corresponding to the intermediate answer based on the target question, the reference information corresponding to the target question, the base model, and the fine-tuning sub-model corresponding to each target medical stage.
[0084] Reference information is the information needed to answer the target question. It can be the historical summary information corresponding to the target question, or it can be the historical summary information corresponding to the target question and the intermediate information generated when the target question is not fully answered. In other words, it refers to the intermediate answer from the previous analysis cycle and the intermediate thought chain corresponding to the intermediate answer. The intermediate answer and the intermediate thought chain corresponding to the intermediate answer are the output results of analyzing the target question based on the reference information using the base model and the fine-tuning sub-model corresponding to the target medical stage.
[0085] Specifically, for each target medical stage, the base model and its corresponding fine-tuning sub-model are used to analyze the target question and its corresponding reference information, and present the thought process behind the analysis. By integrating the output results for each target medical stage, an intermediate answer and the corresponding intermediate thought chain can be obtained.
[0086] Based on the above example, the intermediate answer and the intermediate thinking chain corresponding to the intermediate answer can be determined in the following way based on the target question, the reference information corresponding to the target question, the base model, and the fine-tuning sub-models corresponding to each target medical stage:
[0087] For each target medical stage corresponding to the fine-tuning sub-model, the base model and the fine-tuning sub-model corresponding to the target medical stage are connected in series to form a target analysis model;
[0088] Input the target question, the reference information corresponding to the target question, and the preset question-answer instruction template corresponding to the target medical stage into the target analysis model to obtain the stage answer corresponding to the target medical stage and the stage thinking chain corresponding to the stage answer;
[0089] According to the stage answers and stage thinking chains corresponding to each target medical stage, construct intermediate answers and intermediate thinking chains corresponding to the intermediate answers.
[0090] The target analysis model is the model that connects to the fine-tuning sub-model after the base model. The preset question-and-answer instruction template is a pre-set instruction template used to guide the answer and thinking process based on the target question and corresponding reference information. The stage answer and the corresponding stage thought chain are the output results of analysis using the fine-tuning sub-model corresponding to a target medical stage.
[0091] Specifically, for each target medical stage corresponding to the fine-tuning sub-model, the base model and the fine-tuning sub-model corresponding to the target medical stage are connected in series to form the target analysis model of the target medical stage. The target question and the reference information corresponding to the target question are substituted into the preset question and answer instruction template corresponding to the target medical stage. The instruction is analyzed using the target analysis model to obtain the stage answer corresponding to the target medical stage and the stage thinking chain corresponding to the stage answer. Furthermore, the stage answers and stage thinking chains corresponding to each target medical stage in this analysis cycle are combined to construct an intermediate answer and an intermediate thinking chain corresponding to the intermediate answer.
[0092] Based on the above example, if the fine-tuning sub-models corresponding to each target medical stage are loaded from the graphics processor to the central processor, then according to the target question, the historical message records corresponding to the target question, the base model, the fine-tuning sub-models corresponding to each target medical stage, the intermediate answers, and the intermediate thought chains corresponding to the intermediate answers, these fine-tuning sub-models can be released. Specifically:
[0093] Release the fine-tuned sub-model corresponding to each target medical stage from the central processing unit.
[0094] Specifically, after using the fine-tuning sub-model corresponding to each target medical stage, it can be released and kept in the graphics processor to reduce the load of the central processing unit.
[0095] S130. Based on the base model, the target question, the historical conversation summary corresponding to the target question, the intermediate answer, and the intermediate thinking chain, determine whether the intermediate answer meets the termination condition. If so, execute S140; if not, execute S150.
[0096] Among them, the termination condition is used to determine whether the intermediate answer is accurately associated with the target question and the historical conversation summary, and whether it can completely answer the target question. It can include completeness (for parallel requests) and validity (for serial requests).
[0097] Specifically, the target question, the corresponding historical conversation summary, the intermediate answers, and the intermediate thought chain are substituted into a preset termination analysis instruction template. The base model is then used to analyze whether the termination condition has been met. For example, the answer progress can be given, and when the answer progress reaches 100%, the termination condition is determined to be met. Otherwise, the termination condition is not met, and the analysis loop must continue. The preset termination analysis instruction template can be a pre-set instruction template used to guide the analysis of whether the intermediate answers and intermediate thought chains correspond to the target question and historical conversation summary, and whether the answer to the target question is accurate.
[0098] S140. Determine the target output information corresponding to the target question based on the intermediate answer and the intermediate thinking chain.
[0099] Among them, the target output information is the answer and thinking process that can accurately and completely answer the target question.
[0100] Specifically, if the intermediate answer meets the termination condition, it means that the intermediate answer and the intermediate chain of thought have accurately and completely answered the target question and no further analysis is required. Therefore, the intermediate answer and the intermediate chain of thought can be used as the target output information corresponding to the target question. In addition, the target output information can be provided to the user corresponding to the target question.
[0101] S150. Update the reference information corresponding to the target question according to the intermediate answer and the intermediate thinking chain, and return to execute the step of determining at least one target medical stage and the fine-tuning sub-model corresponding to each target medical stage according to the pre-trained base model, the target question, and the reference information corresponding to the target question.
[0102] Specifically, if the intermediate answer does not meet the termination condition, it means that the intermediate answer and intermediate thinking chain obtained by the current loop analysis cannot completely answer the target problem. Therefore, further analysis is needed, that is, entering the next round of loop analysis. Specifically, the intermediate answer and the intermediate thinking chain are updated to the reference information corresponding to the target problem, so that the results of the current loop analysis are considered in the subsequent loop analysis, and then, the execution is returned to determine at least one target medical stage and the fine-tuning sub-model corresponding to each target medical stage based on the pre-trained base model, target problem, and reference information corresponding to the target problem, so as to obtain a new intermediate answer and intermediate thinking chain, so as to re-judge whether the intermediate answer meets the termination condition, until the termination condition is met and the target output information is obtained.
[0103] For example, by inputting historical conversation summaries and the user's target question into the base model, the most suitable LoRa sub-model (fine-tuned sub-model) can be determined, ensuring that requests are dispatched to the most appropriate fine-tuned sub-model or models, improving answer accuracy. If a single LoRa sub-model is dispatched, the reasoning results of that LoRa sub-model are directly returned as the preliminary reasoning output (intermediate answers and intermediate thought chains). If the dispatch involves multiple LoRa sub-models, complex tasks are split into multiple parallel or serial sub-tasks to ensure more reasonable LoRa sub-model invocation.
[0104] This means that if the target problem can be solved in parallel, multiple LoRA sub-models will be invoked in parallel for reasoning, ultimately integrating the intermediate answer and the intermediate chain of thought. If the target problem involves multiple steps, they will be executed serially according to the task logic. After each step is determined, the decision is then analyzed and fine-tuned to determine the next sub-model to invoke. Based on the decomposed intent recognition results (target medical stage), the LoRA sub-models are scheduled serially or in parallel, and the solution is iterated.
[0105] For example, this can include three parts: Intent Analysis: Based on the base model analysis, the tools (LoRA sub-models) and parameters required to execute the current loop are determined. LoRA inputs can also be adaptively adjusted based on the structured parameters of different tasks (target medical stages), such as adjusting diagnostic keywords and key information in medical record summaries. Reflection: During each step of the task (each round of loop analysis), the thinking process (intermediate thought chain) is recorded and adaptively optimized based on the current environment (reference information). Termination Judgment: Based on the parsed output, it is determined whether to continue iterating the LoRA call, which can improve the consistency and accuracy of task execution.
[0106] The above approach supports collaborative work between multiple LoRA sub-modules, which can solve the problem of task overlap or dependency in medical scenarios. Through context information sharing and task scheduling mechanisms, the coherence and consistency of task processing are ensured. It can seamlessly collaborate between tasks, improving the efficiency and accuracy of task processing in complex scenarios. In addition, it supports the general model (base model) to autonomously select and load the corresponding LoRA module (fine-tuning sub-model) according to task requirements to achieve dynamic adaptation. Through task identification and priority scheduling (analyzing each target medical stage), dynamic loading can quickly switch the LoRA module required for the current task, ensuring the real-time and flexibility of analysis, significantly improving the adaptability of the model in multi-task scenarios, and meeting the dynamic requirements of complex tasks.
[0107] LoRA dynamic management is a technical extension for efficiently fine-tuning large models, and its core goal is to improve the adaptability of models in different tasks or data scenarios by dynamically adjusting the structure and weight distribution of low-rank adapters.
[0108] Optionally, an efficient module management mechanism is designed to support the base model to autonomously select and load corresponding LoRA weights according to task requirements, realize dynamic adaptation, and perform the next inference work.
[0109] The above content realizes the dynamic adaptation of different stages of medical tasks through the LoRA technology, and multiple fine-tuning sub-models can be flexibly switched according to task requirements, improving the generalization ability of the model. Moreover, the fine-tuning sub-models of multiple target medical stages can be dynamically adapted and scheduled to improve efficiency and accuracy in complex medical tasks. Through multi-LoRA two-stage fine-tuning, the balance between the base model and each professional medical stage task is ensured, avoiding overfitting and catastrophic forgetting problems, and realizing the long-term stability and professional performance of the model. Moreover, the historical session information (historical message record) can be combined to generate a medical record summary (historical session summary), providing complete context information for subsequent tasks of answering target questions, improving the coherence and accuracy of the question and answer. The task of answering the target question can also be reasonably decomposed to obtain different target medical stages, realizing parallel or serial scheduling of each fine-tuning sub-model, and ensuring the efficiency and flexibility of task execution. The dynamic management of Lora can reduce system resource consumption and optimize the time and computational efficiency of the inference process through efficient resource management and dynamic loading mechanism.
[0110] The present application has the following technical effects: according to the pre-trained base model, the target question, the reference information corresponding to the target question, at least one target medical stage and the fine-tuning sub-model corresponding to each target medical stage are determined to analyze the target question in the current cycle analysis, and the corresponding fine-tuning sub-module is called. Furthermore, according to the target question, the reference information corresponding to the target question, the base model and the fine-tuning sub-model corresponding to each target medical stage, the intermediate answer and the intermediate thought chain corresponding to the intermediate answer are determined to analyze the target question in the current cycle, and the intermediate answer is determined to determine whether the intermediate answer satisfies the termination condition according to the base model, the target question, the historical session summary corresponding to the target question, the intermediate answer and the intermediate thought chain. To determine whether the answer to the target question can be completed, in response to satisfying the termination condition, the target output information corresponding to the target question is determined according to the intermediate answer and the intermediate thought chain, and in response to not satisfying the termination condition, the reference information corresponding to the target question is updated according to the intermediate answer and the intermediate thought chain, and the next round of cycle analysis is performed. The dynamic recognition of medical stages realizes the flexible switching of fine-tuning sub-models, improves the efficiency and accuracy of medical intelligent question and answer.
[0111] Example 2
[0112] Figure 2 Schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 2 As shown, the electronic device 200 includes one or more processors 201 and a memory 202 .
[0113] The processor 201 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 200 to perform desired functions.
[0114] The memory 202 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 201 may execute the program instructions to implement the low-resource multi-scenario collaborative medical intelligent question-and-answer method and / or other desired functions of any embodiment of the present invention described above. Various contents such as initial external parameters, thresholds, etc. may also be stored in the computer-readable storage medium.
[0115] In one example, the electronic device 200 may further include an input device 203 and an output device 204, which are interconnected via a bus system and / or other connection mechanisms (not shown). The input device 203 may include, for example, a keyboard, a mouse, etc. The output device 204 may output various information to the outside, including warning information, braking force, etc. The output device 204 may include, for example, a display, a speaker, a printer, a communication network, and remote output devices connected thereto.
[0116] Of course, to simplify, Figure 2 Only some of the components related to the present invention in the electronic device 200 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, the electronic device 200 may further include any other appropriate components according to specific application scenarios.
[0117] Example 3
[0118] In addition to the above-mentioned methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the low-resource multi-scenario collaborative medical intelligent question-answering method provided by any embodiment of the present invention.
[0119] The computer program product may be written in any combination of one or more programming languages to implement the operations of embodiments of the present invention, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0120] In addition, an embodiment of the present invention may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the low-resource multi-scenario collaborative medical intelligent question-answering method provided by any embodiment of the present invention.
[0121] The computer-readable storage medium may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0122] It should be noted that the terms used in the present application are only intended to describe specific embodiments and are not intended to limit the scope of the present application. As shown in the specification of the present application, unless the context clearly indicates otherwise, "one", "a", "an", and / or "the" do not specifically refer to the singular, but can also include the plural. The terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method or device including the element.
[0123] It should also be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only used to facilitate the description of the present application and simplify the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application. Unless otherwise specified and limited, the terms "mount", "connect", "connect" and the like should be broadly understood, for example, it can be a fixed connection, or it can be a detachable connection, or an integral connection; it can be a mechanical connection, or an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For those skilled in the art, the specific meaning of the above terms in the present application can be understood according to the specific circumstances.
[0124] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and are not limited thereto; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present application.< / think>
Claims
1. A low-resource, multi-scenario collaborative medical intelligent question-answering method, characterized by: include: Determine at least one target medical stage and a fine-tuning sub-model corresponding to each target medical stage based on a pre-trained base model, a target question, and reference information corresponding to the target question; wherein the target medical stage is the medical stage involved in the target question; the fine-tuning sub-model is a low-rank matrix in LoRA obtained by training based on a pre-built medical question-and-answer thinking chain and a pre-trained base model, and the fine-tuning sub-model is an incremental sub-model of the base model; Determining an intermediate answer and an intermediate thinking chain corresponding to the intermediate answer based on the target question, reference information corresponding to the target question, the base model, and the fine-tuning sub-models corresponding to each target medical stage; Determining whether the intermediate answer satisfies a termination condition based on the base model, the target question, the historical conversation summary corresponding to the target question, the intermediate answer, and the intermediate thought chain; In response to the termination condition being met, determining target output information corresponding to the target question according to the intermediate answer and the intermediate thinking chain; In response to the termination condition not being met, updating the reference information corresponding to the target question according to the intermediate answer and the intermediate thought chain, and returning to the step of determining at least one target medical stage and a fine-tuning sub-model corresponding to each target medical stage according to the pre-trained base model, the target question, and the reference information corresponding to the target question; The base model and each fine-tuning sub-model are trained based on the following method: Based on the pre-built general question-answering thinking chain, the large language model is trained with low-rank fine-tuning to obtain the base model; For each medical stage to be selected, the incremental sub-model is low-rank fine-tuned according to the medical question-and-answer thinking chain corresponding to the medical stage to be selected, the general question-and-answer thinking chain, the preset mixing ratio and the base model to obtain the fine-tuning sub-model corresponding to the medical stage to be selected.
2. The method according to claim 1, characterized in that Also includes: Obtaining initial question-and-answer data and medical non-question-and-answer data for each medical stage to be selected, and determining auxiliary medical information for each medical stage to be selected based on the medical non-question-and-answer data; For each medical stage to be selected, determining the converted question and answer data for the medical stage to be selected based on the auxiliary medical information for the medical stage to be selected and the question and answer generation instruction template for the medical stage to be selected, and determining the medical question and answer data for the medical stage to be selected based on the converted question and answer data and the initial question and answer data; For each medical stage to be selected, the medical question and answer thinking chain corresponding to the medical stage to be selected is determined based on the medical question and answer data of the medical stage to be selected, the auxiliary medical information corresponding to the medical question and answer data, and the thinking chain question and answer instruction template of the medical stage to be selected.
3. The method according to claim 2, characterized in that The determining of the medical question and answer thinking chain corresponding to the to-be-selected medical stage according to the medical question and answer data of the to-be-selected medical stage, the auxiliary medical information corresponding to the medical question and answer data, and the thinking chain question and answer instruction template of the to-be-selected medical stage includes: For each set of medical question and answer data in the selected medical stage, determining the key focus features corresponding to the medical question and answer data based on the question data in the medical question and answer data, the auxiliary medical information corresponding to the medical question and answer data, and the key focus feature instruction template in the thinking chain question and answer instruction template; Constructing a focus feature combination based on the key focus features; For each focus feature combination, determining a candidate thinking process and a candidate answer corresponding to the focus feature combination based on the focus feature combination, the question data, and the thinking process result instruction template in the thinking chain question and answer instruction template; In response to the answer data in the medical question and answer data including the candidate answer, taking the candidate thinking process corresponding to the candidate answer as a thinking chain to be combined; determining a medical question and answer thinking chain of the medical question and answer data according to each to-be-combined thinking chain corresponding to the medical question and answer data and the answer data; The medical question and answer thinking chain of each medical question and answer data corresponding to the medical stage to be selected is used as the medical question and answer thinking chain corresponding to the medical stage to be selected.
4. The method according to claim 2, characterized in that After determining the medical question-and-answer thinking chain corresponding to the selected medical stage, the method further includes: Determine at least one corresponding quality assessment indicator for each medical question-and-answer thinking chain in the selected medical stage; Determine the effectiveness of each medical question-and-answer thinking chain based on its quality assessment indicators; According to each valid status, update the medical question and answer thinking chain corresponding to the selected medical stage; The quality evaluation indicators include a length evaluation value, a diversity evaluation value, and an instruction following difficulty evaluation value.
5. The method according to claim 1, wherein The reference information corresponding to the target question includes a historical conversation summary, and the method further includes: Obtain historical message records corresponding to the target issue; A historical conversation summary is determined according to the historical message record, a preset summary extraction instruction template, and the base model.
6. The method according to claim 1, characterized in that Determining an intermediate answer and an intermediate thinking chain corresponding to the intermediate answer based on the target question, reference information corresponding to the target question, the base model, and the fine-tuning sub-models corresponding to each target medical stage includes: For each target medical stage corresponding fine-tuning sub-model, the base model and the fine-tuning sub-model corresponding to the target medical stage are connected in series to form a target analysis model; Inputting the target question, the reference information corresponding to the target question, and the preset question-answer instruction template corresponding to the target medical stage into the target analysis model, obtaining the stage answer corresponding to the target medical stage and the stage thinking chain corresponding to the stage answer; According to the stage answers and stage thinking chains corresponding to each target medical stage, intermediate answers and intermediate thinking chains corresponding to the intermediate answers are constructed.
7. The method according to claim 1, characterized in that After determining at least one target medical stage and a fine-tuning sub-model corresponding to each target medical stage based on the pre-trained base model, the target problem, and reference information corresponding to the target problem, the method further includes: Loading the fine-tuned sub-model corresponding to each target medical stage from the graphics processor to the central processing unit; Accordingly, after determining the intermediate answer and the intermediate thought chain corresponding to the intermediate answer based on the target question, the reference information corresponding to the target question, the base model, and the fine-tuning sub-models corresponding to each target medical stage, the method further includes: The fine-tuning sub-model corresponding to each target medical stage is released from the central processing unit.
8. An electronic device, characterized in that: The electronic device comprises: processor and memory; The processor is used to execute the steps of the low-resource multi-scenario collaborative medical intelligent question-answering method as described in any one of claims 1 to 7 by calling the program or instructions stored in the memory.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program or instruction, which enables the computer to execute the steps of the low-resource multi-scenario collaborative medical intelligent question-answering method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Medical question and answer method and device, electronic equipment and storage medium
CN118692704A
Question and answer method and device, nonvolatile storage medium and electronic equipment
CN119807370A