Diagnostic reasoning RAG system for resisting retrieval noise based on self-generated knowledge base

The RAG system, which generates its own knowledge base, solves the problems of static and lagging knowledge in medical diagnostic reasoning using traditional large-scale language models. By evaluating and generating modules to identify noise and generate relevance judgment results, it improves the accuracy and timeliness of diagnostic reasoning, meeting the needs of highly accurate and timely clinical decision-making in the medical field.

CN121502070APending Publication Date: 2026-02-10DIGITAL HEALTH CHINA TECHNOLOGIES CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511547813.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-28
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Traditional large-scale language models suffer from incomplete knowledge due to their static and outdated nature in the field of medical diagnostic reasoning, making it difficult to meet the needs of accurate and timely clinical decision-making. Furthermore, the RAG system introduces a large amount of irrelevant or erroneous information during the retrieval process, affecting the quality of the generated results.

Method used

The RAG system, based on a self-generated knowledge base, is adopted. The target text block is retrieved from the external knowledge base through the knowledge retrieval module, and the evaluation generation module is used to independently evaluate and identify noise, and generate relevance and noise level judgment results. Combined with internal memory information, it provides knowledge reference for large-scale language models, and finally generates diagnostic reasoning answers.

Benefits of technology

It effectively resists search noise interference, improves the accuracy and timeliness of medical diagnostic reasoning, and meets the medical field's need for highly accurate and timely clinical decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121502070A_ABST
    Figure CN121502070A_ABST
Patent Text Reader

Abstract

The invention discloses a diagnostic reasoning RAG system for resisting retrieval noise based on a self-generated knowledge base, and the system comprises a knowledge retrieval module which carries out the retrieval from an external knowledge base according to a user question to obtain a plurality of target text blocks; the evaluation generation module is used for independently evaluating each target text block through an evaluation model so as to identify retrieval noise, generating a correlation judgment result and a noise degree judgment result of each target text block, and generating internal memory information as a self-generated knowledge base based on a user question; and the diagnosis reasoning module is used for integrating the user question, each target text block, the corresponding correlation judgment result, the noise degree judgment result and the internal memory information into enhanced prompt information and inputting the enhanced prompt information into a large language model to generate a diagnosis reasoning answer. According to the method, retrieval noise interference can be effectively resisted, model knowledge support is strengthened by means of the self-generated knowledge base, the precision and timeliness of medical diagnosis reasoning are improved, and the requirements of the medical field for high-precision and strong-timeliness clinical decision making are met.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence and medical information technology, and in particular to a diagnosis reasoning RAG system based on a self-generated knowledge base for resisting retrieval noise. BACKGROUND

[0002] The application of traditional large language models (LLMs) in the field of medical diagnosis reasoning is limited by the static and lagging nature of their knowledge, which is incomplete and difficult to update in real time, making it difficult to meet the demand for precise and timely clinical decision-making in the medical field. To address this issue, retrieval augmented generation (RAG) systems have been proposed, which build dynamic external knowledge bases to enable knowledge retrieval and integration, thereby providing the latest and reliable knowledge support for models. Specifically, RAG systems include three main processes: knowledge organization, knowledge retrieval, and knowledge integration. In the knowledge organization stage, large-scale text corpus is divided into target text blocks, which are converted into vectors for storage through embedding models; in the knowledge retrieval stage, relevant information is retrieved from the knowledge base based on methods such as KNN and BM25; in the knowledge integration stage, the retrieved content is preprocessed to improve the quality of the generated results. However, RAG systems introduce a large amount of irrelevant or incorrect information during the retrieval process, leading to a decline in the quality of the generated results, which is a key issue that hinders their performance.

[0003] Therefore, there is an urgent need to provide a technical solution to solve the above problems. SUMMARY

[0004] To solve the above technical problems, the present application provides a diagnosis reasoning RAG system based on a self-generated knowledge base for resisting retrieval noise.

[0005] In a first aspect, the present application provides a diagnosis reasoning RAG system based on a self-generated knowledge base for resisting retrieval noise, and the technical solution of the system is as follows: It includes a knowledge retrieval module, an evaluation generation module, and a diagnosis reasoning module. The knowledge retrieval module is used to retrieve a plurality of target text blocks from an external knowledge base based on semantic similarity according to a user question. The evaluation generation module is used to independently evaluate each target text block to identify retrieval noise through a pre-trained evaluation model, generate a relevance judgment result and a noise degree judgment result for each target text block, and generate internal memory information as a self-generated knowledge base based on the user question; wherein the self-generated knowledge base is used to provide internal knowledge reference for the large language model during the generation process, and the evaluation model is generated by knowledge distillation and parameter fine-tuning of the base language model. The diagnostic reasoning module is used to: integrate the user question, each target text block and the corresponding relevance judgment result and noise level judgment result, as well as the internal memory information into enhanced prompt information, and input the enhanced prompt information into the large language model to generate a diagnostic reasoning answer corresponding to the user question.

