Multi-task-oriented graph model distribution external prediction method, device and system and medium

By constructing a unified multi-task graph neural network framework, using pre-trained graph models to generate task metadata and perform expert routing, the problems of resource waste and insufficient generalization performance of graph neural networks in multi-task and out-of-distribution data processing are solved, achieving efficient multi-task processing and robust prediction results.

CN121543634APending Publication Date: 2026-02-17GREATER BAY AREA UNIV (IN PREPARATION)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511435272.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-09
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing graph neural network methods suffer from resource waste, knowledge isolation, poor scalability, and difficulty in task identification when dealing with multiple tasks and multiple datasets, especially when facing distributed external graph data with insufficient generalization performance.

Method used

A unified multi-task graph neural network framework is constructed. Task metadata is generated through pre-trained graph models. The graph data is transformed into a unified-dimensional task indicator vector using Laplacian smoothing and singular value decomposition techniques. The expert weight distribution is calculated and routed to the most suitable expert model for inference, thereby achieving automatic task recognition and weighted fusion.

Benefits of technology

It improves computational efficiency and generalization ability, enables adaptive processing of distributional external map data, and enhances the robustness of prediction results and the ability to adapt to new tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121543634A_ABST
    Figure CN121543634A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of graph neural networks, in particular to a multi-task-oriented graph model distribution external prediction method, device and system and a medium, and the method comprises the steps: obtaining a pre-training graph model corresponding to a plurality of tasks, and taking the pre-training graph model as an expert model; generating task metadata of each task, and splicing the metadata of all the tasks to form a complete task metadata set; on the basis of Laplace smoothing and singular value decomposition of graph data, converting the graph data in the task metadata set into task indication vectors with unified dimensions to form a task pool; to-be-tested distribution exterior graph data are converted into query vectors, the similarity between the query vectors and all task indication vectors in the task pool is calculated, and expert weight distribution is calculated based on the similarity; according to expert weight distribution, routing the distribution exterior graph data to a corresponding expert model for reasoning, and obtaining a final prediction result through weighted fusion; according to the invention, self-adaptive processing of the distributed exterior graph data is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of graph neural network technology, and in particular to a method, apparatus, system and medium for out-of-distribution prediction of graph models for multi-task applications. Background Technology

[0002] With the widespread application of graph neural networks in various fields, different tasks and datasets have placed diverse demands on graph neural network models. In practical applications, it is often necessary to process multiple graph datasets from different domains, with different feature dimensions and different numbers of categories. These datasets may involve different task types such as node classification, graph classification, and link prediction.

[0003] Existing graph neural network methods typically adopt a "one model, one task" design pattern, which has the following limitations: (1) Low resource efficiency: Each task requires a separate model to be trained and maintained, resulting in a large waste of computing resources and storage space; (2) Knowledge isolation: Knowledge cannot be effectively shared and transferred between different tasks, which limits the generalization ability of the model; (3) Poor scalability: When a new task appears, the entire model needs to be retrained, and it cannot quickly adapt to the new task requirements; (4) Difficulty in task identification: There is a lack of effective mechanisms to automatically identify which task type the input data belongs to, and task identifiers need to be manually specified.

[0004] In recent years, Mixture of Experts (MoE) networks have offered new insights into solving multi-task learning problems. However, existing MoE methods still face challenges in the field of graph neural networks: (1) Task representation problem: How to effectively represent different graph tasks so that the model can automatically identify the task type; (2) Expert allocation strategy: How to design a reasonable gating mechanism to allocate different tasks to the most suitable expert model; (3) Difficulty in unifying dimensions: Graph data of different tasks may have different feature dimensions and structural characteristics, which are difficult to process under a unified framework.

[0005] Therefore, there is an urgent need for a new technical solution that can build a unified multi-task graph neural network framework to achieve automatic task identification and intelligent routing by experts, thereby improving the efficiency and generalization ability of the model. Summary of the Invention

[0006] In view of this, the purpose of the embodiments of the present invention is to provide a method, apparatus, system and medium for multi-task-oriented graph model distribution out-of-distribution prediction, so as to solve one or more technical problems existing in the prior art and provide at least one beneficial option or create conditions.

