Conditional query-oriented adaptive inductive knowledge graph reasoning method and system

By employing a query-aware graph neural network and an adaptive residual information fusion strategy, combined with a relation-aware dual decoder, the inference challenge of knowledge graphs under dynamic entity sets is solved, achieving efficient and accurate complex relation modeling and improving the accuracy and efficiency of knowledge graph inference.

CN121997932APending Publication Date: 2026-05-08CHONGQING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING UNIV OF TECH
Filing Date
2025-12-23
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Existing knowledge graph reasoning methods struggle to adapt and transfer structural patterns and relational semantics when faced with dynamically expanding entity sets, resulting in high computational overhead, severe noise interference, and deficiencies in complex relation modeling, thus affecting reasoning accuracy and efficiency.

Method used

We employ a query-aware graph neural network combined with an adaptive residual information fusion strategy and a relation-aware dual decoder. By filtering relevant evidence through a conditional query attention mechanism, introducing an adaptive residual information fusion strategy, and combining full graph precoding with initial subgraph construction, we optimize the message passing process and achieve unified modeling of symmetric and antisymmetric relation patterns.

Benefits of technology

It significantly improves inference accuracy and computational efficiency, suppresses interference from irrelevant neighbor noise, enhances the ability to model complex relationships, and provides an efficient inductive reasoning scheme.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121997932A_ABST
    Figure CN121997932A_ABST
Patent Text Reader

Abstract

The invention discloses a condition query-oriented adaptive inductive knowledge graph reasoning method and system, and relates to the technical field of knowledge graph reasoning. Obtaining an induction test chart and a target query containing a head entity and a query relationship; performing full-graph pre-coding on the induction test graph, screening related initial entities to construct an initial sub-graph, and generating a node initial representation; building a query perception graph neural network, carrying out normalization weighting on tail entity edge grouping by combining a conditional query attention mechanism through multi-layer message passing, and dynamically updating node representation by an adaptive residual information fusion strategy; a relation sensing double decoder composed of a symmetric MLP decoder and an antisymmetric ComplEx decoder is adopted, and scoring results are fused through a relation-level gating mechanism; and sorting the candidate tail entities according to the scores and outputting a reasoning result. According to the method, the suitability of query conditions and structure evidences is enhanced, the over-smoothing problem is relieved, the complex relation modeling capacity is improved, and collaborative optimization of induction reasoning precision and calculation efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of knowledge graph reasoning technology, specifically to an adaptive inductive knowledge graph reasoning method and system for conditional querying that enables accurate querying of unseen entities by learning structural patterns and relational semantics. Background Technology

[0002] In the rapid evolution of artificial intelligence and semantic computing, knowledge graphs, as the core carrier of structured knowledge, have deeply empowered key areas such as semantic search, intelligent question answering, and recommendation systems, becoming a core infrastructure supporting downstream intelligent applications. Knowledge graphs characterize semantic relationships between entities through ordered triples, but the incompleteness inherent in their construction severely limits the performance ceiling of downstream applications. Knowledge graph reasoning, as a key technology to overcome this deficiency, aims to mine implicit facts from existing triples, achieving accurate prediction of missing relationships or entities, thereby alleviating the challenges posed by knowledge sparsity. However, the dynamic expansion characteristics of knowledge graphs in real-world scenarios often result in significant differences between the entity sets in the training and reasoning phases. Traditional transitive reasoning methods, relying on fixed entity embedding paradigms, struggle to adapt to the reasoning needs of emerging entities, necessitating inductive reasoning techniques with cross-entity set transfer capabilities.

[0003] Inductive reasoning in knowledge graphs requires models to transfer learned structural patterns and relational semantics to unseen entities, under the premise that the entities in the training and test graphs are mutually exclusive, in order to predict emerging triples. Existing inductive reasoning methods are mainly divided into three categories: triple-based, path-based, and graph neural network-based. Triple-based methods model semantic associations through low-dimensional vector embeddings and scoring functions, but the fixed entity embedding characteristic limits their inductive ability. Path-based methods rely on relational paths or logical rules as reasoning evidence, which, while possessing a certain degree of interpretability, suffer from high path search costs and insufficient rule generalization on large-scale graphs. Graph neural network-based methods, leveraging message passing mechanisms to jointly model structural and semantic information, have become the mainstream direction for inductive reasoning. However, existing models are prone to introducing irrelevant noise in multi-hop propagation, have insufficient query condition modeling, and have limited ability to characterize complex relational patterns, thus restricting further improvements in reasoning accuracy.

[0004] As the scale and structural complexity of knowledge graphs continue to expand, the core challenges facing inductive reasoning are becoming increasingly prominent. On the one hand, during multi-hop message passing, traditional models lack precise awareness of query conditions, leading to the aggregation of a large amount of neighbor information unrelated to the target query. This not only increases computational overhead but also introduces redundant noise, causing conditional information decay and reasoning bias. On the other hand, deep network propagation is prone to oversmoothing and gradient instability, resulting in the loss of early key structural information and affecting the effectiveness of entity representation. Furthermore, the single symmetric or near-symmetric scoring function in the decoding stage is insufficient to meet the modeling needs of complex relationship patterns such as symmetry and antisymmetry, and its ability to express strong directional relationships is inadequate, limiting the model's adaptability to diverse relationship scenarios. These problems collectively lead to the urgent need to improve the performance of existing methods in scenarios such as long-distance reasoning and complex relationship modeling.

[0005] To address these challenges, the academic community urgently needs to construct an inductive reasoning framework that can adaptively capture query conditions, stably transmit structural information, and efficiently model complex relationships. Summary of the Invention

[0006] Based on the aforementioned technical problems, this application discloses an adaptive inductive knowledge graph reasoning method and system oriented towards conditional queries; the aforementioned adaptive inductive knowledge graph reasoning method oriented towards conditional queries specifically includes:

[0007] Obtain the inductive test graph and the target query, wherein the target query includes a head entity and a query relationship, which is used to query the corresponding tail entity;

[0008] The inductive test graph is precoded in its entirety. Based on the conditions of the target query, the starting entities related to the query are filtered, an initial subgraph for the query is constructed, and an initial representation of each node in the subgraph is generated.

[0009] A query-aware graph neural network is constructed, and multi-layer message passing is performed through the perceptual graph neural network. During the passing process, a conditional query attention mechanism is introduced to group, normalize, and weight the incoming edges of the tail entity. At the same time, the representation of each node is dynamically updated by combining an adaptive residual information fusion strategy.

[0010] After completing multi-layer message passing, a relation-aware dual decoder is used to calculate the scores of all candidate tail entities in parallel. The dual decoder consists of a symmetric MLP decoder and an antisymmetric ComplEx decoder. The scores of the two decoders are fused through a relation-level gating mechanism.

[0011] Sort all candidate tail entities according to the final scoring results and output the sorted inference results.

[0012] Preferably, in the multi-layer message passing process of the query-aware graph neural network, the first... The actual set of tail entities received by the layer is For entities not included in this set In its first The representation of the layer remains consistent with the one above it, that is ,in For entities In the The layer representation ensures the stability of entity representations that do not participate in the current layer's message interaction and removes noise interference caused by irrelevant updates.

[0013] Preferably, the implementation process of the conditional query attention mechanism includes:

[0014] For the first Entities from scratch in layers Pointing to tail entity edge Based on the relationship between edges Query relationship with the target query Conditional relation vectors are generated through linear mapping. ,in This is a mapping function between relation embedding and query embedding;

[0015] With the first Layered entity The representation of Based on, and conditional relation vector Perform element-wise multiplication to construct the basic message vector. , where ⊙ represents element-wise product;

[0016] Introducing each learnable parameter and attention vector Attention scoring of edges Tail-end entity Group all incoming edges and normalize them using the softmax function to obtain the attention weights for each edge. ;

[0017] Based on the normalized attention weights, for all tail-pointing entities Aggregate the basic message vectors of the edges to obtain the tail entity. In the Intermediate representation of layers ,in Pointing to the tail entity The set of all incoming edges.

[0018] Preferably, the adaptive residual information fusion strategy includes the following steps:

[0019] Calculate the first Tail-end entity The middle representation Represented by the previous layer Difference vector ;

[0020] Calculate the mean of the squared norm of the difference vector. ,in For vector dimensions, adaptive fusion coefficients are generated based on the mean of the squared norm of the difference vectors. In the formula >0 is a hyperparameter that controls the degree of adaptability. ε is the lower bound threshold for the fusion coefficient, and ε>0 is a stability constant to avoid the value being zero;

[0021] The intermediate representation and the previous layer representation are weighted and fused using fusion coefficients to obtain the fused representation. ;

[0022] The fusion representation inputs to a feedforward network consisting of linear layers and ReLU activation functions, and the output is a tail entity. In the The final representation of the layer ,in For the mapping function of the feedforward network, , These represent tail entities. In the query The corresponding number The fusion feature representation and the final feature representation in layered message passing.

[0023] Preferably, the fusion process of the relation-aware dual decoder specifically includes:

[0024] The symmetric MLP decoder first constructs candidate tail entities. Connection vector to head entity ,in Candidate tail entity go through The final representation after layer message passing, For the pre-embedded representation of the head entity, The vectors are concatenated, and then a symmetric score is calculated using a feedforward network. , For the mapping function of the MLP decoder;

[0025] The anti-symmetric CompIlEx decoder uses a learnable matrix , Projecting the pre-embedded representation of the head entity, the final representation of the candidate tail entity, and the query relation embedding onto the complex vector space yields... , For head entity In the query Below is the feature representation of a complex vector after projection onto the complex vector space. Candidate tail entity In the query Below is the feature representation of a complex vector after projection onto the complex vector space. For query Query Relationships Complex vector feature representation after projection into complex vector space, antisymmetric scoring based on trilinear inner product. ,in This is a complex conjugate operation. To perform the real part operation, The score is for the asymmetric aspect.

[0026] Learn scalar gating parameters for each relation in the extended relation set. Query relations for the target query The gating weights are calculated using the sigmoid function. ,in Using the sigmoid activation function, the scores from the two decoders are fused together with this weight to obtain the final score. ,in >0 is a hyperparameter for adjusting the antisymmetric branching scale. This is the overall scoring result.

[0027] Preferably, the full-graph precoding and initial subgraph construction include:

[0028] A lightweight pre-embedded graph neural network is used to perform unsupervised message passing with a finite number of layers on the inductive test graph to generate each entity. Pre-embedded representation ,in To summarize the test chart, Aggregation operators that depend on graph structures and query relationships;

[0029] Constructing a two-layer feedforward neural network Pre-embed entities in the representation Head entity pre-embedded representation Relationship with query After concatenation, input the data into the network to calculate the relevance scores between the entity and the query. ;

[0030] Select the one with the highest relevant score Individual Entity and Head Entity Together they form the starting point set ,in For the set of entities in the inductive test graph;

[0031] In the head entity With the starting set Other starting points Introducing new relationship types Construct fast channel edge sets A message passing operation is performed on this edge set to encode the query conditions into the initial representations of each starting point, ultimately yielding the initial node representations. ,in hour This is the encoded representation. hour It is a zero vector.

[0032] Preferably, the inductive test graph and the training graph are directed multi-relation graphs that are disjoint at the entity level, and the training graph is represented as follows: The inductive test graph is represented as ,in For the set of entities in the training graph, For the entity set of the inductive test graph, and satisfying , For a shared set of relations, For the set of fact triples of the training graph, To summarize the set of fact triples for the test graph, all facts are arranged in ordered triples. This indicates that the head entity is... Through relationships Pointing to tail entity .

