A federated modeling method, device, equipment and medium based on prompt learning

By employing a federated modeling approach based on prompting learning, this method utilizes a data task prompting model to control the learning direction of the locally pre-trained model and combines knowledge distillation techniques for gradient updates. This approach solves the problems of resource waste and privacy protection in federated modeling, achieving efficient and secure federated modeling results.

CN116432746BActive Publication Date: 2026-02-13SHANDONG INSPUR SCI RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310500646.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2026-02-13
Estimated Expiration
2043-04-28

AI Technical Summary

Technical Problem

Existing federated modeling methods suffer from significant waste of computational resources, large data transfer volumes, and a lack of training direction guidance during the training process, resulting in low efficiency and insufficient protection of privacy data. In particular, when multiple parties collaborate on modeling, it is difficult to effectively utilize the existing model resources of each party.

Method used

A cue-based learning approach is adopted, which controls the learning direction of the local pre-trained model by constructing a data task cue model. The prediction results of the globally trained shared model and the local label gradient are used to backpropagate and update the global and local model parameters. Combined with knowledge distillation technology, gradient compression and aggregation are performed to achieve efficient updating and secure transmission of model parameters.

Benefits of technology

It improves the efficiency and accuracy of federated modeling, reduces computational resource consumption and data transmission, ensures the security of privacy data, avoids catastrophic forgetting, and enhances the overall performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116432746B_ABST
    Figure CN116432746B_ABST
Patent Text Reader

Abstract

The application discloses a prompt learning-based federal modeling method and device, equipment and medium, and relates to the technical field of federal learning, which comprises the following steps: a data task prompt model using a prompt information generation strategy is used to control the learning direction of a local pre-training model of a participant; a first prediction result and a second prediction result of a global training shared model on joint modeling data items are obtained, and a first gradient of the first prediction result and a local label is calculated; a local pre-training model is trained using local training data, so as to output a third prediction result subjected to feature extraction and feature processing by the data task prompt model, and a second gradient of the third prediction result and the second prediction result is calculated; and the global model parameters of the global training shared model are updated by back propagation, and the local pre-training model and the data task prompt model are updated until the federal modeling is completed. The learning direction of the local pre-training model is guided, so that the training process of the local pre-training model is more in line with the requirements of the federal modeling task.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of federated learning, and in particular to a federated modeling method and device based on prompt learning, equipment and medium. BACKGROUND

[0002] At present, in the process of development of deep learning and big data technology, the model with good effect often has a large size and a complex structure, and the computational efficiency and resource usage are very large, so a large amount of resources are needed to train an efficient model, and how to effectively use the model and efficiently expand it has become a research hotspot. With the increasing complexity of business scenarios, the traditional single independent modeling method has been unable to meet the business requirements of complex scenarios. Therefore, federated modeling has become an important modeling method. In the process of federated modeling, a large amount of training data is often needed to train the supporting model, and in the process of training the model, the privacy data of different participants is involved, and in the case that all participants provide training data, a large amount of training data transmission is caused, and at present, the existing model is used for large model retraining, and there is no training direction prompt and guidance for large model retraining. For example, multiple banks improve their own risk control capabilities through joint risk control. Under this background, each joint modeling participant hopes to make full use of the existing model resources of each party, such as the financial risk control system owned by each bank, and try to avoid the catastrophic forgetting phenomenon to improve the efficiency of federated modeling, and at the same time, higher requirements for data privacy protection are put forward.

[0003] In summary, how to effectively use the existing business model to realize more efficient and safer federated modeling to improve the modeling efficiency and model accuracy is a technical problem to be solved in the field. SUMMARY

[0004] Therefore, the purpose of the present application is to provide a federated modeling method, device, equipment and medium based on prompt learning, which can effectively use the existing business model to realize more efficient and safer federated modeling to improve the modeling efficiency and model accuracy. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a federated modeling method based on prompt learning, comprising:

[0006] Using a data task prompt model based on a federated modeling task to construct a prompt information generation strategy to control the learning direction of the local pre-training model of each participant;

[0007] Obtaining the first prediction result and the second prediction result of the global training shared model on the joint modeling data item, and calculating the first gradient of the first prediction result and the local label;

[0008] training the local pre-training model by using the local training data of the participant, so that the local pre-training model outputs a third prediction result which is subjected to feature extraction and feature processing by the data task prompt model, and calculating a second gradient of the third prediction result and the second prediction result;

