Self-adaptive completion selection method for dynamic knowledge graph
By adaptively selecting isolated or contextual information modeling paths, the computational overhead and noise interference problems of dynamic knowledge graph completion methods in large-scale and real-time scenarios are solved, achieving efficient and accurate entity completion.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-02
- Publication Date
- 2026-03-31
AI Technical Summary
Existing dynamic knowledge graph completion methods based on graph neural networks have high computational overhead in large-scale or real-time application scenarios, and the contextual information in the unsuitable scenario may introduce interference, affecting reasoning efficiency and accuracy.
An adaptive completion selection method is adopted, which generates a query representation by executing isolated information modeling path and context information modeling path in parallel. The performance is evaluated during the training phase by using a branch selection strategy, and the prediction result of the optimal path is selected as the final query representation.
It significantly improves reasoning efficiency, reduces computational costs, enhances reasoning accuracy and robustness, and is suitable for complex and dynamic knowledge graph environments, maintaining high efficiency and practicality.
Smart Images

Figure CN121765098A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of knowledge graph technology, specifically relating to an adaptive completion selection method for dynamic knowledge graphs. Background Technology
[0002] Dynamic knowledge graphs, as an important data structure for depicting the evolution of entity relationships over time, have been widely used in various intelligent application scenarios such as intelligent question answering, recommendation systems, and event prediction. However, due to the incompleteness of information acquisition in the real world, dynamic knowledge graphs generally suffer from fact gaps, which seriously affects their application effectiveness.
[0003] To address this, researchers have proposed various dynamic knowledge graph embedding methods that map entities, relationships, and temporal information into a unified vector space to preserve temporal evolution features and infer missing facts. In recent years, graph neural networks, with their powerful modeling capabilities for graph structure, neighbor context, and temporal dependencies, have been introduced into dynamic knowledge graph completion tasks, achieving significant progress by aggregating neighbor information to enhance entity representations.
[0004] However, existing graph neural network-based methods still face significant challenges. First, constructing and encoding complex temporal neighbor subgraphs typically requires high computational and storage overhead, leading to low inference efficiency and making them unsuitable for large-scale or real-time-critical applications. Second, not all query scenarios are suitable for incorporating external contextual information. In some knowledge graphs, contextual information may be sparse, noisy, or weakly related to the semantics of the current query. Indiscriminately forcing its fusion may introduce interference, mislead model predictions, and reduce the accuracy and stability of inference. Therefore, how to reduce unnecessary computational costs while ensuring inference performance, and how to adaptively determine whether and how to utilize contextual information for specific queries, are key issues in improving the performance and practicality of dynamic knowledge graph completion methods.
[0005] To address the aforementioned issues, there is an urgent need for an efficient and adaptive completion method that can intelligently weigh and choose between relying on querying its own isolated information and utilizing the contextual information of the graph structure, based on the specific data characteristics and query requirements of the knowledge graph. This would enable accurate and efficient reasoning in complex and dynamic graph environments. Summary of the Invention
[0006] To address the aforementioned technical problems, this invention provides an adaptive completion selection method for dynamic knowledge graphs. By analyzing and judging the input query in the selected knowledge graph, it adaptively selects an information modeling method suitable for the current knowledge graph, thereby generating a high-quality entity representation, and inferring the missing entities in the query based on the generated representation.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] Adaptive completion selection methods for dynamic knowledge graphs include:
[0009] Step 1: Obtain the dynamic knowledge graph query to be completed. The query includes head entity, relation type, timestamp information, and missing tail entity.
[0010] Step 2: For the query, execute the isolated information modeling path based on the query itself and the context information modeling path based on the graph structure neighbor information in parallel to generate the isolated path query representation and the context path query representation, respectively.
[0011] Step 3: Based on the branch selection strategy, evaluate the prediction results corresponding to the isolated path query representation and the context path query representation, and adaptively select the prediction result of one of the paths as the final query representation;
[0012] Step 4: Determine the candidate entity set from the entity set of the dynamic knowledge graph, and determine and output the missing tail entity from the candidate entity set based on the final query representation of the selected path.
[0013] Furthermore, in step 2, the isolated information modeling path is implemented through an isolated branch encoding network, specifically including: vectorizing and encoding the head entity, relation type, and timestamp information in the query and mapping them to a unified feature space; interactively modeling the encoded entity, relation, and time features through a self-attention mechanism to capture their internal semantic dependencies; and fusing and nonlinearly transforming the interactive features to generate the isolated path query representation.
[0014] Furthermore, in step 2, the context information modeling path is implemented through a context branch coding network, specifically including: extracting historical neighbor subgraphs related to the head entity and timestamp of the query from the dynamic knowledge graph; encoding the query itself and the neighbor subgraphs respectively to obtain the initial query representation and the context representation; using the initial query representation as a guide, weighting and aggregating the context representation through a cross-attention mechanism, and fusing the aggregated features with the initial query representation to generate the context path query representation.
[0015] Furthermore, the branch selection strategy in step 3 is executed during the model training phase, specifically including: calculating the performance evaluation metrics for the isolated information modeling path and the context information modeling path based on the validation set or training batch data; and dynamically selecting the prediction result corresponding to the path with the better evaluation result as the final query representation for the current stage according to the performance evaluation metrics.
[0016] Furthermore, the performance evaluation metric combines the average value and stability of the prediction loss of each path; a comprehensive score is calculated by weighting and summing the average value and a statistic representing stability, and the prediction result corresponding to the branch with the lower comprehensive score is selected as the final query representation.
[0017] Furthermore, the branch selection strategy in step 3 is executed during the model inference phase, specifically including: making a decision based on the size of the context neighbors of the query or the prediction confidence of different paths; if the number of context neighbors is lower than the threshold, or the prediction confidence of the context path is lower than that of the isolated path, then the isolated path query representation is selected as the final query representation; otherwise, the context path query representation is selected as the final query representation.
[0018] Furthermore, in step 4, the candidate entity set is a set consisting of all entities in the dynamic knowledge graph, or a subset selected from all entities based on the relationship type or historical interaction information in the query.
[0019] Furthermore, in step 4, the process of determining and outputting the missing tail entity includes: calculating the similarity between the final query representation and the entity representations in the candidate entity set; and outputting the candidate entity with the highest similarity as the completion result of the missing tail entity.
[0020] In a second aspect, the present invention provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned adaptive completion selection method for dynamic knowledge graphs.
[0021] Thirdly, the present invention provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enable the processor to implement the aforementioned adaptive completion selection method for dynamic knowledge graphs.
[0022] The beneficial effects of this invention are as follows:
[0023] Significantly improves inference efficiency and reduces computational costs: By introducing an isolated information modeling path, a lightweight inference solution is provided for a large number of scenarios that can be accurately predicted by relying solely on querying their own information. This avoids the huge computational overhead of forcibly constructing and encoding complex temporal neighbor subgraphs for each query, making the model more practical and scalable when dealing with large-scale dynamic knowledge graphs.
[0024] Enhancing inference accuracy and robustness: An adaptive branch selection strategy was designed, which dynamically evaluates and selects the optimal information modeling path based on the characteristics of the specific query (such as context size and prediction confidence). This mechanism effectively avoids introducing noise or irrelevant contextual information in unsuitable scenarios, thereby reducing the interference of erroneous information and maintaining high inference accuracy and model stability under various data distributions.
[0025] Achieving intelligent adaptation of information modeling methods: Prediction results from different paths are abstracted into comparable "cognitive hypotheses," and decisions are made based on their inherent consistency and distinctiveness. This mechanism does not rely on fixed rules and can autonomously evolve with changes in different knowledge graph datasets and query content, enabling the model to adapt to complex and variable time-series graph environments, thus improving the method's versatility and applicability.
[0026] It maintains the efficiency and practicality of the method: the branch selection mechanism can run independently during the inference phase without updating model parameters, ensuring the speed and stability of the inference process, and is suitable for deployment in real-time application scenarios. Attached Figure Description
[0027] Figure 1 This is a flowchart of the adaptive completion selection method for dynamic knowledge graphs in this invention;
[0028] Figure 2 This is a diagram of the dual-branch coding network structure of the present invention;
[0029] Figure 3 This is a comparison chart of the implementation effects of the present invention. Detailed Implementation
[0030] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0031] like Figure 1 As shown, this invention provides an adaptive completion selection method for dynamic knowledge graphs. Its core lies in that, for a query to be completed (usually a temporal triple with missing tail entities), the system does not consistently use a single information source, but rather explores two information modeling paths in parallel. Through an intelligent branch selection strategy, it adaptively determines which path's prediction result to ultimately adopt, thereby achieving efficient and accurate entity completion. The method specifically includes:
[0032] Step 1: Obtain the dynamic knowledge graph query to be completed. The query includes head entity, relation type, and timestamp information. The tail entity in the query is missing and is the target to be completed.
[0033] Step 2: For the query, execute the isolated information modeling path based on the query itself and the context information modeling path based on the graph structure neighbor information in parallel to generate the isolated path query representation and the context path query representation, respectively.
[0034] Step 3: Based on the branch selection strategy, evaluate the prediction results corresponding to the isolated path query representation and the context path query representation, and adaptively select the prediction result of one of the paths as the final query representation;
[0035] Step 4: Determine the candidate entity set from the entity set of the dynamic knowledge graph, and determine and output the missing tail entity from the candidate entity set based on the final query representation of the selected path.
[0036] like Figure 2 As shown, the core of step 2 is to run two independent encoding networks simultaneously, processing the input query from different information dimensions, thus providing a foundation for subsequent intelligent selection. The input is a time-series query to be completed, in the form of (head entity, relation, timestamp), i.e. Figure 2 As shown The missing tail entity is the prediction target; heuristic branch selection is performed based on the query to choose either the context information modeling path or the isolated information modeling path.
[0037] Isolated Information Modeling Path: This path aims to rely solely on the information contained within the query itself for reasoning, avoiding the introduction of any potentially noisy external data. It is implemented through an "isolated branch encoding network." Specifically, it first performs a vectorized representation of the query, including the head entity s, relation r, and timestamp. The information is input into the isolated branch coding network, which includes the head entity s, relation r, and timestamp. The input embedding matrix H is concatenated and then modeled using a self-attention mechanism. After layer normalization, the outputs Q, K, and V (query, key, and value) are input into a multi-head attention module. After weighted branching, the result is normalized again to obtain the query adaptive embedding matrix. This allows for the capture of semantic relationships between entities, relations, and time, thereby generating predictive representations of target entities without incorporating information from external neighbors.
[0038] The isolated branch coding network is used to model the entity, relation, and temporal information contained in the query itself without introducing external graph structure context information. Its network structure includes the following modules: an input embedding module, used to vectorize and encode the head entity, relation type, and temporal information respectively, and map them to a unified feature space; a self-attention modeling module, used to model the relevance of different feature dimensions in the embedding module to capture the dependencies between the three elements within the query, such as the implicit constraints of a certain relation on an entity at a specific time; a feature fusion module, used to concatenate, weight, sum, or linearly transform the entity embedding, relation embedding, and temporal embedding output by the self-attention modeling module to generate a joint representation of the query; and a feedforward transformation module, used to perform nonlinear mapping on the joint representation to enhance its representational power. Through these modules, the isolated branch coding network can generate stable isolated path query representations relying solely on the query information itself, making it suitable for query scenarios with sparse context information or high noise levels.
[0039] Contextual information modeling path: This approach aims to enhance query representation by leveraging the rich graph structure and temporal evolution information of knowledge graphs. After the query is vectorized, it utilizes the head entity 's' and timestamp from the query. Using the time-series knowledge graph as the anchor point, extract the historical neighbor subgraph related to the query. , The query embedding matrix H is obtained by concatenating the initial representation of the query with the representation of the neighbor subgraph of the query head entity s in the knowledge graph. This matrix is then input into the context branch encoding network, where the query information and context information are interactively modeled through a cross-attention mechanism. The matrix is divided into Q, K, and V types and enters a multi-head attention layer. Entities are then acquired, processed through weighted branches, and after batch normalization, the query adaptive embedding matrix is output. This is used to generate enhanced representations of the fusion graph structure and temporal evolution features.
[0040] The context branching encoding network is used to fuse query information with neighbor context information in a temporal knowledge graph. It includes: a query encoding module for encoding the input original query to obtain an initial representation; a context encoding module for encoding the historical neighbor subgraph related to the query to aggregate semantic and temporal information of neighbors and generate context information; and a cross-attention encoding module for weighted aggregation of context information guided by the initial query representation, thereby highlighting context features related to the current query semantics. The aggregated context features are then fused with the initial query representation to output an updated context path query representation. The cross-attention encoding module units can be stacked hierarchically to integrate graph structure and temporal evolution information layer by layer, ultimately generating a final query representation that fuses context semantics.
[0041] The query representation obtained by using isolated branch coding network or context branch coding network can be used to calculate cosine similarity with candidate entity representation in the embedding space. The candidate entity with the highest similarity score is the missing entity in the target query, thereby achieving completion for dynamic knowledge graphs.
[0042] In step 3, to avoid introducing redundant or noisy context information in unsuitable query scenarios, the present invention further introduces a branch selection strategy to adaptively select between isolated information modeling paths and context information modeling paths.
[0043] The branch selection strategy utilizes the performance of network branches at different stages to evaluate the outputs of the two modeling paths and selects the modeling path with the best performance as the final entity embedding generation method.
[0044] The branch selection strategy is used to make dynamic decisions among multiple information modeling paths. Its basic idea is that not all knowledge graph datasets need to introduce external context information, and the degree of dependence of queries on information sources varies significantly in different datasets. Therefore, the optimal information modeling method should be adaptively determined based on the comprehensive feedback of the dataset query itself and the model prediction behavior.
[0045] Specifically, the branch selection strategy includes the following mechanism: sampling a portion of the queries in the selected dataset, generating joint representations of the queries from different information modeling paths: isolated path query representation and context path query representation, thereby obtaining the prediction results of the target entity, and treating the prediction behavior of each path as an independent "cognitive hypothesis" for the queries within the current dataset, i.e., candidate prediction results formed under different information modeling paths; and performing the following phased analysis on the prediction results corresponding to the above different cognitive hypotheses:
[0046] In the selection of isolated branches or contextual network branches, this paper utilizes the performance of each network branch and examines the statistical characteristics C of the loss in the first few rounds. b The specific formula for analyzing this performance is as follows:
[0047] ,
[0048] b∈{isolation,context} represents feature C b The calculation is based on isolated branches or contextual branches. The average loss μ b The standard deviation σ is used to measure the overall performance of the model. b Used to measure the training stability of a model. Used to balance μ b and σ b The weight of C in an isolated branch.b C less than the context branch b When an isolated branch is deemed to outperform a context branch, it is selected; otherwise, a context branch is selected.
[0049] When the predictive hypothesis formed by introducing contextual information shows advantages in terms of stability, consistency, or distinctiveness, it is determined that the contextual information provides an effective supplement to the current query, and the corresponding information modeling path is selected to complete the selected knowledge graph.
[0050] When the introduction of contextual information leads to significant discrepancies between prediction hypotheses, a more dispersed prediction distribution, or increased uncertainty, it is determined that the contextual information may introduce interference. Instead, an information modeling path based solely on querying its own information is chosen to complete the selected knowledge graph.
[0051] By abstracting the predictive behavior of different information modeling paths into comparable cognitive hypotheses and making decisions based on their inherent consistency and stability, this invention realizes a branch selection mechanism that does not rely on fixed rules and can adaptively evolve with changes in queries, enabling the model to maintain robust reasoning performance in complex and variable time-series knowledge graph dataset completion scenarios.
[0052] The above method can be executed during the training or inference phase. During the inference phase, there is no need to update the model parameters, thus ensuring the stability and efficiency of the inference process.
[0053] In step 4, after completing the adaptive branch selection, the system determines the final adopted query representation. Subsequently, this query representation is matched with all candidate entity representation sets in the vector space for final similarity. The candidate entity with the highest similarity score is selected as the prediction for completing the missing tail entity in the input query, and this result is output, thus completing the completion task of the entire dynamic knowledge graph. In a typical embodiment, the candidate entity set can be directly taken from the complete set of all entities in the dynamic knowledge graph. In another embodiment, to improve reasoning efficiency, entities historically associated with the relation type in the query can be selected from the complete set to form a smaller candidate subset. Those skilled in the art should understand that the specific composition of the candidate entity set does not affect the core method flow of this invention, and any entity set determined based on the dynamic knowledge graph is applicable to this invention.
[0054] like Figure 3As shown, to verify the effectiveness of the proposed method, experimental results were compared on three commonly used public datasets in the field of temporal knowledge graph completion (ICEWS14, ICEWS05-15, and GDELT). Comparison with current representative dynamic knowledge graph inference methods (such as RoAN, HGE, and TeMP) reveals that the proposed adaptive completion selection method achieves optimal or highly competitive performance on most evaluation metrics (including MRR, Hit@1, Hit@3, and Hit@10). The experimental results fully demonstrate that this method effectively improves the accuracy and robustness of the completion task while maintaining inference efficiency, making it suitable for dynamic knowledge graph applications of different scales and time spans.
[0055] In a second aspect, the present invention provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned adaptive completion selection method for dynamic knowledge graphs.
[0056] Thirdly, the present invention provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enable the processor to implement the aforementioned adaptive completion selection method for dynamic knowledge graphs.
[0057] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An adaptive completion selection method for dynamic knowledge graphs, characterized in that, include: Step 1: Obtain the dynamic knowledge graph query to be completed. The query includes head entity, relation type, timestamp information, and missing tail entity. Step 2: For the query, execute the isolated information modeling path based on the query itself and the context information modeling path based on the graph structure neighbor information in parallel to generate the isolated path query representation and the context path query representation, respectively. Step 3: Based on the branch selection strategy, evaluate the prediction results corresponding to the isolated path query representation and the context path query representation, and adaptively select the prediction result of one of the paths as the final query representation; Step 4: Determine the candidate entity set from the entity set of the dynamic knowledge graph, and determine and output the missing tail entity from the candidate entity set based on the final query representation of the selected path.
2. The adaptive completion selection method for dynamic knowledge graphs according to claim 1, characterized in that, In step 2, the isolated information modeling path is implemented through an isolated branch encoding network, specifically including: vectorizing and encoding the head entity, relation type, and timestamp information in the query and mapping them to a unified feature space; using a self-attention mechanism to interactively model the encoded entity, relation, and time features to capture their internal semantic dependencies; and fusing and nonlinearly transforming the interactive features to generate the isolated path query representation.
3. The adaptive completion selection method for dynamic knowledge graphs according to claim 1, characterized in that, In step 2, the context information modeling path is implemented through a context branch coding network, specifically including: extracting historical neighbor subgraphs related to the head entity and timestamp of the query from the dynamic knowledge graph; encoding the query itself and the neighbor subgraphs respectively to obtain the initial query representation and the context representation; using the initial query representation as a guide, weighting and aggregating the context representation through a cross-attention mechanism, and fusing the aggregated features with the initial query representation to generate the context path query representation.
4. The adaptive completion selection method for dynamic knowledge graphs according to claim 1, characterized in that, The branch selection strategy in step 3 is executed during the model training phase, and specifically includes: calculating the performance evaluation index of the isolated information modeling path and the context information modeling path based on the validation set or training batch data; and dynamically selecting the prediction result corresponding to the path with the better evaluation result as the final query representation for the current stage according to the performance evaluation index.
5. The adaptive completion selection method for dynamic knowledge graphs according to claim 4, characterized in that, The performance evaluation metric combines the average value and stability of the prediction loss of each path; a comprehensive score is calculated by weighting and summing the average value and a statistic representing stability, and the prediction result corresponding to the branch with the lower comprehensive score is selected as the final query representation.
6. The adaptive completion selection method for dynamic knowledge graphs according to claim 1, characterized in that, The branch selection strategy in step 3 is executed during the model inference phase, and specifically includes: making a decision based on the size of the context neighbors of the query or the prediction confidence of different paths; if the number of context neighbors is lower than the threshold, or the prediction confidence of the context path is lower than that of the isolated path, then the isolated path query representation is selected as the final query representation; otherwise, the context path query representation is selected as the final query representation.
7. The adaptive completion selection method for dynamic knowledge graphs according to claim 1, characterized in that, In step 4, the candidate entity set is a set of all entities in the dynamic knowledge graph, or a subset selected from all entities based on the relationship type or historical interaction information in the query.
8. The adaptive completion selection method for dynamic knowledge graphs according to claim 1, characterized in that, In step 4, the process of determining and outputting the missing tail entity includes: calculating the similarity between the final query representation and the representations of each entity in the candidate entity set; and outputting the candidate entity with the highest similarity as the completion result of the missing tail entity.
9. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; Wherein, when one or more programs are executed by the one or more processors, the one or more processors implement the adaptive completion selection method for dynamic knowledge graphs as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, It stores executable instructions that, when executed by a processor, enable the processor to implement the adaptive completion selection method for dynamic knowledge graphs as described in any one of claims 1-8.
Citation Information
Cited By
Method, device, equipment, medium and product for completion and prediction of wireless data
CN122262508A