[0033] Preferred, for shared sets of relations After expansion processing, the expanded set of relations is: ,in For the inverse set of relations, for each relation in the shared set of relations... Its inverse relationship Satisfy: If the triplet If true, then the triplet is formed. The same applies; For a set of self-loop relations, for each entity Introducing self-loop relations The corresponding triple is By expanding the relation set, the integrity and directional modeling capabilities of message passing are improved.

[0034] Preferably, the optimization objective is the full-entity softmax cross-entropy loss, and the parameters are continuously adjusted to improve inference accuracy. The loss function is defined as follows: ,in For the queries and corresponding real tail entities in the training set, The training graph is a set of entities. The denominator normalizes all entities in the training graph and treats all entities except the true tail entities as implicit negative samples. During training, the Adam optimizer is used for stochastic gradient descent optimization, an exponential decay strategy is applied to the learning rate, and monitoring is performed based on the average reciprocal ranking on the validation set or the preset proportion of correct answers. Early stopping is performed to avoid overfitting.

[0035] The aforementioned adaptive inductive knowledge graph reasoning system for conditional querying includes:

[0036] The data input unit receives inductive test graph data and target queries containing head entities and query relationships, performs format validation and preprocessing on the input data to ensure that the data meets the requirements of subsequent processing.

[0037] The pre-encoded subgraph construction unit, with a built-in lightweight pre-embedded graph neural network and a related score calculation module, is used to pre-encode the inductive test graph to generate entity pre-embedded representations, filter the starting entities related to the query, construct the initial subgraph, and generate the initial node representations.

[0038] The query-aware message passing unit integrates the conditional query attention module and the adaptive residual fusion module to build a query-aware graph neural network architecture. It dynamically updates the node representation through multi-layer message passing, thereby enhancing the transmission and aggregation of query-related information.

[0039] The dual-decoder fusion unit includes a symmetric MLP decoding module, an antisymmetric ComplEx decoding module, and a relation-level gating module, which are used to calculate the symmetric and antisymmetric scores respectively, and fuse them through a gating mechanism to obtain the final score of the candidate tail entity;

[0040] The inference result output unit receives the scoring results output by the dual decoder fusion unit, sorts all candidate tail entities, generates and outputs a list of inference results, and also supports the visualization of the results.

[0041] Compared with the prior art, the technical solution of this application has the following technical effects:

[0042] This invention achieves precise evidence screening for query perception through a conditional query attention mechanism. This mechanism integrates the features of the head entity, tail entity, and query relationship at the edge level, and normalizes and weights the incoming edges by grouping them according to the tail entity. It can adaptively highlight the propagation path that is highly relevant to the target query, effectively suppress noise interference from irrelevant neighbors, significantly improve the targeting and purity of message transmission, and lay a solid foundation for inference accuracy.

[0043] The introduction of the adaptive residual information fusion strategy in this invention cleverly balances the propagation weights of new and old features. It dynamically generates fusion coefficients based on the differences in representations of adjacent layer nodes, which not only ensures the effective transmission of new aggregated information but also preserves the semantics of early key structures. This successfully alleviates the common problems of oversmoothing and gradient instability in deep networks and ensures the steady-state flow of information and the effectiveness of representation during multi-hop propagation.

[0044] This invention presents a relation-aware dual-decoder parallel architecture that achieves unified modeling of symmetric and antisymmetric relation patterns. By adaptively fusing the symmetric modeling capability of the MLP decoder and the antisymmetric representation advantage of the ComplEx decoder through a relation-level gating mechanism, it overcomes the limitation of a single decoder in failing to characterize complex relations, significantly improves the model's adaptability to diverse relation semantics, and especially enhances its ability to model strongly directional relations.

[0045] This invention optimizes computational efficiency while ensuring inference performance through a collaborative design of full-graph precoding and initial subgraph construction. Lightweight precoding and fast starting point selection reduce redundant computational overhead, and the hierarchical propagation of query-aware GNN further focuses on key structures, avoiding resource waste caused by full-graph propagation. The overall framework combines high precision and high scalability, providing an efficient solution for inductive reasoning of dynamic knowledge graphs.

[0046] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the preferred embodiments of this application are described in detail below with reference to the accompanying drawings.

[0047] The above and other objects, advantages and features of this application will become more apparent to those skilled in the art from the following detailed description of specific embodiments in conjunction with the accompanying drawings. Attached Figure Description

[0048] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In all drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.

[0049] Based on the description of the figures and their corresponding technical content in the document, the titles of the figures are as follows:

[0050] Figure 1A schematic diagram illustrating the overall process of an adaptive inductive knowledge graph reasoning method based on conditional queries;

[0051] Figure 2 A schematic diagram illustrating the multi-layer message passing and collaborative operation of core modules in a query-sensory graph neural network;

[0052] Figure 3 A schematic diagram illustrating the changes in training loss versus validation set MRR of the QAPD model on the FB15k-237v3 dataset;

[0053] Figure 4 A schematic diagram showing the MRR comparison curves of QAPD and mainstream baseline models on different dataset versions. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. In the following description, specific details such as specific configurations and components are provided merely to help fully understand the embodiments of this application. Therefore, those skilled in the art should understand that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. In addition, for clarity and brevity, descriptions of known functions and structures are omitted in the embodiments.

[0055] It should be understood that the phrase "an embodiment" or "this embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "an embodiment" or "this embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.

[0056] Furthermore, reference numerals and / or letters may be repeated in different examples within this application. Such repetition is for the purpose of simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or settings discussed.

[0057] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, B exists alone, and A and B exist simultaneously. The term " / and" in this article describes another type of relationship between related objects, indicating that two relationships can exist. For example, A / and B can mean: A exists alone, and A and B exist alone. In addition, the character " / " in this article generally indicates that the related objects before and after it are in an "or" relationship.