[0009] propagating the first gradient and the second gradient respectively to update global model parameters of the global training shared model, and assembling local model parameters according to the second gradient, and feeding back the local model parameters to the local pre-training model to update the data task prompt model, until federated modeling is completed.

[0010] Optionally, the data task prompt model using the prompt information generation strategy based on the federated modeling task controls the learning direction of the respective local pre-training model of the participant, comprising:

[0011] The data task prompt model based on the federated modeling task and priori knowledge constructs a prompt information generation strategy;

[0012] The data task prompt model determines the prompt information vector of the respective local pre-training model of the participant.

[0013] Optionally, the training of the local pre-training model by using the local training data of the participant, so that the local pre-training model outputs a third prediction result which is subjected to feature extraction and feature processing by the data task prompt model, comprises:

[0014] The local training data is input into the local pre-training model, so that the feature extraction module of the local pre-training model extracts the feature vector of the local training data, and the feature vector and the prompt information vector are input into the task output unit of the local pre-training model for processing to obtain a third prediction result.

[0015] Optionally, the calculation of the second gradient of the third prediction result and the second prediction result comprises:

[0016] Setting a knowledge distillation temperature parameter, and calculating the second gradient of the third prediction result and the second prediction result based on the knowledge distillation temperature parameter.

[0017] Optionally, the propagating of the first gradient and the second gradient respectively to update the global model parameters of the global training shared model, and the assembling of the local model parameters according to the second gradient, comprises:

[0018] The first gradient and the second gradient are propagated respectively by gradient descent method to update the global model parameters of the global training shared model;

[0019] Assembling the update gradients of the global training shared model by each participant, and sending all assembled update gradients to a federal aggregation node, so that the federal aggregation node re-decomposes the assembled update gradients and performs gradient aggregation to obtain aggregated gradient information;

[0020] Assembling local model parameters using the gradient information, and sending the local model parameters to the corresponding participants.

[0021] Optionally, after the local model parameters are sent to the corresponding participants, the method further includes:

[0022] Updating the global training shared model of each participant according to the local model parameters.

[0023] Optionally, the feedback of the local model parameters to the local pre-training model to update the data task prompt model until the completion of federal modeling includes:

[0024] Adjusting the data task prompt model using the local model parameters, generating prompt model parameters, and then updating the data task prompt model using the prompt model parameters until the completion of federal modeling.

[0025] In a second aspect, the present application discloses a federal modeling device based on prompt learning, comprising:

[0026] A direction determination module is configured to control the learning direction of the local pre-training model of each participant using a data task prompt model constructed based on a federal modeling task to generate a prompt information generation strategy.

[0027] A first gradient calculation module is configured to obtain a first prediction result and a second prediction result of a global training shared model on joint modeling data items, and calculate a first gradient of the first prediction result and a local label.

[0028] A second gradient calculation module is configured to train the local pre-training model using local training data of the participant, so that the local pre-training model outputs a third prediction result after feature extraction and feature processing by the data task prompt model, and calculates a second gradient of the third prediction result and the second prediction result.

[0029] A model training module is configured to respectively back-propagate the first gradient and the second gradient to update global model parameters of the global training shared model, assemble local model parameters according to the second gradient, and feed back the local model parameters to the local pre-training model to update the data task prompt model until the completion of federal modeling.

[0030] In a third aspect, the present application discloses an electronic device, comprising:

[0031] a memory for storing a computer program;

[0032] a processor for executing the computer program to implement the steps of the prompt learning based federated modeling method disclosed above.

[0033] In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by a processor to implement the steps of the prompt learning based federated modeling method disclosed above.

