Time sequence knowledge graph link prediction method based on space-time decoupling causal reasoning

By using a spatiotemporally decoupled causal reasoning framework to dynamically model changes in entities and relationships, the problems of spatiotemporal coupling and insufficient robustness in temporal knowledge graphs are solved, achieving high-precision entity relationship prediction and stability against temporal disturbances.

CN121787582APending Publication Date: 2026-04-03EAST CHINA INST OF COMPUTING TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately predict changes in relationships between entities in time-series knowledge graphs, and face issues such as spatiotemporal coupling, rigid relationships, and insufficient robustness.

Method used

Employing a spatiotemporally decoupled causal reasoning framework, this paper utilizes techniques such as dynamic relation-aware graph convolutional networks, temporal masks, multi-head attention mechanisms, adaptive fusion gates, and causal contrastive learning to achieve dynamic modeling and causal intervention of entities and relationships, thereby improving the accuracy and robustness of the spatiotemporal dynamic modeling.

Benefits of technology

It significantly improves the accuracy of link prediction in temporal knowledge graphs and its resistance to temporal perturbations, enabling more refined representation of topological evolution and feature propagation, and enhancing the model's causal robustness and generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121787582A_ABST
    Figure CN121787582A_ABST
Patent Text Reader

Abstract

The invention relates to a time sequence knowledge graph link prediction method based on space-time decoupling causal reasoning, which belongs to the field of time sequence knowledge graph reasoning, and comprises the following steps: receiving a time sequence knowledge graph snapshot calculation hidden representation; generating time mask modulation relation embedding; the dynamic weight generator fuses the features and uses multi-head attention to aggregate neighbor information; the derivative is decoupled into space and time dynamics; dynamically calculating the weight through a self-adaptive fusion gate, fusing according to a differential equation, and performing integration through an ODE solver to obtain evolution embedding; performing negative sampling intervention optimization by adopting causal contrast learning time; and the Fourier basis function is subjected to time coding and then is predicted by a decoder. According to the method, the accuracy of time sequence knowledge graph link prediction and the resistance to time sequence disturbance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a technique for reasoning in temporal knowledge graphs, belonging to the field of temporal knowledge graph reasoning technology. In particular, it relates to a method for achieving accurate and robust continuous-time prediction of the evolution of entities and relations in dynamic knowledge graphs by decoupling spatiotemporal dynamics and integrating causal reasoning mechanisms. Background Technology

[0002] Temporal knowledge graphs, as structured knowledge bases containing temporal information, play a central role in complex real-world applications, such as event prediction and network evolution analysis. However, accurately predicting future links (i.e., relationships between entities) in temporal knowledge graphs is a challenging task, and existing technologies suffer from multiple deficiencies in modeling, severely limiting the accuracy and robustness of the models.

[0003] Traditional inference methods, including those based on discrete-time slice modeling, often struggle to capture the subtle, continuous evolutionary characteristics inherent in complex spatiotemporal systems. While the introduction of neural frequent differential equations (NDEs) in recent years has enhanced the ability to model continuous-time processes, they face the inherent coupling problem between spatial and temporal dynamics. This coupling means that existing NDE-based methods conflate topological evolution with feature propagation. When attempting to simulate the evolution of hidden states using a single differential equation, the model struggles to distinguish between local structural changes and global semantic drift within the knowledge graph, resulting in an inability to perform refined modeling of multi-scale, heterogeneous spatiotemporal dynamics.

[0004] In temporal knowledge graphs, the strength and type of relationships between entities change dynamically over time. However, existing research, such as methods based on static graph convolutional networks, struggles to adapt to the dynamic fluctuations in relationship strength. These static methods typically ignore the influence of different relationship types and the dynamic decay caused by timestamps during information propagation, limiting their expressive power when handling high-frequency, complex event interactions and hindering more nuanced and context-aware information dissemination. Effectively handling and modeling dynamic relationship awareness in temporal knowledge graph reasoning remains a significant challenge.

[0005] Another key challenge in temporal knowledge graph reasoning is improving the robustness of models to temporal distribution shifts. Traditional contrastive learning methods are susceptible to spurious associations arising from timestamps as potential confounding variables. These spurious associations can cause models to learn non-genuine statistical associations based on temporal co-occurrence, rather than genuine causal relationships between entities. If a model relies on such co-occurrence rather than deep semantic associations for prediction, its generalization ability and resistance to temporal perturbations will be severely reduced. Summary of the Invention