[0058] In this article, the term "at least one" is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, "at least one of A and B" can mean: A exists alone, A and B exist simultaneously, or B exists alone.

[0059] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion.

[0060] Example 1

[0061] This embodiment mainly describes an adaptive inductive knowledge graph reasoning method oriented towards conditional queries, such as... Figure 1 As shown, it specifically includes:

[0062] Obtain the inductive test graph and the target query, wherein the target query includes a head entity and a query relationship, which is used to query the corresponding tail entity;

[0063] The inductive test graph is precoded in its entirety. Based on the conditions of the target query, the starting entities related to the query are filtered, an initial subgraph for the query is constructed, and an initial representation of each node in the subgraph is generated.

[0064] A query-aware graph neural network is constructed, and multi-layer message passing is performed through the perceptual graph neural network. During the passing process, a conditional query attention mechanism is introduced to group, normalize, and weight the incoming edges of the tail entity. At the same time, the representation of each node is dynamically updated by combining an adaptive residual information fusion strategy.

[0065] After completing multi-layer message passing, a relation-aware dual decoder is used to calculate the scores of all candidate tail entities in parallel. The dual decoder consists of a symmetric MLP decoder and an antisymmetric ComplEx decoder. The scores of the two decoders are fused through a relation-level gating mechanism.

[0066] Sort all candidate tail entities according to the final scoring results and output the sorted inference results.

[0067] Furthermore, the test graph and training graph are inductively combined into directed multi-relation graphs that are disjoint at the entity level. The training graph is represented as follows: The inductive test graph is represented as ;in, For the set of entities in the training graph, For the entity set of the inductive test graph, and satisfying This ensures that there is no overlap between entities during training and testing, which is consistent with the core setting of inductive reasoning. This is a set of relationships shared by the training and testing graphs. For the set of fact triples of the training graph, To summarize the set of fact triples for the test graph, all facts are arranged in ordered triples. This indicates that the head entity is... Through relationships Pointing to tail entity .

[0068] To improve the integrity and directionality modeling capabilities of message passing, it is necessary to model the shared set of relationships. After expansion processing, the expanded set of relations is: ,in, For the inverse set of relations, for each relation in the shared set of relations... Its inverse relationship Satisfy: If the triplet If true, then the triplet is formed. The same applies; For a set of self-loop relations, for each entity Introducing self-loop relations The corresponding triple is .

[0069] In the target query, ∈ To query the header entity, ∈ To retrieve relationships, the core objective of the reasoning task is based on inductive test graphs. Structural and semantic information, prediction and head entity Through relationships Related tail entities During the acquisition process, the input inductive test graph data and target query need to be format-validated and preprocessed to ensure that the representation formats of entities, relations and triples are consistent and meet the processing requirements of subsequent precoding, subgraph construction and message passing steps.

[0070] Furthermore, such as Figure 2 As shown, full graph precoding and initial subgraph construction aim to quickly focus on the core structures relevant to the query in a large-scale inductive test graph, reduce irrelevant computational overhead, and provide accurate initial input for subsequent message passing. The specific steps are as follows:

[0071] A lightweight pre-embedded graph neural network is used to perform unsupervised message passing with a finite number of layers on the inductive test graph to generate each entity. Pre-embedded representation ,in, As an aggregation operator that depends on graph structure and query relationships, it captures the association information between the local structural features of entities in the graph and query relationships through unsupervised learning, providing a basis for subsequent relevant entity selection;

[0072] Constructing a two-layer feedforward neural network Pre-embed entities in the representation Head entity pre-embedded representation Relationship with query Perform vector concatenation to obtain the concatenated vector. The data is then fed into a feedforward neural network to calculate the relevance score between the entity and the query. This score is used to quantify the semantic relevance between an entity and the current query, providing a quantitative basis for selecting initial entities.

[0073] Based on the calculated scores, the highest score is selected. Individual Entity and Head Entity Together they form the starting point set ,in, This operation is used to filter the top-ranked scores. The entity can expand the coverage of the query related structure by setting multiple starting points, providing richer initial propagation nodes for subsequent multi-layer message passing;

[0074] In the head entity With the starting set Other starting points Introducing new relationship types Construct fast channel edge sets ; Perform a message passing operation on this edge set to encode the query conditions into the initial representation of each starting point, ultimately obtaining the initial representation of the nodes. , specifically, when hour, This is the representation after encoding the query conditions; when hour, It is a zero vector, ensuring that the initial subgraph focuses only on entities and edge structures that are highly relevant to the query.

[0075] Furthermore, the query-aware graph neural network achieves iterative updates of entity representations through multi-layer message passing. The core of this approach lies in introducing a conditional query attention mechanism and an adaptive residual information fusion strategy, which ensures both the query targeting of message passing and stable information flow, avoiding noise interference and oversmoothing issues.

[0076] In the multi-layer message passing process of a query-perceptual graph neural network, the first... The actual set of tail entities received by the layer is For entities not included in this set In the first The representation of the layer remains consistent with the one above it, that is ,in For entities In the The layer representation ensures the stability of entity representations that do not participate in the current layer's message interaction, effectively removes noise interference caused by irrelevant updates, and reduces computational redundancy.

[0077] The core of message passing is to generate the entity representation of the current layer based on the entity's previous layer representation, edge relationship information, and query conditions. Each layer's message passing includes two key steps: weighted aggregation of conditional query attention mechanism and representation update of adaptive residual information fusion. Moreover, the operations of each layer follow a unified computational logic, and deep structural information is captured through multi-layer iteration.

[0078] The Conditional Query Attention (QCA) mechanism is used to perform query-aware grouping, normalization, and weighting of the incoming edges of tail entities, highlighting propagation paths that are highly relevant to the current query and suppressing irrelevant noise. The specific implementation process is as follows:

[0079] For the first Entities from scratch in layers Pointing to tail entity edge Based on the relationship between edges Query relationship with the target query Conditional relation vectors are generated through linear mapping. .in, This is a mapping function for relation embedding and query embedding. This vector integrates the semantic association between edge relations and query relations, enabling query-specific message delivery.

[0080] With the first Layered entity The representation of Based on, and conditional relation vector Perform element-wise multiplication to construct the basic message vector. , where ⊙ represents element-wise multiplication, and the basic message vector combines the features of the head entity with the features of the conditional relation to form the basic message passed along the edge;

[0081] Introducing learnable parameters and attention vector Attention scoring of edges This scoring comprehensively considers the head entity representation, conditional relation vector, query relation, and tail entity representation, fully quantifying the relevance of edges to queries. Subsequently, it is scored by tail entity... Group all incoming edges and normalize them using the softmax function to obtain the attention weights for each edge. This ensures that the sum of the weights of all incoming edges of the same tail entity is 1, thus achieving grouping normalization.

[0082] Based on the normalized attention weights, the underlying message vectors of all edges pointing to the tail entity ${v}}$ are aggregated to obtain the tail entity. In the Intermediate representation of layers ,in, Pointing to the tail entity The set of all incoming edges is weighted and aggregated to make the intermediate representation of the tail entity more focused on absorbing messages that are highly relevant to the query.

[0083] The Adaptive Residual Information Fusion (ARMF) strategy is used to dynamically balance the weights of new messages aggregated in the current layer and entity representations in the previous layer, avoiding representation oscillations caused by excessively large update amplitudes or oversmoothing problems caused by excessively weak updates. The specific steps are as follows:

[0084] Calculate the first Tail-end entity The middle representation Represented by the previous layer Difference vector Further calculate the mean of the squared norm of the difference vector. ,in For vector dimensions, Used to quantify the update magnitude of the current layer on the tail entity ${v}}$ representation;

[0085] Generate adaptive fusion coefficients based on the squared norm mean of the difference vector. In the formula, >0 is a hyperparameter that controls the degree of adaptability. ε is the lower bound threshold for the fusion coefficients, ensuring that new messages or old representations are not completely discarded during the fusion process; ε>0 is a stable constant to avoid values ​​of zero, ensuring computational stability; when the update magnitude is small, When the value is close to 1, the model trusts new messages from the current layer more; when the update magnitude is large, Reduce the size, retaining more of the previous layer's representation;

[0086] The intermediate representation and the previous layer representation are weighted and fused using fusion coefficients to obtain the fused representation. The input is a feedforward network consisting of linear layers and ReLU activation functions, and the output is a tail entity. In the The final representation of the layer ,in is the mapping function of the feedforward network, used to enhance the nonlinear expressive power of the representation.

[0087] Furthermore, after completing the L-layer message passing, each candidate tail entity t∈ All received final approval. The relation-aware dual decoder (PDD) consists of a symmetric MLP decoder and an antisymmetric ComplEx decoder. It obtains two types of scores through parallel computation and fuses them into a final score using a relation-level gating mechanism, thereby achieving unified modeling of symmetric and antisymmetric relation patterns.

[0088] Symmetric MLP decoders are used to model approximately symmetric semantic relationships. Their core principle is to capture the association features between head entities and candidate tail entities through vector concatenation and a feedforward network. The specific process is as follows:

[0089] Construct the connection vector between the candidate tail entity ${t}$ and the head entity. ,in Candidate tail entity go through The final representation after layer message passing, For the pre-embedded representation of the head entity, The concatenation vectors represent the key features of the head entity and the candidate tail entity. These concatenated vectors are then input into a feedforward network to calculate a symmetric score. ,in The mapping function of the MLP decoder consists of several linear layers and ReLU activation functions, which outputs scores for candidate tail entities in symmetric relation scenarios through nonlinear transformation.

[0090] The antisymmetric ComplEx decoder is used to model strongly directional semantic relations. It captures antisymmetric relation features by projecting entity and relation representations onto a complex vector space and using a trilinear inner product. The specific process is as follows:

[0091] Through learnable matrices , Projecting the pre-embedded representation of the head entity, the final representation of the candidate tail entity, and the query relation embedding onto the complex vector space, we obtain: , For head entity In the query Below is the feature representation of a complex vector after projection onto the complex vector space. Candidate tail entity In the query Below is the feature representation of a complex vector after projection onto the complex vector space. For query Query Relationships The feature representation of a complex vector after projection onto the complex vector space.

[0092] Antisymmetric scoring based on trilinear inner product calculation ,in This is a complex conjugate operation. To extract the real part, the directionality of the relation is naturally captured through operations in the complex vector space, thus enabling the modeling of antisymmetric relation patterns.

[0093] To enable the model to adaptively adapt to different types of relation patterns, a relation-level gating mechanism is introduced to fuse the scoring results of the two decoders; this is to expand the gating mechanism for each relation in the relation set. Learning scalar gate parameters Query relations for the target query The gating weights are calculated using the sigmoid function. ,in It is the sigmoid activation function. ∈(0,1), used to control the relative contribution weights of symmetric and antisymmetric scoring.

[0094] The score is obtained through weighted fusion: ,in, >0 is a hyperparameter for adjusting the antisymmetric branch scale, used to balance the numerical range of scores from the two decoders; The candidate tail entities are scored by comprehensively considering both symmetric and antisymmetric relational patterns.

[0095] Furthermore, using full-entity softmax cross-entropy loss as the optimization objective, the model parameters are continuously adjusted during training to improve inference accuracy. The loss function is defined as follows: ,in, For the queries and corresponding real tail entities in the training set, The denominator is the set of entities in the training graph. All entities in the training graph are normalized, and all entities except the true tail entities are regarded as implicit negative samples.

