Model training method, device, storage medium and electronic device

By using the difference between sample prompt diagrams and prediction diagram data in the graph neural network model, the problem of insufficient number of sample annotations in the risk control field is solved, and an effective risk control model is trained under a small number of annotations.

CN119762912APending Publication Date: 2025-04-04ANT ZHIXIN HANGZHOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411829695.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In the field of risk control, when training graph neural network models for risk control tasks, due to the small number of sample annotations, it cannot meet the number of sample annotations required by supervised training methods.

Method used

By obtaining the sample map data and sample annotation map corresponding to the sample risk control task, input the sample map data into the model to be trained, and the sample prompt diagram is determined by the prompt subnet, so that the task subnet can output prediction map data under the prompt of the sample prompt diagram. According to the differences in the prediction graph data and sample annotation graph, the parameters of the prompt subnet and task subnet are adjusted to obtain a risk control model for processing risk control tasks.

Benefits of technology

A graph neural network model that can effectively handle risk control tasks is trained in a small number of samples, solving the problem of insufficient number of samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119762912A_ABST
    Figure CN119762912A_ABST
Patent Text Reader

Abstract

This specification discloses a model training method, device, storage medium and electronic device. Sample graph data corresponding to a sample risk control task and a sample annotation graph corresponding to the sample graph data are obtained, the sample graph data is input into the model to be trained, and the sample prompt graph corresponding to the sample graph data is determined through the prompt subnet of the model to be trained, so that the task subnet of the model to be trained outputs prediction graph data according to the sample graph data under the prompt of the sample prompt graph, and the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet are adjusted according to the difference between the prediction graph data and the sample annotation graph, so as to obtain a risk control model for processing the sample risk control task. In this way, the model to be trained can be trained to obtain a risk control model for processing sample risk control tasks based on a small amount of sample graph data and sample annotation graph under the prompt of the sample prompt graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a model training method, device, storage medium and electronic device. Background Art

[0002] With the rapid development of artificial intelligence and machine learning, Graph Neural Networks (GNNs) have become a powerful tool for processing unstructured data. They can output corresponding prediction results based on the input graph data, and can be used for various tasks such as node classification or edge prediction. Especially in the field of risk control, GNNs can be used to identify subject risks or relationship risks, that is, to determine whether merchants, accounts and other subjects have risky behaviors, or to identify whether there are abnormal transactions and interactive relationships between subjects.

[0003] At present, the preset graph neural network model is usually trained through supervised training so that the trained graph neural network model can handle the corresponding tasks. This supervised training method often requires a large amount of sample graph data and corresponding sample annotations. However, in the field of risk control, when training graph neural network models for risk control tasks, since the risk annotations corresponding to the training samples mostly come from user complaints or reports and rely on user feedback, the number of sample annotations that can be obtained is small, which cannot meet the number of sample annotations required by the supervised training method.

[0004] Therefore, how to train the graph neural network model based on a small amount of sample annotations is an urgent problem to be solved. Summary of the invention

[0005] The embodiments of this specification provide a model training method and device to partially solve the problems existing in the above-mentioned prior art.

[0006] The embodiments of this specification adopt the following technical solutions:

[0007] This specification provides a model training method, the method comprising:

[0008] Obtaining sample graph data corresponding to the sample risk control task, and a sample annotation graph corresponding to the sample graph data;

[0009] The sample graph data is input into the model to be trained, and a sample prompt graph corresponding to the sample graph data is determined through the prompt subnet of the model to be trained, so that the task subnet of the model to be trained outputs prediction graph data according to the sample graph data under the prompt of the sample prompt graph;

[0010] According to the difference between the prediction graph data and the sample annotation graph, the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet are adjusted to obtain a risk control model for processing the sample risk control task.

[0011] Optionally, determining a sample prompt graph corresponding to the sample graph data through the prompt subnet of the model to be trained specifically includes:

[0012] Determining an initial prompt graph according to the sample graph data through the prompt subnet of the model to be trained, wherein the prompt nodes included in the initial prompt graph are the same in number and feature vector dimension as the sample nodes included in the sample graph data;

[0013] According to the prompt parameters corresponding to the prompt subnet, the prompt vector and the prompt weight of each prompt node in the initial prompt graph, and the connection relationship between the prompt nodes are determined to obtain a sample prompt graph corresponding to the sample graph data.

[0014] Optionally, outputting predicted graph data according to the sample graph data specifically includes:

[0015] Determine, by means of the task subnet, for each sample node in the sample graph data, a sample vector of the sample node, and determine, according to a connection relationship between the prompt nodes, a corresponding prompt node of the sample node in the sample prompt graph;

[0016] Determine a final vector of the sample node according to the sample vector, the prompt vector of the corresponding prompt node and the prompt weight;

[0017] According to the final vectors of the sample nodes, a sample fusion graph of the sample graph data and the sample prompt graph is determined, so that the task subnet outputs prediction graph data according to the sample fusion graph.

[0018] Optionally, before inputting the sample graph data into the model to be trained, the method further includes:

[0019] Performing self-supervised training on a preset graph neural network model to obtain an initial pre-trained model, and fixing pre-training parameters of the initial pre-trained model;

[0020] Determine a meta-learning task set based on the sample risk control tasks;

[0021] According to each meta-learning task in the meta-learning task set, the initial pre-trained model is subjected to prompt learning through meta-learning, and the meta-learning prompt parameters corresponding to the prompt subnet and the meta-learning task parameters corresponding to the task subnet are determined to obtain the model to be trained.

[0022] Optionally, according to each meta-learning task in the meta-learning task set, the initial pre-training model is prompted for learning through meta-learning, specifically including:

[0023] Obtain the support dataset and query dataset corresponding to each meta-learning task;

[0024] For each meta-learning task, determining a first loss of the initial pre-trained model on a support data set corresponding to the meta-learning task;

[0025] According to the first loss, adjusting the parameters of the initial pre-trained model, determining initial prompt parameters and initial task parameters, and obtaining a first pre-trained model corresponding to the meta-learning task;