[0006] This invention aims to systematically address the aforementioned problems of spatiotemporal coupling, rigid relationships, and insufficient robustness. By providing a novel spatiotemporal decoupling causal reasoning framework, this invention achieves explicit decoupling of spatiotemporal dynamics, adaptive modeling of dynamic relationship strength, and a counterfactual learning mechanism based on causal intervention, thereby significantly improving the accuracy of temporal knowledge graph link prediction and its resistance to temporal perturbations.

[0007] To achieve the above objectives, the technical solution of this invention provides a temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning, used to continuously predict the evolution of relationships between entities in a dynamic knowledge graph, including the following steps: Receive time-series knowledge graph snapshot The hidden representations of entities and relationships are computed through the convolutional network layers of the dynamic relationship-aware graph. ; Based on relative time interval Generate time mask Dynamically modulate the relation embedding to obtain time-aware relation embedding; The source node features, time-aware relationship embedding, and time mask are fused by a dynamic weight generator, and neighbor information is aggregated by a multi-head attention mechanism. The derivative of the hidden state Decoupling into space dynamics and time dynamics They modeled local structural changes and global temporal evolution respectively; Through adaptive fusion gate The weights of spatial dynamics and temporal dynamics are dynamically calculated and fused according to the following differential equation:

[0008] The predicted time is obtained by integration using an ordinary differential equation solver. Evolutionary Embedding ; During training, a causal contrastive learning strategy is employed, which approximates the intervention on timestamps through a time negative sampling mechanism. Generate counterfactual samples and combine them with contrastive loss to optimize the model; Using Fourier basis functions with learnable frequencies to measure query time Continuous encoding is performed, and evolutionary embedding, relational embedding and temporal encoding are fused together. Then, the prediction score of the target entity is calculated by the decoder.

[0009] Preferably, the time-aware relationship embedding is calculated using the following formula: Calculate the relative time interval

[0010] in For the target node timestamp, The timestamp of the edge occurrence. The attenuation coefficient is a learnable factor. To prevent the minimum value when divided by zero; Generate time mask

[0011] in Use the Sigmoid activation function; Obtaining time-aware relationship embeddings

[0012] in For relational embedding matrix, This represents element-wise multiplication.

[0013] Preferably, the dynamic weight generator is implemented using the following formula: Dynamic weights

[0014] in It is the ReLU activation function. Features of the source node , For learnable weight matrix, , For bias terms; Generate neighbor messages

[0015] Used to indicate the importance of the current edge to the target node.

[0016] Preferably, the spatiotemporal decoupling dynamic modeling is implemented through a two-stream god ordinary differential equation module, the overall form of which is:

[0017] Among them, space dynamics Modeling instantaneous structural changes, time dynamics Model the global time evolution.

[0018] Preferably, the space dynamics are implemented using a feedforward neural network:

[0019] in For GELU activation function, , This is a learnable weight matrix.

[0020] Preferably, time dynamics is achieved through the following formula:

[0021] in This is the Softplus activation function. , This is a learnable weight matrix.

[0022] Preferably, the adaptive fusion gate γ is calculated using the following formula:

[0023] in For learnable weight matrix, This indicates a feature splicing operation.

[0024] Preferably, the ordinary differential equation solver performs the following integration operation:

[0025] From the initial time Evolution to prediction time This allows for continuous and smooth state evolution.

[0026] Preferred causal contrastive learning strategies include: Using a projection head

[0027] Embed Mapped to contrast space, where , These are learnable parameters; Calculate contrast loss

[0028] in For positive sample projection vectors, The negative sample projection vector. / For similarity function, ∈(0,1) is the temperature coefficient.

[0029] Preferably, Fourier time encoding is implemented using the following formula:

[0030] in For learnable frequency parameters, For encoding dimensions.

[0031] Compared with the prior art, the present invention has the following beneficial technical effects: 1. Enhanced Spatiotemporal Dynamic Refinement Modeling Capability: By decoupling the hidden state derivative into spatial dynamics and temporal dynamics, and using GELU and Softplus differential activation functions to model instantaneous local structural changes and long-term global semantic evolution respectively, and combining adaptive fusion gates to dynamically balance the contributions of the two flows, this invention significantly enhances the model's ability to accurately distinguish multi-scale spatiotemporal patterns in temporal knowledge graphs. It effectively solves the problem of local and global dynamic confusion caused by spatiotemporal coupling in traditional methods, and realizes independent characterization and refined representation of topological evolution and feature propagation.

[0032] 2. Enhance the adaptive perception capability of dynamic relationships: Introduce a time decay mechanism to calculate the relative time interval and generate a time mask to dynamically modulate the relationship embedding, ensuring that recent interaction relationships have higher activation intensity. At the same time, through a dynamic weight generator, adaptively fuse source node features, time-aware relationship embedding and time series information, and combine a multi-head attention mechanism to achieve fine-grained neighbor aggregation, so that the model can accurately capture the nonlinear decay characteristics of relationship strength over time, effectively overcoming the rigidity of static graph convolutional networks in dynamic relationship modeling.