[0006] The beneficial effects of the diagnostic reasoning RAG system based on a self-generated knowledge base that resists retrieval noise according to the present invention are as follows: The system of this invention can effectively resist search noise interference, strengthen model knowledge support by leveraging a self-generated knowledge base, improve the accuracy and timeliness of medical diagnostic reasoning, and meet the medical field's demand for highly accurate and timely clinical decision-making.

[0007] Based on the above scheme, the diagnostic reasoning RAG system of the present invention, which resists retrieval noise based on a self-generated knowledge base, can be further improved as follows.

[0008] In one alternative approach, the knowledge retrieval module is specifically used for: The user question is encoded into a query vector, and vector representations of multiple raw text blocks from the external knowledge base are obtained. By calculating the dot product between the query vector and the vector representation of each original text block, the semantic similarity score corresponding to each original text block is obtained and sorted in descending order to obtain the sorting result; The original text blocks corresponding to the top N semantic similarity scores in the sorting results are determined as the target text blocks, where N is a positive integer.

[0009] The advantages of adopting the above optional methods are: further optimizing the accuracy of knowledge retrieval, filtering out the most relevant text blocks through vector comparison and sorting, improving retrieval efficiency and quality, and ensuring that subsequent processing is based on the most relevant information.

[0010] In one alternative approach, the evaluation generation module is specifically used for: The user question and any target text block are input into the evaluation model. The evaluation model analyzes the semantic correlation between the target text block and the user question to obtain the relevance judgment result of the target text block. At the same time, it detects information in the target text block that is inconsistent with medical facts or outdated to obtain the noise level judgment result of the target text block.

[0011] The advantages of adopting the above optional methods are: it further enhances the ability to identify search results, effectively identifies irrelevant or erroneous information through a dual evaluation mechanism, improves the accuracy and reliability of generated answers, and avoids interference from misleading information.

[0012] In one alternative approach, the evaluation generation module is specifically used for: The user question is input into the evaluation model, and the parameterized knowledge of the evaluation model generates generalized content related to the user question as internal memory information, so as to generate the self-generated knowledge base based on the internal memory information.

[0013] The beneficial effects of adopting the above-mentioned optional methods are: further dynamic generation of internal memory information through evaluation models, providing real-time knowledge support for diagnostic reasoning, and enhancing the timeliness and practicality of knowledge.

[0014] In an alternative embodiment, the model training module is further included; the model training module is used for: Construct a training dataset; wherein the training dataset includes: multiple training data; each training data includes: corresponding sample user questions, multiple sample text blocks, relevance judgment results, noise level judgment results, and internal memory information; Based on the training dataset, the training of the base language model is guided by a teacher model. During the training process, a trainable low-rank matrix is ​​injected into the weight matrix of the base language model, the parameters of the low-rank matrix are updated, and the original weight matrix of the base language model remains unchanged, thus obtaining the evaluation model.

[0015] The beneficial effects of adopting the above optional methods are: further improving the model's learning efficiency and adaptability; using a low-rank matrix parameter update strategy accelerates the model's training process, reduces the consumption of computing resources, and improves the model's ability to learn and integrate new knowledge.

[0016] In one alternative approach, the diagnostic reasoning module is specifically used for: The enhanced prompt information is formed by combining the user question, all target text blocks, the relevance judgment result and noise level judgment result corresponding to each target text block, and the internal memory information in a structured format.

[0017] The beneficial effects of adopting the above optional approach are: it further optimizes the input structure of diagnostic reasoning, integrates multiple types of information into structured enhanced prompts, improves the model's ability to understand and process complex problems, and makes the generated answers more comprehensive and accurate.

[0018] In one alternative approach, the diagnostic reasoning module is specifically used for: Using the large language model and based on the relevance and noise level judgment results for each target text block, effective information is identified from the multiple target text blocks. The effective information is then fused and reasoned with the internal memory information to generate the diagnostic reasoning answer corresponding to the user question.

[0019] The beneficial effects of adopting the above optional methods are as follows: Among the above optional methods, the reliability and practicality of the generated results are further improved. By integrating effective information and internal memory for reasoning, the generated diagnostic reasoning answers are more in line with actual needs, enhancing the application value and credibility of the system in the field of medical diagnosis.

[0020] Secondly, this invention provides a diagnostic reasoning RAG method based on a self-generated knowledge base to resist retrieval noise, employing the diagnostic reasoning RAG system based on a self-generated knowledge base to resist retrieval noise provided by this invention. The technical solution of this method is as follows: Based on the user's question, multiple target text blocks are retrieved from an external knowledge base based on semantic similarity; Each target text block is independently evaluated using a pre-trained evaluation model to identify retrieval noise, generating relevance and noise level judgment results for each target text block, and generating internal memory information as a self-generated knowledge base based on the user question; wherein, the self-generated knowledge base is used to provide internal knowledge reference for the large language model during the generation process, and the evaluation model is generated by knowledge distillation and parameter fine-tuning of the basic language model; The user question, each target text block, and the corresponding relevance and noise level judgment results, along with the internal memory information, are integrated into enhanced prompt information. This enhanced prompt information is then input into the large language model to generate a diagnostic reasoning answer corresponding to the user question.