[0007] On one hand, embodiments of the present invention provide a method for out-of-distribution prediction of graph models for multi-task applications, the method comprising the following steps: Acquire pre-trained graph models corresponding to multiple tasks and use them as expert models; the tasks include graph structure prediction tasks for different targets or different molecular properties in the field of drug discovery. Generate task metadata for each task, and concatenate the metadata of all tasks to form a complete task metadata dataset; Based on Laplace smoothing and singular value decomposition of graph data, the graph data in the task metadata set is transformed into a task indicator vector with a unified dimension, forming a task pool; The distribution map data to be tested is converted into a query vector, its similarity with the indicator vectors of each task in the task pool is calculated, and the expert weight distribution is calculated based on the similarity. Based on the expert weight distribution, the data from the external distribution map is routed to the corresponding expert model for inference, and the final prediction result is obtained through weighted fusion.

[0008] Optionally, the step of generating task metadata for each task involves concatenating the metadata of all tasks to form a complete task metadata dataset, including: For each pre-trained graph model, a corresponding graph generator is used to generate graph data samples required for a single task, forming the metadata set for that task. The graph data samples include node feature matrices, adjacency matrices, and class labels. The graph generator is optimized based on the task reconstruction loss. The task reconstruction loss includes cross-entropy loss and sample diversity regularization term. The cross-entropy loss is determined based on the predicted labels and corresponding class labels output by each pre-trained graph model, and the sample diversity regularization term is determined based on the sample variance of each metadata set. The graph data samples are categorized according to category labels to form metadata sets for each task. The metadata of all tasks is then combined to form a complete task metadata dataset.

[0009] Optionally, the expression for the task reconstruction loss function is: ; in, For cross-entropy loss, Let represent the prediction function of the i-th pre-trained graph model for the c-th class of graph data sample g. The balancing parameter has a value range of [value range missing]. , This is a sample diversity regularization term.

[0010] Optionally, the expression for the sample diversity regularization term is: ; in, This represents the sample variance.

[0011] Optionally, the Laplace smoothing and singular value decomposition based on graph data transform the graph data in the task metadata set into a unified-dimensional task indicator vector to form a task pool, including: For each graph data sample in the task metadata set, calculate its normalized Laplacian matrix and node feature matrix; Singular value decomposition is performed on the feature matrix. By truncating the singular value decomposition, a feature representation with a unified dimension is obtained. Then, a unified representation of the graph data is calculated, task indicator vectors are constructed, and all task indicator vectors are combined into a task pool.

[0012] Optionally, the step of converting the distribution map data to be tested into a query vector, calculating its similarity to the task indicator vectors in the task pool, and calculating the expert weight distribution based on the similarity includes: The Laplace smoothing process is used to convert the out-of-plot data of the distribution to be tested into a query vector; Calculate the similarity between the query vector and the indicator vectors of each task in the task pool, and calculate the expert weight distribution based on the similarity. The task indicator vectors are sorted according to their similarity, and the task indicator vectors with the highest similarity to the test graph data are selected. The expert weight distribution for each task is obtained by calculating the distribution map data corresponding to the task using the softmax function on multiple task indicator vectors.

[0013] Optionally, the step of routing the out-of-distribution map data to the corresponding expert model for inference based on the expert weight distribution, and obtaining the final prediction result through weighted fusion, includes: Construct a hybrid expert network with pre-trained models as expert models, where each expert model has the same input and output interfaces; Through the expert routing mechanism, the distribution map data is routed to the corresponding expert model for inference based on the expert weights of each expert model. The inference results of each expert model are then weighted and fused to obtain the final prediction result.