[0096] During training, the Adam optimizer is used for stochastic gradient descent optimization, an exponential decay strategy is applied to the learning rate, and early stopping is performed based on the mean reciprocal rank (MRR) on the validation set or the pre-set percentage of correct answers to avoid overfitting.

[0097] During the testing phase, based on the final scoring results For all candidate tail entities t∈ Sort the candidate tail entities in descending order to prioritize them in the sorted list. Output the sorted list of candidate tail entities as the inference result, and support visualization of the results to intuitively present the priority order of the inference.

[0098] This implementation employs a conditional query attention mechanism to accurately filter query-related evidence and suppress noise. It combines this with an adaptive residual fusion strategy to stabilize information flow in multi-layered message passing. A relation-aware dual-decoder model unifies the modeling of symmetric and antisymmetric relational patterns, while full-graph precoding and initial subgraph construction optimize computational efficiency. The overall framework enhances the adaptability of query conditions and structural evidence, alleviates oversmoothing and gradient instability issues, improves the ability to model complex relationships, and achieves synergistic optimization of inductive reasoning accuracy and computational efficiency. This provides an efficient and reliable solution for predicting tail entities of emerging entities.

[0099] Based on Example 1, this example describes in detail how three inductive knowledge graph reasoning benchmark datasets, FB15k-237[], WN18RR[], and NELL-995[], are used, and the inductive partitioning setting is followed: the training graph and the test graph are mutually exclusive at the entity level, but share the relation set; each dataset contains four versions, v1, v2, v3, and v4, to reflect the different structural difficulties and distribution differences of the data. Table 1 shows the number of entities, the number of relations, the number of triples, and the proportion of each version of the dataset under the training and testing partitions.

[0100] Table 1 Inductive Dataset Settings

[0101] The model's performance is evaluated through a primary task: entity prediction, using standard ranking metrics for tail entity prediction: mean regression rank (MRR) and the proportion of correct answers appearing in the top 10 (Hit@10). Let the test set be... Its scale is For the i-th query, the model calculates and sorts the candidate tail entities, assigning a rank to the true tail entity. The rank is then used to calculate the values ​​of two evaluation metrics:

[0102]

[0103] The evaluation uses filtering settings to filter out other known correct tail entities for the same query and avoid using them as negative examples that affect the ranking results.

[0104] The performance of the proposed QAPD model in inductive knowledge graph reasoning was compared with several state-of-the-art models on the three inductive datasets mentioned above, including:

[0105] Rule and path models, such as RuleN, NeuralLP, and DRUM, perform inference by learning interpretable relational chains or first-order logic rules.

[0106] Subgraph encoding models: GraIL[], CoMPILE[], extract local subgraphs from the graph around the query, label the nodes, and then use graph neural networks to encode the local structure and complete the scoring;

[0107] Progressive propagation models: NBFNet[], A*Net[], RED-GNN[], AdaProp[], RUN-GNN[], MStar[], perform multi-layer message passing and neighbor aggregation under query constraints, gradually expand the reachable area through propagation and sort candidate entities, thereby verifying the effectiveness of the model in completing the inference task;

[0108] All models were compared under the same data partitioning and evaluation script, and the evaluation metrics were MRR and Hit@10.

[0109] Because the inductive dataset is relatively small compared to other datasets and prone to overfitting, we use an early stopping mode to mitigate this problem. The QAPD model is implemented based on PyTorch 1.8 and trained and tested on a single NVIDIA RTX 3090 (24GB). The model follows a progressive propagation framework and a query-aware GNN framework to obtain candidate tail entity representations, and then uses a relation-aware parallel bed decoder to calculate and rank the scores of all candidate tail entities. The training objective is full-entity softmax cross-entropy, the optimizer is Adam, and an exponential decay is applied to the learning rate. During training, monitoring or early stopping is performed based on MRR. We use grid search for hyperparameter optimization and select the optimal configuration for each dataset version.

[0110] Analyzing the model performance using the MRR and Hit@10 metrics, QAPD shows the best performance across all metrics on FB15k-237 and NELL-995, and also has an advantage over the best model on WN18RR. Table 2 shows that QAPD achieves the best MRR in 10 out of 12 subtasks, and is slightly lower than AdaProp and RUN-GNN on WN18RRv2 and v4 versions, respectively. WN18RR has relatively fewer relation types, and entity representation relies more on limited relation semantics, making query condition propagation more difficult. This explains why the overall gap between various strong models on WN18RR is relatively small, while QAPD more prominently demonstrates its competitiveness and achieves a slight advantage on some versions, such as... Figure 3 As shown.

[0111] Table 2 MRR metric values ​​for each dataset version

[0112] In Table 3, QAPD achieved optimal or tied-optimal results in 9 out of 12 subtasks, demonstrating that the model not only improves the average ranking quality but also more consistently pushes real tail entities into the Top-10. Considering the aforementioned discussion that fewer relation types make query condition propagation more challenging, it is preliminarily concluded that WN18RR tests the model's fine-grained discriminative ability under limited relation semantics, while QAPD maintains an overall performance comparable to the current best models in this scenario.

[0113] Table 3 Hit@10 metrics for each dataset version

[0114] To quantify the contributions of each key module in QAPD, we constructed ablation variants under the same data partitioning and training strategy, and compared them on MRR and Hit@10. The key improvements of QAPD are reflected in three modules:

[0115] QAPD with / o PDD: Removes the antisymmetric decoder and cancels relation-level gated fusion, with the final score output by a single symmetric decoder.

[0116] QAPD with / o ARMF: Removes the gating calculation used to dynamically adjust the fusion ratio of new and old information, and degenerates inter-layer updates into a fixed fusion method.