[0021] The beneficial effects of the diagnostic reasoning RAG method based on a self-generated knowledge base that resists retrieval noise, as described in this invention, are as follows: The method of this invention can effectively resist search noise interference, strengthen model knowledge support by leveraging a self-generated knowledge base, improve the accuracy and timeliness of medical diagnostic reasoning, and meet the medical field's need for highly accurate and timely clinical decision-making.

[0022] Thirdly, the technical solution of an electronic device according to the present invention is as follows: It includes a memory, a processor, and a program stored in the memory and running on the processor, wherein the processor executes the program to implement the steps of the diagnostic reasoning RAG method based on a self-generated knowledge base that resists retrieval noise, as is the present invention.

[0023] Fourthly, the technical solution of a computer-readable storage medium provided by the present invention is as follows: The computer-readable storage medium stores instructions that, when read, cause the computer-readable storage medium to perform the steps of the diagnostic reasoning RAG method based on a self-generated knowledge base that resists retrieval noise, as described in this invention.

[0024] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0025] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a schematic diagram of an embodiment of the diagnostic reasoning RAG system based on a self-generated knowledge base to resist retrieval noise according to the present invention. Figure 2 This is a schematic diagram of the overall process; Figure 3 This is a flowchart illustrating an embodiment of the diagnostic reasoning RAG method based on a self-generated knowledge base to resist retrieval noise according to the present invention. Figure 4 This is a schematic diagram of an embodiment of an electronic device according to the present invention. Detailed Implementation

[0026] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0027] Figure 1 This diagram illustrates a structural schematic of an embodiment of a diagnostic reasoning RAG system 100 based on a self-generated knowledge base to resist retrieval noise, provided by the present invention. Figure 1 As shown, the diagnostic reasoning RAG system 100 based on a self-generated knowledge base to resist retrieval noise includes: a knowledge retrieval module 101, an evaluation generation module 102, and a diagnostic reasoning module 103. The knowledge retrieval module 101 is used to retrieve multiple target text blocks from an external knowledge base based on the user's question and semantic similarity.

[0028] In this context, "user question" refers to a natural language inquiry entered by a user regarding a medical diagnosis; for example, "How should diabetic patients control their blood sugar?". Semantic similarity refers to an indicator that measures the degree of semantic association between texts through vector calculation; for example, calculating the cosine similarity score between the user question vector and the knowledge base document vector. "External knowledge base" refers to a database that stores structured or unstructured text such as medical literature, clinical guidelines, and case data; for example, a collection of documents containing the latest diabetes treatment guidelines. "Target text block" refers to a text fragment retrieved from an external knowledge base that is related to the user question; for example, a paragraph about precautions for insulin use.

[0029] The evaluation generation module 102 is used to: independently evaluate each target text block using a pre-trained evaluation model to identify retrieval noise, generate relevance judgment results and noise level judgment results for each target text block, and generate internal memory information as a self-generated knowledge base based on the user question; wherein, the self-generated knowledge base is used to provide internal knowledge reference for large language models during the generation process, and the evaluation model is generated by knowledge distillation and parameter fine-tuning of the basic language model.

[0030] The evaluation model refers to a neural network model trained through knowledge distillation and parameter fine-tuning to assess text quality; for example, a noise detection model fine-tuned based on the Qwen model. The relevance judgment result refers to the quantitative output of the evaluation model on the degree of association between the target text block and the user's question; for example, determining that a text block has a relevance of 0.85 to a blood glucose control question. The noise level judgment result refers to the evaluation model's detection results of errors or outdated information in the target text block; for example, detecting that a text block contains outdated drug dosage recommendations. Internal memory information refers to the generalized content generated by the evaluation model based on parameterized knowledge; for example, a summary of key points for diabetes dietary control generated by the model. The self-generated knowledge base refers to a dynamic knowledge set composed of internal memory information; for example, a diabetes management knowledge summary generated in real time by the system. A large-scale language model refers to a pre-trained language generation model with a large parameter scale; for example, the GPT-4 model used to ultimately generate diagnostic answers. The basic language model refers to the original pre-trained model that has not been fine-tuned for a specific task; for example, the pre-tuned version of the Qwen-14B model. Knowledge distillation refers to the technique of using a teacher model to guide the training of a student model; for example, using GPT-4 to generate training data to guide the training of the Qwen model. Parameter fine-tuning refers to the process of making targeted adjustments to the parameters of a pre-trained model; for example, using LoRA technology to efficiently fine-tune the Qwen model.