[0014] On the other hand, embodiments of the present invention provide a multi-task-oriented graph model distribution out-of-prediction device, comprising: The first module is used to acquire pre-trained graph models corresponding to multiple tasks and use them as expert models; the tasks include graph structure prediction tasks for different targets or different molecular properties in the field of drug discovery. The second module is used to generate task metadata for each task and to combine the metadata of all tasks to form a complete task metadata dataset. The third module is used for Laplace smoothing and singular value decomposition based on graph data, which transforms the graph data in the task metadata set into a unified-dimensional task indicator vector to form a task pool. The fourth module is used to convert the distribution map data to be tested into query vectors, calculate their similarity with the indicator vectors of each task in the task pool, and calculate the expert weight distribution based on the similarity. The fifth module is used to route the external distribution map data to the corresponding expert model for inference based on the expert weight distribution, and obtain the final prediction result through weighted fusion.

[0015] On the other hand, embodiments of the present invention provide a multi-task-oriented graphical model distribution out-of-distribution prediction system, comprising: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.

[0016] On the other hand, embodiments of the present invention provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the above-described method.

[0017] The embodiments of the present invention have the following beneficial effects: This invention discloses a method, apparatus, system, and medium for out-of-distribution prediction of graph models for multiple tasks. By collecting pre-trained graph models from different domains or data types, it provides a diverse knowledge base for subsequent task identification. It employs a graph generator and a task reconstruction loss optimization mechanism to ensure the quality and diversity of task metadata. Using Laplace smoothing and singular value decomposition techniques, it maps heterogeneous graph data to a unified feature space, constructing a comparable task indicator vector pool. By calculating the similarity between query vectors and task indicator vectors, it achieves accurate determination of the task to which the test data belongs. Finally, it performs intelligent routing based on expert weight distribution, ensuring that different task data are processed by the most relevant expert models, and improves the robustness of the prediction results through a weighted fusion mechanism. This invention achieves adaptive processing of out-of-distribution graph data by constructing an expert pool containing multiple pre-trained graph models and utilizing task metadata generation and conversion techniques. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the steps of a multi-task-oriented graph model distribution out-of-distribution prediction method provided in an embodiment of the present invention. Figure 2 This is a structural block diagram of a graph model distributed out-of-prediction device for multi-task applications provided in an embodiment of the present invention. Figure 3 This is a structural block diagram of a multi-task-oriented graphical model distributed out-of-prediction system provided in an embodiment of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0021] It should be noted that although the device diagram shows a modular division and the flowchart illustrates a logical order, in some cases, the steps shown or described may be performed in a different order than the modular division in the device or the order shown in the flowchart. The terms "first," "second," etc., used in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0023] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.

[0024] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0025] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0026] Graph neural networks in related technologies suffer from poor generalization performance when processing out-of-distribution (OOD) graph data. In particular, when faced with multiple different tasks, a separate model needs to be maintained for each task, which cannot achieve knowledge sharing and automatic task identification between tasks, resulting in wasted computing resources and decreased prediction accuracy.

[0027] This invention aims to provide a method, device, system, and medium for out-of-distribution prediction of graph models for multiple tasks. By constructing a unified graph neural network framework, it can automatically identify different graph task types and intelligently route test data to the most suitable expert model, thereby achieving efficient and unified processing of multiple tasks and multiple datasets.

[0028] like Figure 1 As shown, Figure 1 An embodiment of the present invention provides a method for predicting out-of-distribution graph models for multi-task applications, the method comprising the following steps: S100, acquire pre-trained graph models corresponding to multiple tasks and use them as expert models; the tasks include graph structure prediction tasks for different targets or different molecular properties in the field of drug discovery. Specifically, the tasks include graph structure-related tasks in different fields or with different data types, including but not limited to: drug-target interaction prediction tasks based on molecular graph structures, molecular ADMET property (absorption, distribution, metabolism, excretion, and toxicity) prediction tasks, drug-drug interaction prediction tasks, and molecular synthesis feasibility assessment tasks; wherein, the graph data corresponding to different tasks have different node feature dimensions, edge types, and label spaces. For example, in a molecular graph, nodes represent atom types and chemical properties, and edges represent chemical bond types and bond energy information, etc.

