Intelligent medical question-answering system based on large model

By designing a large model-based intelligent medical question-and-answer system, using the combination of basic modules, functional modules, memory modules and security modules, the existing medical question-and-answer system is solved, and efficient in the medical field is achieved. Accurate Q&A service and ensures the stability and security of the system.

CN119396956AInactive Publication Date: 2025-02-07YUNNAN UNITED VISION TECH CO LTD

Patent Information

Application Number
CN202411647859.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-02-07
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing medical question-and-answer system is not flexible enough to deal with unknown problems, and traditional face-to-face consultations are limited by time and space, which cannot meet the efficient needs of medical services.

Method used

A large-scale model-based intelligent medical question-and-answer system is designed to achieve fast access and automatic routing of LLMs in different general fields through basic modules, the functional module optimizes the Prompt of user problems, and the memory module integrates the context and case data of user problems, which is safe. Module adds security statements and manual audits.

Benefits of technology

It has achieved zero fine-tuning application in the medical field, improved the application efficiency and accuracy of LLM in medical scenarios, ensured the stability and reliability of the system, and avoided potential risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396956A_ABST
    Figure CN119396956A_ABST
Patent Text Reader

Abstract

The invention relates to an intelligent medical question-answering system based on a large model, and belongs to the technical field of intelligent medical question-answering. The system comprises a basic module which is used as middleware between a user and the LLM and serves as a routing gateway, and through the basic module, the system can be connected to any supported LLM without modifying any code; the function module is used for analyzing the questions asked by the user, constructing proper prompt words to ask the LLM, formatting the response of the LLM and returning the formatted response to a system user interface; the memory module is used for realizing association between the case data of the user and the historical dialogues of the user by means of a vector database; when the big model is helped to answer, specific answers can be made to specific users, and meanwhile, historical dialogue information is owned; and the safety module is used for carrying out safety prompt.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an intelligent medical question-answering system based on a large model, and belongs to the technical field of intelligent medical question-answering. Background Art

[0002] In recent years, people's requirements for medical services have become higher and higher. Patients or their families usually need to obtain medical and health consultation and advice. Traditional face-to-face consultation methods are often restricted by factors such as time and space, which to some extent affects the effectiveness of medical treatment; previous intelligent medical question-and-answer systems based on knowledge graphs or knowledge retrieval are often not as flexible as large language models when dealing with unknown problems.

[0003] Thanks to the rapid development of intelligent computing capabilities and natural language processing technology, large language models (LLMs) have experienced a blowout, and basic large language models such as ChatGPT, GPT-4, Llama, Claude, and Gemini have emerged one after another. The application of LLM in the medical field has also developed rapidly. Its main generation paradigm is to collect data sets in the medical vertical field to fine-tune LLM so that it has knowledge for proprietary fields. The generation paradigm of LLM fine-tuning has achieved good results in practical applications, such as Med-PaLM fine-tuned from PaLM, DoctorGLM fine-tuned from GLM, and ChatDoctor from Llama. However, with the emergence of GPT-4turbo, experiments have shown that its capabilities exceed those of other medical LLMs obtained through fine-tuning. As a result, the research direction of medical LLM has shifted to how to apply LLM more reasonably in medical scenarios.

[0004] The present invention is the application of LLM in the intelligent question-answering scenario in the medical field. With the continuous improvement of the degree of medical informatization and the automation trend of medical industry management, the intelligent question-answering system will become an important part of the medical field in the future. The intelligent question-answering system based on LLM can automatically generate accurate answers based on the medical knowledge base and the questions raised by patients, providing comprehensive and efficient medical services for doctors and patients. Its application deployment is simple and can be seamlessly integrated with the existing medical information system, providing important support and assistance for the development of the medical industry and the health of patients, and providing important support for the informatization process of the medical industry. Summary of the invention

[0005] The present invention provides an intelligent medical question-and-answer system based on a large model, which is used to realize fast access and automatic routing of existing LLMs in different general fields through a basic module, thereby ensuring the stability and reliability of the application; realize Prompt optimization of questions raised by users through a functional module, so that LLMs can be more clearly guided and return more accurate answers; realize integration of the context of questions raised by users and user case data through a memory module, so that LLMs can fully understand the context information of multiple rounds of dialogues, thereby returning more accurate personalized answers; realize adding a security statement to the model output through a security module to prompt users to be cautious, and perform manual review intervention on high-risk answers of the model or high-risk questions of users.