[0031] The diagnostic reasoning module 103 is used to: integrate the user question, each target text block and the corresponding relevance judgment result and noise level judgment result, as well as the internal memory information into enhanced prompt information, and input the enhanced prompt information into the large language model to generate a diagnostic reasoning answer corresponding to the user question.

[0032] Enhanced prompts refer to structured input content formed by integrating information from multiple sources; for example, prompt text that includes user questions, search text, evaluation results, and internal memory. Diagnostic reasoning responses refer to the medical advice or diagnostic conclusions ultimately generated by the system; for example, specific medication and dietary recommendations for blood sugar control issues.

[0033] The technical solution of this embodiment can effectively resist search noise interference, strengthen model knowledge support by leveraging a self-generated knowledge base, improve the accuracy and timeliness of medical diagnostic reasoning, and meet the medical field's need for highly accurate and timely clinical decision-making.

[0034] In one alternative embodiment, the knowledge retrieval module 101 is specifically used for: The user question is encoded into a query vector, and vector representations of multiple raw text blocks from the external knowledge base are obtained.

[0035] Here, the query vector refers to the numerical representation of a user's question after encoding; for example, the 768-dimensional vector obtained by encoding the user question "how to control blood sugar". The raw text block refers to an unfiltered fragment of raw text from an external knowledge base; for example, the complete chapter on exercise therapy in a diabetes guideline. The vector representation refers to the numerical vector obtained by transforming text through an embedding model; for example, converting a text paragraph into a 512-dimensional dense vector.

[0036] By calculating the dot product between the query vector and the vector representation of each original text block, the semantic similarity score corresponding to each original text block is obtained and sorted in descending order to obtain the sorting result.

[0037] The semantic similarity score refers to the quantified similarity between the query vector and the text vector; for example, the vector dot product score between a user question and a text block is 0.72. The ranking result refers to the list of texts arranged in descending order of semantic similarity score; for example, sorting the retrieved text blocks from highest to lowest similarity.

[0038] The original text blocks corresponding to the top N semantic similarity scores in the sorting results are determined as the target text blocks, where N is a positive integer.

[0039] Specifically, in the enhanced knowledge retrieval stage, the knowledge retrieval module 101 retrieves multiple target text blocks from an external knowledge base based on the user's question and semantic similarity. Specifically, the system uses a dense retrieval model based on contrastive learning as the retrieval tool, which learns semantic representations of documents and queries through unsupervised training methods.

[0040] The retrieval engine is trained using a contrastive learning objective function and estimates the loss function using information-noise contrastive estimation. The loss function is expressed as: ;in, Indicates a query. This represents positive sample documents related to the query. This represents documents in the negative sample pool. Indicates temperature parameter, This represents the similarity score between the query and the document.

[0041] Similarity score Calculated by the dot product of the query vector and the document vector: ;in, This represents the encoder network of the retrieval system. Represents network parameters, Indicates a query. This refers to a document.

[0042] The retrieval process uses calculated semantic similarity scores to search external knowledge bases. Select the most relevant text blocks to form a document subset. : ;in This represents the set of target text blocks retrieved. Represents semantic similarity score, This indicates selecting the candidate with the highest score. A text block.

[0043] The above process ensures that even if the query and document do not have exact matching keywords, as long as they are semantically related, they can still be effectively retrieved, providing high-quality original information materials for the subsequent evaluation and knowledge integration stages.

[0044] Among the above optional methods, the accuracy of knowledge retrieval is further optimized by filtering out the most relevant text blocks through vector comparison and sorting, thereby improving retrieval efficiency and quality and ensuring that subsequent processing is based on the most relevant information.

[0045] In an alternative embodiment, the evaluation generation module 102 is specifically used for: The user question and any target text block are input into the evaluation model. The evaluation model analyzes the semantic correlation between the target text block and the user question to obtain the relevance judgment result of the target text block. At the same time, it detects information in the target text block that is inconsistent with medical facts or outdated to obtain the noise level judgment result of the target text block.

[0046] Semantic relevance refers to the semantic relevance between the text content and the user's question; for example, evaluating the semantic match between a text and a question about blood sugar control. Information that is inconsistent with medical facts or outdated refers to content that does not conform to current medical consensus or has been updated; for example, mentioning outdated blood sugar control regimens in the text.

[0047] Among the above optional methods, the ability to discriminate search results is further enhanced. By using a dual evaluation mechanism, irrelevant or erroneous information can be effectively identified, thereby improving the accuracy and reliability of the generated answers and avoiding interference from misleading information.

[0048] In an alternative embodiment, the evaluation generation module 102 is specifically used for: The user question is input into the evaluation model, and the parameterized knowledge of the evaluation model generates generalized content related to the user question as internal memory information, so as to generate the self-generated knowledge base based on the internal memory information.

[0049] Among them, general content refers to a condensed summary of specific medical knowledge; for example, condensing a lengthy guideline into the core points of diabetes management.