[0029] This step prepares the pre-trained graph model and obtains... Pre-trained graphical models on different datasets ,in, Indicates the first The hyperparameters of each model are extracted from task-related knowledge on different datasets. For example, the tasks include: (1) a binary classification prediction task of mutagenicity based on the molecular graph structure dataset MUTAG, wherein the molecular graph node feature dimension is 7-dimensional (including atom type, atom valence state, number of hydrogen atoms, etc.), involving the prediction of mutagenicity of 188 molecular compounds; (2) a blood-brain barrier permeability prediction task based on the drug molecule dataset BACE, involving the quantitative activity prediction of 1513 compound molecules; (3) a protein-ligand binding affinity prediction task based on the biomolecule dataset PDBbind, used to evaluate the binding strength of candidate drug molecules and target proteins; (4) a drug-drug interaction prediction task based on the DrugBank database, used to identify the synergistic or antagonistic effects that may occur when drugs are used in combination. The molecular graphs corresponding to the above tasks have different node feature dimensions (ranging from 7 to 100 dimensions), different average number of nodes (10 to 500 nodes), and different number of categories (binary to multi-class classification), which need to be adaptively processed through the unified framework of this invention. Each model can have different architectures (GCN, GAT, GIN, GraphSAGE, etc.) and hyperparameter configurations.

[0030] It's important to note that a pre-trained graph model is trained on a single task. In each task, the training data has low-dimensional ground truth labels (e.g., categories for classification), which are referred to as categories. One task corresponds to multiple categories in the data. The number of pre-trained graph models is the same as the number of tasks; multiple pre-trained graph models are trained on multiple tasks in a one-to-one correspondence.

[0031] S200 generates task metadata for each task and concatenates the metadata of all tasks to form a complete task metadata dataset. S300, based on Laplace smoothing and singular value decomposition of graph data, transforms graph data in the task metadata set into a unified-dimensional task indicator vector to form a task pool; S400 converts the external distribution map data to be tested into a query vector, calculates its similarity with the indicator vectors of each task in the task pool, and calculates the expert weight distribution based on the similarity. S500 routes the external distribution map data to the corresponding expert model for inference based on the expert weight distribution, and obtains the final prediction result through weighted fusion.

[0032] In steps S100 to S500 of this embodiment of the invention, an expert pool containing multiple pre-trained graph models is constructed, and task metadata generation and conversion techniques are used to achieve adaptive processing of out-of-distribution graph data. Specifically, step S100 collects pre-trained graph models from different domains or data types, providing a diverse knowledge base for subsequent task recognition; step S200 employs a graph generator and task reconstruction loss optimization mechanism to ensure the quality and diversity of task metadata; step S300 uses Laplace smoothing and singular value decomposition techniques to map heterogeneous graph data to a unified feature space, constructing a comparable task indicator vector pool; step S400 calculates the similarity between the query vector and the task indicator vector to achieve accurate judgment of the task to which the test data belongs; finally, step S500 performs intelligent routing based on the expert weight distribution, enabling different task data to be processed by the most relevant expert model, and improves the robustness of the prediction results through a weighted fusion mechanism. This framework effectively solves the problems of insufficient generalization ability and wasted computational resources faced by traditional graph neural networks when processing multi-task out-of-distribution data.

[0033] This invention solves the problem of degradation in the generalization performance of graph neural networks on out-of-distribution data; it realizes a unified inference framework for multi-task graph models, improving computational efficiency; and it enhances the adaptability to unseen task types through automatic task identification and expert routing.

[0034] In some embodiments, generating task metadata for each task and concatenating the metadata of all tasks to form a complete task metadata dataset includes: S210, For each pre-trained graph model, a corresponding graph generator is used to generate graph data samples required for a single task, forming a metadata set for that task; the graph data samples include node feature matrices, adjacency matrices, and class labels; the graph generator is optimized based on task reconstruction loss; the task reconstruction loss includes cross-entropy loss and sample diversity regularization term, the cross-entropy loss is determined based on the predicted labels and corresponding class labels output by each pre-trained graph model, and the sample diversity regularization term is determined based on the sample variance of each metadata set; S220: Classify the graph data samples according to category labels to form a metadata set for each task, and then combine the metadata of all tasks to form a complete task metadata dataset.