[0006] The technical solution of the present invention is: an intelligent medical question-answering system based on a large model, comprising a basic module, a functional module, a memory module, and a security module;

[0007] The basic module is used as the middleware between the user and the LLM, and plays the role of a "routing gateway". Through this module, the large model-based intelligent medical question-answering system can be connected to any supported LLM without modifying any code;

[0008] The functional module is used to implement the analysis of the questions raised by the user, construct prompt words to ask questions to the LLM to generate answers, and format the responses of the LLM and return them to the system user interface;

[0009] The memory module is used to associate user case data and user historical conversations with the help of a vector database; it helps the large model to provide targeted answers to specific users and to have historical conversation information when answering questions;

[0010] The security module is used for providing security prompts.

[0011] As a further solution of the present invention, the basic module includes:

[0012] Used for flexible configuration of LLM: allows users to configure the LLM list and perform zero-code addition, editing, and deletion operations of LLM through the LLM management interface;

[0013] Used for automatic routing: Allows users to specify LLMs in order of priority. If a requesting LLM fails to respond or encounters an infrastructure error, the next LLM will be automatically selected for access.

[0014] Used to implement the automatic retry function: allow retry with exponential backoff strategy when request fails, which can automatically resend failed requests and prevent network overload caused by frequent retries;

[0015] Used to achieve load balancing: allows the load to be effectively distributed among multiple LLMs or services based on custom weights, ensuring high availability and optimal performance of the system and preventing any single LLM from becoming a performance bottleneck.

[0016] As a further solution of the present invention, the functional module includes:

[0017] Used to achieve question classification and standardization: The function module first identifies the intent and subject area of ​​the questions raised by users, and classifies the questions into three categories: disease speculation diagnosis, medical terminology or keyword explanation, and medication or measure suggestions. At the same time, it cleans up illegal characters, irrelevant words, and semantic ambiguity that may exist in the questions;

[0018] Optimize prompt words for multi-round conversations: In order to guide users to ask questions with more accurate prompt words, the prompt words are optimized using multi-round conversations in the function module; the conversation history context and key information are incrementally added after each round of conversation, and semantic deviations are corrected for inappropriate replies;

[0019] Used to implement prompt word templates: For commonly asked questions, the function module provides commonly used templates, and users only need to enter keywords to get corresponding accurate answers.

[0020] As a further solution of the present invention, the memory module includes:

[0021] Used to realize knowledge storage and retrieval: The memory module first loads the user's electronic medical record data, test and examination data, and surgical information, and divides the large text into small pieces through text segmentation. Then, the text is converted into embedded vectors using the text embedding model and stored in the vector database. When the user interacts with the large model, the most relevant information is retrieved from the vector database according to the user's questions and provided to the large model as supplementary information, which helps to improve the knowledge coverage and generation quality of the large model and provide users with more personalized question-and-answer services.

[0022] Used for context memory: In addition to storing the user's case data in the vector database, the memory module also vectorizes the multi-round conversation history between the big model and the user and stores it in the vector database. In this way, in subsequent interactions, the most semantically relevant conversation information can be quickly found from the conversation vector library and input into the big model as context prompts, enhancing its conversation management and question understanding capabilities.

[0023] Used to optimize prompt word feedback: The memory module also vectorizes the user's feedback on the large model output and stores it in the vector database. In subsequent conversations, it can perform similarity matching in the vector database based on new questions, retrieve previously optimized prompt word templates for similar questions, and accelerate the prompt word optimization process.

[0024] As a further solution of the present invention, the security module includes:

[0025] Clear warnings are added for outputs that may pose risks, reminding patients to act with caution and avoid blindly following advice that may have adverse consequences, thereby encouraging users to make prudent and rational judgments. At the same time, the security module clarifies the non-authoritative and reference nature of system outputs by adding a disclaimer, which can effectively avoid potential legal dispute risks and ensure that the medical large model question and answer system can operate in a controllable, responsible and reliable manner.

[0026] The beneficial effects of the present invention are:

[0027] (1) The system of the present invention realizes zero fine-tuning application of the existing general-purpose LLM in the medical field, saving the development cost of secondary fine-tuning of the LLM.

[0028] (2) The system of the present invention uses the basic module to achieve rapid access and automatic routing of existing LLMs in different general fields.

[0029] (3) The system of the present invention changes the original mode of direct user interaction with LLM with the help of functional modules, and enables LLM to answer user questions more accurately through prompt optimization.

[0030] (4) The system of the present invention uses a memory module to integrate the context of the user's question and the user's case data, alleviating the limitation on the maximum number of tokens in existing LLM conversations, so that LLM can fully understand the context information of multiple rounds of conversations and return more accurate personalized answers.

[0031] (5) With the help of the security module, the system of the present invention adds a security statement to the model output to remind users to be cautious. At the same time, manual review and intervention are performed on the high-risk answers of the model or the high-risk questions of the user to ensure that the output generated by the model will not cause harm to the user, thereby improving the reliability of the application. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a system framework diagram in the present invention. DETAILED DESCRIPTION

[0033] Example 1: Figure 1 As shown, an intelligent medical question-answering system based on a large model includes a basic module (BasicModule, BM), a functional module (Functional Module, FM), a memory module (Memory Module, MM) and a safety module (Safety Module, SM);

[0034] With the continuous development of LLM technology, various LLM model frameworks are increasing, and the management and integration of multiple models, service providers and keys are becoming more and more complicated. In response to this problem, the present invention proposes a basic module of an intelligent medical question-and-answer system, which is used as a middleware between users and LLMs and acts as a "routing gateway". Through this module, the intelligent medical question-and-answer system based on a large model can be connected to any supported LLM without modifying any code; the purpose of more efficiently integrating and managing multiple models is achieved, and the stability and reliability of the application are improved.

[0035] The basic module includes:

[0036] Used for flexible configuration of LLM: allows users to configure the LLM list and perform zero-code addition, editing, and deletion operations of LLM through the LLM management interface;

[0037] Used for automatic routing: Allows users to specify LLMs in order of priority. If a requesting LLM fails to respond or encounters an infrastructure error, the next LLM will be automatically selected for access, ensuring the robustness and reliability of the system;

[0038] Used to implement the automatic retry function: allow retry with exponential backoff strategy when request fails, which can automatically resend failed requests and prevent network overload caused by frequent retries;

[0039] Used to achieve load balancing: allows the load to be effectively distributed among multiple LLMs or services based on custom weights, ensuring high availability and optimal performance of the system and preventing any single LLM from becoming a performance bottleneck.

[0040] When using large language models to perform various natural language processing tasks, properly designed prompts are of great significance for guiding the model to effectively generate the required output. Well-designed prompts can not only clearly convey task objectives and output requirements, but also combine task context and prior knowledge to stimulate the model's potential and fully tap its learned semantics and logical capabilities, thereby ensuring the accuracy, relevance and consistency of the generated results. In the functional module of the intelligent medical question-and-answer system proposed in the present invention, the functional module is used to implement the parsing of questions raised by users, construct prompts to generate answers to questions raised by LLM, and format the responses of LLM and return them to the system user interface;

[0041] As a further solution of the present invention, the functional module includes:

[0042] Used to achieve question classification and standardization: The function module first identifies the intent and subject area of ​​the questions raised by users, and classifies the questions into three categories: disease speculation diagnosis, medical terminology or keyword explanation, and medication or measure suggestions. At the same time, it cleans up illegal characters, irrelevant words, and semantic ambiguity that may exist in the questions;

[0043] Optimize prompt words for multi-round conversations: In order to guide users to ask questions with more accurate prompt words, the prompt words are optimized using multi-round conversations in the function module; the conversation history context and key information are incrementally added after each round of conversation, and semantic deviations are corrected for inappropriate replies;

[0044] Used to implement prompt word templates: For commonly asked questions, the function module provides commonly used templates, and users only need to enter keywords to get corresponding accurate answers.

