Hybrid decoupling model construction method, device and equipment for dynamic graph distribution external generalization
By dynamically adjusting the model architecture through a hybrid decoupled model that incorporates a spatiotemporal distribution detector and an expert network, the problem of distribution offset in dynamic graphs is solved, thereby improving generalization ability and prediction stability in out-of-distribution scenarios.
Patent Information
- Application Number
- CN202511754099.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-03-06
AI Technical Summary
Existing technologies struggle to adapt to continuously changing distribution shifts in dynamic graphs, leading to a decline in the model's generalization ability in out-of-distribution scenarios and an inability to maintain stable prediction performance.
The spatiotemporal distribution detector in the hybrid decoupled model generates node routing vectors, and the prototype vectors and similarity of the expert network are used to determine the expert weights. Weighted aggregation and intervention node embedding are then performed, and invariant pattern embeddings are learned for prediction.
It achieves adaptive adjustment of model architecture, improves generalization ability and prediction stability in out-of-distribution scenarios, can capture and understand complex distribution changes in data more precisely, and improves decision reliability.
Smart Images

Figure CN121614933A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of graph processing technology, and in particular to a method, apparatus and device for constructing a hybrid decoupling model for the externalization of dynamic graph distributions. Background Technology
[0002] Dynamic graph neural networks (DNNs), as an important branch of graph representation learning, have attracted widespread attention in temporal scenarios such as social network analysis and recommender systems because they can simultaneously capture graph structure evolution and temporal dependencies. Related techniques typically employ a fixed network architecture to learn and extract generalizable invariant patterns from dynamic graph data.
[0003] However, real-world dynamic graphs often suffer from complex and continuously evolving distribution shifts, meaning the data distribution changes unpredictably over time. This dynamic change results in training and testing data being under different distributions, causing fixed-architecture models to exhibit significant limitations due to their lack of adaptive mechanisms. Fixed-architecture models cannot perceive or adapt to the continuous evolution of data distributions, making it difficult to maintain stable predictive performance in out-of-distribution scenarios, and significantly reducing model generalization ability. Therefore, how to enable models to dynamically adapt to constantly changing distributions has become a pressing technical challenge in this field. Summary of the Invention
[0004] In view of the above problems, embodiments of this application provide a method, apparatus and device for constructing a hybrid decoupling model for outward generalization of dynamic graph distributions, so as to overcome the above problems or at least partially solve the above problems.
[0005] A first aspect of this application discloses a method for constructing a hybrid decoupling model for outgeneralization of dynamic graph distributions, the method comprising: The graph structure data is input into the hybrid decoupling model to be trained, and the spatiotemporal distribution detector of the hybrid decoupling model generates a node routing vector that reflects the current distribution shift. The graph structure data is encoded by multiple expert networks of the hybrid decoupling model to obtain the node embedding output by each expert network; wherein, each expert network is associated with a prototype vector for capturing specific variation factors in the graph structure data; Based on the similarity between the node routing vector and the prototype vector, expert weights are determined, and the node embeddings output by multiple expert networks are weighted and aggregated according to the expert weights to obtain the hybrid node embeddings of each node. Based on the expert weights, the distribution to which the nodes belong is identified, and the variable pattern embeddings of nodes in different distributions are used to intervene in the hybrid node embedding of the target node to obtain the intervened node embedding; wherein, the variable pattern embeddings represent the change information in the graph structure data; The hybrid decoupling model is used to learn the invariant pattern embedding in the intervention node embedding to obtain a trained hybrid decoupling model. The trained hybrid decoupling model is used to predict the category of each node in the graph structure data based on the invariant pattern embedding.
[0006] Optionally, the spatiotemporal distribution detector of the hybrid decoupling model generates a node routing vector reflecting the current distribution offset, including: The current vector of a node is obtained from its self-graph trajectory, and the memory vector is obtained from the memory bank; wherein the self-graph trajectory is a subgraph in the graph structure data, and the memory bank includes the memory vector of each node, and the memory vector contains all distribution information up to the current time. The current vector is concatenated with the memory vector, and after a linear transformation, it is input into a graph neural network to generate a node routing vector that reflects the current distribution offset.
[0007] Optionally, the method further includes: The memory vector in the memory bank is updated through a gating mechanism based on the hybrid node embedding; wherein the updated memory vector contains all distribution information of the current time and all time prior to the current time.
[0008] Optionally, the expert network is a graph neural network, and the expert network is one of a graph attention network and a graph convolutional network; the graph structure data includes a node feature matrix and an adjacency matrix; The graph structure data is encoded using multiple expert networks of the hybrid decoupled model to obtain the node embedding output by each expert network, including: By using multiple expert networks to process the node feature matrix and the adjacency matrix based on their own associated prototype vectors, the node embedding output by each expert network is obtained. Among them, the prototype vectors associated by the expert network promote dissimilarity among prototype vectors by minimizing the similarity loss between prototype vectors.
[0009] Optionally, expert weights are determined based on the similarity between the node routing vector and the prototype vector, including: Calculate the similarity score between the node routing vector and the prototype vector; The similarity score is converted into expert weights using a cross-entropy function, wherein the similarity score is positively correlated with the expert weights.
[0010] Optionally, based on the expert weights, the distribution to which the node belongs is identified, and the mixed node embedding of the target node is intervened using the variable pattern embedding of nodes from different distributions to obtain the intervened node embedding, including: For each node, the expert network corresponding to the expert weight with the largest value among all expert weights is determined as the dominant expert network of that node. The dominant expert network is used to identify the distribution to which the node belongs. Each node's hybrid node embedding is decoupled into invariant mode embedding and variable mode embedding. Invariant mode embedding represents the unchanging information in the graph structure data. Select other nodes that have different dominant network experts from the target node, and replace the target node's variable pattern embedding with the variable pattern embedding of the other nodes to obtain the intervention node embedding.
[0011] Optionally, the hybrid node embedding of each node is decoupled into invariant mode embedding and variable mode embedding, including: The hybrid node embedding is mapped to the frequency domain using a fast Fourier transform to obtain the frequency domain embedding; Based on the frequency domain embedding, the invariant mode mask and the variable mode mask are decoupled; The invariant mode mask is transformed back to the original space through inverse fast Fourier transform to obtain the invariant mode embedding; and the variable mode mask is transformed back to the original space through inverse fast Fourier transform to obtain the variable mode embedding.
[0012] Optionally, the invariant pattern embedding in the intervention node embedding is learned using the hybrid decoupling model, including: Based on the intervention node embedding, the invariance loss is calculated; wherein, the invariance loss includes: the variance of the prediction loss of the hybrid decoupled model after the hybrid node embedding of the target node is intervened by the variable pattern embeddings of different other nodes; The similarity loss is calculated based on the similarity between any two prototype vectors. The similarity loss is configured to minimize the similarity between different prototype vectors, so that each expert network captures different mutation factors. Classification prediction is performed based on the invariant pattern embedding of the node to obtain the prediction result, and the task loss is calculated based on the prediction result. The total loss is obtained based on the invariance loss, the similarity loss, and the task loss. The model parameters of the hybrid decoupling model are optimized by minimizing the total loss.
[0013] A second aspect of this application discloses a hybrid decoupling model construction apparatus for dynamic graph distribution extrageneralization, the apparatus comprising: The generation module is used to input graph structure data into the hybrid decoupled model to be trained, and generate node routing vectors that reflect the current distribution shift through the spatiotemporal distribution detector of the hybrid decoupled model; The encoding module is used to encode the graph structure data through multiple expert networks of the hybrid decoupled model to obtain the node embedding output by each expert network; wherein, each expert network is associated with a prototype vector for capturing specific variation factors in the graph structure data; An aggregation module is used to determine expert weights based on the similarity between the node routing vector and the prototype vector, and to perform weighted aggregation of the node embeddings output by multiple expert networks based on the expert weights to obtain the hybrid node embeddings of each node. An intervention module is used to identify the distribution to which a node belongs based on the expert weights, and to intervene in the hybrid node embedding of the target node using the variable pattern embedding of nodes in different distributions, thereby obtaining the intervention node embedding; wherein, the variable pattern embedding represents the change information in the graph structure data; The learning module is used to learn the invariant pattern embedding in the intervention node embedding using the hybrid decoupling model, so as to obtain a trained hybrid decoupling model. The trained hybrid decoupling model is used to predict the category of each node in the graph structure data based on the invariant pattern embedding.
[0014] A third aspect of this application discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the hybrid decoupling model construction method for dynamic graph distribution extrageneralization described in the first aspect of this application.
[0015] A fourth aspect of this application discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the hybrid decoupling model construction method for dynamic graph distribution extrapolation described in the first aspect of this application.
[0016] A fifth aspect of this application discloses a computer program product, including a computer program that, when executed by a processor, implements the steps of the hybrid decoupling model construction method for dynamic graph distribution extrapolation described in the first aspect of this application.
[0017] The embodiments of this application have the following advantages: In this embodiment, a spatiotemporal distribution detector generates node routing vectors reflecting the current distribution offset in real time. Based on the similarity between these vectors and the prototype vectors of each expert network, expert weights are dynamically determined, enabling adaptive adjustment of the model architecture. This allows the hybrid decoupled model to flexibly combine and utilize different expert networks according to the actual data distribution, thereby overcoming the limitations of traditional fixed-architecture models and significantly improving generalization ability and prediction stability in out-of-distribution scenarios.
[0018] Furthermore, by assigning a learnable prototype vector to each expert network to capture specific variation factors, and by guiding different nodes to the corresponding experts based on a routing mechanism, each expert network is encouraged to professionally learn different types of variation patterns in the data. This enables the model to capture and understand complex distribution changes in the data more precisely and comprehensively, laying a solid foundation for subsequent adaptive aggregation and effective intervention.
[0019] This method innovatively introduces a distribution-aware intervention mechanism, which identifies the distribution to which a node belongs based on expert weights and proactively intervenes in the target node using variable pattern embeddings from nodes in different distributions. This process forces the model to make accurate predictions even in changing environments (i.e., when variable pattern embeddings are replaced), effectively driving the hybrid decoupling model to remove spurious correlation features unrelated to causality, focusing on and learning highly robust invariant pattern embeddings, and fundamentally improving the decision reliability of the hybrid decoupling model under unknown distributions.
[0020] Thus, this method, through its deep integration of adaptive architecture, decoupled learning, and active intervention, effectively overcomes the performance degradation of fixed architecture models under dynamic distribution shifts, providing an innovative and efficient solution for achieving high-performance and robust dynamic graph learning. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart illustrating the steps of a hybrid decoupling model construction method for outward generalization of dynamic graph distributions provided in an embodiment of this application. Figure 2 This is an overall architecture diagram of a hybrid decoupling model construction method for dynamic graph distribution extrapolation provided in an embodiment of this application; Figure 3 This is a schematic diagram of a hybrid decoupling model construction device for dynamic graph distribution extrapolation provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0023] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the technical solutions in 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. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] Dynamic graph representation learning under distribution shifts has attracted widespread attention in time-series scenarios such as social network analysis and recommender systems due to its broad applicability in real-world applications. Related techniques typically employ fixed architecture designs to extract invariant patterns. However, dynamic graphs may exhibit constantly evolving distribution shifts, leading to suboptimal performance of fixed architecture designs.
[0025] To overcome the limitations of related technologies, embodiments of this application provide a method, apparatus, and device for constructing a hybrid decoupled model for dynamic graph distribution extrapolation. By adopting a novel dynamic graph adaptive architecture design to cope with the ever-changing distribution offset over time, the prediction performance of the dynamic graph model under distribution offset can be significantly improved.
[0026] Reference Figure 1 As shown, Figure 1 This is a flowchart illustrating the steps of a hybrid decoupling model construction method for outward generalization of dynamic graph distributions provided in an embodiment of this application. Figure 1 As shown, the method for constructing a hybrid decoupling model for outgeneralization of dynamic graph distributions may include steps S110 to S150: Step S110: Input the graph structure data into the hybrid decoupling model to be trained, and generate a node routing vector reflecting the current distribution shift through the spatiotemporal distribution detector of the hybrid decoupling model.
[0027] Graph structure data consists of nodes and edges that evolve over time, and can be represented as a time-series graph snapshot. , Let be the node feature matrix at time t. Let be the adjacency matrix at time t; the graph structure data can be a molecular graph, a social network graph, a transportation network graph, a financial network graph, etc., and this embodiment does not limit this.
[0028] In this embodiment, graph structure data is used as training samples to train the hybrid decoupling model, enabling the trained model to make accurate predictions in generalization scenarios. To infer specific distribution shifts in the context of constantly evolving distribution changes, a spatiotemporal distribution detector is used to process the graph structure data. This detector infers the constantly changing distribution shifts based on historical and current information, thereby generating node routing vectors that reflect the current distribution shifts.
[0029] Specifically, the spatiotemporal distribution detector uses a graph neural network (e.g., GAT (Graph Attention Network) or GCN (Graph Convolutional Network)) to generate a node routing vector for each node, which captures the distribution characteristics of the node at the current time.
[0030] Step S120: Encode the graph structure data through multiple expert networks of the hybrid decoupling model to obtain the node embedding output by each expert network; wherein, each expert network is associated with a prototype vector for capturing specific variation factors in the graph structure data.
[0031] The hybrid decoupled model comprises multiple independent expert networks, each of which can be a GAT or GCN. Each expert network is associated with a learnable prototype vector to capture specific variability factors (such as structural or feature variations) in the graph-structured data. By encoding the graph-structured data into each expert network separately, the node embeddings output by each expert network are obtained.
[0032] Step S130: Determine expert weights based on the similarity between the node routing vector and the prototype vector, and perform weighted aggregation on the node embeddings output by multiple expert networks based on the expert weights to obtain the hybrid node embeddings of each node.
[0033] In this embodiment, to ensure that the expert routing aligns with the underlying distribution, expert weights are determined based on the similarity between the node routing vector and the prototype vector. The more similar a node routing vector is to the prototype vector of the expert network, the higher the weight of that expert network. Then, the node embeddings output by multiple expert networks are weighted and summed according to the expert weights to generate a hybrid node embedding for each node. This achieves the effect of adaptively selecting expert combinations based on distribution characteristics.
[0034] Step S140: Identify the distribution to which the node belongs based on the expert weights, and intervene in the hybrid node embedding of the target node using the variable pattern embedding of nodes in different distributions to obtain the intervened node embedding; wherein, the variable pattern embedding represents the change information in the graph structure data.
[0035] In this embodiment, considering that some nodes may be inefficient when they have already been intervened by other nodes from the same distribution, effective distribution-aware intervention is needed. Therefore, to perform effective intervention on nodes, it is first necessary to quantitatively identify which distribution each node belongs to. This embodiment utilizes the expert weights obtained in step S130 to identify nodes from different distributions; that is, it selects the expert network with the largest expert weight as the dominant expert for that node, and considers nodes with the same dominant expert as belonging to the same distribution. Finally, intervention is performed using nodes sampled from different distributions.
[0036] The hybrid node embedding includes variable-mode embeddings (feature components sensitive to distribution changes) and invariant-mode embeddings (i.e., feature components stable across distributions). Candidate nodes are sampled from nodes of different distributions, and their variable-mode embeddings replace the corresponding parts of the target node to construct the intervention node embedding. In other words, the intervention node embedding includes the invariant-mode embedding of the original hybrid node embedding, as well as variable-mode embeddings from nodes of other different distributions.
[0037] Understandably, for each target node, the hybrid node embedding of the target node can be intervened using multiple variable pattern embeddings from nodes with different distributions to construct multiple intervened node embeddings; thus, subsequent operations can be based on these multiple intervened node embeddings. Step S150: Use the hybrid decoupling model to learn the invariant pattern embedding in the intervention node embedding to obtain the trained hybrid decoupling model. The trained hybrid decoupling model is used to predict the category of each node in the graph structure data based on the invariant pattern embedding.
[0038] In this embodiment, intervention node embeddings are used to learn invariant pattern embeddings, and the model parameters of the hybrid decoupling model are optimized by minimizing the loss. In some embodiments, invariant loss (encouraging the hybrid decoupling model to maintain predictive consistency after intervention) and task loss (encouraging the model to achieve accurate node predictions based on invariant pattern embeddings) are calculated through intervention node embeddings. At the same time, similarity loss between prototype vectors (promoting dissimilarity between prototype vectors) is combined to jointly optimize the hybrid decoupling model.
[0039] After training, invariant pattern embeddings extract invariant pattern embeddings from the input dynamic graph data (graph structure data), and perform node class prediction based on these stable invariant pattern embeddings. During the inference phase, the invariant pattern embeddings directly use the trained parameters to classify nodes in new dynamic graph data.
[0040] The technical solution adopted in this application generates node routing vectors reflecting the current distribution shift in real time through a spatiotemporal distribution detector. Based on the similarity between these vectors and the prototype vectors of each expert network, expert weights are dynamically determined, achieving adaptive adjustment of the model architecture. This allows the hybrid decoupled model to flexibly combine and utilize different expert networks according to the actual data distribution, thereby overcoming the limitations of traditional fixed-architecture models and significantly improving generalization ability and prediction stability in out-of-distribution scenarios. Furthermore, by assigning a learnable prototype vector to each expert network to capture specific variation factors and guiding different nodes to corresponding experts based on a routing mechanism, each expert network is encouraged to professionally learn different types of change patterns in the data. This enables the model to capture and understand complex distribution changes in the data more precisely and comprehensively, laying a solid foundation for subsequent adaptive aggregation and effective intervention.
[0041] This method innovatively introduces a distribution-aware intervention mechanism, identifying the distribution to which a node belongs based on expert weights and proactively intervening in the target node using variable pattern embeddings from nodes in different distributions. This process forces the model to make accurate predictions even in changing environments (i.e., when variable pattern embeddings are replaced), effectively driving the hybrid decoupled model to remove spurious correlation features unrelated to causality, focusing on and learning highly robust invariant pattern embeddings, fundamentally improving the decision reliability of the hybrid decoupled model under unknown distributions. Thus, through its deep integration of adaptive architecture, decoupled learning, and proactive intervention, this method effectively overcomes the performance degradation of fixed-architecture models under dynamic distribution shifts, providing an innovative and efficient solution for achieving high-performance, highly robust dynamic graph learning.
[0042] In an optional embodiment, step S110 above, "generating a node routing vector reflecting the current distribution offset through the spatiotemporal distribution detector of the hybrid decoupling model," specifically includes: Step S110-1: Obtain the current vector of the node from the self-graph trajectory of the node, and obtain the memory vector from the memory bank; wherein, the self-graph trajectory is a subgraph in the graph structure data, and the memory bank includes the memory vector of each node, and the memory vector contains all distribution information before the current time. Step S110-2: Concatenate the current vector with the memory vector, and input the result into the graph neural network after linear transformation to generate a node routing vector that reflects the current distribution offset.
[0043] In this embodiment of the application, for each node v in the graph structure data at time step t, its autograph trajectory is extracted from the graph structure data. A self-graph trajectory is a local subgraph centered at node v, defined as:
[0044] in, , , It includes node v itself and all its first-order neighbor nodes at time t; It includes the edges associated with these nodes. In other words, the self-graph trajectory encodes the local structure and feature information of node v at the current moment, and is the basis for generating its current vector.
[0045] To infer distributions from historical information, a global memory is maintained. This is used to store the historical distribution information of all nodes (i.e., all distribution information of each node before the current time). The memory can be represented as a matrix or a set of vectors. For example, for each node v, its memory vector... It contains refined distribution information accumulated from historical time 1 to time t-1.
[0046] The process of generating node routing vectors is as follows: First, execute step S110-1, from the node's self-graph trajectory In the process, a shallow graph neural network (GNN) is used for initial encoding to extract the current vector of node v, which focuses on the node's current local environment; simultaneously, the historical memory vector of node v at the previous time step is read from the memory bank M. .
[0047] Next, step S110-2 is executed, concatenating the obtained current vector with the memory vector to form a comprehensive feature vector. This feature vector is then input into the graph neural network after a linear transformation to generate a node routing vector reflecting the current distribution shift. For example, the node routing vector... It can be represented as:
[0048] in, This represents a graph neural network. It is the combined feature of node v at time t. The dimension representing the initial node features. The first line represents a node-by-node concatenation operation, while Linear(·) is a linear transformation used to map the concatenated feature vectors back to their original form. The input dimension.
[0049] The node routing vector corresponding to each node in the graph structure data is generated according to the method in steps S110-1 to S110-2. The generated node routing vector is represented as follows: A node routing vector is a low-dimensional, dense representation that integrates the node's immediate environment with its long-term distribution evolution history, accurately reflecting the current distribution offset.
[0050] Furthermore, after step S130, the method may further include: The memory vector in the memory bank is updated through a gating mechanism based on the hybrid node embedding; wherein the updated memory vector contains all distribution information of the current time and all time prior to the current time.
[0051] In this embodiment of the application, after obtaining the hybrid node embedding of each node in step S130, the memory can be updated through a gating mechanism, namely: based on the hybrid node embedding... To selectively update the memory vector This ensures that historical information can evolve adaptively.
[0052] For example, the updated memory vector is represented as:
[0053] in, This represents element-wise multiplication. It is a gating vector used to control the rate at which the memory is updated, and That is the Sigmoid function. (·) is a linear transformation. Initially, the memory vector is... By setting it as a zero vector, this mechanism allows the memory vector to adaptively incorporate new information while preserving relevant historical context, thus enabling routing vectors to... Infer the current distribution trend from current and past information.
[0054] The technical solution adopted in this application no longer views the distribution statically, but dynamically captures the evolution trend of the distribution by fusing current and historical information. Furthermore, the current vector provides an instantaneous snapshot of the distribution, while the memory vector provides the evolutionary context of the distribution; the combination of the two makes the inference of the routing vector more accurate and robust.
[0055] In an optional embodiment, the expert network is a graph neural network, and the expert network is one of a graph attention network and a graph convolutional network; the graph structure data includes a node feature matrix and an adjacency matrix; the step S120 above, "encoding the graph structure data through multiple expert networks of the hybrid decoupling model to obtain the node embedding output by each expert network", may specifically include: Multiple expert networks process the node feature matrix and the adjacency matrix based on their own associated prototype vectors to obtain the node embedding output by each expert network. The prototype vectors associated by the expert networks are designed to minimize the similarity loss between prototype vectors to promote dissimilarity among them.
[0056] In this embodiment, the multiple expert networks in the hybrid decoupling model can be of the same type of graph neural network (e.g., all expert networks are GAT, or all expert networks are GCN), or they can be a mixture of different types of graph neural networks (e.g., some expert networks are GAT, and some expert networks are GCN); if there are K expert networks, it can be represented as .
[0057] Each expert network is associated with a learnable prototype vector. Each prototype vector is designed to capture and characterize a unique, potential variability factor (e.g., a specific pattern of structural evolution) in the graph data. To enable each expert network to focus on different variability factors and prevent all expert networks from converging to the same pattern, embodiments of this application promote decoupling between prototype vectors by minimizing the similarity loss between prototype vectors.
[0058] Graph-structured data is represented as a graph snapshot at each time step t, which specifically includes a point feature matrix. and adjacency matrix (Used to represent the connection relationship between nodes). Specifically, the node feature matrix and adjacency matrix at the same time step t are input into each expert network in parallel. Each expert network independently encodes the node feature matrix and adjacency matrix based on its own associated prototype vector, thereby obtaining the node embedding output by each expert network.
[0059] For example, the node embeddings output by expert network k can be represented as:
[0060] in, This represents the node embedding generated by expert network k at time t. This represents the node embedding of node v generated by expert network k at time t.
[0061] The technical solution adopted in this application employs graph neural networks such as GAT and GCN as expert networks, allowing them to process data independently, thus ensuring that each expert can develop unique graph data encoding capabilities. By introducing and minimizing prototype similarity loss, the model is explicitly guided to learn a diverse set of decoupled prototype vectors, avoiding redundancy in the functions of the expert network and enabling each expert to more accurately correspond to a specific distribution offset factor.
[0062] In an optional embodiment, step S130 above, "determining expert weights based on the similarity between the node routing vector and the prototype vector," may include: Step S130-1: Calculate the similarity score between the node routing vector and the prototype vector; Step S130-2: Convert the similarity score into expert weights using the cross-entropy function, wherein the similarity score is positively correlated with the expert weights.
[0063] In this embodiment of the application, for a given node routing vector Calculate its relationship with each prototype vector. Similarity score between This similarity score quantifies the degree of matching between the current distribution state of a node and the mutation patterns that experts are good at.
[0064] For example, the similarity score can be calculated using the dot product operation, i.e.:
[0065] in, This represents the dot product of the node routing vector and the prototype vector. The larger the value, the higher the degree of alignment between the two in the direction, i.e., the more similar they are. It is the L2 norm of the prototype vector, used to normalize the dot product result to reduce the influence of vector magnitude on similarity comparison.
[0066] Therefore, the similarity score is converted into expert weights using the cross-entropy function. ,Right now:
[0067] The similarity score is positively correlated with the expert weight. The more similar an expert's prototype vector is to the node's routing vector, the higher its corresponding similarity score will be, and a higher similarity score will be mapped to a higher expert weight. Conversely, expert networks with low similarity will be assigned lower expert weights.
[0068] Ultimately, the hybrid node embedding for each node v It can be represented as:
[0069] Hybrid node embedding of all nodes T represents the duration of time. Represents a set of nodes. To hide the dimension.
[0070] By employing the technical solution of this application embodiment, the hybrid decoupling model can automatically and dynamically allocate the expert network to the most suitable node based on the real-time distribution status of the nodes, achieving a "data-driven" adaptive architecture. The magnitude of the expert weight directly reflects the correlation between the expert and the node distribution, ensuring that the most "professionally relevant" expert network contributes the most to the hybrid node embedding, thus enhancing the interpretability of the model.
[0071] In an optional embodiment, step S140 above, "identifying the distribution to which the node belongs based on the expert weights, and intervening in the hybrid node embedding of the target node using the variable pattern embedding of nodes from different distributions to obtain the intervened node embedding," specifically includes steps S140-1 to S140-3: Step S140-1: For each node, the expert network corresponding to the expert weight with the largest value among all expert weights is determined as the dominant expert network of that node. The dominant expert network is used to identify the distribution to which the node belongs.
[0072] In this embodiment, to effectively intervene in the distribution of nodes, it is first necessary to quantitatively identify which distribution each node belongs to. Since the expert network is distributed across nodes based on its underlying nodes, a significant difference in the dominant expert between two nodes strongly suggests that they follow different distributions. The distribution of each node can be identified by expert weights. That is, for each node at time step t, its expert weights corresponding to multiple expert networks have been calculated using the aforementioned method. The expert weight with the largest value is selected, and the expert network corresponding to this weight is determined as the dominant expert network of that node at that moment.
[0073] The dominant expert network is the expert that best "matches" or is most "professional" with the current distribution state of node v. Therefore, the dominant expert network is used as the distribution identifier for that node. If two nodes have different dominant experts at the same time step, it is considered that these two nodes may come from different data distributions.
[0074] Step S140-2: Decouple the hybrid node embedding of each node into invariant mode embedding and variable mode embedding. Invariant mode embedding represents the unchanging information in the graph structure data.
[0075] In this embodiment, to enable effective intervention, it is necessary to separate the stable and invariant parts of the hybrid node embedding from the parts that vary with the distribution. Therefore, the hybrid node embedding of each node is decoupled into invariant mode embedding and variable mode embedding. The invariant mode embedding represents the unchanging information in the graph structure data; that is, this embedding aims to capture the semantic or structural information in the graph structure data that remains stable and unchanged across different distributions, and is the ideal basis for the final prediction. The variable mode embedding represents the changing information in the graph structure data; that is, this embedding aims to capture the information in the graph structure data that changes with the distribution shift. This information may be spurious correlation features that cause the model's performance to degrade in OOD scenarios.
[0076] In some embodiments, the hybrid node embedding of each node is decoupled into invariant mode embedding and variable mode embedding, including: Step S140-2-1: Map the hybrid node embedding to the frequency domain using a fast Fourier transform to obtain the frequency domain embedding.
[0077] In this embodiment, to incorporate spectral information, a Fast Fourier Transform (FFT) is applied to embed the hybrid nodes into the frequency domain, resulting in frequency domain embedding; wherein, frequency domain embedding includes real part embedding. and imaginary part embedding ,Right now:
[0078]
[0079] Step S140-2-2: Decouple the invariant mode mask and the variable mode mask according to the frequency domain embedding.
[0080] In this embodiment, an invariant mode mask and a variable mode mask are learned and generated from frequency domain embedding using a multilayer perceptron and a sigmoid function. For example, the invariant mode mask... and variable mode mask They are represented as follows:
[0081] in, This represents the Sigmoid function, where τ is a temperature hyperparameter, and MLP. It is a multilayer perceptron.
[0082] Step S140-2-3: Transform the invariant mode mask back to the original space through inverse fast Fourier transform to obtain the invariant mode embedding; and transform the variable mode mask back to the original space through inverse fast Fourier transform to obtain the variable mode embedding.
[0083] In this embodiment, the invariant mode embedding is reconstructed by applying the two masks in the frequency domain and performing an inverse fast Fourier transform. and variable pattern embedding ,Right now:
[0084]
[0085] in, This represents the inverse fast Fourier transform, where i is the imaginary unit; , These represent the invariant pattern embedding and the variable pattern embedding of all nodes at all timestamps, respectively.
[0086] Step S140-3: Select other nodes that have different dominant network experts from the target node, and replace the variable pattern embedding of the target node with the variable pattern embedding of the other nodes to obtain the intervention node embedding.
[0087] In this embodiment of the application, in order to ensure that the node is intervened by other nodes from different distributions, the variable pattern embedding of the target node is replaced by sampling the variable pattern embedding of other nodes with different dominant experts, thereby intervening in the node.
[0088] Specifically, at each time step t, the embedding from the invariant pattern A set of nodes u is randomly selected (for example, the dominant expert of node u is...). Then check whether the dominant expert of the target node v is in time with node u. The dominant expert at the time is different; if there is a difference, the variable pattern embedding of the target node v is replaced with the variable pattern embedding of node u.
[0089] This substitution operation can be intuitively understood as combining the "essence" (invariant pattern embedding) of one node with the "variable features" (variable pattern embedding) of another node from a different distribution, thereby creating a new, virtual intervention sample.
[0090] Ultimately, the intervention node embedding is formed by combining the invariant mode embedding of the target node with the variable mode embeddings of other nodes. During subsequent training, the model will make predictions based on this intervention node embedding and calculate the invariance loss, thereby forcing the hybrid decoupled model to learn to ignore the interference from the variable mode embeddings and make robust predictions relying solely on the invariant mode embeddings.
[0091] The technical solution adopted in this application eliminates the need for prior distribution labels, dynamically and softly partitioning node distributions solely through expert weights generated internally by the model. This method is ingenious and adaptive. By explicitly replacing variable pattern embeddings from different distributions, the spurious association between invariant and variable pattern embeddings is directly broken, providing a strong supervisory signal for the model to learn true causal features (invariant pattern embeddings). This intervention mechanism is key to the model's superior performance in out-of-distribution generalization tasks; through data augmentation, it allows the model to encounter and adapt to various possible distribution changes during the training phase.
[0092] In an optional embodiment, step S150 above, "learning the invariant pattern embedding in the intervention node embedding using the hybrid decoupling model," specifically includes sub-steps S150-1 to S150-4: Step S150-1: Calculate the invariance loss based on the intervention node embedding; wherein the invariance loss includes the variance of the prediction loss of the hybrid decoupled model after the hybrid node embedding of the target node is intervened by the variable pattern embeddings of different other nodes.
[0093] In this embodiment, invariance loss is the key to driving the hybrid decoupling model to discover causal invariant patterns. Invariance loss ensures that the predictive performance of the hybrid decoupling model does not fluctuate drastically due to the intervention of variable pattern embedding.
[0094] Invariance loss is defined as the variance of the prediction loss of the hybrid decoupled model after the target node's hybrid node embedding is intervened by the variable pattern embeddings of different other nodes. In other words, by sampling multiple different other nodes to intervene in the target node, the prediction loss of the intervention node embedding is calculated once for each intervention, and the invariance loss is the variance of the loss generated under these different interventions.
[0095] For example, the invariance loss can be expressed as:
[0096] in, It is a classifier based on invariant patterns. This represents the cross-entropy loss, while Then it is an indicator function: when The value is 1 when the invariant is active and 0 otherwise. By minimizing the invariant loss, the classifier's predictions are ensured to be independent of which specific variable pattern embedding is introduced, and decisions are made using only the invariant pattern embedding, thus eliminating spurious associations with the variable pattern embedding.
[0097] Step S150-2: Calculate the similarity loss based on the similarity between any two prototype vectors. The similarity loss is configured to minimize the similarity between different prototype vectors, so that each expert network captures different mutation factors.
[0098] The similarity loss is applied to all prototype vector pairs, by calculating any two different prototype vectors ( and The similarity between the pairs (e.g., cosine similarity) is calculated, and the summation over all dissimilar pairs is used as the similarity loss to be minimized.
[0099] For example, similarity loss It can be represented as:
[0100] Minimizing the similarity loss pushes each prototype vector away from each other in the vector space, thereby prompting each expert network to focus on and capture distinctive and unique variation factors, thus achieving the decoupling and specialization of expert functions.
[0101] Step S150-3: Perform classification prediction based on the invariant pattern embedding of the node to obtain the prediction result, and calculate the task loss based on the prediction result.
[0102] The task loss is used to ensure that the hybrid decoupled model retains its most basic predictive function and is the fundamental guarantee for the performance of the hybrid decoupled model. First, based on the invariant pattern embedding of the nodes (i.e., stable features extracted from the original data without intervention), a classifier (such as a linear layer or MLP) is used to perform classification prediction to obtain the prediction result; then, the task loss is calculated based on the prediction result and the true node label.
[0103] Step S150-4: Based on the invariance loss, the similarity loss, and the task loss, obtain the total loss, and optimize the model parameters of the hybrid decoupling model by minimizing the total loss.
[0104] In this embodiment, the training process of the hybrid decoupling model is a multi-objective optimization process. Its objective is to ensure the performance of the main task while enabling the hybrid decoupling model to extract invariant features robust to distribution shifts and to maintain the diversity of expert functions. The optimization process achieves this by minimizing a comprehensive total loss.
[0105] Of which, total loss It can be represented as:
[0106] in, It is an invariant loss. It is similarity loss. It's a mission loss. and It is a hyperparameter used to balance the importance of the three losses.
[0107] By minimizing the total loss using optimization algorithms such as gradient descent, all model parameters of the hybrid decoupled model can be optimized simultaneously, such as the parameters of each expert network, prototype vectors, parameters of the spatiotemporal distribution detector, and memory.
[0108] The technical solution adopted in this application introduces and minimizes invariance loss, enabling the model prediction to be entirely based on invariant pattern embeddings, while the intervention on variable pattern embeddings from different distributions remains unchanged. This ensures the stability and accuracy of the model's prediction results, thereby achieving excellent out-of-distribution generalization performance. By introducing and minimizing similarity loss, the model is explicitly guided to learn a set of dissimilar, highly differentiated prototype vectors. This mechanism directly ensures that each expert network can focus on capturing and representing a unique variable factor in the data, thus forming a clear functional division of labor. This allows the model to more finely and comprehensively understand and model complex, multimodal dynamic graph distribution shifts.
[0109] like Figure 2 As shown, Figure 2 This is an overall architecture diagram of a hybrid decoupling model construction method for dynamic graph distribution outward generalization provided in this application embodiment. Specifically, the hybrid decoupling model includes a spatiotemporal distribution detector, multiple expert networks, and a distributed perception intervention mechanism. The construction process of this hybrid decoupling model includes: First, the graph-structured data is input into a hybrid decoupled model. The spatiotemporal distribution detector obtains the current vector of each node from its self-graph trajectory and the memory vector from the memory bank. The current vector and the memory vector are concatenated and then input into the graph neural network after a linear transformation to generate a node routing vector reflecting the current distribution shift. Here, the self-graph trajectory is a subgraph in the graph-structured data, and the memory bank includes the memory vector of each node, which contains all distribution information up to the current time step.
[0110] Next, multiple expert networks encode the graph structure data, resulting in node embeddings output by each expert network. Each expert network is associated with a prototype vector used to capture specific variability factors in the graph structure data. Expert weights are determined based on the similarity between the node routing vector and the prototype vector. The node embeddings output by multiple expert networks are then weighted and aggregated according to these expert weights to obtain a mixed node embedding for each node.
[0111] Then, through a distributed perception intervention mechanism, for each node, the expert network corresponding to the expert weight with the largest value among all expert weights is determined as the dominant expert network of that node; the hybrid node embedding of each node is decoupled into invariant mode embedding and variable mode embedding; other nodes with different dominant network experts from the target node are selected, and the variable mode embedding of the target node is replaced by the variable mode embedding of the other nodes to obtain the intervention node embedding.
[0112] Finally, based on the intervention node embeddings, invariance loss is calculated. This invariance loss includes: the variance of the prediction loss of the hybrid decoupling model after intervening with the hybrid node embedding of the target node using variable pattern embeddings of different other nodes; a similarity loss is calculated based on the similarity between any two prototype vectors, configured to minimize the similarity between different prototype vectors to encourage each expert network to capture different variation factors; classification prediction is performed based on the invariant pattern embeddings of the nodes to obtain prediction results, and task loss is calculated based on these results; thus, the total loss is obtained based on the invariance loss, similarity loss, and task loss. By minimizing the total loss, the model parameters of the hybrid decoupling model are optimized. The trained hybrid decoupling model can predict the category of each node in the graph structure data based on the invariant pattern embeddings.
[0113] The technical solution implemented in this application effectively overcomes the performance degradation of fixed architecture models under dynamic distribution shifts through its deep integration of adaptive architecture, decoupled learning, and active intervention, providing an innovative and efficient solution for achieving high-performance and robust dynamic graph learning.
[0114] This application also provides a hybrid decoupling model construction apparatus for dynamic graph distribution extrageneralization, referring to... Figure 3 As shown, Figure 3 This is a schematic diagram of a hybrid decoupling model construction device for dynamic graph distribution extrapolation provided in an embodiment of this application. The device includes: The generation module 310 is used to input graph structure data into the hybrid decoupling model to be trained, and generate node routing vectors reflecting the current distribution shift through the spatiotemporal distribution detector of the hybrid decoupling model; The encoding module 320 is used to encode the graph structure data through multiple expert networks of the hybrid decoupled model to obtain the node embedding output by each expert network; wherein, each expert network is associated with a prototype vector for capturing specific variation factors in the graph structure data; The aggregation module 330 is used to determine expert weights based on the similarity between the node routing vector and the prototype vector, and to perform weighted aggregation on the node embeddings output by multiple expert networks based on the expert weights to obtain the hybrid node embeddings of each node. Intervention module 340 is used to identify the distribution to which a node belongs based on the expert weights, and to intervene in the hybrid node embedding of the target node using the variable pattern embedding of nodes in different distributions, thereby obtaining the intervention node embedding; wherein, the variable pattern embedding represents the change information in the graph structure data; The learning module 350 is used to learn the invariant pattern embedding in the intervention node embedding using the hybrid decoupling model to obtain a trained hybrid decoupling model. The trained hybrid decoupling model is used to predict the category of each node in the graph structure data based on the invariant pattern embedding.
[0115] It is understood that the hybrid decoupling model construction device for dynamic graph distribution extrapolation in the embodiments of this application can implement the hybrid decoupling model construction method for dynamic graph distribution extrapolation in the above embodiments. The hybrid decoupling model construction device for dynamic graph distribution extrapolation has the same advantages as the hybrid decoupling model construction method for dynamic graph distribution extrapolation in the above embodiments compared with the prior art, and will not be repeated here.
[0116] This application also provides an electronic device, see embodiments thereof. Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 4 As shown, the electronic device 400 includes a memory 410 and a processor 420. The memory 410 and the processor 420 are connected via a bus for communication. The memory 410 stores a computer program that can run on the processor 420 to implement the steps of the hybrid decoupling model construction method for dynamic graph distribution extrageneralization described in the embodiments of this application.
[0117] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the hybrid decoupling model construction method for dynamic graph distribution extrapolation described in this application.
[0118] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the hybrid decoupling model construction method for dynamic graph distribution extrageneralization described in this application.
[0119] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0120] This application describes embodiments of methods and apparatus according to flowchart illustrations and / or block diagrams. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0121] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0123] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0124] Finally, it should 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, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0125] The above provides a detailed description of a hybrid decoupling model construction method, apparatus, and device for dynamic graph distribution extrapolation provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for constructing a hybrid decoupling model for outward generalization of dynamic graph distributions, characterized in that, The method comprises the following steps: inputting the graph structure data into a mixed decoupling model to be trained, and generating a node routing vector reflecting the current distribution offset by a spatiotemporal distribution detector of the mixed decoupling model; encoding the graph structure data by a plurality of expert networks of the mixed decoupling model to obtain node embeddings output by each expert network; wherein each expert network is associated with a prototype vector for capturing a specific variation factor in the graph structure data; determining expert weights according to the similarity between the node routing vector and the prototype vector, and weighting and aggregating the node embeddings output by the plurality of expert networks according to the expert weights to obtain mixed node embeddings of each node; identifying the distribution to which a node belongs based on the expert weights, and intervening in the mixed node embeddings of a target node by using variable mode embeddings of nodes in different distributions to obtain intervened node embeddings; wherein the variable mode embeddings represent change information in the graph structure data; learning invariant mode embeddings in the intervened node embeddings by using the mixed decoupling model to obtain a trained mixed decoupling model, and using the trained mixed decoupling model to predict the categories of the nodes in the graph structure data based on the invariant mode embeddings.
2. The method of claim 1, wherein, The method for generating a node routing vector reflecting the current distribution offset by a spatiotemporal distribution detector of the mixed decoupling model comprises the following steps: obtaining a current vector of a node from a self-graph trajectory of the node, and obtaining a memory vector from a memory bank; wherein the self-graph trajectory is a subgraph in the graph structure data, and the memory bank comprises memory vectors of each node, and the memory vectors contain all distribution information before the current time; splicing the current vector and the memory vector, and inputting the spliced vector into a graph neural network after linear transformation to generate a node routing vector reflecting the current distribution offset.
3. The method of claim 2, wherein, The method further comprises the following steps: updating the memory vectors in the memory bank according to the mixed node embeddings by using a gating mechanism; wherein the updated memory vectors contain all distribution information at the current time and before the current time.
4. The method of claim 1, wherein, The expert network is a graph neural network, and the expert network is one of a graph attention network and a graph convolution network; the graph structure data comprises a node feature matrix and an adjacency matrix; The method for encoding the graph structure data by a plurality of expert networks of the mixed decoupling model to obtain node embeddings output by each expert network comprises the following steps: processing the node feature matrix and the adjacency matrix by a plurality of expert networks based on the prototype vectors associated with the expert networks respectively to obtain node embeddings output by each expert network; wherein the prototype vectors associated with the expert networks are obtained by minimizing the similarity loss between the prototype vectors to promote the mutual dissimilarity between the prototype vectors.
5. The method according to claim 1 or 4, characterized in that, The method for determining expert weights according to the similarity between the node routing vector and the prototype vector comprises the following steps: calculating a similarity score between the node routing vector and the prototype vector; converting the similarity score into expert weights by using a cross-entropy function, wherein the similarity score and the expert weights are positively correlated.
6. The method of claim 1, wherein, Intervene a mixed node embedding of the target node based on a distribution to which the expert weight identifying node belongs, and utilize a variable mode embedding of a node of different distribution, to obtain an intervened node embedding, comprising: For each node, determine the expert network corresponding to the expert weight with the maximum value in all expert weights as a dominant expert network of the node, and the dominant expert network is used to identify the distribution to which the node belongs; Decouple the mixed node embedding of each node into an invariant mode embedding and a variable mode embedding, and the invariant mode embedding represents invariable information in the graph structure data; Select other nodes with different dominant network experts from the target node, and replace the variable mode embedding of the target node with the variable mode embedding of the other nodes to obtain the intervened node embedding.
7. The method of claim 6, wherein, Decouple the mixed node embedding of each node into an invariant mode embedding and a variable mode embedding, comprising: Map the mixed node embedding to a frequency domain through a fast Fourier transform to obtain a frequency domain embedding; Decouple an invariant mode mask and a variable mode mask from the frequency domain embedding; Convert the invariant mode mask back to the original space through an inverse fast Fourier transform to obtain the invariant mode embedding, and convert the variable mode mask back to the original space through the inverse fast Fourier transform to obtain the variable mode embedding.
8. The method according to claim 6 or 7, characterized in that, Learn the invariant mode embedding in the intervened node embedding by using the mixed decoupling model, comprising: Calculate an invariance loss based on the intervened node embedding; wherein the invariance loss includes a variance of a prediction loss of the mixed decoupling model after the variable mode embedding of different other nodes intervenes the mixed node embedding of the target node; Calculate a similarity loss according to a similarity between any two prototype vectors, and the similarity loss is configured to minimize the similarity between different prototype vectors to facilitate each expert network to capture different variation factors; Perform classification prediction according to the invariant mode embedding of the node to obtain a prediction result, and calculate a task loss according to the prediction result; Obtain a total loss according to the invariance loss, the similarity loss and the task loss, and optimize model parameters of the mixed decoupling model by minimizing the total loss.
9. A hybrid decoupled model construction device for dynamic graph distribution out-generalization, characterized in that, Comprise: A generation module is configured to input graph structure data into a mixed decoupling model to be trained, and generate a node routing vector reflecting a current distribution offset by a spatio-temporal distribution detector of the mixed decoupling model; An encoding module is configured to encode the graph structure data by a plurality of expert networks of the mixed decoupling model to obtain node embeddings output by each expert network; wherein each expert network is associated with a prototype vector for capturing a specific variation factor in the graph structure data; An aggregation module is configured to determine expert weights according to a similarity between the node routing vector and the prototype vector, and aggregate the node embeddings output by the plurality of expert networks by weighting according to the expert weights to obtain mixed node embeddings of nodes. An intervention module is configured to identify a distribution to which the expert weight identification node belongs based on the expert weight, and intervene in a mixed node embedding of a target node by using a variable pattern embedding of nodes in different distributions to obtain an intervention node embedding; wherein the variable pattern embedding represents change information in the graph structure data; A learning module is configured to learn an invariant pattern embedding in the intervention node embedding by using the mixed decoupling model to obtain a trained mixed decoupling model, wherein the trained mixed decoupling model is configured to predict the category of each node in the graph structure data based on the invariant pattern embedding.
10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method for constructing a mixed decoupling model for dynamic graph out-of-distribution generalization according to any one of claims 1-8.