[0035] In this embodiment, the node feature matrix is ​​obtained by sampling the node features of the graph data using a standard normal distribution, the adjacency matrix is ​​obtained by modeling the splicing features between nodes using an edge encoder, and the category label represents the task category to which the graph data belongs; specifically, for each pre-trained graph model Construct a graph generator corresponding to its training task. To restore the task metadata distribution, perform the following sub-steps: Node feature generation: Sampling node features from a standard normal distribution ,in To generate the number of nodes, The feature dimension is ; sampling from the standard normal distribution can give node features a certain degree of randomness and generality, which meets the needs of diverse graph data.

[0036] Edge structure generation: via edge encoder Generate adjacency matrix , For nodes in the graph and nodes The weight of the edges connecting them. It is a three-layer fully connected neural network. For any commonly used activation function, such as the ReLU function, express Middle node and nodes The splicing characteristics; based on nodes and nodes splicing features As input, through a fully connected neural network Model the relationships between nodes.

[0037] For each data category in a single task Generate a fixed number of The graph data samples form the metadata set for this task. When At that time, the metadata set can be represented as Each sample The node feature matrix, adjacency matrix, and category label of the sample should be respectively used. This allows the generated node features and edge structures to be combined into a complete graph data sample, which is then organized according to categories to form a task-related metadata set.

[0038] It should be noted that a graph generator can generate all the graph data (containing many categories) needed for a task, and the sample set obtained from multiple graph generators is called the task metadata dataset. The complete task metadata dataset is formed by concatenating the metadata sets of all tasks. ,in The number of tasks; In some embodiments, the expression for the task reconstruction loss function is: ; in, For cross-entropy loss, Let represent the prediction function of the i-th pre-trained graph model for the c-th class of graph data sample g. The balancing parameter has a value range of [value range missing]. , This is a sample diversity regularization term.

[0039] In some embodiments, the expression for the sample diversity regularization term is: ; in, This represents the sample variance.

[0040] Optimize the graph generator described above using task reconstruction loss: (1); in, Cross-entropy loss is used to ensure that the generated graph data can be correctly classified by the corresponding pre-trained graph model; Let represent the prediction function of the i-th pre-trained graph model for the c-th class graph data sample g. This function can be used to obtain the prediction probability distribution of the model for the sample class. This represents the true label of the c-th class graph data sample in the i-th task; The balancing parameter has a value range of [value range missing]. This is used to balance the weight of cross-entropy loss and sample diversity regularization in the task reconstruction loss; This is a sample diversity regularization term used to make the graph data samples generated by the graph generator more evenly distributed in terms of class, avoiding situations where some classes have too many or too few samples, thereby improving the generalization ability and quality of the generated samples. By minimizing the cross-entropy loss, the data generated by the graph generator is made to better conform to the classification requirements of the pre-trained graph model. When optimizing the graph generator, not only the classification accuracy of the generated data is considered, but also the diversity of the data.

[0041] The sample diversity regularization term is defined in the following form: (2); in, This represents the sample variance. The penalty term is applied by maximizing the variance of the generated samples. The distribution of features is obtained, which effectively prevents the graph generator from producing similar duplicate samples and ensures that the metadata within each category has sufficient diversity.

[0042] In some embodiments, the Laplace smoothing and singular value decomposition based on graph data transform the graph data in the task metadata set into a unified-dimensional task indicator vector to form a task pool, including: S310, For each graph data sample in the task metadata set, calculate its standardized Laplacian matrix and node feature matrix; S320 performs singular value decomposition on the feature matrix, obtains a unified dimension feature representation by truncating the singular value decomposition, then calculates a unified representation of the graph data, constructs task indicator vectors, and combines all task indicator vectors into a task pool.