[0026] Training the first pre-trained model according to the query data set corresponding to the meta-learning task, and determining a second loss of the first pre-trained model on the query data set corresponding to the meta-learning task;

[0027] According to the second losses corresponding to the meta-learning tasks, meta-learning prompt parameters and meta-learning task parameters are determined to obtain a model to be trained.

[0028] Optionally, determining a first loss of the initial pre-trained model on a support data set corresponding to the meta-learning task specifically includes:

[0029] For each meta-learning task, a support sample graph in a support data set corresponding to the meta-learning task is input into the initial pre-training model, and a support prompt graph corresponding to the support sample graph is determined through a prompt subnet of the initial pre-training model, so that the task subnet of the initial pre-training model outputs a support prediction graph according to the support sample graph under the prompt of the support prompt graph;

[0030] Determining a first loss corresponding to the meta-learning task according to a difference between the support prediction graph and the support annotation graph corresponding to the meta-learning task;

[0031] Determining a second loss of the first pre-trained model on the query data set corresponding to the meta-learning task specifically includes:

[0032] For each meta-learning task, a query sample graph in a query data set corresponding to the meta-learning task is input into the first pre-trained model, and a query prompt graph corresponding to the query sample graph is determined through a prompt subnet of the first pre-trained model, so that the task subnet of the first pre-trained model outputs a query prediction graph according to the query sample graph under the prompt of the query prompt graph;

[0033] Determine a second loss corresponding to the meta-learning task based on a difference between the query prediction graph and the query annotation graph corresponding to the meta-learning task.

[0034] Optionally, according to the difference between the prediction graph data and the sample annotation graph, the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet are adjusted, specifically including:

[0035] Determine the loss value according to the difference between the predicted graph data and the sample labeled graph and a preset loss function;

[0036] According to the loss value, the meta-learning prompt parameters and the meta-learning task parameters of the model to be trained are adjusted to obtain a risk control model for processing the sample risk control task.

[0037] This specification provides a model training device, the device comprising:

[0038] An acquisition module, used to acquire sample graph data corresponding to a sample risk control task, and a sample annotation graph corresponding to the sample graph data;

[0039] An input module, used for inputting the sample graph data into the model to be trained, and determining a sample prompt graph corresponding to the sample graph data through the prompt subnet of the model to be trained, so that the task subnet of the model to be trained outputs prediction graph data according to the sample graph data under the prompt of the sample prompt graph;

[0040] An adjustment module is used to adjust the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet according to the difference between the prediction graph data and the sample annotation graph, so as to obtain a risk control model for processing the sample risk control task.

[0041] This specification provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned model training method is implemented.

[0042] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned model training method when executing the program.

[0043] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects: The embodiments of this specification provide a training method for a graph neural network model, obtain sample graph data corresponding to a sample risk control task, and a sample annotation graph corresponding to the sample graph data, input the sample graph data into the model to be trained, and determine the sample prompt graph corresponding to the sample graph data through the prompt subnet of the model to be trained, so that the task subnet of the model to be trained outputs prediction graph data according to the sample graph data under the prompt of the sample prompt graph, and adjusts the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet according to the difference between the prediction graph data and the sample annotation graph, so as to obtain a risk control model for processing the sample risk control task. In this way, the model to be trained can be trained to obtain a risk control model for processing the sample risk control task based on a small amount of sample graph data and sample annotation graph under the prompt of the sample prompt graph. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:

[0045] Figure 1 A flowchart of a model training method provided in an embodiment of this specification;

[0046] Figure 2A A node construction generation subgraph of a model training method provided in an embodiment of this specification;

[0047] Figure 2B A subgraph generated by edge construction of a model training method provided in an embodiment of this specification;

[0048] Figure 3 A schematic diagram of the structure of a model training device provided in an embodiment of this specification;

[0049] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0051] Figure 1 The following is a flow chart of a model training method in this specification, which may include the following steps:

[0052] S100: Obtain sample graph data corresponding to a sample risk control task, and a sample annotation graph corresponding to the sample graph data.

[0053] In an embodiment of the present application, the execution entity for obtaining the sample graph data corresponding to the sample risk control task and the sample annotation graph corresponding to the sample graph data can be a terminal device such as a laptop computer, a tablet computer, or, of course, a server. For the sake of ease of description, this specification only takes the server as an execution entity as an example to illustrate the model training method provided in this specification.

[0054] Specifically, in the embodiments of this specification, the user may need to train a risk control model to handle specific sample risk control tasks. The sample risk control tasks may be subject risk identification tasks, which are used to identify and judge whether a subject such as a merchant or an account has risky behavior, or relationship risk identification tasks, which are used to identify whether there is risky behavior between subjects such as merchants or accounts. The specific sample risk control tasks are not limited in the embodiments of this specification.

[0055] Furthermore, after determining the sample risk control task, the sample graph data corresponding to the sample risk control task can be determined according to the nature of the sample risk control task. In the field of risk control, compared with graphic data, graph data naturally contains rich information: independent attributes of the subject, the relationship and attributes between subjects. Therefore, when determining the sample of the model to be trained, you can first obtain the subject information related to the sample risk control task, as well as data such as the interaction information between the subjects, and then construct the sample graph data corresponding to the sample task, including nodes, edges and their attributes, where nodes represent entities and edges represent the relationship between entities.

[0056] For example, in a transaction risk control scenario, if the sample risk control task is to identify the risk subject, then the sample graph data can be defined based on the sample risk control task. is the set of graph nodes, and ε is the set of edges. Nodes can be entities such as accounts, merchants, and mini-programs, and edges can be selected from relationships such as transactions, transfers, same entities, and social interactions. Label node features X∈R |V|×d , x i ∈R d Represents node v i Taking the merchant as an example, the node features can include its own basic information (registration time, age, gender, etc.), transaction aggregation information, behavioral statistical features, etc.