[0050] Among the above-mentioned optional methods, internal memory information is further dynamically generated through evaluation models to provide real-time knowledge support for diagnostic reasoning, thereby enhancing the timeliness and practicality of the knowledge.

[0051] In an alternative embodiment, the model training module is further included; the model training module is used for: Construct a training dataset; wherein the training dataset includes: multiple training data; each training data includes: corresponding sample user questions, multiple sample text blocks, and relevance judgment results, noise level judgment results, and internal memory information.

[0052] The training dataset refers to a normalized collection of data used for model training; for example, a dataset containing sample questions, text blocks, and corresponding annotations. Training data refers to a single data instance within the training dataset; for example, a complete sample containing diabetes questions, related text, and evaluation results. Sample user questions refer to pre-defined typical medical questions in the training data. Sample text blocks refer to accompanying reference text in the training data; for example, a drug instruction manual paragraph corresponding to a sample question in the training set.

[0053] Based on the training dataset, the training of the base language model is guided by a teacher model. During the training process, a trainable low-rank matrix is ​​injected into the weight matrix of the base language model, the parameters of the low-rank matrix are updated, and the original weight matrix of the base language model remains unchanged, thus obtaining the evaluation model.

[0054] In this context, the teacher model refers to a pre-trained large model that provides knowledge guidance; for example, the GPT-4 model used to generate training labels. The weight matrix refers to the matrix structure that stores parameters in a neural network; for example, the query weight matrix in a Transformer layer. The trainable low-rank matrix refers to the lightweight parameter matrix introduced during fine-tuning; for example, the rank-16 adaptation matrix in the LoRA method. The original weight matrix refers to the parameter matrix that remains fixed in the pre-trained model; for example, the original parameters of the Qwen model that are frozen during fine-tuning.

[0055] Regarding the dataset construction and knowledge distillation process, it is important to note that: A high-quality training dataset was constructed using a multi-source data integration strategy. Specifically, the data sources included the natural question set and the network question set of the comprehensive question-answering system, while also incorporating a high-quality dataset constructed by a professional medical data provider using real medical record data and guideline question-answer pairs. Based on these multi-source data, a teacher-model-driven knowledge distillation scheme was used to generate training samples. The specific construction process is as follows: a dense retrieval model based on contrastive learning was used as the retrieval engine. This retrieval engine adopted a bidirectional encoder architecture, using the same Transformer network. For each independently encoded query q and document d, the relevance score s(q,d) between the query and the document is calculated as the dot product of their respective vector representations: ;in This represents the Transformer network parameters initialized by the base language model. Here are the network parameters: q represents the query, d represents the document, and s(q,d) represents the relevance score between the query and the document.

[0056] Obtain question Q from the original dataset, and retrieve the top k relevant documents from the document repository D using a retrieval tool. Leveraging the limited example learning capabilities of the teacher model, we define the input question Q and the document set. The output contains evaluation information. and internal memory M, where It is a document The evaluation. The probability of this process is expressed as: ;in Let M represent the set of evaluation information, M represent internal memory, and Q represent the problem. Represents a collection of documents. Indicates a document The assessment.

[0057] This process generates a high-quality distillation dataset containing evaluation information and internal memory, providing a training basis for subsequent model fine-tuning, reducing the cost of manual annotation, and ensuring the diversity and quality of the dataset.

[0058] Regarding the process of fine-tuning model parameters, it should be noted that: After obtaining the training dataset, the base language model is fine-tuned using parameter-efficient fine-tuning techniques, specifically the low-rank adaptation method. The core idea of ​​the low-rank adaptation method is to inject a trainable low-rank matrix into the Transformer layer of the pre-trained base language model without updating all parameters of the original model. For a pre-trained weight matrix... The low-rank adaptation method introduces two low-rank matrices. and , where rank much smaller and The minimum value. The fine-tuned weight matrix. Represented as .in Represents the original weight matrix. This represents the first low-rank matrix. This represents the second low-rank matrix. Indicates rank. Indicates the input dimension. Indicates the output dimension. This indicates the amount of weight update.

[0059] During fine-tuning, by minimizing the loss function To optimize the model, loss function Measuring the performance of an evaluation model on a given input problem and document collection In this case, its output evaluation information and internal memory Compared with standard evaluation information in the training dataset and internal memory The differences between them.

[0060] The loss function is expressed as: ;in This indicates a user issue. This represents the collection of documents retrieved. Indicates standard evaluation information, Indicates standard internal memory, This represents the training dataset.

[0061] Regarding training parameter configuration, a greedy decoding strategy is used, and the number of documents retrieved is... Setting it to 10 sets the rank of the low-rank matrix. Set to 16, low-rank adaptation parameter The learning rate is set to 1e, the dropout rate is set to 0.1, a warm-up strategy is used, and the learning rate is set to 32. -5 The batch size per GPU was set to 8, the number of training cycles was 10, and all training was performed on multiple graphics processing units (default two H20 GPUs, each with 140GB of video memory). This approach significantly reduced computational resource and space requirements, and improved training efficiency.