[0043] Specifically, for the task meta dataset Define a single graph data sample. Normalized Laplace matrix ,in, yes The adjacency matrix, Represents the nodes in the graph and nodes The weight of the connected edges, for A degree matrix, where the elements on the main diagonal are equal to the degree of each node, and the remaining elements are all 0; For graph data samples Define its node feature matrix ,in For the number of nodes, The original feature dimension; For the characteristic matrix The singular value decomposition formula is as follows: ; in It is a left singular vector matrix. It is a singular value matrix. It is a right singular vector matrix; A unified-dimensional feature representation is obtained by truncating singular value decomposition: ; in, For the preset unified feature dimension, Indicates taking the first Left singular vectors, Indicates taking the first A diagonal matrix composed of singular values.

[0044] This yields a feature matrix with a unified dimension. ,in This is a shared feature dimension for all tasks. The final unified representation of the graph data is calculated using the following formula: ; ; in, It is the identity matrix. The number of nodes in the graph. and These are the degree matrix and Laplacian matrix of the generated graph, respectively. For smoothing coefficients, This represents the feature matrix of the nodes in the graph after smoothing. That is, in the graph data sample The task instruction vector constructed above.

[0045] It should be noted that, , They are all two-dimensional matrices, with subscripts indicating the corresponding vectors or elements. express The j-th row of the matrix, express The element in the j-th row and j-th column of a matrix has a maximum value equal to the number of rows and columns of the matrix.

[0046] Combine all the task indication vectors obtained above into a task pool: .

[0047] It should be noted that, It's essentially a task indicator vector, meaning one vector corresponds to one sample, and the task pool has a size of M×m. The process of constructing a task indicator vector involves transforming any single graph data (A, X) into a 1*d one-dimensional vector. This process is parameter-free and requires no training; it is equivalent to data preprocessing.

[0048] In some embodiments, the step of converting the external distribution map data to be tested into a query vector, calculating its similarity to the task indicator vectors in the task pool, and calculating the expert weight distribution based on the similarity includes: S410 uses the Laplace smoothing process to convert the out-of-plot distribution data to be tested into a query vector; S420, calculate the similarity between the query vector and the indicator vectors of each task in the task pool, and calculate the expert weight distribution based on the similarity; S430: Sort the task indicator vectors according to their similarity and select the task indicator vectors with the highest similarity to the test graph data. S440, the expert weight distribution of each task is obtained by calculating the distribution map data corresponding to each task through the softmax function on multiple task indicator vectors.

[0049] Specifically, for the distribution outside graph data to be tested Using the Laplace smoothing process described above, i.e., formulas (2~5), which are simplified here as follows: Convert to query vector : ; It should be noted that the distribution outside plot data should be calculated using the same method. Laplace matrix, distribution outside plot data It is the graph data to be tested for any type of task.

[0050] In the task pool A similarity query is performed to calculate the similarity between the query vector and each task indicator vector. The similarity formula is as follows: (8); Based on similarity, the expert weight distribution is calculated, and the formula for expert weight is: (9); in, For temperature parameters, It means that it will be Select before The most similar task indicator vectors are assigned weights, and the remaining elements are set to 0. Instructions were given to Most similar The graph data samples can be obtained by summing the weights of samples from the same task. Weight allocation corresponding to each task .

[0051] In some embodiments, the step of routing the external distribution map data to the corresponding expert model for inference based on the expert weight distribution, and obtaining the final prediction result through weighted fusion, includes: S510 constructs a hybrid expert network with pre-trained models as expert models, where each expert model has the same input and output interfaces; S520 uses an expert routing mechanism to route the distributed external map data to the corresponding expert model for inference based on the expert weights of each expert model. The inference results of each expert model are then weighted and fused to obtain the final prediction result.

[0052] Building a Hybrid Expert Network Each pre-trained graph model As an expert: ; Based on the calculated expert weights The test data is routed to the corresponding expert model for inference; The final prediction result is obtained through weighted fusion: ; It's important to note that Topk() selects the k most similar elements in s to calculate weights, setting the rest to 0. The dimension of the s vector remains unchanged, representing the total number of generated samples. gtest's final prediction result is obtained through inference from multiple expert networks, essentially fusing the inference results from multiple experts.

[0053] Output the trained unified inference framework, including the task pool. With the help of expert weighting mechanisms and hybrid expert networks, this framework can automatically identify the task type of new input graph data and perform corresponding inferences.