[0057] Furthermore, after the sample graph data is determined, the sample annotation graph corresponding to the sample graph data will also be determined. Compared with natural language tasks, graph tasks vary greatly. In order to further improve the generalization ability of the model to be trained, adapt to various sample risk control tasks, and reduce the sample annotations corresponding to the sample graph data, the sample risk control task can be converted into a subgraph-level task instead of a node or edge task. This conversion allows the model to understand the graph structure at a higher level, thereby improving its ability to handle different tasks.

[0058] Specifically, the node-level tasks and edge-level tasks do not overlap much, but both belong to subgraph-level tasks. For example, "delete an edge" or "delete a node" can be expressed as "delete a subgraph". At the same time, compared with node-level and edge-level tasks, graph-level tasks are more general and contain the largest overlapping task subspace for knowledge transfer. Based on this, the sample risk control tasks can be reconstructed, and all types of sample risk control tasks can be converted into graph-level tasks, and then subsequent prompt learning can be used to match the graph-level training strategy. That is, according to the sample risk control tasks, the nodes and edges that need to be predicted or identified in the sample graph data corresponding to the sample risk control tasks can be reconstructed into the various subgraphs to be predicted that need to be predicted or identified in the sample graph data, as the annotations corresponding to the sample graph data, that is, the sample annotation graph.

[0059] The sample annotation graph includes several nodes and edges in the sample graph data. Specifically, Figure 2A and Figure 2B As shown in , the induced graph is constructed for the nodes and edges to be predicted or identified, and the node-level and edge-level tasks are reformulated as graph-level tasks. Figure 2A For node-level tasks, the generated subgraph of the target node represents the local area within its τ distance. The generated subgraph retains the local structure of the node through the connection of adjacent nodes and retains its semantic context through the feature information of adjacent nodes. At the same time, the label of the target node is regarded as the label of its corresponding generated subgraph, thereby converting node classification into a subgraph classification problem.

[0060] akin, Figure 2B In the figure, a pair of nodes is given as an edge relationship. If there is a connection between the two nodes, it is considered a positive edge, otherwise it is considered a negative edge. Similarly, the node pairs are extended to neighbors with a distance of τ, and the spanning graph of the edge relationship is constructed. The edge relationship label is regarded as the label of the spanning graph, and the edge-level task is converted into a subgraph-level task. For unweighted graph data, the distance τ is equivalent to τ-hop ​​neighbors, and for weighted graph data, the distance τ is the shortest path distance.

[0061] S102: Input the sample graph data into the model to be trained, and determine a sample prompt graph corresponding to the sample graph data through the prompt subnet of the model to be trained, so that the task subnet of the model to be trained outputs prediction graph data according to the sample graph data under the prompt of the sample prompt graph.

[0062] Furthermore, after determining the sample graph data corresponding to the sample risk control task and the sample annotation graph corresponding to the sample graph data, the model to be trained can be trained based on the sample graph data and the sample annotation graph. Specifically, the sample graph data can be input into the model to be trained so that the model to be trained predicts the subgraph required for judgment and recognition based on the sample graph data to obtain the predicted graph data.

[0063] It should be noted that the model to be trained includes a prompt subnetwork and a task subnetwork. After the sample graph data is input into the model to be trained, the prediction result is not obtained directly based on the sample graph data, but the sample prompt graph corresponding to the sample graph data is first determined in advance through the prompt subnetwork based on the input sample graph data and the prompt parameters corresponding to the prompt subnetwork, which is used to guide the model to be trained when making predictions based on the sample graph data. Among them, the sample prompt graph is also a graph structure data, including a number of prompt nodes and edges connecting the prompt nodes. These prompt nodes correspond one-to-one to each node in the sample graph data, and are used to generate guidance and prompts for the nodes in the sample graph data.

[0064] Among them, a sample prompt graph corresponding to the sample graph data is determined through a prompt subnet. Before the sample graph data is input into the model to be trained, an initial prompt graph corresponding to the sample graph data can be pre-determined according to a preset prompt graph structure, and the initial prompt graph and the sample graph data can be input into the model to be trained together, so that the prompt subnet can determine the sample prompt graph corresponding to the sample graph data according to the sample graph data, the initial prompt graph, and the prompt parameters of the prompt subnet. The specific method for determining the sample prompt graph is not limited in the embodiments of this specification.

[0065] Furthermore, after determining the sample prompt graph, the sample graph data and the sample prompt graph are fused through the task subnet in the model to be trained according to the task parameters of the task subnet, and the fused graph data is feature extracted and encoded according to the graph convolution operation or the attention mechanism to capture the complex relationships in the fused graph structure and the interaction information between nodes, so that the model to be trained can output the prediction results based on the sample risk control task under the prompt of the sample prompt graph, that is, the prediction graph data. The specific prediction results are not limited in the embodiments of this specification.

[0066] S104: According to the difference between the prediction graph data and the sample annotation graph, the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet are adjusted to obtain a risk control model for processing the sample risk control task.

[0067] Then, according to the difference between the prediction graph data output by the model to be trained and the sample annotation graph, the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet are adjusted. Specifically, the difference can be quantified by a preset loss function, wherein the choice of the loss function depends on the task type, for example, cross entropy loss can be used for classification problems, and mean square error loss can be used for regression problems.

[0068] Then, according to the loss value calculated by the loss function, the prompt parameters and task parameters of the model to be trained can be adjusted at the same time through the back propagation algorithm to reduce the difference between the predicted graph data and the sample annotation graph. Specifically, the descent gradient of the loss function can be calculated according to the loss function of the model to be trained, and the parameters can be adjusted in the opposite direction according to the descent gradient of the loss function. This is an optimization iterative process in the training process of the model to be trained, and multiple iterations can be performed to obtain a risk control model that has been finally trained and has good performance in the sample risk control task. It should be noted that the specific model parameter adjustment method is not limited in the embodiments of this specification.