[0062] Among the above-mentioned optional methods, the learning efficiency and adaptability of the model are further improved. The low-rank matrix parameter update strategy accelerates the training process of the model, reduces the consumption of computing resources, and improves the model's ability to learn and integrate new knowledge.

[0063] In an alternative embodiment, the diagnostic reasoning module 103 is specifically used for: The enhanced prompt information is formed by combining the user question, all target text blocks, the relevance judgment result and noise level judgment result corresponding to each target text block, and the internal memory information in a structured format.

[0064] Structured format refers to the standardized form of information organization; for example, JSON format, which arranges questions, text, and evaluation results according to a fixed template.

[0065] Among the above optional methods, the input structure of diagnostic reasoning has been further optimized, integrating multiple types of information into structured enhanced prompts, which improves the model's ability to understand and process complex problems, making the generated answers more comprehensive and accurate.

[0066] In an alternative embodiment, the diagnostic reasoning module 103 is specifically used for: Using the large language model and based on the relevance and noise level judgment results for each target text block, effective information is identified from the multiple target text blocks. The effective information is then fused and reasoned with the internal memory information to generate the diagnostic reasoning answer corresponding to the user question.

[0067] Among them, effective information refers to reliable content that has been screened and retained; for example, descriptions of blood glucose monitoring methods that have been confirmed to be accurate and usable after evaluation.

[0068] Among the above-mentioned optional methods, the reliability and practicality of the generated results are further improved. By integrating effective information and internal memory for reasoning, the generated diagnostic reasoning answers are more in line with actual needs, enhancing the application value and credibility of the system in the field of medical diagnosis.

[0069] like Figure 2 As shown, this embodiment includes two main stages: the first stage is dataset construction and model fine-tuning, and the second stage is the use of the retrieval enhancement generation framework after adding components.

[0070] In the first stage, a dense retrieval model based on contrastive learning is used as the retrieval engine to retrieve the k most relevant documents from an external knowledge base for each question. These documents and questions are then used as input to generate high-quality evaluation information and internal memories through a teacher model. This data is processed and organized into a distillation dataset. Using this distillation dataset, the parameters of the base language model are fine-tuned using a low-rank adaptation method to obtain a pre-trained evaluation model. The fine-tuned evaluation model is capable of evaluating retrieved text fragments and generating internal memories about the questions.

[0071] In the second stage, when a user inputs a question, the retrieval engine retrieves multiple target text blocks from an external knowledge base based on the user's question and semantic similarity. Then, a pre-trained evaluation model is invoked to independently evaluate each target text block, generating relevance and noise level judgments for each block. An internal memory is also generated based on the user's question as a self-generated knowledge base. Finally, the user's question, each target text block, and their corresponding relevance and noise level judgments, along with the internal memory, are integrated into enhanced prompts. These enhanced prompts are then input into a large-scale language model to generate a diagnostic reasoning answer corresponding to the user's question.

[0072] To better illustrate the technical solution of this embodiment, the following complete example is used for explanation, specifically: S10, the knowledge retrieval module 101 retrieves multiple target text blocks from an external knowledge base based on the user's question "How should diabetic patients control their blood sugar?" and semantic similarity, including paragraphs about precautions for insulin use, explanations of dietary control principles, and text fragments of exercise therapy guidelines. S20. The evaluation generation module 102 independently evaluates each target text block through a pre-trained evaluation model to identify retrieval noise and generates a relevance judgment result and a noise level judgment result for each target text block. The relevance judgment result quantifies the semantic association between each target text block and the user's question, and the noise level judgment result detects information in each target text block that is inconsistent with medical facts or outdated. S30, Evaluation generation module 102 generates internal memory information based on user questions as a self-generated knowledge base. By inputting user questions into a pre-trained evaluation model, the evaluation model uses parameterized knowledge to output generalized content related to user questions, forming a summary of key points for diabetes management. S40, the diagnostic reasoning module 103 integrates the user question, each target text block and the corresponding relevance judgment result and noise level judgment result, as well as internal memory information into enhanced prompt information, and combines all the content into a unified input according to a structured format; S50, the diagnostic reasoning module 103 inputs the enhanced prompt information into the large language model. The large language model parses the user question, target text block, relevance judgment result, noise level judgment result, and internal memory information in the enhanced prompt information. Based on the relevance judgment result and noise level judgment result, it identifies effective information from the target text block, integrates the effective information with the internal memory information, and generates a diagnostic reasoning answer corresponding to the user question, including specific drug usage suggestions, daily diet arrangements, and suitable exercise plans.