[0054] Compared with related technologies, the present invention has the following advantages: 1. The effect of task metadata generation: The task metadata generation method of this invention ensures that the generated metadata strictly conforms to the true distribution characteristics of the original task, avoiding the distribution offset problem commonly found in traditional methods. Furthermore, by introducing a dedicated sample diversity regularization term, this method guarantees the diversity of generated samples, effectively avoiding the generation of duplicate samples, thereby improving the generalization ability of this method.

[0055] 2. Methods for refactoring task weights: The dimensionality unification method based on SVD employed in this invention exhibits excellent dimensionality independence, enabling the unified processing of feature vectors of arbitrary dimensions through SVD decomposition without requiring the design of specialized processing algorithms for different dimensions. Regarding information preservation, this method maximizes the retention of important information in the original features, ensuring that dimensionality reduction does not lead to the loss of crucial information. Furthermore, SVD, as a mature numerical algorithm, possesses good computational efficiency and numerical stability, guaranteeing the efficient operation of the entire algorithm process.

[0056] 3. The effect of Laplacian smoothing vectors: The method for constructing task vectors based on Laplace smoothing terms proposed in this invention exhibits excellent topological awareness. It effectively captures topological information within the graph structure through the Laplace smoothing algorithm, ensuring that the generated task indicator vectors reflect the true relationships between tasks. Through multi-layer smoothing processing, this method achieves effective feature propagation, preserving detailed features of local neighborhoods while integrating macroscopic information about the global structure. Ultimately, this method generates a unified representation vector of fixed dimensions for all tasks, providing a standardized input format for the subsequent "expert-sample" allocation process, significantly improving the system's operability and the algorithm's versatility.

[0057] See Figure 2 This invention provides a multi-task-oriented graph model distributed out-of-distribution prediction device, comprising: The first module is used to acquire pre-trained graph models corresponding to multiple tasks and use them as expert models; the tasks include graph structure prediction tasks for different targets or different molecular properties in the field of drug discovery. The second module is used to generate task metadata for each task and to combine the metadata of all tasks to form a complete task metadata dataset. The third module is used for Laplace smoothing and singular value decomposition based on graph data, which transforms the graph data in the task metadata set into a unified-dimensional task indicator vector to form a task pool. The fourth module is used to convert the distribution map data to be tested into query vectors, calculate their similarity with the indicator vectors of each task in the task pool, and calculate the expert weight distribution based on the similarity. The fifth module is used to route the external distribution map data to the corresponding expert model for inference based on the expert weight distribution, and obtain the final prediction result through weighted fusion.

[0058] It is evident that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented in this device embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0059] See Figure 3 This invention provides a multi-task-oriented graphical model distributed out-of-distribution prediction system, comprising: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.

[0060] It is evident that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0061] Furthermore, this application also discloses a computer program product or computer program stored in a computer-readable storage medium. A processor of a computer device can read the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the computer device to perform the described method. Similarly, the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0062] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0063] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0064] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0065] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0066] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0067] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0068] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0069] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0070] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A method for out-of-distribution prediction of graph models for multi-task applications, characterized in that, The method includes the following steps: Acquire pre-trained graph models corresponding to multiple tasks and use them as expert models; the tasks include graph structure prediction tasks for different targets or different molecular properties in the field of drug discovery. Generate task metadata for each task, and concatenate the metadata of all tasks to form a complete task metadata dataset; Based on Laplace smoothing and singular value decomposition of graph data, the graph data in the task metadata set is transformed into a task indicator vector with a unified dimension, forming a task pool; The distribution map data to be tested is converted into a query vector, its similarity with the indicator vectors of each task in the task pool is calculated, and the expert weight distribution is calculated based on the similarity. Based on the expert weight distribution, the data from the external distribution map is routed to the corresponding expert model for inference, and the final prediction result is obtained through weighted fusion.