[0034] It can be seen that the present application discloses a prompt learning based federated modeling method, comprising: using a data task prompt model based on a federated modeling task to construct a prompt information generation strategy to control the learning direction of a local pre-training model of each participant; obtaining a first prediction result and a second prediction result of a global training shared model on joint modeling data items, and calculating a first gradient of the first prediction result and a local label; training the local pre-training model using local training data of the participant, so that the local pre-training model outputs a third prediction result after feature extraction and feature processing by the data task prompt model, and calculating a second gradient of the third prediction result and the second prediction result; respectively back-propagating the first gradient and the second gradient to update global model parameters of the global training shared model, and assembling local model parameters according to the second gradient, and feeding back the local model parameters to the local pre-training model to update the data task prompt model, until the federated modeling is completed. It can be seen that by using a data task prompt model based on a federated modeling task to construct a prompt information generation strategy, then adjusting the model parameters of the training process of the local pre-training model using the data task prompt model, and guiding the learning direction of the local pre-training model, the training process of the local pre-training model is more in line with the requirements of the federated modeling task, then training the global training shared model and the local pre-training model, and constantly updating the model parameters in the constant training and adjustment process between the global training shared model and the local pre-training model, to realize the prediction model of the final federated modeling. BRIEF DESCRIPTION OF DRAWINGS