[0073] Figure 3 This diagram illustrates a flowchart of an embodiment of a diagnostic reasoning RAG method based on a self-generated knowledge base to resist retrieval noise, provided by the present invention. It employs the diagnostic reasoning RAG system 100 based on a self-generated knowledge base to resist retrieval noise, as provided by the present invention. Figure 3 As shown, the method includes the following steps: S1. Based on the user's question and semantic similarity, retrieve multiple target text blocks from an external knowledge base; S2. Each target text block is independently evaluated using a pre-trained evaluation model to identify retrieval noise, generating relevance and noise level judgment results for each target text block, and generating internal memory information as a self-generated knowledge base based on the user question; wherein, the self-generated knowledge base is used to provide internal knowledge reference for the large language model during the generation process, and the evaluation model is generated by knowledge distillation and parameter fine-tuning of the basic language model; S3. Integrate the user question, each target text block, the corresponding relevance judgment result and noise level judgment result, and the internal memory information into enhanced prompt information, and input the enhanced prompt information into the large language model to generate a diagnostic reasoning answer corresponding to the user question.

[0074] It should be noted that the beneficial effects of the diagnostic reasoning RAG method based on self-generated knowledge base to resist retrieval noise provided in the above embodiments are the same as those of the diagnostic reasoning RAG system 100 based on self-generated knowledge base to resist retrieval noise, and will not be repeated here. Furthermore, the system provided in the above embodiments is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to the actual situation to complete all or part of the functions described above. In addition, the method and system embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiments, and will not be repeated here.

[0075] The diagnostic reasoning RAG system 100 based on a self-generated knowledge base to resist retrieval noise of the present invention can be a computer program (including program code) running on a computer device. For example, the diagnostic reasoning RAG system 100 based on a self-generated knowledge base to resist retrieval noise of the present invention is an application software that can be used to execute the corresponding steps in the diagnostic reasoning RAG method based on a self-generated knowledge base to resist retrieval noise of the present invention.

[0076] In some embodiments, the diagnostic reasoning RAG system 100 based on a self-generated knowledge base to resist retrieval noise of the present invention can be implemented in a combination of hardware and software. As an example, the diagnostic reasoning RAG system 100 based on a self-generated knowledge base to resist retrieval noise of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the diagnostic reasoning RAG method based on a self-generated knowledge base to resist retrieval noise of the present invention. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0077] The modules described in the embodiments of this invention can be implemented in software or hardware. The names of the modules are not, in some cases, limiting the scope of the module itself.

[0078] An electronic device according to an embodiment of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned diagnostic reasoning RAG methods based on a self-generated knowledge base to resist retrieval noise. That is, an electronic device according to an embodiment of the present invention may include, but is not limited to: a processor and a memory; the memory is used to store the computer program; the processor is used to execute the diagnostic reasoning RAG method based on a self-generated knowledge base to resist retrieval noise shown in any embodiment of the present invention by calling the computer program.

[0079] In one alternative embodiment, an electronic device is provided, such as Figure 4 As shown, Figure 4 The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0080] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this invention. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.

[0081] Bus 4002 may include a path for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4The bus 4002 is represented by only one thick line, but this does not mean that there is only one bus or one type of bus.

[0082] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.

[0083] The memory 4003 stores application code (computer program) for executing the present invention, and its execution is controlled by the processor 4001. The processor 4001 executes the application code stored in the memory 4003 to implement the content shown in the foregoing method embodiments.

[0084] Among them, electronic devices can also be terminal devices. A terminal device can be any terminal device that can install applications and access web pages through applications, including at least one of smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, smart TVs, and smart in-vehicle devices.

[0085] It should be noted that, Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0086] An embodiment of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements any of the above-mentioned diagnostic reasoning RAG methods based on a self-generated knowledge base to resist retrieval noise.

[0087] Alternatively, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, a floppy disk, and an optical data storage device, etc.

[0088] In an exemplary embodiment, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the aforementioned diagnostic reasoning RAG method based on a self-generated knowledge base to resist retrieval noise.

[0089] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0090] It should be understood that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0091] The computer-readable storage medium provided in this invention can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0092] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the method shown in the above embodiments.

[0093] The above description is merely a preferred embodiment of the present invention and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of disclosure in this invention is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-disclosed concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this invention.

[0094] It should be noted that the terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and represent a limitation on a specific order or sequence. Where appropriate, the order of use for similar objects can be interchanged so that the embodiments of this application described herein can be implemented in an order other than that shown or described.

[0095] Those skilled in the art will recognize that this invention can be implemented as a system, method, or computer program product. Therefore, this invention can be specifically implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, this invention can also be implemented as a computer program product contained in one or more computer-readable media, which includes computer-readable program code.