[0069] based on Figure 1 A model training method is provided, which obtains sample graph data corresponding to a sample risk control task and a sample annotation graph corresponding to the sample graph data, inputs the sample graph data into a model to be trained, and determines a sample prompt graph corresponding to the sample graph data through a prompt subnet of the model to be trained, so that the task subnet of the model to be trained outputs prediction graph data according to the sample graph data under the prompt of the sample prompt graph, and adjusts the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet according to the difference between the prediction graph data and the sample annotation graph, so as to obtain a risk control model for processing the sample risk control task. Through this method, the model to be trained can be trained to obtain a risk control model for processing the sample risk control task based on a small amount of sample graph data and sample annotation graph under the prompt of the sample prompt graph.

[0070] Furthermore, a sample prompt graph corresponding to the sample graph data is determined through the prompt subnet of the model to be trained. Specifically, an initial prompt graph is determined according to the sample graph data through the prompt subnet of the model to be trained, wherein the number and feature vector dimension of prompt nodes included in the initial prompt graph are the same as those of sample nodes included in the sample graph data, and prompt vectors and prompt weights of each prompt node in the initial prompt graph, as well as the connection relationship between the prompt nodes are determined according to prompt parameters corresponding to the prompt subnet, so as to obtain a sample prompt graph corresponding to the sample graph data.

[0071] Specifically, in the embodiment of the present specification, the sample prompt graph includes a number of prompt nodes and edges, and is composed of three elements: PromptToken, Token Structure, and Inserting Pattern. Among them, Prompt Tokenb represents the prompt vector corresponding to each prompt node, Token Structure defines the connection relationship between each prompt node, which can be represented by an adjacency matrix, and Inserting Pattern defines the insertion relationship between the sample prompt graph and the sample graph data, including the prompt weight of each prompt node when inserting the sample graph data. These three elements all belong to the prompt parameters of the prompt subnet.

[0072] Furthermore, by using the prompt subnet of the model to be trained to determine the sample prompt graph corresponding to the sample graph data, the initial prompt graph can be determined based on the input sample graph data. Specifically, the number of prompt nodes can be determined based on the number of sample nodes in the sample graph data, the prompt vector dimension of the prompt node can be determined based on the feature vector dimension of each sample node in the sample graph data, and the prompt vector, connection relationship and prompt weight of each prompt node are randomly initialized to obtain the initial prompt graph. The prompt nodes contained in the initial prompt graph are the same as the number and feature vector dimension of the sample nodes contained in the sample graph data.

[0073] Using the above example, based on the sample graph data The initial prompt graph can be determined by the prompt subnet. in Represents a collection of prompt tokens. is the number of prompt tokens. Each prompt token can be represented by the prompt token vector p i ∈R 1×d , which is the same as the dimension of the sample node feature vector in the sample graph data. Next, initialize the structure between prompt tokens using Represents structural relationships. Specifically, through the adjacency matrix Indicates the connection relationship between prompt tokens. Then, the initial prompt graph can be determined based on the prompt tokens corresponding to each prompt node and the connection relationship between each prompt token.

[0074] Furthermore, after determining the initial prompt graph, the specific prompt vectors and prompt weights corresponding to each prompt node in the initial prompt graph and the connection relationship between the prompt nodes can be determined according to the prompt parameters corresponding to the prompt subnet in the model to be trained, so as to obtain a sample prompt graph corresponding to the sample graph data.

[0075] Furthermore, outputting prediction graph data according to the sample graph data can be specifically performed by, through the task subnet, determining the sample vector of each sample node in the sample graph data, and determining the corresponding prompt node of the sample node in the sample prompt graph according to the connection relationship between the prompt nodes, determining the final vector of the sample node according to the sample vector, the prompt vector of the corresponding prompt node and the prompt weight, and determining the sample fusion graph of the sample graph data and the sample prompt graph according to the final vectors of the sample nodes, so that the task subnet outputs prediction graph data according to the sample fusion graph.

[0076] Specifically, after determining the sample prompt graph, the task subnet will determine the sample vector of each sample node in the sample graph data, and determine the prompt node corresponding to each sample node based on the connection relationship between each prompt node in the sample prompt graph. Among them, each sample node in the sample graph data corresponds to each prompt node in the sample prompt graph one by one. For each sample node, after determining the corresponding prompt node of the sample node, the prompt vector and prompt weight of the corresponding prompt node determined by the prompt parameter can be obtained. Then, based on the prompt weight and the prompt vector, the vector to be added to the sample node is determined, and finally, the final vector of the sample node is determined based on the vector to be added and the sample vector of the sample node. Of course, the sample weight of each sample node can also be determined according to the task parameters, and the final vector of the sample node can be determined based on the sample weight, sample vector, prompt weight and prompt weight. The method for determining the final vector of each sample node is not limited in the embodiment of this specification.

[0077] Then, the sample fusion graph of the sample graph data and the sample prompt graph can be determined according to the final vector of each sample node, so that the task subnet outputs the prediction result according to the final vector corresponding to each sample node in the sample fusion graph, that is, through the task subnet, under the prompt of the sample prompt graph, the prediction graph data is output according to the sample graph data.

[0078] Furthermore, since in each iteration of the model to be trained, the prediction results are output according to the sample graph data under the prompt of the sample prompt graph, when the parameters of the model to be trained are adjusted according to the difference between the prediction graph data and the annotation graph data, the prompt parameters of the prompt subnet and the task parameters of the task subnet are adjusted at the same time. Among them, when the prompt parameters are adjusted, the parameter learning formula corresponding to the connection relationship between the prompt nodes in the prompt parameters is as follows:

[0079]

[0080] where a ij is an adjustable parameter, representing the token p i With token p j Possibility of connection between.

[0081] In addition, the prompt weights in the prompt parameters are learned, and ψ can be pre-set as an insertion function to represent the sample prompt graph With sample graph data The fusion of Then, a linking method is defined, that is, the prompt token of each prompt node in the sample prompt graph tries to connect with each corresponding sample node in the sample graph data, so that the threshold weight is determined by calculating the click between the prompt token and each corresponding sample node in the sample graph data to prune the connection in each training iteration. The calculation formula of the linking method is as follows:

[0082]

[0083] where w ik is the hint weight value, which is used to prune unimportant edges. Similarly, during the hint parameter adjustment process, the model to be trained will adjust w based on the input sample graph data and the corresponding graph-level labels. ik This weight is used for parameter learning to determine the value of each sample node v in the sample graph data. i The weight of the prompt token when the prompt token of the corresponding prompt node is added.

[0084] Furthermore, before inputting the sample graph data into the model to be trained, the preset graph neural network model can also be self-supervised trained to obtain an initial pre-trained model, and the pre-training parameters of the initial pre-trained model can be fixed. According to the sample risk control task, a meta-learning task set is determined, and according to each meta-learning task in the meta-learning task set, prompt learning is performed on the initial pre-trained model through meta-learning to determine the meta-learning prompt parameters corresponding to the prompt subnet and the meta-learning task parameters corresponding to the task subnet to obtain the model to be trained.

[0085] In other words, in order to train the model to be trained more efficiently and further reduce the dependence on sample graph data and sample annotated graphs, before inputting the sample graph data into the model to be trained, the preset graph neural network model can be self-supervised trained through a large amount of unlabeled graph data that is easy to obtain or automatically generated to obtain an initial pre-trained model.

[0086] Specifically, a large amount of unlabeled graph data related to sample risk control tasks can be collected first. These data can come from a variety of sources, such as public data sets, internal databases, or graph data generated by simulation, covering the diversity of graph structures in sample risk control tasks. The collected graph data is preprocessed, including but not limited to node feature extraction, edge weight setting, graph structure normalization, etc., to obtain training sample graphs to ensure that the data format matches the input requirements of the graph neural network model.

[0087] Then, based on the preset graph neural network model architecture that can effectively capture the structural information and node features of graph data, such as GCN (graph convolutional network), GAT (graph attention network), GraphSAGE, etc., the initial preset graph neural network model is determined, and the pre-trained sample graph is input into the preset graph neural network model, so that the preset graph neural network model is self-supervised trained to obtain the initial pre-trained model. This process usually involves multiple rounds of iterations until the performance of the preset graph neural network model on the pre-training task tends to be stable or reaches the preset stop condition. During the pre-training process, the hyperparameters of the model, such as learning rate, batch size, training rounds, etc., can be adjusted as needed to optimize the training effect and generalization ability of the model. At the same time, when the initial pre-training model is trained, its pre-training parameters determined by pre-training will be fixed and remain unchanged in the subsequent fine-tuning stage to maintain the knowledge learned by the model in the pre-training stage.

[0088] Among them, self-supervised learning is usually a prediction task, which enables the model to predict the characteristics of certain nodes or edges through the information in the graph, such as link prediction, graph reconstruction tasks, etc. Through self-supervised training, the preset graph neural network model will learn the representation of the graph structure, thereby obtaining an initial pre-trained model that can capture the relationship between nodes and edges in the graph. It should be noted that the specific model self-supervised training method is not limited in the embodiments of this specification.

[0089] Then, after the initial pre-training is completed, in order to further improve the adaptability and performance of the initial pre-model on multiple tasks, the initial pre-trained model can be prompted and fine-tuned (PromptTuning) based on meta-learning (Meta-Learning). Among them, meta-learning can allow the initial pre-trained model to learn how to quickly adapt to new sample risk control tasks, and learn general learning strategies or knowledge transfer capabilities from multiple meta-learning tasks. Prompt learning can provide prompt information of meta-learning tasks during the training process to guide the further learning of the initial pre-trained model, convert the goals of each meta-learning task into tasks related to the above pre-training, and help the initial pre-trained model better utilize upstream and downstream task information to improve the performance of the model.

[0090] Specifically, a meta-learning task set can be determined according to the sample risk control task, wherein the meta-learning task set includes several meta-learning tasks for meta-learning. These tasks should cover diverse data distributions, feature spaces, and task types so that the initial pre-trained model can learn a wide range of adaptability and migration capabilities from them. Then, based on each meta-learning task, the initial pre-trained model is prompted to fine-tune. Instead of performing large-scale retraining on the entire pre-trained model, a lightweight parameter adjustment strategy is adopted. On the basis of fixing the pre-training parameters of the initial pre-trained model, the prompt parameters of the prompt subnet and the task parameters of the task subnet are adjusted to determine the meta-learning prompt parameters corresponding to the prompt subnet and the meta-learning task parameters corresponding to the task subnet, and obtain the model to be trained.

[0091] During the fine-tuning process, the initial pre-trained model will process these meta-learning tasks sequentially or in parallel, and adjust the parameters through the back-propagation algorithm and the appropriate optimizer to minimize the loss function on each meta-learning task. As the training progresses, the initial pre-trained model will gradually learn how to transfer knowledge between different tasks and improve its generalization ability on unseen sample risk control tasks.

[0092] Finally, when the performance of the initial pre-trained model on multiple meta-learning tasks reaches the preset threshold, the fine-tuning process can be considered complete, and the model at this time is the model to be trained. The model to be trained not only inherits the general knowledge of the initial pre-trained model, but also obtains stronger adaptability and generalization capabilities through fine-tuning of meta-learning tasks, preparing for further fine-tuning on subsequent sample risk control tasks. It should be noted that the specific method of prompting fine-tuning of the initial pre-trained model based on several meta-learning tasks and determining the model to be trained is not limited in the embodiments of this specification.

[0093] Furthermore, according to each meta-learning task in the meta-learning task set, the initial pre-trained model is prompted for learning through meta-learning, which can be specifically as follows: a support data set and a query data set corresponding to each meta-learning task are obtained, and for each meta-learning task, a first loss of the initial pre-trained model on the support data set corresponding to the meta-learning task is determined; according to the first loss, the parameters of the initial pre-trained model are adjusted to determine initial prompt parameters and initial task parameters to obtain the first pre-trained model corresponding to the meta-learning task; according to the query data set corresponding to the meta-learning task, the first pre-trained model is trained to determine the second loss of the first pre-trained model on the query data set corresponding to the meta-learning task; according to the second losses corresponding to each meta-learning task, meta-learning prompt parameters and meta-learning task parameters are determined to obtain the model to be trained.