[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings.

[0036] Figure 1A federal modeling method flowchart based on prompt learning disclosed by the present application;

[0037] Figure 2 A specific federal modeling method flowchart based on prompt learning disclosed by the present application;

[0038] Figure 3 A federal modeling structure flowchart based on prompt learning and knowledge distillation disclosed by the present application;

[0039] Figure 4 A federal modeling device structure schematic diagram based on prompt learning disclosed by the present application;

[0040] Figure 5 A structure diagram of an electronic device disclosed by the present application. DETAILED DESCRIPTION

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

[0042] At present, in the process of development of deep learning and big data technology, a model with good effect often has a large size and a complex structure, and often has a large overhead in terms of calculation efficiency and resource use. Therefore, a large amount of resources are needed to train an efficient model. How to effectively use the model and efficiently expand it has become a research hotspot. With the increasing complexity of business scenarios, the traditional single independent modeling method has been unable to meet the business requirements of complex scenarios. Therefore, federal modeling has become an important modeling means. In the process of federal modeling, a large amount of training data is often needed to train the supporting model, and in the process of training the model, the privacy data of different participants is involved, and in the case that all participants provide training data, a large amount of training data transmission is caused, and at present, the existing model is retrained to obtain a large model, and there is no training direction prompt and guidance for retraining of a large model. For example, multiple banks improve their own risk control capabilities through joint risk control. Under this background, each joint modeling participant hopes to make full use of the existing model resources of each party, such as the financial risk control systems owned by each bank, and try to avoid the catastrophic forgetting phenomenon to improve the efficiency of federal modeling, and at the same time, higher requirements are put forward for data privacy protection.

[0043] Therefore, the present application provides a federal modeling scheme based on prompt learning, which can effectively utilize the existing business model to realize more efficient and safer federal modeling, so as to improve the modeling efficiency and model accuracy.

[0044] Referring to Figure 1 As shown in the figure, the embodiment of the application discloses a federated modeling method based on prompt learning, comprising:

[0045] Step S11: using a data task prompt model based on a prompt information generation strategy of a federated modeling task to control the learning direction of the local pre-training model of each participant.

[0046] In this embodiment, a data task prompt model based on a prompt information generation strategy of a federated modeling task and prior knowledge is constructed; and the prompt information vector of the local pre-training model of each participant is determined by using the data task prompt model. It can be understood that, according to the demand of the federated modeling task, the prompt information generation strategy is constructed, and the prior knowledge is integrated into the prompt information generation strategy to guide the learning direction of the local pre-training model of each participant.

[0047] Step S12: obtaining the first prediction result and the second prediction result of the global training shared model on the joint modeling data item, and calculating the first gradient of the first prediction result and the local label.

[0048] In this embodiment, the joint modeling data item is predicted by using the constructed global training shared model to obtain the first prediction result GM-Hard-output and the second prediction result GM-Soft-output. It can be understood that, before prediction, the global training shared model GM is constructed, wherein the global training shared model GM is a model formed by common training of each federated modeling participant, and is used to complete the federated modeling task of each party. The core is a neural network model, which is specifically composed of a feature extraction unit, a feature processing unit, a task output unit and the like. After the construction is completed, the prediction results in two ways can be obtained by predicting through the global training shared model. The first prediction result GM-Hard-output is a direct specific prediction category, while the second prediction result GM-Soft-output is a different prediction category carrying different probabilities, for example: when inputting a picture, the first prediction result is "horse", and the second prediction result is "0.8 is horse, 0.12 is donkey, and 0.08 is dog". After the first prediction result is obtained, the first gradient of the first prediction result and the local label corresponding to the input data obtained in advance is calculated.

[0049] Step S13: training the local pre-training model by using the local training data of the participant, so that the local pre-training model outputs a third prediction result subjected to feature extraction and feature processing by the data task prompt model, and calculating the second gradient of the third prediction result and the second prediction result.

[0050] In this embodiment, the local training data is input into the local pre-training model, so that the feature extraction module of the local pre-training model extracts the feature vector of the local training data, and the feature vector and the prompt information vector are input into the task output unit of the local pre-training model for processing to obtain a third prediction result. It can be understood that the local pre-training model is trained using the local training data of the participant, which can avoid the leakage of private data. At the same time, before training the local pre-training model using the local training data, the local pre-training model is constructed. Specifically, the local pre-training model LM is a prediction model owned by the federal modeling participant itself, which realizes the business scenario requirement, and its core is a deep learning neural network model, which is composed of a feature extraction unit, a feature processing unit, and a task output unit, etc., and is used to complete the prediction of business function tasks. When the local training data is input into the local pre-training model, the prompt model Prompt-Model is constructed according to the prompt information setting strategy of the federal modeling task demand, which is composed of a data prompt generation module Data-Prompt-Gen and a task prompt generation module Task-Prompt-Gen. The construction of the prompt information is based on domain knowledge and other means, and is mainly used to set the parameters of the local pre-training model LM; the data prompt generation module Data-Prompt-Gen is mainly responsible for adjusting the input parameter feature extraction unit of the federal modeling local pre-training model LM, so as to meet the requirements of the joint modeling input data, and guide the feature extraction unit to be more consistent with the requirements of the federal modeling task; the task prompt generation module Task-Prompt-Gen is mainly responsible for adjusting the task output unit of the federal modeling local pre-training model LM, so as to make the prediction result generated by it meet the requirements of the joint modeling output, and guide the task output unit to output the prediction result more consistent with the requirements of the federal modeling task. The local pre-training model outputs a third prediction result LM-Prompt-Soft-output, and then calculates a second gradient between the third prediction result LM-Prompt-Soft-output and a second prediction result GM-Soft-output. Through prompt learning, the machine learning of the downstream task prediction effect is improved by adding prompt information to the input without significantly changing the structure and parameters of the pre-training language model.

[0051] Step S14: respectively propagating the first gradient and the second gradient to update the global model parameters of the global training shared model, assembling the local model parameters according to the second gradient, and feeding back the local model parameters to the local pre-training model to update the data task prompt model until the federal modeling is completed.

[0052] In this embodiment, the first gradient and the second gradient obtained above are back propagated, and the global training shared model GM parameters are updated using the back propagated error; it should be noted that a Teacher-Student knowledge distillation mode is constructed between the global training shared model GM and the local pre-training model, knowledge distillation is an important means of model compression and training acceleration, which realizes efficient transmission of knowledge from a large model to a small model, so that the global shared model parameter knowledge semantic level compression and refinement of the local training of the global training shared model GM in the federal modeling participant play a role. It can reduce the transmission amount of model parameters, reduce the communication cost, and effectively improve the training efficiency of federal modeling and the accuracy of the final model. Then, the local model parameters are assembled according to the second gradient, and the local model parameters are fed back to the local pre-training model to update the data task prompt model until the federal modeling is completed.

[0053] Therefore, the application discloses a federal modeling method based on prompt learning, which comprises the following steps: using a data task prompt model based on a federal modeling task to construct a prompt information generation strategy to control the learning direction of each local pre-training model of the participants; obtaining a first prediction result and a second prediction result of a global training shared model on joint modeling data items, and calculating a first gradient of the first prediction result and a local label; training the local pre-training model using the local training data of the participants, so that the local pre-training model outputs a third prediction result after feature extraction and feature processing by the data task prompt model, and calculating a second gradient of the third prediction result and the second prediction result; respectively back propagating the first gradient and the second gradient to update the global model parameters of the global training shared model, and assembling local model parameters according to the second gradient, and feeding back the local model parameters to the local pre-training model to update the data task prompt model until the federal modeling is completed. It can be seen that by using the data task prompt model based on the prompt information generation strategy of the federal modeling task, the model parameters of the training process of the local pre-training model are adjusted, and the learning direction of the local pre-training model is guided, so that the training process of the local pre-training model is more in line with the requirements of the federal modeling task. Then, the global training shared model and the local pre-training model are trained, and the model parameters are updated during the continuous training and adjustment process between the global training shared model and the local pre-training model, so as to realize the prediction model of the final federal modeling.

[0054] Reference Figure 2 The embodiment of the application discloses a specific federal modeling method based on prompt learning. Compared with the previous embodiment, the technical solution is further described and optimized.

[0055] Specifically,

[0056] Step S21: Control the learning direction of the local pre-training model of each participant by using the data task prompt model based on the prompt information generation strategy of the federated modeling task.

[0057] Step S22: Obtain the first prediction result and the second prediction result of the joint modeling data item of the global training shared model, and calculate the first gradient of the first prediction result and the local label.

[0058] Step S23: Train the local pre-training model by using the local training data of the participant, so that the local pre-training model outputs a third prediction result subjected to feature extraction and feature processing by the data task prompt model.

[0059] The more detailed processing procedures in steps S21, S22 and S23 are described in the foregoing embodiments, which will not be repeated here.

[0060] Step S24: Set a knowledge distillation temperature parameter, and calculate the second gradient of the third prediction result and the second prediction result based on the knowledge distillation temperature parameter.

[0061] In this embodiment, the knowledge distillation temperature parameter is set, that is, the knowledge semantic level of the global training shared model parameter of the Teacher-Student mode interaction strategy between the local pre-training model and the global training shared model is compressed and refined, so as to realize the knowledge distillation and local training of the federated modeling global shared model, and then obtain the second gradient of the third prediction result and the second prediction result.

[0062] Step S25: Update the global model parameter of the global training shared model by respectively back-propagating the first gradient and the second gradient by the gradient descent method.

[0063] In this embodiment, the first gradient of the first prediction result GM-Hard-Output and the local label Real-Lable is calculated, the error is back-propagated by the gradient descent method to update the global training shared model GM parameter; after appropriately adjusting the knowledge distillation temperature parameter, the gradient of the second prediction result GM-Soft-Output and the third prediction result LM-Prompt-Soft-output is calculated, and the error is back-propagated by the gradient descent method to update the global training shared model GM parameter.

[0064] In this embodiment, the participating parties compress and assemble the update gradient of the global training shared model, and send all the assembled update gradients to the federal aggregation node, so that the federal aggregation node re-decomposes the assembled update gradient and performs gradient aggregation to obtain aggregated gradient information; the local model parameters are assembled using the gradient information, and the local model parameters are sent to the corresponding participating parties. It can be understood that each federal modeling participant compresses and assembles the update gradient of the global training shared model GM, and converges to the federal aggregation node FL-Server; the federal aggregation node FL-Server re-decomposes the update gradient of the global training shared model GM from each federal modeling participant through the parameter aggregation module Para-Aggregate, and realizes gradient aggregation; the federal aggregation node FL-Server performs parameter selection assembly according to the gradient information uploaded by each federal modeling participant through the parameter update module Para-Upd, and feeds back the updated parameters to each federal modeling party. Among them, the parameter aggregation module Para-Aggregate is responsible for aggregating the gradient parameters of the federal modeling participants; the parameter update module Para-Upd is responsible for updating the global training shared model GM according to the updated parameters fed back to each federal modeling party; the prompt model distribution module Prompt-Dist adjusts the prompt model according to the model parameter update and issues it to each federal modeling participant.

[0065] In this embodiment, after the local model parameters are sent to the corresponding participating parties, the global training shared model of each participating party is updated according to the local model parameters. It can be understood that each federal modeling participant receives the updated parameters and updates the global training shared model GM.

[0066] Step S26: Obtain local model parameters based on the global model parameters, adjust the data task prompt model using the local model parameters, and generate prompt model parameters, and then update the data task prompt model using the prompt model parameters until the federal modeling is completed.

[0067] In this embodiment, the prompt model distribution module Prompt-Dist adjusts the prompt model according to the model parameter update and issues it to each federal modeling participant; each federal modeling participant receives the updated prompt model parameters and updates the local prompt model Prompt-Model; the entire model training process is continuously executed until the federal modeling task requirements are met, and the final federal modeling prediction model is formed.

[0068] In this embodiment, refer to Figure 2As shown, before the federal modeling training, first, the preparation process and the federal modeling process of the federal modeling task are carried out, specifically as follows:

[0069] Step 101, according to the requirements of the federal modeling prediction task, the data features affecting the prediction task are selected, the model structure and the loss function are set.

[0070] Step 102, the federal aggregation node FL-Server distributes the global training shared model GM to each federal modeling participant.

[0071] Step 103, according to the federal modeling prediction task, the initial parameters of the prompt model Prompt-Model are set.

[0072] Step 104, the federal aggregation node FL-Server distributes the prompt model Prompt-Model to each federal modeling participant.

[0073] Step 105, each participant prepares the training data for federal modeling, the federal modeling local pre-training model LM and the local label data.

[0074] When the preparation of federal modeling is completed, the federal modeling task training is started, specifically as follows:

[0075] Step 201, each federal modeling participant generates the first prediction result GM-Hard-Output and the second prediction result GM-Soft-Output by inputting the joint modeling data item FL-Input through the global training shared model GM.

[0076] Step 202, each federal modeling participant inputs the local training data Input into the local pre-training model LM, and the data prompt generation module Data-Prompt-Gen of the prompt model Prompt-Model generates a prompt information vector and inputs it into the feature extraction unit of the prompt model Prompt-Model, realizing feature extraction for the federal modeling prediction task.

[0077] Step 203, the local pre-training model LM performs feature processing on the features extracted by the feature extraction unit to form a feature vector.

[0078] Step 204, the feature vector and the prompt information vector generated by the task prompt generation module Task-Prompt-Gen of the prompt model Prompt-Model are input into the task output unit of the local pre-training model LM to generate the third prediction result LM-Prompt-Soft-output.

[0079] Step 205, calculate the gradient of the first prediction result GM-Hard-Output and the local label Real-Lable, use gradient descent method to update the global training shared model GM parameters by backpropagation of errors.

[0080] Step 206, adjust the knowledge distillation temperature parameter, calculate the gradient of the second prediction result GM-Soft-Output and the third prediction result LM-Prompt-Soft-output, use gradient descent method to update the global training shared model GM parameters by backpropagation of errors.

[0081] Step 207, each federal modeling participant compresses and assembles the update gradient of the global training shared model GM, and converges to the federal aggregation node FL-Server.

[0082] Step 208, the federal aggregation node FL-Server re-decomposes the update gradient of the global training shared model GM from each federal modeling participant through the parameter aggregation module Para-Aggregate, and realizes gradient aggregation.

[0083] Step 209, the federal aggregation node FL-Server selects and assembles parameters according to the gradient information uploaded by each federal modeling participant through the parameter update module Para-Upd, and feeds back the updated parameters to each federal modeling party.

[0084] Step 210, each federal modeling participant receives the updated parameters and updates the global training shared model GM.

[0085] Step 211, the prompt model distribution module Prompt-Dist adjusts the prompt model according to the model parameter update and distributes it to each federal modeling participant.

[0086] Step 212, each federal modeling participant receives the updated prompt model parameters and updates the local prompt model Prompt-Model.

[0087] Step 213, continuously execute steps 201 to 212 until the federal modeling task requirements are met, and form the final federal modeling prediction model.

[0088] In this embodiment, when the federal modeling prediction model is completed, the inference of the federal prediction task is performed by using the federal modeling prediction model, specifically, the prediction model formed by the federal modeling is deployed at the data application end; data input is performed according to the requirements of the federal modeling task, the federal modeling prediction model outputs a prediction result; prediction result feedback data is continuously collected, the model is continuously optimized, and the internal relationship of the prediction task is continuously explored, and the design update prompt model is continuously optimized.

[0089] Therefore, by adopting the gradient secure aggregation method, the gradient parameter decomposition and compression are performed on the different local personalized models of the participants, thereby further guaranteeing the privacy data and security of each party. Finally, by continuously collecting feedback information, the modeling task characteristics are continuously refined and the prompt model is continuously optimized to form the best joint modeling model for the joint inference task.

[0090] Referring to Figure 4 The embodiments of the present application also correspondingly disclose a federal modeling device based on prompt learning, comprising:

[0091] The direction determination module 11 is configured to control the learning direction of the local pre-training model of each participant by using the data task prompt model constructed based on the federal modeling task construction prompt information generation strategy;

[0092] The first gradient calculation module 12 is configured to obtain the first prediction result and the second prediction result of the global training shared model on the joint modeling data item, and calculate the first gradient of the first prediction result and the local label;

[0093] The second gradient calculation module 13 is configured to train the local pre-training model by using the local training data of the participant, so that the local pre-training model outputs a third prediction result which is subjected to feature extraction and feature processing by the data task prompt model, and calculates the second gradient of the third prediction result and the second prediction result;

[0094] The model training module 14 is configured to respectively back-propagate the first gradient and the second gradient to update the global model parameters of the global training shared model, assemble the local model parameters according to the second gradient, and feed back the local model parameters to the local pre-training model to update the data task prompt model, until the federal modeling is completed.

[0095] It can be seen that the application discloses a data task prompt model using a prompt information generation strategy based on a federal modeling task to control the learning direction of a local pre-training model of each participant, obtains a first prediction result and a second prediction result of a global training shared model on joint modeling data items, and calculates a first gradient of the first prediction result and a local label; the local pre-training model is trained using local training data of the participant, so that the local pre-training model outputs a third prediction result subjected to feature extraction and feature processing by the data task prompt model, a second gradient of the third prediction result and the second prediction result is calculated; the first gradient and the second gradient are respectively back propagated to update global model parameters of the global training shared model, and local model parameters are assembled according to the second gradient, and the local model parameters are fed back to the local pre-training model to update the data task prompt model, until the federal modeling is completed. It can be seen that by constructing a data task prompt model using a prompt information generation strategy based on a federal modeling task, then adjusting the model parameters of the training process of the local pre-training model using the data task prompt model, and guiding the learning direction of the local pre-training model, the training process of the local pre-training model is more in line with the requirements of the federal modeling task, then the global training shared model and the local pre-training model are trained, and in the continuous training and adjustment process between the global training shared model and the local pre-training model, the model parameters are continuously updated to realize the prediction model of the final federal modeling.

[0096] Further, the embodiment of the application further discloses an electronic device, Figure 5 The electronic device 20 structure diagram shown in the figure is not considered as any limitation on the use range of the application.

[0097] Figure 5 The electronic device 20 structure diagram provided by the embodiment of the application. The electronic device 20, specifically can include: at least one processor 21, at least one memory 22, power supply 23, communication interface 24, input output interface 25 and communication bus 26. Wherein, the memory 22 is used to store computer program, the computer program is loaded and executed by the processor 21, to realize the related steps in the federal modeling method based on prompt learning disclosed by any preceding embodiment. In addition, the electronic device 20 in the embodiment of the application specifically can be electronic computer.

[0098] In this embodiment, the power supply 23 is configured to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 is configured to create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which will not be specifically limited herein; the input and output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application requirements, which will not be specifically limited herein.

[0099] The processor 21 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 21 can also include a main processor and a coprocessor. The main processor is a processor for processing data in a wake-up state, also known as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 21 can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 can also include an AI (Artificial Intelligence) processor configured to process machine learning-related computing operations.

[0100] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a magnetic disk, or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage mode can be temporary storage or permanent storage.

[0101] The operating system 221 is used to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to realize the operation and processing of the processor 21 on the mass data 223 in the memory 22, which can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of completing the prompt learning-based federated modeling method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include a computer program capable of completing other specific work. In addition to the data received by the electronic device from the external device, the data 223 can also include the data collected by the self input / output interface 25, etc.

[0102] Further, the application also discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by a processor to realize the prompt learning-based federated modeling method disclosed in the foregoing. The specific steps of the method can refer to the corresponding content disclosed in the foregoing embodiments, which will not be described here.

[0103] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can refer to the method part.

[0104] The skilled person can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present text can be realized by electronic hardware, computer software or a combination of both. In order to clearly show the interchangeability of hardware and software, the composition and steps of each example have been described in the above description. Whether the functions are realized by hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application. The steps of the method or algorithm described in combination with the embodiments disclosed in the present text can be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software modules can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0105] Finally, it needs to be pointed out that in this paper, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitation, the element defined by the statement "including a" does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0106] The above describes in detail the method, device, equipment and medium provided by the present application based on prompt learning federal modeling. The principles and implementation modes of the present application are described by applying specific examples in this paper. The above example is only used to help understand the method and core idea of the present application. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed. In view of the above, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A federated modeling method based on cue-based learning, characterized in that, include: A data task prompting model, which utilizes a federated modeling task to construct a prompting information generation strategy, controls the learning direction of each participant's local pre-trained model; wherein, the local pre-trained model is each participant's own financial risk control model; and the input data of the financial risk control model is an image. Obtain the first and second prediction results of the globally trained shared model for the jointly modeled data item, and calculate the first gradient between the first prediction result and the local label; The local pre-trained model is trained using the local training data of the participants, so that the local pre-trained model outputs a third prediction result after feature extraction and feature processing by the data task prompting model, and the second gradient between the third prediction result and the second prediction result is calculated. The first gradient and the second gradient are backpropagated to update the global model parameters of the globally trained shared model, and the local model parameters are assembled according to the second gradient. The local model parameters are then fed back to the local pre-trained model to update the data task prompt model until the federated modeling meets the requirements of the financial risk control task.