[0033] 3. Enhance causal robustness and generalization ability: The time negative sampling mechanism is adopted to approximate the causal intervention of timestamps, generate counterfactual samples and optimize them in combination with contrastive loss, which forces the model to learn deep causal relationships based on entity-relation semantics rather than false associations based on temporal co-occurrence. This significantly improves the model's resistance to temporal distribution shifts and causal discrimination ability, and enhances the prediction stability and generalization performance when faced with temporal confusion variables. Attached Figure Description

[0034] Figure 1 This is a diagram illustrating the overall architecture of the spatiotemporal decoupling causal reasoning framework in the temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning of the present invention. Figure 2 This is a structural diagram of the spatiotemporal decoupling dual-flow neural ordinary differential equation module in a temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning of the present invention. Figure 3 This is a flowchart of causal comparison learning in a temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning, as described in this invention. Detailed Implementation

[0035] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0036] This invention discloses a method for predicting links in a temporal knowledge graph based on spatiotemporal decoupling causal reasoning, used for reasoning on temporal knowledge graphs. This method decouples dynamic modeling into spatial topological evolution and temporal feature propagation, and introduces a causal intervention mechanism to enhance robustness. It includes the following steps: Step 1: Time-aware relation embedding, receiving snapshots of time-series knowledge graphs. Entities are computed through dynamic relationship-aware graph convolutional network layers. and relationships Hidden representation The dynamic graph structure encoding includes methods for calculating relative time intervals. The mechanism, and uses this interval to generate a time mask. Modulation relation embedding is used to adapt to the dynamic fluctuations in relation strength in time series.

[0037] Step 2: Dynamic weight generation and aggregation, using a dynamic weight generator. Fusion source node features Time modulation relationship embedding and time mask To determine neighbor messages Contribution to the target node, and through a multi-head attention mechanism. Aggregate neighbor information.

[0038] Step 3: Spatiotemporal decoupling dynamic modeling, converting the derivatives of the hidden states... Decoupling into space dynamics and time dynamics ,in Modeling local structural changes, Model the global time evolution.

[0039] Step 4: Adaptive fusion and integration, using an adaptive fusion gate. The weights of the two dynamic flows are dynamically calculated and applied according to the differential equation. The equations are then fused, and the ODE solver is used to integrate the fused differential equations to obtain the predicted time. Evolutionary Embedding .

[0040] Step 5: Causal contrastive learning. During the training process, a causal contrastive learning strategy is adopted, which uses a time negative sampling mechanism to approximate the intervention of timestamps. Generate counterfactual samples and combine them with contrastive loss. Optimize the model to enhance its robustness to time-confused variables.

[0041] Step 6: Fourier time encoding and prediction, using Fourier basis functions with learnable frequencies to encode the query time. Perform continuous encoding and embed evolution Relational embedding and time encoding Fusion, which calculates the predicted score of the target entity through a linear decoder. .

[0042] Furthermore, the overall architecture of the spatiotemporal decoupling causal reasoning framework is as follows: Figure 1 Specifically, it includes the following steps: Step 1, Time Relationship Aware Embedding: To make the model sensitive to changes in relation stability over time, this method introduces a time decay factor into the relation embedding. First, the relative time interval is calculated. :

[0043] in It is the timestamp of the target node. It is the timestamp of the edge occurrence. It is a learnable attenuation coefficient. It prevents the minimum value when divided by zero.

[0044] Subsequently, the Sigmoid activation function was used. Generate time mask :

[0045] time mask Embedded matrix for dynamic modulation relationship Generate time-aware relation embeddings :

[0046] in This represents element-wise multiplication. This mechanism ensures that the embedding of relationships from recent interactions has a higher activation strength, effectively attenuating the influence of old relationships.

[0047] The core of this step lies in enabling the model to perceive the dynamic decay of relation strength in a temporal knowledge graph. By calculating relative time intervals and generating temporal masks, the model can dynamically modulate relation embeddings. This mechanism simulates the timeliness of relations in the real world, ensuring that relations with recent interactions occupy a more dominant position in the embedding space, thereby accurately adapting to the key characteristic of relation strength fluctuating over time and solving the problem of relation rigidity.

[0048] Step 2, Dynamic Weight Generation and Aggregation: In order to adaptively fuse source node features Time-aware relationship embedding and time mask Introducing a dynamic weight generator:

[0049] in The ReLU activation function is used. Dynamic weights. This reflects the importance of the current edge to the target node.

[0050] Generated neighbor messages It integrates source node features, time-aware relationship embedding, and dynamic weights:

[0051] Finally, utilizing multi-head attention mechanisms Aggregating neighbor messages To the target node The updated features are obtained. The multi-head mechanism enhances the model's ability to capture different interaction patterns, thereby enabling accurate modeling of complex and dynamic relationships.

[0052] This step aims to achieve fine-grained, adaptive aggregation of neighbor information. A dynamic weight generator integrates source node features, time-aware relation embeddings, and temporal masks to calculate a weight for each edge that reflects its current importance. Subsequently, a multi-head attention mechanism aggregates weighted neighbor messages, enabling the model to capture diverse interactions of the same entity in different contexts or relational patterns. This achieves accurate modeling of complex, dynamic topological evolution, overcoming the shortcomings of traditional static graph convolutional networks in dynamic relation awareness.

[0053] Step 3, Spatiotemporal decoupling dynamic modeling: The structure of the two-stream constant differential equation module is as follows: Figure 2 As shown, its overall form is .

[0054] Spatial flow is used to model transient structural changes or local structural evolution. It uses a function with GELU activation. Feedforward neural network implementation:

[0055] This stream will hide the representation. Mapping to a higher dimension and then back to the original dimension captures topological evolution information.

[0056] Time-streaming is used to model long-term global patterns or global temporal evolution. Considering the longevity and positive nature of time dependencies, the stream employs the Softplus activation function. :

[0057] The Softplus function, as a smooth ReLU variant, helps to introduce nonlinearity and avoid gradient vanishing, making it particularly suitable for modeling long-term time dependencies.

[0058] This step is the core embodiment of the spatiotemporal decoupling concept. By explicitly decoupling the derivatives of the hidden states into spatial and temporal flows, the model can independently characterize two dynamics: the spatial flow focuses on capturing instantaneous structural changes caused by local events or interactions (using GELU activation), while the temporal flow models the long-term, smooth global evolutionary trends of entities and relationships over time (using Softplus activation). This decoupling design fundamentally solves the problem of spatiotemporal coupling, enabling the model to distinguish and represent multi-scale evolutionary patterns with fine detail.

[0059] Step 4, Adaptive Fusion and Integration: To adaptively balance the contributions of spatial and temporal dynamics to the overall evolution, this invention designs an adaptive fusion gate. It consists of a linear layer and a Sigmoid activation function. composition:

[0060] Ultimately, the differential equation is represented by a weighted sum of two decoupled dynamics, where It is element-wise multiplication:

[0061] This decoupling and adaptive weighting mechanism enables a refined representation of different evolution speeds, solving the problem of rigid coupling in traditional ODEs.

[0062] The ODE solver then integrates the differential equation from the initial time. Evolution to prediction time To obtain the final evolutionary embedding. :

[0063] The adaptive fusion gate dynamically balances the relative contributions of spatial and temporal dynamics to the entity's state evolution at a specific moment. By weighted fusion of the decoupled two streams, the model can flexibly adapt to differences in evolution rates among different entities or at different times. Subsequently, the ODE solver integrates the differential equation, achieving continuous and smooth state evolution from the initial observation time to any future prediction time, which is crucial for continuous-time prediction.

[0064] Step 5: Causal comparison learning: In a time-series knowledge graph, timestamps It may simultaneously affect the entity state. and relationship strength This becomes a confounding variable. To eliminate... To address the non-causal effects, this invention approximates causal intervention through a negative sampling strategy. 1. This mechanism aims to force the model to learn true causal relationships based on entity-relation semantics, rather than relying on time. The false co-occurrence association.

[0065] The causal contrast learning strategy process of this invention is as follows: Figure 3 As shown, first use the projection head The generated embedding Mapping to a task-related contrast space to separate redundant information and enhance discriminative features:

[0066] Subsequently, the contrast loss was calculated. :

[0067] in and These are the projection vectors of the positive and negative samples, respectively. Temperature coefficient. Used to control the intensity of contrastive learning and the sharpness of the similarity distribution.

[0068] The causal contrastive learning step aims to improve the model's robustness to temporal confounding variables, directly addressing the problem of spurious associations. By intervening in timestamps (e.g., time negative sampling) to generate counterfactual samples and optimizing them using contrastive loss, the model is forced to learn and reinforce causal associations between entities and relationships based on true semantics, rather than simple co-occurrence with timestamps. This enhances the model's generalization ability and causal discrimination ability when faced with temporal distribution shifts, and is a key mechanism for achieving robustness improvement.