[0117] QAPD with / o QCA: Removes computations related to conditional query attention in the model, degenerating message aggregation into neighbor aggregation that does not depend on query conditions.

[0118] Table 4 presents the results for different ablation variants on MRR. It can be seen that removing ARMF resulted in the largest average decrease, while removing PDD resulted in the smallest average decrease. This indicates that ARMF and QCA are more critical to ranking quality during the inductive reasoning propagation phase, while PDD primarily provides additional ranking discriminative gain.

[0119] Table 4 Ablation studies of MRR

[0120] Table 5 reports the ablation results at Hot@10, reflecting the model's ability to push true tail entities into the Top-10. Similarly, removing ARMF resulted in the largest average decrease, while removing PDD resulted in the smallest. It is worth emphasizing that removing QCA resulted in an increase in MRR on NELL-995 (v1) but a significant decrease in Hit@10. This indicates that removing QCA led to a higher ranking on a small number of samples, but weakened the model's ability to filter query-related evidence, causing more true answers to be squeezed out of the Top-10, thus significantly reducing Hit@10. In contrast, the introduction of QCA improved the model's consistency and robust hit rate across a wider range of queries.

[0121] Table 5 Ablation study of Hit@10

[0122] To further verify the impact of ablation on long-range inference, this paper will bucket FB15k-237 (v1) according to the shortest path distance between the head and tail entities (1-10 and ∞), and count Hit@10 within each bucket. This table is used to observe whether removing QCA / ARMF will produce more significant degradation on buckets >3hop or ∞, thus correlating performance changes with insufficient coverage / noise accumulation.

[0123] Table 6. Single-distance evaluation of FB15k-237 (v1) (Hit@10 measurement)

[0124] To explain the differences in the magnitude of ablation impact across different dataset versions, Table 7 shows the proportion of long-distance queries in each version, reported on both the training and test graphs. This table illustrates that when the proportion of long-distance and unreachable entity samples in the knowledge graph is higher, the model's reliance on QCA and ARMF is generally stronger, resulting in more significant degradation caused by ablation.

[0125] Table 7. Proportion of long-range triples in the dataset

[0126] The preceding sections validated the model performance and module contributions through main experiments and ablation experiments. This new subsection focuses on the stability of the model training process. To verify the convergence and stability of the QAPD model training process, the FB15k-237v3 dataset is used as an example to track the changes in training loss and validation set MRR with training epochs. The results are as follows: Figure 4As shown, the training loss decreases continuously with the number of rounds and stabilizes around 100 rounds, indicating that the model parameters gradually converge. The validation set MRR rises rapidly in the early stage of training, reaches its peak around 80 rounds and then remains stable without significant oscillation or decline. This verifies the effect of the early stopping strategy and the adaptive residual fusion strategy on improving gradient stability, effectively avoiding overfitting and demonstrating the model's good training robustness.

[0127] The above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any changes, modifications, substitutions, integrations, and parameter changes made to these embodiments within the spirit and principles of the present invention, without departing from the principles and spirit of the present invention, through conventional substitutions or to achieve the same function, fall within the scope of protection of the present invention.

Claims

1. An adaptive inductive knowledge graph reasoning method based on conditional queries, characterized in that, include: Obtain the inductive test graph and the target query, wherein the target query includes a head entity and a query relationship, which is used to query the corresponding tail entity; The inductive test graph is precoded in its entirety. Based on the conditions of the target query, the starting entities related to the query are filtered, an initial subgraph for the query is constructed, and an initial representation of each node in the subgraph is generated. A query-aware graph neural network is constructed, and multi-layer message passing is performed through the perceptual graph neural network. During the passing process, a conditional query attention mechanism is introduced to group, normalize, and weight the incoming edges of the tail entity. At the same time, the representation of each node is dynamically updated by combining an adaptive residual information fusion strategy. After completing multi-layer message passing, a relation-aware dual decoder is used to calculate the scores of all candidate tail entities in parallel. The dual decoder consists of a symmetric MLP decoder and an antisymmetric ComplEx decoder. The scores of the two decoders are fused through a relation-level gating mechanism. Sort all candidate tail entities according to the final scoring results and output the sorted inference results.

2. The adaptive inductive knowledge graph reasoning method based on conditional query as described in claim 1, characterized in that, In the multi-layer message passing process of the query-aware graph neural network, the first... The actual set of tail entities received by the layer is For entities not included in this set In its first The representation of the layer remains consistent with the one above it, that is ,in For entities In the The layer representation ensures the stability of entity representations that do not participate in the current layer's message interaction and removes noise interference caused by irrelevant updates.

3. The adaptive inductive knowledge graph reasoning method based on conditional query as described in claim 2, characterized in that, The implementation process of the conditional query attention mechanism includes: For the Entities from scratch in layers Pointing to tail entity edge Based on the relationship between edges Query relationship with the target query Conditional relation vectors are generated through linear mapping. ,in This is a mapping function between relation embedding and query embedding; With the first Layered entity The representation of Based on, and conditional relation vector Perform element-wise multiplication to construct the basic message vector. , where ⊙ represents element-wise product; Introducing each learnable parameter and attention vector Attention scoring of edges Tail-end entity Group all incoming edges and normalize them using the softmax function to obtain the attention weights for each edge. ; Based on the normalized attention weights, for all tail-pointing entities Aggregate the basic message vectors of the edges to obtain the tail entity. In the Intermediate representation of layers ,in Pointing to the tail entity The set of all incoming edges.