2. The federated modeling method based on cue learning according to claim 1, characterized in that, The data task prompting model, which utilizes a prompting information generation strategy based on a federated modeling task to control the learning direction of each participant's local pre-trained model, includes: A data task prompting model is constructed based on federated modeling tasks and prior knowledge to generate prompting information strategies. The data task prompting model is used to determine the prompting information vector of each participant's local pre-trained model.

3. The federated modeling method based on cue learning according to claim 2, characterized in that, The step of training the local pre-trained model using the local training data of the participating parties, so that the local pre-trained model outputs a third prediction result after feature extraction and feature processing by the data task prompting model, includes: The local training data is input into the local pre-trained model so that the feature extraction module of the local pre-trained model can extract the feature vector of the local training data. The feature vector and the prompt information vector are then input into the task output unit of the local pre-trained model for processing to obtain a third prediction result.

4. The federated modeling method based on cue-based learning according to claim 1, characterized in that, The calculation of the second gradient between the third prediction result and the second prediction result includes: Set the knowledge distillation temperature parameter, and calculate the second gradient between the third prediction result and the second prediction result based on the knowledge distillation temperature parameter.

5. The federated modeling method based on cue-based learning according to claim 1, characterized in that, The step of backpropagating the first gradient and the second gradient to update the global model parameters of the globally trained shared model, and assembling the local model parameters according to the second gradient, includes: The first gradient and the second gradient are backpropagated using gradient descent to update the global model parameters of the globally trained shared model. The update gradients of the globally trained shared model are compressed and assembled by each participant, and all assembled update gradients are sent to the federated aggregation node. The federated aggregation node then decomposes the assembled update gradients and performs gradient aggregation to obtain the aggregated gradient information. The local model parameters are assembled using the gradient information and then sent to the corresponding participant.