[0045] Due to the timeliness of the training data of the large model, the large model cannot update the learned knowledge in real time, resulting in a lag in the answers generated by the model, and the model output will be severely restricted by the scope of knowledge coverage. In addition, due to the lack of vectorized storage of conversation history, the large model will find it difficult to remember and utilize early context information, resulting in insufficient context understanding and association capabilities. To address this problem, the present invention proposes a memory module, which is used to associate user case data and user historical conversations with the help of a vector database; helping the large model to provide targeted answers to specific users while having historical conversation information;

[0046] As a further solution of the present invention, the memory module includes:

[0047] Used to realize knowledge storage and retrieval: The memory module first loads the user's electronic medical record data, test and examination data, and surgical information, and divides the large text into small pieces through text segmentation. Then, the text is converted into embedded vectors using the text embedding model and stored in the vector database. When the user interacts with the large model, the most relevant information is retrieved from the vector database according to the user's questions and provided to the large model as supplementary information, which helps to improve the knowledge coverage and generation quality of the large model and provide users with more personalized question-and-answer services.

[0048] Used for context memory: In addition to storing the user's case data in the vector database, the memory module also vectorizes the multi-round conversation history between the big model and the user and stores it in the vector database. In this way, in subsequent interactions, the most semantically relevant conversation information can be quickly found from the conversation vector library and input into the big model as context prompts, enhancing its conversation management and question understanding capabilities.

[0049] Used to optimize prompt word feedback: The memory module also vectorizes the user's feedback on the large model output and stores it in the vector database. In subsequent conversations, it can perform similarity matching in the vector database based on new questions, retrieve previously optimized prompt word templates for similar questions, and accelerate the prompt word optimization process.

[0050] There are many potential risks in the content generated by the medical question-and-answer big model. For the diagnosis and treatment suggestions of patients, the big model may produce deviations or errors due to insufficient information. Blindly adopting these suggestions will delay the disease or bring adverse consequences, such as wrong medication, improper surgery, etc., and may even threaten life safety. To address this problem, the present invention designs a safety module, which is used to provide safety prompts.

[0051] As a further solution of the present invention, the security module includes:

[0052] Clear warnings are added for outputs that may pose risks, reminding patients to act with caution and avoid blindly following advice that may have adverse consequences, thereby encouraging users to make prudent and rational judgments. At the same time, the security module clarifies the non-authoritative and reference nature of system outputs by adding a disclaimer, which can effectively avoid potential legal dispute risks and ensure that the medical large model question and answer system can operate in a controllable, responsible and reliable manner.

[0053] The present invention proposes an intelligent medical question-answering system based on a large model, which consists of three modules: Basic Module (BM), Functional Module (FM), Memory Module (MM) and Safety Module (SM). The basic module implements unified protocol access to the existing large model to ensure the stability and reliability of the application. The functional module is mainly responsible for combining the conversation history and specific tasks to generate appropriate prompts, and use the prompts to ask questions to the large model to generate appropriate answers; the functional module can optimize the prompts, thereby improving the accuracy of LLM responses to a greater extent; the memory module is responsible for saving the memory of each session. Combined with the memory of each session, the system can generate more accurate prompts to ask questions in the next round of questions, and thus obtain more accurate answers. The memory module also maintains a vector database, which stores all case data of the current patient and the embedded encoded vectors of historical questions; the memory module maintains user-specific case and historical conversation vector databases so that when interacting with the large model, it can ask questions in combination with the content in the vector database to improve the accuracy of the answers, while providing contextual understanding capabilities for human-computer dialogues and alleviating the limitation of the large model on the number of input tokens; the security module will add security statements to the answers generated by the model or conduct manual review of life-threatening answers; the security module can ensure that the content generated by the model will not pose a threat to the user's life safety.

[0054] With the help of the large model's extensive medical knowledge reserves and rich language comprehension capabilities, the system can provide personalized medical advice based on user questions and specific situations, making medical services more accurate and closer to user needs.

[0055] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. An intelligent medical question-answering system based on a large model, characterized by: Including basic module, functional module, memory module and security module; The basic module is used as the middleware between the user and the LLM, and plays the role of a "routing gateway". Through this module, the large model-based intelligent medical question-answering system can be connected to any supported LLM without modifying any code; The functional module is used to implement the analysis of the questions raised by the user, construct prompt words to ask questions to the LLM to generate answers, and format the responses of the LLM and return them to the system user interface; The memory module is used to associate user case data and user historical conversations with the help of a vector database; it helps the large model to provide targeted answers to specific users and to have historical conversation information when answering questions; The security module is used for providing security prompts.