[0096] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A diagnostic reasoning RAG system based on a self-generated knowledge base to resist retrieval noise, characterized in that, include: Knowledge retrieval module, evaluation generation module, diagnostic reasoning module; The knowledge retrieval module is used to: retrieve multiple target text blocks from an external knowledge base based on the user's question and semantic similarity; The evaluation generation module is used to: independently evaluate each target text block using a pre-trained evaluation model to identify retrieval noise, generate relevance judgment results and noise level judgment results for each target text block, and generate internal memory information as a self-generated knowledge base based on the user question; wherein, the self-generated knowledge base is used to provide internal knowledge reference for the large language model during the generation process, and the evaluation model is generated by knowledge distillation and parameter fine-tuning of the basic language model; The diagnostic reasoning module is used to: integrate the user question, each target text block and the corresponding relevance judgment result and noise level judgment result, as well as the internal memory information into enhanced prompt information, and input the enhanced prompt information into the large language model to generate a diagnostic reasoning answer corresponding to the user question.

2. The diagnostic reasoning RAG system based on a self-generated knowledge base to resist retrieval noise according to claim 1, characterized in that, The knowledge retrieval module is specifically used for: The user question is encoded into a query vector, and vector representations of multiple raw text blocks from the external knowledge base are obtained. By calculating the dot product between the query vector and the vector representation of each original text block, the semantic similarity score corresponding to each original text block is obtained and sorted in descending order to obtain the sorting result; The original text blocks corresponding to the top N semantic similarity scores in the sorting results are determined as the target text blocks, where N is a positive integer.

3. The diagnostic reasoning RAG system based on a self-generated knowledge base to resist retrieval noise according to claim 1, characterized in that, The evaluation generation module is specifically used for: The user question and any target text block are input into the evaluation model. The evaluation model analyzes the semantic correlation between the target text block and the user question to obtain the relevance judgment result of the target text block. At the same time, it detects information in the target text block that is inconsistent with medical facts or outdated to obtain the noise level judgment result of the target text block.

4. The diagnostic reasoning RAG system based on a self-generated knowledge base to resist retrieval noise according to claim 3, characterized in that, The evaluation generation module is specifically used for: The user question is input into the evaluation model, and the parameterized knowledge of the evaluation model generates generalized content related to the user question as internal memory information, so as to generate the self-generated knowledge base based on the internal memory information.

5. The diagnostic reasoning RAG system based on a self-generated knowledge base to resist retrieval noise according to any one of claims 1 to 4, characterized in that, Also includes: Model training module; The model training module is used for: Construct a training dataset; wherein the training dataset includes: multiple training data; each training data includes: corresponding sample user questions, multiple sample text blocks, relevance judgment results, noise level judgment results, and internal memory information; Based on the training dataset, the training of the base language model is guided by a teacher model. During the training process, a trainable low-rank matrix is ​​injected into the weight matrix of the base language model, the parameters of the low-rank matrix are updated, and the original weight matrix of the base language model remains unchanged, thus obtaining the evaluation model.

6. The diagnostic reasoning RAG system based on a self-generated knowledge base to resist retrieval noise according to claim 1, characterized in that, The diagnostic reasoning module is specifically used for: The enhanced prompt information is formed by combining the user question, all target text blocks, the relevance judgment result and noise level judgment result corresponding to each target text block, and the internal memory information in a structured format.

7. The diagnostic reasoning RAG system based on a self-generated knowledge base to resist retrieval noise according to claim 6, characterized in that, The diagnostic reasoning module is specifically used for: Using the large language model and based on the relevance and noise level judgment results for each target text block, effective information is identified from the multiple target text blocks. The effective information is then fused and reasoned with the internal memory information to generate the diagnostic reasoning answer corresponding to the user question.

8. A diagnostic reasoning RAG method based on a self-generated knowledge base to resist retrieval noise, employing the diagnostic reasoning RAG system based on a self-generated knowledge base to resist retrieval noise as described in any one of claims 1 to 7, characterized in that, The method includes: Based on the user's question, multiple target text blocks are retrieved from an external knowledge base based on semantic similarity; Each target text block is independently evaluated using a pre-trained evaluation model to identify retrieval noise, generating relevance and noise level judgment results for each target text block, and generating internal memory information as a self-generated knowledge base based on the user question; wherein, the self-generated knowledge base is used to provide internal knowledge reference for the large language model during the generation process, and the evaluation model is generated by knowledge distillation and parameter fine-tuning of the basic language model; The user question, each target text block, and the corresponding relevance and noise level judgment results, along with the internal memory information, are integrated into enhanced prompt information. This enhanced prompt information is then input into the large language model to generate a diagnostic reasoning answer corresponding to the user question.

9. An electronic device, characterized in that, The electronic device includes a processor coupled to a memory storing at least one computer program, which is loaded and executed by the processor to enable the electronic device to implement the diagnostic reasoning RAG method based on a self-generated knowledge base to resist retrieval noise as described in claim 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which, when executed by a processor, implements the diagnostic reasoning RAG method based on a self-generated knowledge base to resist retrieval noise as described in claim 8.

Citation Information

Cited By

  • A reinforcement learning-based credit allocation modeling method for information source perception of search agents

    CN122311476A