Large model agent question and answer method and device based on self-evolution and electronic equipment
By adopting a large-scale model agent question and answer method based on self-evolution in medical question and answer agents, using a closed-loop training framework to build a database and update it dynamically, the problem of low accuracy of medical question and answer agents' response information is solved, achieving more efficient and flexible Question and answer skills in the medical field.
Patent Information
- Application Number
- CN202411294778.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-02-11
AI Technical Summary
In the medical field, medical Q&A agents based on large language models have low accuracy in generating reply information, and the existing memory database lacks an update mechanism, making it difficult to effectively resolve conflicts and conflict scenarios.
A large-model agent question-and-answer method based on self-evolution is used to construct sample databases and empirical databases through a closed-loop training framework, and a large language model is used to generate reply information in combination with these databases, and dynamically update the database based on feedback.
It improves the accuracy and fluency of the medical Q&A agent to generate reply information, enhances the agent's long-term memory ability, and adapts to the needs of different scenarios through dynamic update mechanisms.
Smart Images

Figure CN119418945A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a large-model intelligent agent question-answering method, device and electronic equipment based on self-evolution. Background Art
[0002] In recent years, artificial intelligence technology has made significant progress. Among them, large language models, as one of the core technologies, have received widespread attention. The application of intelligent agents driven by large language models in the medical field is becoming more and more extensive. In order to continuously improve the capabilities of large language models and intelligent agents, researchers and technical teams continue to explore and optimize, and have formed a variety of solutions. These solutions include supervised fine-tuning of basic models and building memory banks for large model intelligent agents. These methods have been applied and recognized to a certain extent in medical application scenarios, providing effective technical ideas and solutions for improving model capabilities.
[0003] However, despite a series of research results and engineering verification, these solutions still face many challenges. Supervised fine-tuning methods need to update the overall parameters of the basic model, which requires the accumulation of a large amount of high-quality data for training and requires large computing resources. Although the method of establishing a large model agent memory library can improve the long-term memory ability of the agent, it is not always effective in improving the accuracy of answers, and the existing memory library lacks an update mechanism, making it difficult to effectively resolve contradictions and conflict scenarios. For the above reasons, in the medical field, the medical question-answering agent based on a large language model has low accuracy in generating reply information.
[0004] Therefore, how to use medical question-answering agents to generate accurate and fluent response information is a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of the problems existing in the prior art, the present invention provides a large-model intelligent agent question-answering method, device and electronic device based on self-evolution, which are used to utilize the medical question-answering intelligent agent to generate accurate and fluent response information.
[0006] The present invention provides a large-model intelligent agent question-answering method based on self-evolution, comprising the following steps.
[0007] A medical question-answering intelligent agent obtains medical consultation questions; the medical question-answering intelligent agent uses an associated large language model to obtain reply information for the medical consultation questions based on an established experience database and a sample database; wherein the sample database and the experience database are constructed by the medical question-answering intelligent agent during automatic training in a closed-loop training framework, and the automatic training is a machine learning method that does not require labeled data; the medical question-answering intelligent agent feeds back the reply information.
[0008] According to a large model agent question-answering method based on self-evolution provided by the present invention, the associated large language model is used to obtain reply information for the medical consultation question based on the established experience database and sample database, including: obtaining first answer information for the medical consultation question from the sample database; obtaining second answer information for the medical consultation question from the experience database; generating consultation prompt words based on the medical consultation question, the first answer information and the second answer information; and inputting the consultation prompt words into the large language model to obtain the reply information output by the large language model.
[0009] According to a large-model intelligent agent question-answering method based on self-evolution provided by the present invention, the method also includes: the medical question-answering intelligent agent, in response to receiving positive feedback of the reply information, updates the sample database according to the medical consultation question and the reply information; the medical question-answering intelligent agent, in response to receiving negative feedback carrying a correct answer of the reply information, updates the experience database according to the medical consultation question and the correct answer.
[0010] According to a large-model agent question-answering method based on self-evolution provided by the present invention, the closed-loop training framework at least includes: a patient agent and the medical question-answering agent; in the closed-loop training framework, the sample database and the experience database are constructed in the following manner: the patient agent outputs a medical consultation question using an associated first large language model; the medical question-answering agent obtains a first reply to the medical consultation question using an associated second large language model; in response to the first reply being a correct answer, a data entry in the sample database is created based on the medical consultation question and the first reply; wherein the correct answer is obtained using the first large language model; in response to the first reply being an incorrect answer, a second reply is obtained based on the correct answer to the medical consultation question using the second large language model; and a data entry in the experience database is created based on the medical consultation question and the second reply.
[0011] According to a large-model intelligent agent question-answering method based on self-evolution provided by the present invention, the use of the associated second largest language model to obtain a first response to the medical consultation question includes: obtaining third answer information of the medical consultation question from the sample database; obtaining fourth answer information of the medical consultation question from the experience database; in response to the third answer information and the fourth answer information being both empty, generating a training prompt word according to the medical consultation question; in response to at least one of the third answer information and the fourth answer information being not empty, generating a training prompt word according to the medical consultation question and the at least one answer information; and inputting the training prompt word into the second largest language model to obtain the first response.
[0012] According to a large-model intelligent agent question-answering method based on self-evolution provided by the present invention, in response to the first reply being an incorrect answer, the second reply is obtained according to the correct answer to the medical consultation question using the second large language model, including: generating reflection prompt words according to the medical consultation question, the correct answer to the medical consultation question and the first reply; inputting the reflection prompt words into the second large language model so that the second large language model performs context learning according to the reflection prompt words to obtain the second reply.
[0013] The present invention also provides a large-model intelligent agent question-answering device based on self-evolution, comprising the following modules: a first acquisition module, used to enable a medical question-answering intelligent agent to obtain medical consultation questions; a second acquisition module, used to enable the medical question-answering intelligent agent to use an associated large language model to obtain reply information for the medical consultation questions based on an established experience database and a sample database; wherein the sample database and the experience database are constructed by the medical question-answering intelligent agent during automatic training in a closed-loop training framework, and the automatic training is a machine learning method that does not require labeled data; a feedback module, used to enable the medical question-answering intelligent agent to feedback the reply information.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the large-model intelligent agent question-answering method based on self-evolution as described above is implemented.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the self-evolution-based large-model intelligent agent question-answering methods described above.
[0016] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the self-evolution-based large-model intelligent agent question-answering methods described above.
[0017] The self-evolving large model intelligent agent question-answering method, device and electronic device provided by the present invention, the medical question-answering intelligent agent obtains medical consultation questions, uses the associated large language model, and combines the established experience database and sample database to generate reply information for the medical consultation questions. Since the medical question-answering intelligent agent uses the medical field knowledge stored in the experience database and sample database, it can provide correct and rich reference information for the large language model; and then use the powerful natural language processing and reasoning capabilities of the large language model to generate accurate and fluent reply information. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to the drawings required for use in the 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.
[0019] Figure 1 It is a flowchart of the self-evolving large-model intelligent agent question-answering method provided by the present invention.
[0020] Figure 2 It is a flowchart of a method for the medical question-answering intelligent agent provided by the present invention to generate reply information for medical consultation questions.
[0021] Figure 3 It is a structural schematic diagram of the closed-loop training framework provided by the present invention.
[0022] Figure 4 It is a flowchart of the method for constructing an experience database and a sample database in a closed-loop training framework provided by the present invention.
[0023] Figure 5 It is a schematic diagram of a medical record generated by using a large language model provided by the present invention.
[0024] Figure 6 It is a structural schematic diagram of the large-model intelligent agent question-answering device based on self-evolution provided by the present invention.
[0025] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] Combine the following Figure 1-Figure 5 Describe the self-evolving large model agent question answering method of the present invention.
[0028] Figure 1 : is a flow chart of the self-evolving large model intelligent agent question answering method provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 101: The medical question-answering agent obtains medical consultation questions.
[0029] An agent is a software entity that can operate autonomously and make decisions. It has the ability to perceive its environment and take actions based on it to achieve specific goals or tasks. An agent can receive input information and, based on this information, follow a preset logical algorithm to generate corresponding output information.
[0030] The medical question-answering agent is designed in medical scenarios for medical consultation questions. It can generate appropriate dialogue responses and provide users with the required medical information or advice.
[0031] The medical question-answering agent can obtain medical consultation questions input by users from the medical system in a variety of ways, for example, through voice or text, and is not limited to the description in this specification.
[0032] Step 102: The medical question-answering agent uses the associated large language model to obtain response information for medical consultation questions based on the established experience database and sample database.
[0033] The sample database and experience database are constructed during the automatic training of the medical question-answering agent in a closed-loop training framework. Automatic training is a machine learning method that does not require labeled data.
[0034] The experience database is used to record the correct responses generated by the medical question-answering agent during the training and reasoning process after the incorrect responses are corrected.
[0035] The sample database is used to record the positive examples collected by the medical question-answering agent during the training and reasoning process.
[0036] For more detailed description of the closed-loop training framework, experience database, and sample database, see Figure 4 The relevant content in will not be repeated here.
[0037] Large Language Models (LLMs) are complex algorithms built based on deep learning and natural language processing techniques that can understand, generate, and translate natural language texts.
[0038] The medical question-answering agent can be associated with the large language model in a variety of ways, which are not limited to the description of this specification. For example, the large language model can be deployed as a part of the medical question-answering agent on the processing device where the medical question-answering agent is located. For another example, the large language model can be deployed on a server, and data and / or information can be transmitted between the server and the medical question-answering agent via a wireless network.
[0039] In the specific implementation process, the medical question-answering intelligent agent can use the associated large language model in a variety of ways to obtain response information for medical consultation questions based on the established experience database and sample database.
[0040] Regarding an embodiment of a medical question-answering agent that uses an associated large language model to obtain response information for medical consultation questions based on an established experience database and sample database, see Figure 2 The relevant content in will not be repeated here.
[0041] Step 103: The medical question-answering agent feeds back reply information.
[0042] During the specific implementation process, the medical question-answering intelligent agent will feed back the generated response information to the medical system; the medical system can use the human-computer interaction interface to display the response information to the user (for example, in the form of text or voice).
[0043] In some embodiments, the user's feedback on the reply information output by the medical question and answer agent can be returned to the medical question and answer agent; the medical question and answer agent can update the experience database or sample database based on the user's feedback, so that during the use of the medical question and answer agent, the experience database and sample database can be continuously expanded to accumulate more and more rich medical field knowledge.
[0044] In the specific implementation process, after receiving positive feedback of the reply information, the medical question-answering agent can update the sample database according to the medical consultation question and the reply information. For example, the medical question-answering agent can query whether there is a data entry corresponding to the medical consultation question and its reply information in the experience database. If not, the medical question-answering agent can add the corresponding data entry to the sample database according to the medical consultation question and its reply information.
[0045] In the specific implementation process, after receiving the negative feedback of the reply information carrying the correct answer, the medical question-answering agent updates the experience database according to the medical consultation question and the correct answer. For example, the medical question-answering agent can add corresponding data entries in the experience database according to the medical consultation question and the correct answer.
[0046] Figure 2 FIG. 1 is a flow chart of a method for a medical question-answering agent provided by the present invention to generate reply information for a medical consultation question. Figure 2 As shown, the method includes the following: Step 201: Obtain first answer information of a medical consultation question from a sample database.
[0047] In a specific implementation process, the first answer information may be data in various forms, such as text data or structured data, and is not limited by the description of this specification.
[0048] The medical question-answering agent can use a variety of retrieval algorithms to obtain first answer information from the sample database and is not limited by the description of this specification.
[0049] As an example only, the medical question-answering agent can use the cosine similarity calculation method to obtain the first answer information from the sample database. The specific process is as follows.
[0050] First, we can use the existing large language model or text encoder to obtain the representation vector A of the medical consultation question. In the sample database, medical consultation questions and their corresponding answer information are stored in the form of key-value pairs. The representation vector of the medical consultation question stored in the sample database is B. The similarity between the two can be calculated using the following formula: .
[0051] (1)
[0052] in, n is the number of elements contained in the representation vector of the medical consultation question, i Numbering of vector elements representing medical consultation issues.
[0053] During the specific implementation process, the answer information corresponding to multiple medical consultation questions in the sample database whose similarity is greater than a preset threshold can be selected as the first answer information provided to the large language model; or the answer information corresponding to the medical consultation question with the highest similarity can be selected as the first answer information provided to the large language model, without being limited by the description of this specification.
[0054] Step 202: Obtain second answer information of the medical consultation question from the experience database.
[0055] In a specific implementation process, the second answer information may be data in various forms, such as text data or structured data, and is not limited by the description of this specification.
[0056] The medical question-answering agent can use a variety of retrieval algorithms to obtain first answer information from the sample database and is not limited by the description of this specification.
[0057] Step 203: Generate a consultation prompt word according to the medical consultation question, the first answer information and the second answer information.
[0058] In the specific implementation process, the medical consultation question, the first answer information and the second answer information can be connected using natural language as consultation prompt words.
[0059] As an example only, the template for the consultation prompt wording is as follows: “Instruction: You are now playing the role of a doctor and need to make some decisions. You need to combine existing cases and diagnostic experience to answer relevant questions: Input: The top n similarity samples retrieved from the sample database (first answer information); The top k experiences with the highest similarity are retrieved from the experience database (second answer information); Medical consultation questions; Based on the above information, please answer the current question and give your reasoning process. Please conduct reasoning and analysis step by step to reach the final result.
[0060] Step 204: input the inquiry prompt words into the large language model to obtain the reply information output by the large language model.
[0061] After the consultation prompt words are input into the large language model, the large language model uses the reasoning and reflection abilities acquired during the training process, combined with the first answer information and the second answer information, to output correct and fluent reply information.
[0062] Figure 3 It is a structural schematic diagram of the closed-loop training framework provided by the present invention.
[0063] The evolution of intelligent agents depends on the interaction with the environment and closed-loop feedback. Existing research has found that large-model intelligent agents can perform better in social simulation and have good interaction capabilities. Therefore, the present invention uses a large language model and intelligent agent simulation to construct a closed-loop training framework for medical scenarios. Figure 3 As shown, the closed-loop training framework includes: patient agent, medical question-answering agent and judgment module.
[0064] The patient agent is an agent whose role is a patient. The patient agent is associated with the first language model. The patient agent is used to output medical consultation questions to the medical question-answering agent using the first language model.
[0065] The first large language model can be a large language model in the medical field, or a pre-trained general large language model, and is not limited by the description in this specification.
[0066] In the specific implementation process, the patient agent can be associated with the first language model in a variety of ways, which are not limited to the description of this specification. For example, the first language model can be deployed as a part of the patient agent on the processing device where the patient agent is located. For another example, the first language model can be deployed on a server, and data and / or information can be transmitted between the server and the patient agent through a wireless network.
[0067] The medical question-answering agent is associated with the second largest language model. The second largest language model can be a large language model in the medical field or a pre-trained general large language model, which is not limited by the description of this specification.
[0068] Medical question-answering agents are used to generate responses to medical consultation questions. In a closed-loop training framework, medical question-answering agents can play different roles, such as virtual doctors or virtual nurses. By playing different roles, medical question-answering agents can learn different medical domain knowledge in a closed-loop training framework and build corresponding experience databases and sample databases.
[0069] In the specific implementation process, the medical question-answering agent can be associated with the second largest language model in a variety of ways, which are not limited to the description of this specification. For example, the second largest language model can be deployed as a part of the medical question-answering agent on the processing device where the medical question-answering agent is located. For another example, the second largest language model can be deployed on a server, and data and / or information can be transmitted between the server and the medical question-answering agent through a wireless network.
[0070] The judgment module is used to determine whether the response information output by the medical question-answering agent is correct, and to guide the medical question-answering agent to conduct contextual learning when it makes a mistake, so as to improve its medical professional ability.
[0071] The judgment module can be implemented in a variety of ways, for example, a program or a virtual agent (for example, it can be implemented by a patient agent), and is not limited to the description of this specification.
[0072] Through the above closed-loop training framework, the following diagnosis and treatment process can be realized: a) The virtual patient (played by the patient agent) becomes sick; b) The virtual patient goes to the hospital and talks with the virtual nurse (played by the medical question-and-answer agent) for triage; c) The virtual patient registers; d) The virtual patient talks to the virtual doctor (played by the medical question-and-answer agent), and the virtual doctor prescribes an examination; e) The virtual patient undergoes the examination and gets the examination results; f) The virtual doctor gives a diagnosis based on the interview and examination results, and gives a treatment plan; g) The virtual patient gets medicine based on the treatment plan; h) The virtual patient returns to recuperate.
[0073] Since the intelligent agents in the closed-loop training framework are driven by a large language model, the entire process can use partially customized prompts to ensure its normal operation. For example, by combining the symptoms and treatment plans of the virtual patients to determine whether they can recover quickly, etc., a complete diagnosis and treatment closed-loop process can be carried out in the closed-loop training framework.
[0074] After the closed-loop training framework is built, it is necessary to introduce the disease information of the virtual patient so that the closed-loop diagnosis and treatment process can operate normally. For example, it is necessary to introduce the virtual patient's disease, symptoms, examination results, and treatment plans to be taken, so that the virtual doctor can complete the examination plan, disease diagnosis, treatment plan and other tasks.
[0075] During the specific implementation process, different methods can be selected to provide data input for the closed-loop training framework, including: real data, virtual data, or real data mixed with virtual data.
[0076] Real data not only consumes a lot of human resources in the process of collection, but may also involve issues such as data sensitivity. Existing research has verified that large language models have strong knowledge reserves and data generation capabilities in the medical field. Therefore, in the specific implementation process, the first large language model associated with the patient agent can be used to generate medical consultation questions related to the patient's background information and disease information to promote the operation of the closed-loop diagnosis and treatment process.
[0077] The embodiment provided by the present invention realizes efficient closed-loop feedback by constructing a closed-loop training framework close to real scenarios, and provides a reliable environment for the rapid and automatic training of medical question-answering intelligent agents.
[0078] For more information about the automatic training tasks performed by medical question answering agents in a closed-loop training framework, see Figure 4 Related content in .
[0079] Figure 4 is a flow chart of the method for constructing an experience database and a sample database in a closed-loop training framework provided by the present invention, such as Figure 4 As shown, the method includes the following: Step 401: The patient agent uses the associated first language model to output medical consultation questions.
[0080] The patient agent can use the prompt words to make the first language model associated with it output medical consultation questions.
[0081] Just as an example, the prompt words could be as follows: "You are now in the role of the patient and need to provide some symptom descriptions."
[0082] The first language model outputs medical consultation questions based on the input prompt words, such as: "I have a headache, what treatment do I need?"
[0083] Step 402: The medical question-answering agent uses the associated second largest language model to obtain a first response to the medical consultation question.
[0084] In some embodiments, the medical question-answering agent may obtain third answer information of the medical consultation question from the sample database; and obtain fourth answer information of the medical consultation question from the experience database.
[0085] In the early stage of training the medical question-answering agent and its associated second language model using the closed-loop training framework, both the experience database and the sample database are empty. As the number of training rounds increases, the data entries in the experience database and the sample database gradually increase. Therefore, in the early stage of training, the third answer information and the fourth answer information may both be empty; as the number of data entries in the experience database and the sample database increases, at least one of the third answer information and the fourth answer information may not be empty.
[0086] In the case where both the third answer information and the fourth answer information are empty, training prompt words can be generated based only on the medical consultation question. As an example only, in this case, the training prompt words can be as follows: “Instruction: You are now playing the role of a doctor and need to make some decisions and answer relevant questions: Medical consultation questions; Based on the above information, please answer the current question and give your reasoning process. Please conduct reasoning and analysis step by step to reach the final result.
[0087] When at least one of the third answer information and the fourth answer information is not empty, a training prompt word may be generated according to the medical consultation question and the at least one answer information that is not empty. As an example only, in this case, the training prompt word may be as follows.
[0088] “Instruction: You are now playing the role of a doctor and need to make some decisions. You need to combine existing cases and diagnostic experience to answer relevant questions: Input: The top n similarity samples retrieved from the sample database (third answer information); The top k experiences with the highest similarity are retrieved from the experience database (the fourth answer information); Medical consultation questions; Based on the above information, please answer the current question and give your reasoning process. Please conduct reasoning and analysis step by step to reach the final result.
[0089] The training prompt word is input into the second largest language model to obtain the first response.
[0090] After the training prompt words are input into the second largest language model, the second largest language model uses the reasoning ability and reflection ability obtained in the training process, combined with the third answer information and the fourth answer information, to output the first reply information.
[0091] Step 403: In response to the first reply being a correct answer, a data entry in the sample database is created according to the medical consultation question and the first reply.
[0092] In a specific implementation process, the correct answer can be obtained using the first language model. For example, the correct answer can be obtained from the diagnosis result of the case generated by the first language model.
[0093] After the second largest language model outputs the first reply information, the judgment module in the closed-loop training framework can determine whether the first reply information is a correct answer.
[0094] When the first reply is determined to be the correct answer, the medical question-answering agent can create a data entry in the sample database based on the medical consultation question and the first reply in a variety of ways. For example, the text of the medical consultation question and the text of the first reply can be stored in the sample database in the form of a key-value pair to obtain a data entry in the sample database. For another example, the structured data of the medical consultation question and the structured data of the first reply can be stored in the sample database in the form of a key-value pair to obtain a data entry in the sample database.
[0095] Step 404: In response to the first reply being an incorrect answer, a second reply is obtained based on the correct answer to the medical consultation question using the second largest language model.
[0096] In some embodiments, when the first reply is not a correct answer, a reflection prompt word can be generated according to the medical consultation question, the correct answer to the medical consultation question, and the first reply. As an example only, the reflection prompt word can be as follows.
[0097] “Instruction: You are now playing the role of a doctor and need to make some decisions, but you made mistakes in the decision-making process and need to reflect and summarize your experience: Medical consultation questions; Correct responses to medical inquiries; The model's last answer
[0098] Based on the above information, please summarize why the model gave the wrong answer last time."
[0099] The reflection prompt word is input into the second largest language model, so that the second largest language model performs context learning according to the reflection prompt word to obtain a second response.
[0100] During the specific implementation process, the reflection prompt words can be input into the second largest language model; the second largest language model performs context learning based on the reflection prompt words to obtain an experience summary based on natural language; the second largest language model is used again to answer medical consultation questions to obtain a second reply.
[0101] Just as an example, the natural language based experience obtained by the second largest language model is summarized as follows.
[0102] "When selecting tests based on a patient's symptoms, it is critical to take a comprehensive approach that covers all possible potential causes. In this context, a combination of physical examination, imaging, etiological tests, immunological tests, routine blood tests, and endoscopy will provide a more thorough assessment of the patient's condition. It is critical to prioritize those tests that will comprehensively address specific symptoms and potential causes."
[0103] Step 405: Create a data entry in the experience database based on the medical consultation question and the second reply.
[0104] When the second reply is determined to be the correct answer, the medical question-answering agent can create a data entry in the experience database based on the medical consultation question and the second reply in a variety of ways. For example, the text of the medical consultation question and the text of the second reply can be stored in the experience database in the form of a key-value pair to obtain a data entry in the experience database. For another example, the structured data of the medical consultation question and the structured data of the second reply can be stored in the experience database in the form of a key-value pair to obtain a data entry in the experience database.
[0105] Based on the above steps, the automatic training of the medical question-answering agent in a closed-loop training framework can be completed, and an experience database and sample database with massive data can be constructed.
[0106] In some embodiments, in order to ensure that the medical field knowledge accumulated in the virtual environment is still valid in the real scenario, the data in the experience database and the sample database can be aligned and optimized with the real data.
[0107] Studies have shown that pre-trained large language models can generate complete medical records with high similarity to real data (see Figure 5 ). There may be slight differences in format, distribution characteristics, etc. between the data generated by the large language model and the real data. Therefore, a small number of high-quality real data samples can be given. Through context learning, the powerful rewriting ability of the large language model can be used to align and optimize the data in the constructed experience database and sample database with the real data, making the data in the experience database and sample database closer to the real data.
[0108] In the embodiment provided by the invention, a closed-loop training framework including a patient agent and a medical question-answering agent is constructed; in the closed-loop training framework, the patient agent uses the associated first language model to output medical consultation questions to drive the operation of the closed-loop training framework, and provides a massive data source for the establishment of an experience database and a sample database without relying on manually labeled data. The medical question-answering agent uses the associated second language model to obtain a first reply to the medical consultation question. In the case where the first reply is the correct answer, a data entry in the sample database is created based on the medical consultation question and the first reply, so that a sample database containing rich medical field knowledge can be obtained. In the case where the first reply is not the correct answer, the second language model is used to obtain a second reply based on the correct answer to the medical consultation question, thereby enhancing the second language model's processing ability for medical field data without using training data to fine-tune the second language model; a data entry in the experience database is created based on the medical consultation question and the second reply, so as to obtain an experience database accumulated by experience summary.
[0109] The embodiment provided by the present invention effectively saves a lot of human resources for collecting training data and computing resources required for labeling data because real training data is not required. Since the experience database and the sample database are relatively independent of the base model (the second largest language model associated with the medical question-answering agent), the medical question-answering agent has strong expansibility. For example, in the automatic training process of the closed-loop training framework, the base model A can be used to associate with the medical question-answering agent to generate the experience database and the sample database; during use, the base model B can be used to associate with the medical question-answering agent, and the constructed experience database and sample database can be used for reasoning.
[0110] The following describes the large-model intelligent agent question-answering device based on self-evolution provided by the present invention. The large-model intelligent agent question-answering device based on self-evolution described below and the large-model intelligent agent question-answering method based on self-evolution described above can be referenced to each other.
[0111] Figure 6 Schematic diagram of the structure of the self-evolving large-model intelligent agent question-answering device provided by the present invention. Figure 6 As shown, the device 600 includes the following modules.
[0112] The first acquisition module 610 is used to enable the medical question-answering agent to obtain medical consultation questions.
[0113] The second acquisition module 620 is used to enable the medical question-answering agent to use the associated large language model to obtain response information for the medical consultation question based on the established experience database and sample database; wherein the sample database and the experience database are constructed by the medical question-answering agent during automatic training in a closed-loop training framework, and the automatic training is a machine learning method that does not require labeled data.
[0114] The feedback module 630 is used to enable the medical question-answering agent to feedback the reply information.
[0115] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communications interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the self-evolution-based large model intelligent agent question-answering method, the method comprising: a medical question-answering intelligent agent, obtaining a medical consultation question; the medical question-answering intelligent agent, using an associated large language model, according to an established experience database and a sample database, obtaining reply information for the medical consultation question; wherein the sample database and the experience database are constructed by the medical question-answering intelligent agent in the process of automatic training in a closed-loop training framework, and the automatic training is a machine learning method that does not require labeled data; the medical question-answering intelligent agent, feeding back the reply information.
[0116] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0117] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the self-evolving large model intelligent agent question and answer method provided by the above methods, the method including: a medical question and answer agent obtains medical consultation questions; the medical question and answer agent uses an associated large language model to obtain reply information for the medical consultation questions based on an established experience database and a sample database; wherein the sample database and the experience database are constructed during the automatic training of the medical question and answer agent in a closed-loop training framework, and the automatic training is a machine learning method that does not require labeled data; the medical question and answer agent feeds back the reply information.
[0118] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the self-evolution-based large model intelligent agent question and answer method provided by the above-mentioned methods, the method comprising: a medical question and answer agent, obtaining medical consultation questions; the medical question and answer agent, using an associated large language model, obtains reply information for the medical consultation questions based on an established experience database and a sample database; wherein the sample database and the experience database are constructed during the automatic training of the medical question and answer agent in a closed-loop training framework, and the automatic training is a machine learning method that does not require labeled data; the medical question and answer agent, feeding back the reply information.
[0119] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A self-evolving large-model intelligent agent question answering method, characterized in that: The method comprises: Medical question-answering agent, which obtains medical consultation questions; The medical question-answering agent obtains reply information for the medical consultation question by using the associated large language model based on the established experience database and sample database; wherein the sample database and the experience database are constructed by the medical question-answering agent during automatic training in a closed-loop training framework, and the automatic training is a machine learning method that does not require labeled data; The medical question-answering intelligent agent feeds back the reply information.
2. The self-evolving large-model intelligent agent question-answering method according to claim 1 is characterized in that: The use of the associated large language model, based on the established experience database and sample database, to obtain response information for the medical consultation question includes: Obtaining first answer information of the medical consultation question from the sample database; Acquiring second answer information of the medical consultation question from the experience database; Generate a consultation prompt word according to the medical consultation question, the first answer information and the second answer information; The consultation prompt word is input into the large language model to obtain the reply information output by the large language model.
3. The self-evolving large-model intelligent agent question-answering method according to claim 1 is characterized in that: The method further comprises: The medical question-answering agent, in response to receiving positive feedback of the reply information, updates the sample database according to the medical consultation question and the reply information; The medical question-answering agent, in response to receiving the negative feedback of the reply information carrying the correct answer, updates the experience database according to the medical consultation question and the correct answer.
4. The self-evolving large model agent question answering method according to any one of claims 1 to 3, characterized in that: The closed-loop training framework at least includes: a patient agent, the medical question-answering agent; In the closed-loop training framework, the sample database and the experience database are constructed in the following manner: The patient agent, using the associated first language model, outputs a medical consultation question; The medical question-answering agent obtains a first response to the medical consultation question using the associated second largest language model; In response to the first reply being a correct answer, creating a data entry in the sample database according to the medical consultation question and the first reply; wherein the correct answer is obtained by using the first language model; In response to the first reply being an incorrect answer, obtaining a second reply based on the correct answer to the medical consultation question using the second largest language model; A data entry in the experience database is created based on the medical consultation question and the second response.
5. The self-evolving large model agent question answering method according to claim 4 is characterized in that: The use of the associated second largest language model to obtain a first response to the medical consultation question includes: Acquiring third answer information of the medical consultation question from the sample database; Acquiring fourth answer information of the medical consultation question from the experience database; In response to the third answer information and the fourth answer information being both empty, generating a training prompt word according to the medical consultation question; In response to at least one of the third answer information and the fourth answer information being not empty, generating a training prompt word according to the medical consultation question and the at least one answer information; The training prompt word is input into the second largest language model to obtain the first response.
6. The self-evolving large model agent question answering method according to claim 4 is characterized in that: In response to the first reply being an incorrect answer, obtaining a second reply based on the correct answer to the medical consultation question using the second largest language model includes: generating a reflection prompt word according to the medical consultation question, the correct answer to the medical consultation question and the first response; The reflection prompt word is input into the second largest language model, so that the second largest language model performs context learning according to the reflection prompt word to obtain the second reply.
7. The self-evolving large-model intelligent agent question-answering device according to claim 1 is characterized in that: include: The first acquisition module is used to enable the medical question-answering agent to acquire medical consultation questions; A second acquisition module is used to enable the medical question-answering agent to obtain reply information for the medical consultation question based on the established experience database and sample database using the associated large language model; wherein the sample database and the experience database are constructed during the automatic training of the medical question-answering agent in a closed-loop training framework, and the automatic training is a machine learning method that does not require labeled data; The feedback module is used to enable the medical question-answering agent to feedback the reply information.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the large-model intelligent agent question-answering method based on self-evolution as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the self-evolving large model agent question-answering method as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the self-evolving large model agent question-answering method as described in any one of claims 1 to 6.
Citation Information
Cited By
Medical question and answer data generation method and system, terminal and medium
CN119993562A