[0094] For each meta-learning task, the meta-learning task has a corresponding support dataset and a query dataset. The support dataset is used for preliminary training of the initial pre-trained model, while the query dataset is used to evaluate the rapid adaptability and prediction accuracy of the initial pre-trained model trained based on the support dataset to new tasks.

[0095] Specifically, for each meta-learning task, after obtaining the support data set and query data set corresponding to the meta-learning, the first loss corresponding to the meta-learning task can be determined based on the support data set, and then based on the first loss, under the condition of fixing the pre-training parameters of the initial pre-training model, the prompt parameters of the prompt subnet in the initial pre-training model and the task parameters corresponding to the task subnet are adjusted to determine the initial prompt parameters and initial task parameters, and obtain the first training model corresponding to the meta-learning task. Then, based on the query data set, the first pre-training model is verified to obtain the second loss of the first pre-training model on the query data set corresponding to the meta-learning task, and based on the second losses corresponding to each meta-learning, the meta-learning prompt parameters and meta-learning task parameters that perform well on each meta-learning task are determined, thereby obtaining the model to be trained, so that the model to be trained can rely on a small amount of sample graph data and annotated graph data for efficient training when training for subsequent sample risk control tasks.

[0096] Furthermore, determining the first loss of the initial pre-trained model on the support data set corresponding to the meta-learning task can be specifically as follows: for each meta-learning task, inputting the support sample graph in the support data set corresponding to the meta-learning task into the initial pre-trained model, and determining the support prompt graph corresponding to the support sample graph through the prompt subnet of the initial pre-trained model, so that the task subnet of the initial pre-trained model outputs a support prediction graph according to the support sample graph under the prompt of the support prompt graph, and determining the first loss corresponding to the meta-learning task according to the difference between the support prediction graph and the support annotation graph corresponding to the meta-learning task.

[0097] Specifically, for each meta-learning task, the support sample graph in the support data set corresponding to the meta-learning task is input into the initial pre-training model, and the support hint graph corresponding to the support sample graph is determined through the hint sub-network in the initial pre-training model according to the input support sample graph and hint parameters, and then, the support fusion graph of the support hint graph and the support sample graph is determined based on the support hint graph through the task sub-network of the initial pre-training model, and the support prediction graph corresponding to the support sample graph of the meta-learning task is output according to the support fusion graph. Then, according to the difference between the support prediction graph and the support annotation graph, according to the preset loss function, the loss value, that is, the first loss of the meta-learning task on the corresponding support data set, can be determined, so that the hint parameters and task parameters of the initial pre-training model can be adjusted through methods such as gradient descent to obtain the first pre-training model corresponding to the meta-learning task.

[0098] Then, the second loss of the first pre-trained model on the query data set corresponding to the meta-learning task is determined. Specifically, for each meta-learning task, the query sample graph in the query data set corresponding to the meta-learning task is input into the first pre-trained model, and the query prompt graph corresponding to the query sample graph is determined through the prompt subnet of the first pre-trained model, so that the task subnet of the first pre-trained model outputs a query prediction graph according to the query sample graph under the prompt of the query prompt graph, and the second loss corresponding to the meta-learning task is determined according to the difference between the query prediction graph and the query annotation graph corresponding to the meta-learning task.

[0099] Similar to determining the first loss, after determining the first pre-trained model according to the support data set of the meta-learning task, the initial task parameters and initial prompt parameters of the first pre-trained model will be further adjusted according to the query data set corresponding to the meta-learning task. Specifically, the query sample graph in the query data set corresponding to the meta-learning task will be input into the first pre-trained model, and the query prompt graph corresponding to the query sample graph will be determined through the prompt sub-network in the first pre-trained model according to the input query sample graph and prompt parameters. Then, based on the query prompt graph, the query fusion graph of the query prompt graph and the query sample graph will be determined through the task sub-network of the first pre-trained model, and the query prediction graph corresponding to the query sample graph of the meta-learning task will be output according to the query fusion graph. Then, according to the difference between the query prediction graph and the query annotation graph, the loss value, that is, the second loss of the meta-learning task on the corresponding query data set, can be determined according to the preset loss function, so that the prompt parameters and task parameters of the first pre-trained model can be adjusted later by methods such as gradient descent, and the meta-learning prompt parameters and meta-learning task parameters can be determined to obtain the model to be trained.

[0100] Specifically, we apply meta-learning to graph cue learning. Given τ i represents the meta-learning task i, represents the dataset for meta-learning task i, For the query set, For the supporting set, Representation dataset In the setting of the parameters that need to be adjusted, θ represents the prompt parameter, φ represents the task parameter, and π * Indicates the fixed pre-training parameters of the initial pre-training model, using As the meta-learning hint graph (θ), the initial pre-trained model (π * ) and the downstream tasker (φ). For each meta-learning task τ i , the corresponding prompt parameters and task parameters in the meta-learning process are updated as follows:

[0101]

[0102] k is the update round, when k = 0, the initial setting Indicates the initial prompt parameters, Denotes the initial task parameters. By minimizing the meta-learning loss on each meta-learning task, that is, the second loss of each meta-learning task on the query dataset, the meta-learning parameters (θ) of the meta-prompt task can be learned. * ,φ * ), the optimization function is as follows, where For the task set:

[0103]

[0104] After obtaining the meta-learning prompt parameters and meta-learning task parameters, the next step is to fine-tune the prompts for the sample risk control task in combination with the sample prompt graph to obtain the final risk control model.

[0105] Specifically, according to the difference between the prediction graph data and the sample annotation graph, the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet are adjusted. Specifically, according to the difference between the prediction graph data and the sample annotation graph, and a preset loss function, a loss value is determined, and according to the loss value, the meta-learning prompt parameters and the meta-learning task parameters of the model to be trained are adjusted to obtain a risk control model for processing the sample risk control task.