2. The method for out-of-distribution prediction of a graph model oriented to multiple tasks according to claim 1, characterized in that, The process of generating task metadata for each task, and then concatenating all task metadata to form a complete task metadata dataset, includes: For each pre-trained graph model, a corresponding graph generator is used to generate graph data samples required for a single task, forming the metadata set for that task. The graph data samples include node feature matrices, adjacency matrices, and class labels. The graph generator is optimized based on the task reconstruction loss. The task reconstruction loss includes cross-entropy loss and sample diversity regularization term. The cross-entropy loss is determined based on the predicted labels and corresponding class labels output by each pre-trained graph model, and the sample diversity regularization term is determined based on the sample variance of each metadata set. The graph data samples are categorized according to category labels to form metadata sets for each task. The metadata of all tasks is then combined to form a complete task metadata dataset.

3. The method for out-of-distribution prediction of a graph model oriented to multiple tasks according to claim 2, characterized in that, The expression for the task reconstruction loss function is: ; in, For cross-entropy loss, Let represent the prediction function of the i-th pre-trained graph model for the c-th class of graph data sample g. The balancing parameter has a value range of [value range missing]. , This is a sample diversity regularization term.

4. The method for out-of-distribution prediction of a graph model oriented to multiple tasks according to claim 3, characterized in that, The expression for the sample diversity regularization term is: ; in, This represents the sample variance.

5. The method for out-of-distribution prediction of a graph model oriented to multiple tasks according to claim 1, characterized in that, The Laplace smoothing and singular value decomposition based on graph data transform the graph data in the task metadata set into a unified-dimensional task indicator vector, forming a task pool, including: For each graph data sample in the task metadata set, calculate its normalized Laplacian matrix and node feature matrix; Singular value decomposition is performed on the feature matrix. By truncating the singular value decomposition, a feature representation with a unified dimension is obtained. Then, a unified representation of the graph data is calculated, task indicator vectors are constructed, and all task indicator vectors are combined into a task pool.

6. The method for out-of-distribution prediction of a graph model oriented to multiple tasks according to claim 1, characterized in that, The process of converting the external distribution map data to be tested into a query vector, calculating its similarity to the indicator vectors of each task in the task pool, and calculating the expert weight distribution based on the similarity includes: The Laplace smoothing process is used to convert the out-of-plot data of the distribution to be tested into a query vector; Calculate the similarity between the query vector and the indicator vectors of each task in the task pool, and calculate the expert weight distribution based on the similarity. The task indicator vectors are sorted according to their similarity, and the task indicator vectors with the highest similarity to the test graph data are selected. The expert weight distribution for each task is obtained by calculating the distribution map data corresponding to the task using the softmax function on multiple task indicator vectors.

7. The method for out-of-distribution prediction of a graph model oriented to multiple tasks according to claim 1, characterized in that, The step of routing the out-of-distribution map data to the corresponding expert model for inference based on the expert weight distribution, and obtaining the final prediction result through weighted fusion, includes: Construct a hybrid expert network with pre-trained models as expert models, where each expert model has the same input and output interfaces; Through the expert routing mechanism, the distribution map data is routed to the corresponding expert model for inference based on the expert weights of each expert model. The inference results of each expert model are then weighted and fused to obtain the final prediction result.

8. A graph model distributed out-of-prediction device for multi-task applications, characterized in that, include: The first module is used to acquire pre-trained graph models corresponding to multiple tasks and use them as expert models; the tasks include graph structure prediction tasks for different targets or different molecular properties in the field of drug discovery. The second module is used to generate task metadata for each task and to combine the metadata of all tasks to form a complete task metadata dataset. The third module is used for Laplace smoothing and singular value decomposition based on graph data, which transforms the graph data in the task metadata set into a unified-dimensional task indicator vector to form a task pool. The fourth module is used to convert the distribution map data to be tested into query vectors, calculate their similarity with the indicator vectors of each task in the task pool, and calculate the expert weight distribution based on the similarity. The fifth module is used to route the external distribution map data to the corresponding expert model for inference based on the expert weight distribution, and obtain the final prediction result through weighted fusion.

9. A graphical model-based out-of-target prediction system for multi-task applications, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a processor-executable program, characterized in that, The processor-executable program, when executed by the processor, is used to perform the method as described in any one of claims 1 to 7.