4. The adaptive inductive knowledge graph reasoning method based on conditional query as described in claim 3, characterized in that, The adaptive residual information fusion strategy includes the following steps: Calculate the first Tail-end entity The middle representation Represented by the previous layer Difference vector ; Calculate the mean of the squared norm of the difference vector. ,in For vector dimensions, adaptive fusion coefficients are generated based on the mean of the squared norm of the difference vectors. In the formula >0 is a hyperparameter that controls the degree of adaptability. ε is the lower bound threshold for the fusion coefficient, and ε>0 is a stability constant to avoid the value being zero; The intermediate representation and the previous layer representation are weighted and fused using fusion coefficients to obtain the fused representation. ; The fusion representation inputs to a feedforward network consisting of linear layers and ReLU activation functions, and the output is a tail entity. In the The final representation of the layer ,in For the mapping function of the feedforward network, , These represent tail entities. In the query The corresponding number The fusion feature representation and the final feature representation in layered message passing.

5. The adaptive inductive knowledge graph reasoning method based on conditional query as described in claim 1, characterized in that, The fusion process of the relation-aware dual decoder specifically includes: The symmetric MLP decoder first constructs candidate tail entities. Connection vector to head entity ,in Candidate tail entity go through The final representation after layer message passing, For the pre-embedded representation of the head entity, The vectors are concatenated, and then a symmetric score is calculated using a feedforward network. , For the mapping function of the MLP decoder; The antisymmetric ComplEx decoder uses a learnable matrix , Projecting the pre-embedded representation of the head entity, the final representation of the candidate tail entity, and the query relation embedding onto the complex vector space yields... , For head entity In the query Below is the feature representation of a complex vector after projection onto the complex vector space. Candidate tail entity In the query Below is the feature representation of a complex vector after projection onto the complex vector space. For query Query Relationships Complex vector feature representation after projection into complex vector space, antisymmetric scoring based on trilinear inner product. ,in This is a complex conjugate operation. To perform the real part operation, The score is for the asymmetric aspect. Learn scalar gating parameters for each relation in the extended relation set. Query relations for the target query The gating weights are calculated using the sigmoid function. ,in Using the sigmoid activation function, the scores from the two decoders are fused together with this weight to obtain the final score. ,in >0 is a hyperparameter for adjusting the antisymmetric branching scale. This is the overall scoring result.

6. The adaptive inductive knowledge graph reasoning method based on conditional query as described in claim 5, characterized in that, The full-graph precoding and initial subgraph construction include: A lightweight pre-embedded graph neural network is used to perform unsupervised message passing with a finite number of layers on the inductive test graph to generate each entity. Pre-embedded representation ,in To summarize the test chart, Aggregation operators that depend on graph structures and query relationships; Constructing a two-layer feedforward neural network Pre-embed entities in the representation Head entity pre-embedded representation Relationship with query After concatenation, input the data into the network to calculate the relevance scores between the entity and the query. ; Select the one with the highest relevant score Individual Entity and Head Entity Together they form the starting point set ,in For the set of entities in the inductive test graph; In the head entity With the starting set Other starting points Introducing new relationship types Construct fast channel edge sets A message passing operation is performed on this edge set to encode the query conditions into the initial representations of each starting point, ultimately yielding the initial node representations. ,in hour This is the encoded representation. hour It is a zero vector.

7. The adaptive inductive knowledge graph reasoning method based on conditional query as described in claim 6, characterized in that, The inductive test graph and training graph are disjoint directed multi-relation graphs at the entity level. The training graph is represented as follows: The inductive test graph is represented as ,in For the set of entities in the training graph, For the entity set of the inductive test graph, and satisfying , For a shared set of relations, For the set of fact triples of the training graph, To summarize the set of fact triples for the test graph, all facts are arranged in ordered triples. This indicates that the head entity is... Through relationships Pointing to tail entity .

8. The adaptive inductive knowledge graph reasoning method based on conditional query as described in claim 1, characterized in that, Shared set of relations After expansion processing, the expanded set of relations is: ,in For the inverse set of relations, for each relation in the shared set of relations... Its inverse relationship Satisfy: If the triplet If true, then the triplet is formed. The same applies; For a set of self-loop relations, for each entity Introducing self-loop relations The corresponding triple is By expanding the relation set, the integrity and directional modeling capabilities of message passing are improved.

9. The adaptive inductive knowledge graph reasoning method based on conditional query as described in claim 1, characterized in that, Using full-entity softmax cross-entropy loss as the optimization objective, parameters are continuously adjusted to improve inference accuracy. The loss function is defined as follows: ,in For the queries and corresponding real tail entities in the training set, The denominator is the set of entities in the training graph. All entities in the training graph are normalized, and all entities except the true tail entities are regarded as implicit negative samples. During training, the Adam optimizer is used for stochastic gradient descent optimization, an exponential decay strategy is applied to the learning rate, and monitoring is performed based on the average reciprocal ranking on the validation set or the pre-set percentage of correct answers. Early stopping is also performed to avoid overfitting.

10. An adaptive inductive knowledge graph reasoning system for conditional querying, characterized in that, include: The data input unit receives inductive test graph data and target queries containing head entities and query relationships, performs format validation and preprocessing on the input data to ensure that the data meets the requirements of subsequent processing. The pre-encoded subgraph construction unit, with a built-in lightweight pre-embedded graph neural network and a related score calculation module, is used to pre-encode the inductive test graph to generate entity pre-embedded representations, filter the starting entities related to the query, construct the initial subgraph, and generate the initial node representations. The query-aware message passing unit integrates the conditional query attention module and the adaptive residual fusion module to build a query-aware graph neural network architecture. It dynamically updates the node representation through multi-layer message passing, thereby enhancing the transmission and aggregation of query-related information. The dual-decoder fusion unit includes a symmetric MLP decoding module, an antisymmetric ComplEx decoding module, and a relation-level gating module, which are used to calculate the symmetric and antisymmetric scores respectively, and fuse them through a gating mechanism to obtain the final score of the candidate tail entity; The inference result output unit receives the scoring results output by the dual decoder fusion unit, sorts all candidate tail entities, generates and outputs a list of inference results, and also supports the visualization of the results.