6. The federated modeling method based on cue learning according to claim 5, characterized in that, After sending the local model parameters to the corresponding participant, the process further includes: The global training shared model of each participant is updated based on the local model parameters.

7. The federated modeling method based on cue-based learning according to claim 1, characterized in that, The step of feeding back the local model parameters to the local pre-trained model to update the data task prompting model until federated modeling is completed includes: The data task prompting model is adjusted using the local model parameters, and prompting model parameters are generated. Then, the data task prompting model is updated using the prompting model parameters until federated modeling is completed.

8. A federated modeling apparatus based on cue-based learning, characterized in that, include: The direction determination module is used to control the learning direction of each participant's local pre-trained model by using a data task prompting model that constructs a prompting information generation strategy based on a federated modeling task; wherein, the local pre-trained model is each participant's financial risk control model; and the input data of the financial risk control model is an image. The first gradient calculation module is used to obtain the first and second prediction results of the globally trained shared model for the jointly modeled data item, and to calculate the first gradient between the first prediction result and the local label. The second gradient calculation module is used to train the local pre-trained model using the local training data of the participants, so that the local pre-trained model outputs a third prediction result after feature extraction and feature processing by the data task prompting model, and calculates the second gradient between the third prediction result and the second prediction result. The model training module is used to backpropagate the first gradient and the second gradient to update the global model parameters of the globally trained shared model, assemble local model parameters according to the second gradient, and feed the local model parameters back to the local pre-trained model to update the data task prompt model until the federated modeling meets the requirements of the financial risk control task.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the federated modeling method based on cueing learning as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the federated modeling method based on prompting learning as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Federated learning model training method and device

    CN111950740A

  • Transverse federated learning modeling optimization method and device, medium and program product

    CN113627085A