[0106] In other words, after determining the model to be trained, the sample risk control task will be prompted for fine-tuning, and the sample graph data will be input into the model to be trained, so that the model to be trained outputs the prediction result according to the sample graph data under the prompt of the sample prompt graph, and then, by comparing the difference between the model's prediction result and the true label of the sample risk control task, that is, the difference between the predicted graph data and the labeled graph data, the loss value is calculated according to the preset loss function. Among them, the choice of loss function depends on the nature of the sample risk control task. For example, cross entropy loss is often used for classification tasks, while mean square error loss is suitable for regression tasks. The loss value measures the accuracy of the model's prediction. The smaller the value, the more accurate the model's prediction.

[0107] Furthermore, the calculated loss value is used to guide the adjustment of the parameters of the model to be trained. In this process, the back-propagation algorithm is used to calculate the gradient of the loss function with respect to the model parameters, thereby determining the direction and magnitude of the parameter update. It should be noted that in the multi-task meta-learning framework, when adjusting the parameters of the pre-trained model, the fixed pre-training parameters will not be adjusted, but the meta-learning prompt parameters and meta-learning task parameters will be adjusted. The adjustment of these parameters helps the model to better adapt to the sample risk control task and improve the performance of the model on specific tasks. In addition, parameter adjustment is usually not a one-time process, but an iterative process. In each iteration, the model performs forward propagation on the training data to generate predictions, and then updates the parameters through back-propagation. Through multiple rounds of iterations, the model gradually learns the characteristics of the sample risk control task and optimizes its prediction performance.

[0108] Finally, after a series of iterative optimizations, when the performance of the model to be trained on the sample risk control task reaches the preset threshold, the obtained model parameter set constitutes the risk control model used to handle the sample risk control task. This risk control model not only inherits the generalization ability of the pre-trained model to be trained, but also adapts to specific risk control scenarios through targeted parameter adjustments.

[0109] The above is the model training method provided in the embodiments of this specification. Based on the same idea, this specification also provides corresponding devices, storage media and electronic devices.

[0110] Figure 3 A schematic diagram of the structure of a model training device provided in an embodiment of this specification, the device comprising:

[0111] An acquisition module 300 is used to acquire sample graph data corresponding to a sample risk control task, and a sample annotation graph corresponding to the sample graph data;

[0112] An input module 302 is used to input the sample graph data into the model to be trained, and determine a sample prompt graph corresponding to the sample graph data through the prompt subnet of the model to be trained, so that the task subnet of the model to be trained outputs prediction graph data according to the sample graph data under the prompt of the sample prompt graph;

[0113] The adjustment module 304 is used to adjust the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet according to the difference between the prediction graph data and the sample annotation graph, so as to obtain a risk control model for processing the sample risk control task.

[0114] Optionally, the input module 302 is specifically used to determine an initial prompt graph according to the sample graph data through the prompt subnet of the model to be trained, wherein the number and feature vector dimension of the prompt nodes contained in the initial prompt graph are the same as those of the sample nodes contained in the sample graph data; and determine the prompt vector and prompt weight of each prompt node in the initial prompt graph, as well as the connection relationship between the prompt nodes according to the prompt parameters corresponding to the prompt subnet, to obtain a sample prompt graph corresponding to the sample graph data.

[0115] Optionally, the input module 302 is specifically used to determine, through the task subnet, for each sample node in the sample graph data, the sample vector of the sample node, and determine the corresponding prompt node of the sample node in the sample prompt graph based on the connection relationship between the prompt nodes; determine the final vector of the sample node based on the sample vector, the prompt vector of the corresponding prompt node and the prompt weight; determine the sample fusion graph of the sample graph data and the sample prompt graph based on the final vectors of the sample nodes, so that the task subnet outputs prediction graph data based on the sample fusion graph.

[0116] Optionally, the input module 302 is also used to perform self-supervised training on a preset graph neural network model to obtain an initial pre-trained model, and fix the pre-training parameters of the initial pre-trained model; determine a meta-learning task set based on the sample risk control task; and perform prompt learning on the initial pre-trained model through meta-learning based on each meta-learning task in the meta-learning task set to determine the meta-learning prompt parameters corresponding to the prompt subnet and the meta-learning task parameters corresponding to the task subnet to obtain the model to be trained.

[0117] Optionally, the input module 302 is also used to obtain a support data set and a query data set corresponding to each meta-learning task; for each meta-learning task, determine a first loss of the initial pre-trained model on the support data set corresponding to the meta-learning task; according to the first loss, adjust the parameters of the initial pre-trained model, determine initial prompt parameters and initial task parameters, and obtain a first pre-trained model corresponding to the meta-learning task; according to the query data set corresponding to the meta-learning task, train the first pre-trained model, and determine a second loss of the first pre-trained model on the query data set corresponding to the meta-learning task; according to the second losses corresponding to each meta-learning task, determine the meta-learning prompt parameters and meta-learning task parameters to obtain the model to be trained.

[0118] Optionally, the input module 302 is also used to, for each meta-learning task, input the support sample graph in the support data set corresponding to the meta-learning task into the initial pre-training model, determine the support prompt graph corresponding to the support sample graph through the prompt subnet of the initial pre-training model, so that the task subnet of the initial pre-training model outputs a support prediction graph according to the support sample graph under the prompt of the support prompt graph; determine the first loss corresponding to the meta-learning task according to the difference between the support prediction graph and the support annotation graph corresponding to the meta-learning task; for each meta-learning task, input the query sample graph in the query data set corresponding to the meta-learning task into the first pre-training model, determine the query prompt graph corresponding to the query sample graph through the prompt subnet of the first pre-training model, so that the task subnet of the first pre-training model outputs a query prediction graph according to the query sample graph under the prompt of the query prompt graph; determine the second loss corresponding to the meta-learning task according to the difference between the query prediction graph and the query annotation graph corresponding to the meta-learning task.

