Dynamic medical knowledge graph updating method based on large language model decision control
Patent Information
- Application Number
- CN202611050477.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2046-07-15
AI Technical Summary
[0003]本发明的目的在于提供一种基于大语言模型决策控制的动态医疗知识图谱更新方法,以解决现有技术中知识更新滞后、易引入大语言模型幻觉信息且计算开销大、难以适配资源受限基层医疗场景的问题
[0016] 1. This invention proposes a lightweight LLM decision control paradigm, transforming the large language model from a traditional "knowledge generator" into a "knowledge update decision controller." By modeling graph updates as a sequential decision problem in a discrete action space, generation and decision-making are separated. This design fundamentally cuts off the path of injecting illusory knowledge into the graph, significantly reducing computational overhead while ensuring security, and is highly adaptable to the reality of limited computing power in primary healthcare institutions.
Smart Images

Figure CN122575770B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of medical artificial intelligence and knowledge engineering, specifically involving a dynamic medical knowledge graph update method based on decision control using a large language model. It is particularly suitable for primary healthcare, community healthcare, and small and medium-sized medical institutions with limited data scale, insufficient computing resources, and a lack of continuous expert verification. Background Technology
[0002] Medical knowledge graphs (MKGs) provide crucial knowledge support for medical information retrieval, clinical decision support, and intelligent question-answering systems by structurally representing diseases, symptoms, drugs, and treatment relationships. With the surge in electronic medical records, medical literature, and online medical data, knowledge graphs have become a core infrastructure for integrating massive amounts of heterogeneous medical knowledge. However, medical knowledge exhibits significant timeliness and dynamic evolution. New clinical guidelines, drug safety warnings, and treatment plans are constantly emerging, making it difficult for statically constructed knowledge graphs to maintain their accuracy and timeliness in the long term. If not updated in a timely manner, outdated or erroneous medical knowledge will spread to downstream applications, seriously threatening the reliability of clinical decisions. Existing knowledge graph update methods mainly fall into two categories: one employs a periodic offline reconstruction strategy, which, while maintaining structural consistency, incurs enormous computational costs and cannot adapt to the real-time evolution of knowledge; the other utilizes deep learning models (such as graph neural networks) or large language models for knowledge completion and expansion, but large language models pose a serious risk of "fact illusion" in the medical field—the model may generate seemingly reasonable but actually erroneous medical content. Directly writing such unreliable information into the knowledge graph would jeopardize the security and credibility of clinical systems. This problem is particularly prominent in resource-constrained primary healthcare settings. Primary hospitals and community healthcare institutions generally face challenges such as limited data scale, scarce computing resources, and a lack of continuous expert verification, making it difficult to deploy large-scale model training and complex reasoning processes. Therefore, there is an urgent need for a controllable knowledge graph update mechanism that can leverage the reasoning capabilities of large language models while effectively mitigating the risk of generating illusions, and is adaptable to resource-constrained environments. Summary of the Invention
[0003] The purpose of this invention is to provide a dynamic medical knowledge graph update method based on large language model decision control, so as to solve the problems of lagging knowledge updates, easy introduction of large language model illusion information, large computational overhead, and difficulty in adapting to resource-constrained primary healthcare scenarios in the prior art.
[0004] The method described in this invention is specifically as follows:
[0005] First, entity types and semantic relationships are defined, and triples are extracted from candidate medical knowledge texts. Then, confidence and timestamp dimensions are introduced to construct a medical knowledge graph with confidence and timestamps, aiming to maximize the utility of the knowledge graph in downstream tasks. Next, at each update time step, task effectiveness feedback, knowledge consistency feedback, and temporal evolution feedback are calculated. A large language model is used as the update strategy controller, constructing a decision state based on the natural language description of the current graph state summary, candidate knowledge texts, and multi-source feedback vectors, and outputting update actions from a pre-defined discrete action space. The selected actions are executed under stability constraints to generate the updated knowledge graph, forming a continuously evolving closed loop.
[0006] Furthermore, the confidence level is represented by a continuous value to indicate the credibility of knowledge, supporting gradual weighting rather than forced deletion; the timestamp provides a basis for timeliness assessment, and when candidate knowledge conflicts with existing triples in the atlas, time information can be combined to determine which side better reflects the current clinical consensus.
[0007] Furthermore, the task effectiveness feedback uses the F1 score to measure the support effect of the current graph on the downstream medical question answering task, the knowledge consistency feedback measures the semantic compatibility between candidate knowledge and the graph by calculating the cosine similarity between the semantic vectors of candidate knowledge and existing triples in the graph, and the time evolution feedback quantifies the timeliness of candidate knowledge through an exponential decay function.
[0008] Furthermore, the graph state summary includes knowledge graph statistics, such as the total number of triples, entity type distribution, and most recent update time.
[0009] Furthermore, in the decision-making process of the large language model: when the knowledge consistency feedback is higher than the preset high threshold and the time evolution feedback is lower than the preset threshold, it tends to reduce the weight; when the knowledge consistency feedback is lower than the preset low threshold and the task effectiveness feedback is high, it tends to increase the weight; when the knowledge consistency feedback is at a medium level and the task effectiveness feedback has improved, it tends to correct the weight; when any dimension triggers a consistency conflict, that is, when the knowledge consistency feedback tends to 1 but there is a semantic contradiction, it tends to refuse to write.
[0010] Furthermore, during the large language model decoding stage, the processor forces the large language model to output action labels only from a preset discrete action space.
[0011] Furthermore, the specific process of performing the selected action under stability constraints is as follows:
[0012] When the action is "addition," the candidate knowledge is added to the graph as a new triple, an initial confidence level is set based on semantic compatibility, and the current timestamp is recorded. When the action is "correction," the existing triple with the highest semantic similarity to the candidate knowledge is retrieved from the graph, the candidate knowledge is used to replace the triple, and the new and old confidence levels are weighted and fused to obtain the updated confidence level, with the timestamp updated synchronously. When the action is "deweighting," existing triples with semantic similarity to the candidate knowledge exceeding a threshold are retrieved from the graph, their confidence levels are multiplied by a decay factor to reduce their weight, and the graph structure and timestamps remain unchanged. When the action is "reject writing," the system does not perform any writing operations on the graph, and the graph remains unchanged.
[0013] Furthermore, before performing any action, the magnitude of the graph change after the action is pre-calculated. If it exceeds the preset stability threshold, the action is forcibly downgraded to a write rejection, ensuring that a single update does not cause drastic disturbances to the knowledge structure.
[0014] To achieve the above method, this invention also proposes a dynamic medical knowledge graph update system based on large language model decision control. This system includes a knowledge graph storage module, a multi-source feedback computation module, a large language model decision module, and an update execution module. The knowledge graph storage module maintains a set of five-tuples of medical knowledge graphs with confidence scores and timestamps. The multi-source feedback computation module computes task effectiveness feedback, knowledge consistency feedback, and temporal evolution feedback to construct a multi-source feedback vector. The large language model decision module constructs a decision state based on a natural language description of the current graph state summary, candidate knowledge texts, and feedback vectors, and outputs update actions from a preset discrete action space. The update execution module executes the selected actions under stability constraints to generate the updated knowledge graph.
[0015] The beneficial effects of this invention are:
[0016] 1. This invention proposes a lightweight LLM decision control paradigm, transforming the large language model from a traditional "knowledge generator" into a "knowledge update decision controller." By modeling graph updates as a sequential decision problem in a discrete action space, generation and decision-making are separated. This design fundamentally cuts off the path of injecting illusory knowledge into the graph, significantly reducing computational overhead while ensuring security, and is highly adaptable to the reality of limited computing power in primary healthcare institutions.
[0017] 2. This invention addresses the challenges of noise amplification and error entrenchment in the construction of small-sample medical knowledge maps in primary hospitals. It constructs a three-dimensional feedback signal comprised of task effectiveness, knowledge consistency, and temporal evolution, providing multidimensional evidence support for decision-making in the absence of real-time expert verification. This mechanism effectively suppresses the introduction and spread of erroneous knowledge, significantly improving the accuracy of downstream medical question answering in dynamically updated scenarios containing erroneous knowledge. It provides a practical technical path for the continuous evolution of medical knowledge systems in resource-constrained environments.
[0018] 3. By introducing a graph utility function and stability constraints, this invention transforms knowledge updating from "passive data writing" to "a constrained decision-making process," establishing a balance between knowledge introduction efficiency and system reliability. This makes the performance improvement of the dynamic knowledge graph dependent on the selectivity and constraints of the updating process, rather than the simple expansion of knowledge generation capabilities or knowledge scale. Attached Figure Description
[0019] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used according to the embodiments will be briefly introduced below. Obviously, the description in the drawings is only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without any creative effort.
[0020] Figure 1 This is a flowchart of the feedback-driven dynamic medical knowledge graph update framework in this invention.
[0021] Figure 2 This is a partial structural screenshot of the respiratory disease knowledge graph in an embodiment of the present invention. Different colored dots in the graph represent an entity, and the lines connecting entities represent semantic relationships between entities.
[0022] Figure 3 This is a statistical distribution diagram of each update action in the LLM decision-making update process in an embodiment of the present invention. Detailed Implementation
[0023] The present invention will be further explained and described below with reference to the accompanying drawings and specific embodiments.
[0024] The core of this invention lies in transforming the large language model from a traditional "knowledge generator" into an "update decision controller," driving decisions through multi-source feedback signals and performing update operations under stability constraints.
[0025] like Figure 1 As shown, a dynamic medical knowledge graph update method based on large language model decision control includes the following steps:
[0026] Step 1: Extracting Medical Text
[0027] A disease keyword dictionary is constructed, and keyword matching is performed on the disease field and condition description field of each candidate medical text. If a match is found, the text is retained; otherwise, it is filtered. For each filtered medical text, regular expressions are used to extract the required information: defining entity types and semantic relationships, converting unstructured medical text into structured text, and extracting triples from the candidate medical text.
[0028] This embodiment uses a doctor-patient dialogue record as an example to illustrate how to extract knowledge from raw medical text. The raw data is organized with "id=" as the delimiter. Each record contains fields such as the doctor's hospital and department, disease name, description of the condition, doctor-patient dialogue content, and diagnostic suggestions. The content in these fields is written by the doctor and patient in everyday language and has no fixed format requirements. Computers cannot process it directly, so it must be structured first.
[0029] The original text of a certain dialogue record (number 60) is: "id=60. Doctor faculty: Pediatrics Department of a People's Hospital of a certain Autonomous Region. Disease: Dry cough. Description of condition: The child had neonatal pneumonia at 28 days old, and was discharged from the hospital after six days of inpatient intravenous treatment. Now, just over 100 days old, the child has developed a cough again, which is a dry cough that has lasted for two days. The cough is more when lying down and playing, and does not occur when held upright or asleep. Summary and recommendation: Do not give medication for the time being, and pay attention to the body temperature and the degree of cough."
[0030] The above unstructured medical text was converted into labeled text, such as: "People's Hospital of a Certain Autonomous Region" corresponds to the medical institution, "Pediatrics" corresponds to the medical department, "dry cough" and "cough" correspond to the disease names, "The child had neonatal pneumonia at 28 days old... and now has coughed again just over 100 days old" is the symptom description, and "Do not take medicine for now, pay attention to body temperature and cough severity" is the doctor's treatment advice.
[0031] Then, the tagged text is filtered, and only those that meet the criteria are retained. Specifically, a keyword list is first created (in this example, which deals with respiratory diseases, keywords include "cough," "cold," "pneumonia," "bronchitis," and "fever"). Then, the disease name and symptom description fields in each record are searched. Records containing any of these keywords are retained; otherwise, they are discarded. For example, the "disease" field in the above record contains "dry cough" and "cough," which includes the keyword "cough," so it meets the criteria and is retained.
[0032] Then, define entity types and semantic relationships, and extract triples ("head entity-relationship-tail entity") from medical text.
[0033] In this embodiment, six entities and six relationships are defined. The entities include medical records, clinical symptoms, disease name, treatment method, hospital, and department. The six relationships include which hospital was visited, which department was visited, what disease was diagnosed, what symptoms were present, what treatment plan was adopted, and the department to which the patient belongs.
[0034] After extracting triples from the above dialogue records using keyword matching, we found that: a visit numbered 60 is related to "Guangxi Zhuang Autonomous Region People's Hospital" as "visited at"; similarly, this visit is related to "pediatrics" as "visited department"; this visit was also diagnosed with "dry cough" and "cough"; this visit also had two symptoms: "history of neonatal pneumonia" and "dry cough for two days"; the treatment method used for this visit was "observation".
[0035] The above processing breaks down the key information in the original text into small units of "who is related to whom and what is their relationship," resulting in the following: Figure 2 The knowledge graph shown.
[0036] Step 2: Construct a medical knowledge graph representation model with confidence scores and timestamps:
[0037] Traditional knowledge graphs store knowledge in the form of triples (head entity, relation, tail entity), but this representation implicitly assumes that all knowledge is deterministic and permanently valid. However, medical knowledge is constantly evolving, and new guidelines may render some of the old knowledge invalid. Directly deleting it would result in the loss of historically valuable information, while leaving it untouched could interfere with decision-making.
[0038] To address this, confidence and timestamp dimensions are introduced, expanding the traditional static triples into quintuples to obtain a novel medical knowledge graph. ;in, Represent the head entity, relation, and tail entity respectively; confidence level The credibility of knowledge is represented numerically, supporting gradual deweighting rather than forced deletion; timestamps To provide a basis for timeliness assessment, when candidate knowledge conflicts with existing triples (existing knowledge) in the atlas, time information can be used to determine which side is more likely to reflect the current clinical consensus.
[0039] Existing knowledge consists of triples already stored in the current knowledge graph, while candidate knowledge consists of triples that have just been extracted from medical texts and have not yet been written into the graph. By comparing candidate knowledge with existing knowledge, it is determined whether to add, correct, reduce the weight of, or reject the writing of candidate knowledge.
[0040] The advantage of confidence level is that it supports gradual downweighting rather than direct deletion. When knowledge becomes outdated, the confidence level can be reduced from 0.90 to 0.60. For example, the confidence level for knowledge that conforms to the new medical guidelines can be set to 0.95, while the confidence level for knowledge that conforms to the old medical guidelines can be set to 0.70. This reduces the interference of outdated information while retaining its reference value in specific contexts.
[0041] Timestamps record when knowledge is introduced into the graph. When candidate knowledge conflicts with existing knowledge—for example, old knowledge states "a certain drug is used at a certain dosage," while new knowledge states "a certain drug is used at another dosage"—the system can determine which side better aligns with current clinical consensus based on the timestamps. Generally, the later-appearing side is more likely to represent the latest understanding. Once candidate knowledge is accepted by the system, an initial confidence level and a current timestamp are assigned, and it is added to the graph as new existing knowledge. At this point, each piece of knowledge in the graph carries reliability and timeliness markers, providing a foundation for subsequent dynamic update decisions.
[0042] Step 3: Calculation of multi-source feedback vectors:
[0043] Multi-source feedback vector Including task effectiveness feedback Knowledge Consistency Feedback and time evolution feedback : .
[0044] Task effectiveness feedback is measured by F1 score, which indicates the current atlas's support effect on downstream medical question-answering tasks. ;in, Based on the current map The generated answer, The standard answer is used as the pseudo-standard answer in scenarios where annotation resources are scarce. The final diagnosis and treatment plan confirmed by the doctor is used as the pseudo-standard answer. Multiple rounds of dialogue generate weak supervision signals based on the consistency of subsequent diagnosis and treatment feedback, supplemented by a small number of expert annotations as anchor points, in order to obtain a stable task feedback estimate.
[0045] Knowledge Consistency Feedback Measuring the semantic compatibility between candidate knowledge and the graph: ;in, For candidate knowledge Vectors encoded by a medical pre-trained language model For the encoding vectors of existing triples in the graph, the maximum cosine similarity is taken and averaged over the batch to capture the strongest semantic associations; This indicates that the candidate knowledge highly overlaps with the graph, and a tendency is to reject or revise it; This indicates entirely new information and tends to indicate additions.
[0046] Time evolution feedback Quantifying the timeliness of candidate knowledge using an exponential decay function: ;
[0047] in, This is the difference between the time of the candidate knowledge source and the time of the current reference guide. The attenuation rate (preferably 0.1 to 0.3); when When the value is below a preset threshold, the system will automatically tend to make a decay decision.
[0048] Step 4: Decision on Update Strategy Driven by the Large Language Model
[0049] To adapt to the computing power limitations of primary healthcare, the current map... The system performs a summary representation, extracting statistical information such as the total number of triples and the distribution of entity types, and retrieves the local triples most similar to the candidate knowledge as context. The natural language descriptions of the graph summary, candidate knowledge text, and feedback vectors together constitute the decision state. .
[0050] The feedback vector is input in natural language rather than raw numerical values, for example, The description is "low consistency feedback, candidate knowledge differs significantly from the semantics of the existing graph, and may be entirely new information".
[0051] During the model decoding phase, the logit processor sets the probability of all non-action tokens to negative infinity, forcing the large language model to rely solely on the preset discrete action space. The output is an action label. Specifically, the generation process of a large language model is essentially predicting the probability distribution of the next output token by token. Its vocabulary typically contains tens of thousands or even hundreds of thousands of tokens, covering commonly used Chinese characters, English words, punctuation marks, and numbers. Without constraints, the model may output complete sentences such as "Add this knowledge" or mixed content such as "Add then...", thus deviating from the discrete action selection paradigm required by this invention. To address this, a whitelist of tokens containing only four action labels is predefined: Add, Revise, Decay, and Reject. At each step of decoding, the logit processor forces the predicted probability of all non-action tokens in the vocabulary to negative infinity, making the probability of outputting a non-predicted action approach zero, and the model can only choose from these four tokens. For example, when the system expects the model to output Add, the model calculates that "Add" has the highest probability, while "Add," "Add then," or any other words will not be selected because they are set to negative infinity.
[0052] If the model output exceeds the predefined set, it will default to Reject as a safety net. This constraint prevents the possibility of illusory knowledge from being written into the knowledge graph at the mechanism level. Even if the large language model makes an incorrect judgment during the reasoning process, its impact is limited to the action selection level and will not generate any medical entities or relational content to directly pollute the knowledge base.
[0053] The four update actions are explained in Chinese as follows: Add means adding candidate knowledge as a new triplet to the graph, which is suitable for introducing verified new medical facts; Revise means retrieving the existing triplet with the highest semantic similarity to the candidate knowledge in the graph and replacing it, which is suitable for updating and refining existing knowledge; Decay means multiplying the confidence of the relevant triplet by a decay factor to reduce its weight, while keeping the graph structure unchanged, which is suitable for old knowledge that has become less relevant but still has reference value; Reject means that the system does not perform any write operations on the graph, and the graph state is completely preserved, which is suitable for filtering noise or content that conflicts with existing knowledge.
[0054] In this embodiment, the guiding rules shown in Table 1 are embedded:
[0055] Table 1 Guiding rules from feedback signals to actions
[0056]
[0057] Step 5: Execution and stability constraints of knowledge update operations:
[0058] Before performing any action, the system pre-calculates the magnitude of the resulting map changes. If the preset stability threshold is exceeded If the action is rejected, it will be forcibly downgraded to Reject to ensure that a single update does not cause drastic disturbances to the knowledge structure; the magnitude of the graph change is defined as: ;
[0059] in, Represents the current knowledge graph. This represents the updated knowledge graph. , , These are the sets of triplets added, deleted, and modified in this update. This represents the total number of triplets in the current graph.
[0060] If the spectrum changes Exceeding the stability threshold (In this embodiment, it is set to 0.15), forcibly downgrading the action to Reject.
[0061] When the action is "Add", the candidate knowledge is added to the graph as a new triple, an initial confidence level is set based on semantic compatibility, and the current timestamp is recorded. When the action is "Revise", the existing triple with the highest semantic similarity to the candidate knowledge is retrieved from the graph, the candidate knowledge is used to replace the triple, and the new and old confidence levels are weighted and fused to obtain the updated confidence level, with the timestamp updated synchronously. (Weighted fusion of confidence levels...) Decay multiplies the confidence level of the relevant triple by a decay factor. (0.6~0.8) Weight reduction; When the action is Decay, the system retrieves existing triples in the graph whose semantic similarity with the candidate knowledge exceeds the threshold, and reduces their weight by multiplying their confidence by the decay factor, while keeping the graph structure and timestamp unchanged; When the action is Reject, the system does not perform any write operations on the graph, and the graph state is completely preserved.
[0062] To more clearly illustrate the technical effects of this invention, a complete process demonstration and experimental verification will be conducted below using a dynamic update scenario of a respiratory disease knowledge graph.
[0063] 1. Experimental Setup
[0064] This embodiment constructs an experimental dataset based on two data sources. The medical question-and-answer dataset uses the cMedQA v2.0 Chinese medical question-and-answer dataset, from which respiratory disease-related question-and-answer samples are selected as test data. The clinical medical record dataset is based on 251,790 hospital outpatient records, from which 2,000 respiratory disease-related cases are extracted for dynamic updates of the knowledge graph. Disease types cover frequently occurring diagnostic scenarios in primary healthcare institutions, such as cough, cold, pharyngitis, rhinitis, and pneumonia, as shown in Table 2. 1,000 records are used to construct the initial static knowledge graph, and the other 1,000 records serve as candidate knowledge streams to simulate the streaming knowledge update process. Although this data is relatively small compared to a large-scale medical knowledge base, it covers common respiratory diseases in primary healthcare scenarios and has good clinical representativeness. The distribution of extracted respiratory disease types is shown in Table 2.
[0065] Table 2. Distribution of extracted respiratory disease types
[0066]
[0067] Hardware Environment: All experiments were conducted on a single machine with an NVIDIA GeForce RTX 3060 GPU (24GB VRAM), an Intel x86 multi-core CPU, and 64GB RAM. The GPU was primarily used for inference and text encoding computation of the large language model, while the storage, retrieval, and updating of the knowledge graph were all performed on the CPU. Software Environment: Implemented using Python 3.9, with PyTorch as the deep learning framework, and Neo4j Desktop (community edition) used for knowledge graph storage. The large language model employed DeepSeek-R1 as the update strategy decision model; this model was used only for inference and decision control and did not participate in the generation of medical knowledge content.
[0068] To verify the effectiveness of the method of the present invention, four medical knowledge graphs under different update strategies were set up for comparison in this experiment: (1) Static KG: a static knowledge graph was constructed based on the initial 1,000 medical texts without any update operation; (2) Direct Update KG: 1,000 newly arrived candidate knowledge texts were added directly to the graph unconditionally; (3) LLM-Assisted Update KG: candidate knowledge texts were generatively completed or corrected using a large language model before being added to the graph; (4) LLM-Decision Update KG: the feedback-driven decision framework proposed in this invention was used for controllable evolution.
[0069] During the streaming update process, 20% of erroneous candidate knowledge (i.e., triples that do not match the standard answer) is introduced in each round of updates to simulate noisy data that may occur in a real clinical setting. Faced with 1000 data points, the types of operations performed by this system and the statistics are as follows: Figure 3 As shown.
[0070] 2. Comparative Analysis of the Basic Quality of Knowledge Graphs
[0071] Table 3 shows a comparison of the basic quality of the knowledge graph under the four update strategies.
[0072] Table 3 Comparison of basic data for each atlas
[0073]
[0074] Semantic Relation Accuracy (S-RA) measures the proportion of semantically correct triple relations, defined as follows: The S-RA of the basic knowledge graph is 0.6021, reflecting the inherent challenges of automatically constructing knowledge graphs from real-world clinical question-and-answer data. Without policy updates, the S-RA only improves to 0.6080. Directly using LLM for updates can improve the S-RA to 0.7794, but the update speed decreases significantly, with the update time per data entry increasing from 2 seconds to approximately 22 seconds, resulting in an overall processing time exceeding 12 hours, making it difficult to deploy in real-world medical systems. The method of this invention improves the S-RA to 0.7892, a relative improvement of 18.7%, validating the effectiveness of decision-based updates in correcting erroneous semantic relationships.
[0075] Medical Model Conformity Rate (M-SCR) assesses whether knowledge conforms to a predefined medical ontology model, defined as... The M-SCR of the basic graph reached 0.9810, indicating good pattern conformity of the initial graph. The M-SCR of the graph directly updated by LLM dropped to 0.9321, indicating that there may be pattern deviations when directly using knowledge generated by LLM. The M-SCR of the method in this invention is 0.9521, which maintains pattern conformity well while improving semantic accuracy. The effective attribute coverage (E-CAR) of all graphs is 1.0000, verifying the ability of the update framework to protect the basic skeleton of the knowledge graph during dynamic updates. The connectivity ratio (CCR') of the disease subgraph reflects the structural stability of the disease-related subgraphs. The method in this invention maintains it at 0.9437, which, although slightly decreased, is still controllable overall.
[0076] 3. Analysis of Question-Answering Performance and Error Knowledge Suppression Ability
[0077] The objective is to maximize the utility function of the updated graph while imposing stability constraints; the graph utility function is defined as follows: ;in, , A higher utility function value indicates better overall quality of the updated graph across the three dimensions of task performance, knowledge compatibility, and structural stability. Table 4 shows a comparison of the question-answering performance of the four graphs under noise conditions containing 20% erroneous candidate knowledge.
[0078] Table 4. Comparison of question-answering performance for each graph under 20% error data.
[0079]
[0080] Using a static knowledge graph as a baseline, its Micro-F1 score is 62.73%. Direct graph updates show a significant performance degradation under noise, with the Micro-F1 score dropping to 51.89%, the erroneous knowledge introduction rate reaching 20.15%, and the graph utility function value decreasing to 0.4783. This indicates that unfiltered update mechanisms easily embed noise into the knowledge base, impairing the performance of downstream tasks. Policy-free LLM updates further amplify the noise effect, with the Micro-F1 score dropping to only 49.62%, the erroneous knowledge introduction rate rising to 24.37%, and the utility function value falling to 0.4536. These results demonstrate that while LLM possesses powerful generation capabilities, without policy control, its output may introduce more unreliable information, exacerbating knowledge contamination.
[0081] In comparison, the LLM decision-based update method proposed in this invention exhibits significant advantages under the same noise conditions: Micro-F1 is improved to 78.95%, Hit@1 and Hit@3 reach 76.51% and 83.27% respectively, the erroneous knowledge introduction rate is successfully suppressed to 3.68%, and the graph utility function value is improved to 0.8174. This result verifies the robustness of the decision-based update mechanism in noisy environments—the system evaluates candidate knowledge through multi-source feedback and only performs addition or correction when the benefit is confirmed to outweigh the risk, thereby effectively blocking the propagation path of erroneous knowledge.
[0082] 4. Computational Overhead and Security Analysis
[0083] Besides accuracy, computational cost is also a key factor in the practical deployment of healthcare systems. Experimental statistics show that the average time for a single decision in LLM-based decision-making updates is in the seconds range (approximately 1.2 seconds), while directly using LLM to generate and update each piece of knowledge takes approximately 22 seconds. Processing 2,000 data points takes over 12 hours, which is insufficient to meet the real-time requirements of primary care hospitals. This invention's framework, by limiting LLM to a decision controller rather than a generator, significantly reduces computational costs while maintaining accuracy.
[0084] Furthermore, to address extreme cases where LLM responses are unreliable or time out, the system employs an automatic rejection mechanism: if the LLM fails to return a decision within 60 seconds, it is directly rejected. Experiments show that under this protection mechanism, the structure and performance of the knowledge graph do not exhibit significant fluctuations, further validating the framework's stability and security in practical deployments.
[0085] The above results indicate that the performance improvement of dynamic knowledge graphs does not depend on the knowledge generation capacity or a simple expansion of the knowledge scale, but rather on the decision-making control capability of the update process—that is, the selective mechanism of "when to update, what to update, and the extent of the update." This method provides a new technical approach for building safe and sustainable clinical knowledge systems, and is particularly suitable for resource-constrained primary healthcare environments.
[0086] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A dynamic medical knowledge graph update method based on large language model decision control, characterized in that, Specifically: First, entity types and semantic relationships are defined, and triples are extracted from candidate medical knowledge texts. Then, confidence and timestamp dimensions are introduced to construct a medical knowledge graph with confidence and timestamps, with the goal of maximizing the utility of the knowledge graph in downstream tasks. Then, at each update time step, task effectiveness feedback, knowledge consistency feedback, and time evolution feedback are calculated; the large language model is used as the update strategy controller, and the decision state is constructed based on the natural language description of the current graph state summary, candidate knowledge text, and multi-source feedback vectors. The update action is output from the preset discrete action space; the selected action is executed under stability constraints to generate the updated knowledge graph and form a continuously evolving closed loop. The task effectiveness feedback uses the F1 score to measure the support effect of the current graph on the downstream medical question answering task. The knowledge consistency feedback measures the semantic compatibility between candidate knowledge and the graph by calculating the cosine similarity between the semantic vectors of candidate knowledge and existing triples in the graph. The time evolution feedback quantifies the timeliness of candidate knowledge through an exponential decay function. When making decisions in a large language model: when knowledge consistency feedback is higher than a preset high threshold and time evolution feedback is lower than a preset threshold, it tends to reduce weight; when knowledge consistency feedback is lower than a preset low threshold and task effectiveness feedback is high, it tends to increase weight; when knowledge consistency feedback is at a medium level and task effectiveness feedback has improved, it tends to correct; when any dimension triggers a consistency conflict, that is, when knowledge consistency feedback tends to be 1 but there is a semantic contradiction, it tends to refuse to write. Before performing any action, the magnitude of the graph change after the action is pre-calculated. If it exceeds the preset stability threshold, the action is forcibly downgraded to a write rejection to ensure that a single update does not cause drastic disturbances to the knowledge structure.
2. The dynamic medical knowledge graph update method based on large language model decision control as described in claim 1, characterized in that, The confidence level is represented by a continuous value to indicate the credibility of knowledge, supporting gradual deweighting rather than forced deletion; the timestamp provides a basis for timeliness assessment, and when candidate knowledge conflicts with existing triples in the atlas, the time information can be combined to determine which side better reflects the current clinical consensus.
3. The dynamic medical knowledge graph update method based on large language model decision control as described in claim 1, characterized in that, The graph state summary includes knowledge graph statistics.
4. The dynamic medical knowledge graph update method based on large language model decision control as described in claim 1, characterized in that, During the large language model decoding stage, the processor forces the large language model to output action labels only from the preset discrete action space.
5. The dynamic medical knowledge graph update method based on large language model decision control as described in claim 1, characterized in that, The specific process of performing the selected action under stability constraints is as follows: When the action is to add, the candidate knowledge is added to the graph as a new triple, the initial confidence is set according to the degree of semantic compatibility, and the current timestamp is recorded; when the action is to correct, the existing triple with the highest semantic similarity to the candidate knowledge is retrieved in the graph, the candidate knowledge is used to replace the triple, and the new and old confidences are weighted and fused to obtain the updated confidence, and the timestamp is updated synchronously. When the action is to reduce weight, existing triples in the retrieval graph whose semantic similarity to candidate knowledge exceeds the threshold are reduced by multiplying their confidence by a decay factor, while the graph structure and timestamp remain unchanged. When the action is to refuse to write, the system does not perform any write operation on the map, and the map remains unchanged.
6. A dynamic medical knowledge graph update system based on large language model decision control for implementing the method of any one of claims 1 to 5, characterized in that, It includes a knowledge graph storage module, a multi-source feedback computation module, a large language model decision module, and an update execution module. The knowledge graph storage module is used to maintain a set of medical knowledge graph quintuples with confidence and timestamps. The multi-source feedback computation module is used to calculate task effectiveness feedback, knowledge consistency feedback, and time evolution feedback, and construct multi-source feedback vectors. The large language model decision module is used to construct decision states based on the natural language description of the current graph state summary, candidate knowledge texts, and feedback vectors, and output update actions from a preset discrete action space. The update execution module is used to perform selected actions under stability constraints to generate an updated knowledge graph.
Citation Information
Patent Citations
Knowledge graph dynamic updating method based on large language model
CN121833967A
Medical knowledge graph updating method and system based on agent driving
CN122387477A