2. The intelligent medical question-answering system based on a large model according to claim 1, characterized in that: The basic module includes: Used for flexible configuration of LLM: allows users to configure the LLM list and perform zero-code addition, editing, and deletion operations of LLM through the LLM management interface; Used for automatic routing: Allows users to specify LLMs in order of priority. If a requesting LLM fails to respond or encounters an infrastructure error, the next LLM will be automatically selected for access. Used to implement the automatic retry function: allow retry with exponential backoff strategy when request fails, which can automatically resend failed requests and prevent network overload caused by frequent retries; Used to achieve load balancing: allows the load to be effectively distributed among multiple LLMs or services based on custom weights, ensuring high availability and optimal performance of the system and preventing any single LLM from becoming a performance bottleneck.

3. The intelligent medical question-answering system based on a large model according to claim 1, characterized in that: The functional modules include: Used to achieve question classification and standardization: The function module first identifies the intent and subject area of ​​the questions raised by users, and classifies the questions into three categories: disease speculation diagnosis, medical terminology or keyword explanation, and medication or measure suggestions. At the same time, it cleans up illegal characters, irrelevant words, and semantic ambiguity that may exist in the questions; Optimize prompt words for multi-round conversations: In order to guide users to ask questions with more accurate prompt words, the prompt words are optimized using multi-round conversations in the function module; the conversation history context and key information are incrementally added after each round of conversation, and semantic deviations are corrected for inappropriate replies; Used to implement prompt word templates: For commonly asked questions, the function module provides commonly used templates, and users only need to enter keywords to get corresponding accurate answers.

4. The intelligent medical question-answering system based on a large model according to claim 1, characterized in that: The memory module comprises: Used to realize knowledge storage and retrieval: The memory module first loads the user's electronic medical record data, test and examination data, and surgical information, and divides the large text into small pieces through text segmentation. Then, the text is converted into embedded vectors using the text embedding model and stored in the vector database. When the user interacts with the large model, the most relevant information is retrieved from the vector database according to the user's questions and provided to the large model as supplementary information, which helps to improve the knowledge coverage and generation quality of the large model and provide users with more personalized question-and-answer services. Used for context memory: In addition to storing the user's case data in the vector database, the memory module also vectorizes the multi-round conversation history between the big model and the user and stores it in the vector database. In this way, in subsequent interactions, the most semantically relevant conversation information can be quickly found from the conversation vector library and input into the big model as context prompts, enhancing its conversation management and question understanding capabilities. Used to optimize prompt word feedback: The memory module also vectorizes the user's feedback on the large model output and stores it in the vector database. In subsequent conversations, it can perform similarity matching in the vector database based on new questions, retrieve previously optimized prompt word templates for similar questions, and accelerate the prompt word optimization process.

5. The intelligent medical question-answering system based on a large model according to claim 1, characterized in that: The security module comprises: Clear warnings are added for outputs that may pose risks, reminding patients to act with caution and avoid blindly following advice that may have adverse consequences, thereby encouraging users to make prudent and rational judgments. At the same time, the security module clarifies the non-authoritative and reference nature of system outputs by adding a disclaimer, which can effectively avoid potential legal dispute risks and ensure that the medical large model question and answer system can operate in a controllable, responsible and reliable manner.

Citation Information

Patent Citations

  • Medical auxiliary question and answer method and system based on knowledge calibration and retrieval enhancement

    CN117573843A

  • Medical question answering system based on large language model

    CN117851558A

  • Large model service management method and system, terminal and storage medium

    CN117914971A

  • Universal adaptive question answering method and system, storage medium and electronic equipment

    CN118643144A

  • Intelligent question and answer method, system and device based on context information aggregation and medium

    CN118820443A

Cited By

  • Medical knowledge question-answering method, system and equipment based on large language model

    CN119577099A

  • Data encryption processing method and device for medical question and answer large model and medium

    CN120910883A

  • Virtual human auxiliary inquiry system and method based on medical knowledge graph

    CN120954675A