[0119] Optionally, the adjustment module 304 is specifically used to determine the loss value based on the difference between the predicted graph data and the sample annotation graph, and a preset loss function; according to the loss value, the meta-learning prompt parameters and meta-learning task parameters of the model to be trained are adjusted to obtain a risk control model for processing the sample risk control task.

[0120] This specification also provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, it can be used to perform the above Figure 1 Provided model training method.

[0121] based on Figure 1 The model training method shown in this specification also provides Figure 4 The structural diagram of the electronic device shown in FIG. Figure 4 At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The model training method described.

[0122] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the executor of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0123] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0124] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0125] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0126] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0127] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0128] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0129] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0130] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0131] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0132] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0133] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0134] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0135] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0136] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0137] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0138] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. A model training method, the method comprising: Obtaining sample graph data corresponding to the sample risk control task, and a sample annotation graph corresponding to the sample graph data; The sample graph data is input into the model to be trained, and a sample prompt graph corresponding to the sample graph data is determined through the prompt subnet of the model to be trained, so that the task subnet of the model to be trained outputs prediction graph data according to the sample graph data under the prompt of the sample prompt graph; According to the difference between the prediction graph data and the sample annotation graph, the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet are adjusted to obtain a risk control model for processing the sample risk control task.

2. The method according to claim 1, wherein determining a sample prompt graph corresponding to the sample graph data through the prompt subnet of the model to be trained comprises: Determining an initial prompt graph according to the sample graph data through the prompt subnet of the model to be trained, wherein the prompt nodes included in the initial prompt graph are the same in number and feature vector dimension as the sample nodes included in the sample graph data; According to the prompt parameters corresponding to the prompt subnet, the prompt vector and the prompt weight of each prompt node in the initial prompt graph, and the connection relationship between the prompt nodes are determined to obtain a sample prompt graph corresponding to the sample graph data.

3. The method according to claim 2, outputting predicted graph data according to the sample graph data, specifically comprising: Determine, by means of the task subnet, for each sample node in the sample graph data, a sample vector of the sample node, and determine, according to a connection relationship between the prompt nodes, a corresponding prompt node of the sample node in the sample prompt graph; Determine a final vector of the sample node according to the sample vector, the prompt vector of the corresponding prompt node and the prompt weight; According to the final vectors of the sample nodes, a sample fusion graph of the sample graph data and the sample prompt graph is determined, so that the task subnet outputs prediction graph data according to the sample fusion graph.

4. The method according to claim 1, before inputting the sample graph data into the model to be trained, the method further comprises: Performing self-supervised training on a preset graph neural network model to obtain an initial pre-trained model, and fixing pre-training parameters of the initial pre-trained model; Determine a meta-learning task set based on the sample risk control tasks; According to each meta-learning task in the meta-learning task set, the initial pre-trained model is subjected to prompt learning through meta-learning, and the meta-learning prompt parameters corresponding to the prompt subnet and the meta-learning task parameters corresponding to the task subnet are determined to obtain the model to be trained.

5. The method according to claim 4, wherein the initial pre-trained model is subjected to prompt learning through meta-learning according to each meta-learning task in the meta-learning task set, specifically comprising: Obtain the support dataset and query dataset corresponding to each meta-learning task; For each meta-learning task, determining a first loss of the initial pre-trained model on a support data set corresponding to the meta-learning task; According to the first loss, adjusting the parameters of the initial pre-trained model, determining initial prompt parameters and initial task parameters, and obtaining a first pre-trained model corresponding to the meta-learning task; Training the first pre-trained model according to the query data set corresponding to the meta-learning task, and determining a second loss of the first pre-trained model on the query data set corresponding to the meta-learning task; According to the second losses corresponding to the meta-learning tasks, meta-learning prompt parameters and meta-learning task parameters are determined to obtain a model to be trained.

6. The method of claim 5, wherein determining the first loss of the initial pre-trained model on the support data set corresponding to the meta-learning task comprises: For each meta-learning task, a support sample graph in a support data set corresponding to the meta-learning task is input into the initial pre-training model, and a support prompt graph corresponding to the support sample graph is determined through a prompt subnet of the initial pre-training model, so that the task subnet of the initial pre-training model outputs a support prediction graph according to the support sample graph under the prompt of the support prompt graph; Determining a first loss corresponding to the meta-learning task according to a difference between the support prediction graph and the support annotation graph corresponding to the meta-learning task; Determining a second loss of the first pre-trained model on the query data set corresponding to the meta-learning task specifically includes: For each meta-learning task, a query sample graph in a query data set corresponding to the meta-learning task is input into the first pre-trained model, and a query prompt graph corresponding to the query sample graph is determined through a prompt subnet of the first pre-trained model, so that the task subnet of the first pre-trained model outputs a query prediction graph according to the query sample graph under the prompt of the query prompt graph; Determine a second loss corresponding to the meta-learning task based on a difference between the query prediction graph and the query annotation graph corresponding to the meta-learning task.

7. The method according to claim 5, wherein the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet are adjusted according to the difference between the prediction graph data and the sample annotation graph, specifically comprising: Determine the loss value according to the difference between the predicted graph data and the sample labeled graph and a preset loss function; According to the loss value, the meta-learning prompt parameters and the meta-learning task parameters of the model to be trained are adjusted to obtain a risk control model for processing the sample risk control task.

8. A model training device, comprising: An acquisition module, used to acquire sample graph data corresponding to a sample risk control task, and a sample annotation graph corresponding to the sample graph data; An input module, used for inputting the sample graph data into the model to be trained, and determining a sample prompt graph corresponding to the sample graph data through the prompt subnet of the model to be trained, so that the task subnet of the model to be trained outputs prediction graph data according to the sample graph data under the prompt of the sample prompt graph; An adjustment module is used to adjust the prompt parameters corresponding to the prompt subnet and the task parameters corresponding to the task subnet according to the difference between the prediction graph data and the sample annotation graph, so as to obtain a risk control model for processing the sample risk control task.

9. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 7.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the program.