[0069] Step 6, Fourier Time Coding and Prediction: To effectively capture continuous dynamic patterns, query time Learnable frequencies High-dimensional feature encoding using Fourier basis functions:

[0070] This encoding method allows the model to adaptively adjust the time resolution through adjustable frequency parameters, constructing a continuous and smooth time-domain representation, effectively avoiding the step effect that may be caused by traditional discrete encoding.

[0071] This invention employs a three-stage linear transform decoder for prediction. The decoder incorporates head entity embeddings. Relational embedding and Fourier time coding And activated by the GELU function Perform nonlinear mapping to ultimately output the target entity. Predicted probability:

[0072] Fourier temporal encoding maps continuous query time to high-dimensional features. Its learnable frequency parameters allow the model to adaptively capture dynamic patterns of different periods or frequencies, constructing a continuous and smooth temporal representation. This avoids the information loss and step effect that may be introduced by discrete-time encoding. Finally, the decoder fuses the evolved entity embedding and relation embedding with this continuous temporal encoding, and calculates the probability of the target entity's existence at any consecutive future time point through nonlinear transformation, thereby completing the link prediction task.

[0073] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. 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. A temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning, characterized in that, The method for continuous-time prediction of the evolution of relationships between entities in a dynamic knowledge graph includes the following steps: Receive time-series knowledge graph snapshot The hidden representations of entities and relationships are computed through the convolutional network layers of the dynamic relationship-aware graph. ; Based on relative time interval Generate time mask Dynamically modulate the relation embedding to obtain time-aware relation embedding; The source node features, time-aware relationship embedding, and time mask are fused by a dynamic weight generator, and neighbor information is aggregated by a multi-head attention mechanism. The derivative of the hidden state Decoupling into space dynamics and time dynamics They modeled local structural changes and global temporal evolution respectively; Through adaptive fusion gate The weights of spatial dynamics and temporal dynamics are dynamically calculated and fused according to the following differential equation: The predicted time is obtained by integration using an ordinary differential equation solver. Evolutionary Embedding ; During training, a causal contrastive learning strategy is employed, which approximates the intervention on timestamps through a time negative sampling mechanism. Generate counterfactual samples and combine them with contrastive loss to optimize the model; Using Fourier basis functions with learnable frequencies to measure query time Continuous encoding is performed, and evolutionary embedding, relational embedding and temporal encoding are fused together. Then, the prediction score of the target entity is calculated by the decoder.

2. The temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning according to claim 1, characterized in that, Time-aware relation embedding is calculated using the following formula: Calculate the relative time interval in For the target node timestamp, The timestamp of the edge occurrence. The attenuation coefficient is a learnable factor. To prevent the minimum value when divided by zero; Generate time mask in Use the Sigmoid activation function; Obtaining time-aware relationship embeddings in For relational embedding matrix, This represents element-wise multiplication.

3. A temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning according to claim 1 or 2, characterized in that, The dynamic weight generator is implemented using the following formula: Dynamic weights in It is the ReLU activation function. Features of the source node , For learnable weight matrix, , For bias terms; Generate neighbor messages Used to indicate the importance of the current edge to the target node.

4. The temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning according to claim 1, characterized in that, Spatiotemporal decoupling dynamic modeling is implemented through a dual-flows-god ordinary differential equation module, the overall form of which is: Among them, space dynamics Modeling instantaneous structural changes, time dynamics Model the global time evolution.

5. The temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning according to claim 4, characterized in that, Space dynamics is implemented using a feedforward neural network: in For GELU activation function, , This is a learnable weight matrix.

6. A temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning according to claim 4 or 5, characterized in that, Time dynamics is achieved through the following formula: in This is the Softplus activation function. , This is a learnable weight matrix.

7. The temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning according to claim 4, characterized in that, The adaptive fusion gate γ is calculated using the following formula: in For learnable weight matrix, This indicates a feature splicing operation.

8. The temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning according to claim 7, characterized in that, The ordinary differential equation solver performs the following integration operation: From the initial time Evolution to prediction time This allows for continuous and smooth state evolution.

9. The temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning according to claim 1, characterized in that, Causal contrastive learning strategies include: Using a projection head Embed Mapped to contrast space, where , These are learnable parameters; Calculate contrast loss in For positive sample projection vectors, The negative sample projection vector. / For similarity function, ∈(0,1) is the temperature coefficient.

10. The temporal knowledge graph link prediction method based on spatiotemporal decoupling causal reasoning according to claim 1, characterized in that, Fourier time coding is implemented using the following formula: in For learnable frequency parameters, For encoding dimensions.