Joint training method and device of model, equipment, medium and product

By introducing a computing service in joint model training and matrix splitting of training data, sending shared matrix and gradient shard values, the problem of low security in the existing technology is solved, and higher data privacy is achieved Protection and system performance improvements.

CN119249158AActive Publication Date: 2025-01-03LINGSHU TECH CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411783738.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-01-03
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

When the existing joint training methods of model ensure data privacy security, the system performance is low, making it difficult to effectively improve the security of training data.

Method used

By introducing a computing service provider and splitting the training data matrix held by the first training participant, a local matrix, a first shared matrix and a second shared matrix are obtained, and the first shared matrix is ​​sent to the second training participant. The second shared matrix is ​​sent to the computing service provider, and finally, the gradient shard value feedback from the second training participant and the computing service provider and the gradient shard value generated by the first training participant are updated to ensure the second training Participants cannot independently restore the complete training data matrix.

Benefits of technology

On the premise of ensuring the joint training effect, the privacy and security of training data are effectively improved to prevent data leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119249158A_ABST
    Figure CN119249158A_ABST
Patent Text Reader

Abstract

The invention discloses a joint training method and device of a model, equipment, a medium and a product, and relates to the technical field of artificial intelligence, and the method comprises the steps: splitting a first training data matrix of a first training participant, and determining a local matrix, a first shared matrix and a second shared matrix from the first split matrix; the first shared matrix is sent to the second training participant, and the second shared matrix is sent to the calculation service party; and according to the first gradient first fragment value sent by the second training participant, calculating a first gradient second fragment value sent by the service party and a first gradient third fragment value generated by the first training participant, and updating a first to-be-updated model parameter of a first to-be-trained model of the first training participant. According to the method, the second training participant cannot independently restore the complete first training data matrix, the privacy of the training data of the first training participant is protected on the premise of ensuring the joint training effect, and the safety of the training data is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a joint training method, device, equipment, medium and product of a model. Background Art

[0002] Model joint training is a technique that improves overall performance by training multiple models simultaneously and leveraging the interaction and information sharing between them. This method can solve the challenges that a single model may face, such as insufficient data and overfitting, by working together with multiple models, thereby improving the accuracy and stability of predictions.

[0003] However, to ensure data privacy and security, current model joint training methods are usually implemented based on homomorphic encryption and complete secret sharing technology, which results in low performance of the entire system. Summary of the invention

[0004] The present invention provides a model joint training method, device, equipment, medium and product to solve the problem of low training data security in existing model joint training.

[0005] According to one aspect of the present invention, a joint training method of a model is provided, comprising:

[0006] Splitting a first training data matrix held by a first training participant to obtain a target number of first split matrices, and determining a local matrix, a first shared matrix, and a second shared matrix from the first split matrix, wherein the local matrix is ​​different from the first shared matrix and the second shared matrix;

[0007] Sending the first shared matrix to a second training participant, and sending the second shared matrix to a computing service provider;

[0008] Update the first model parameter to be updated of the first model to be trained of the first training participant in the current iteration round according to the first gradient first slice value sent by the second training participant, the first gradient second slice value sent by the computing service provider, and the first gradient third slice value generated by the first training participant;

[0009] Among them, the first gradient first slice value is determined by the second training participant according to the first shared matrix, the first gradient second slice value is determined by the computing service provider according to the second shared matrix, and the first gradient third slice value is determined by the first training participant according to the local matrix.

[0010] According to another aspect of the present invention, there is provided a joint training device for a model, comprising:

[0011] a matrix splitting module, configured to split a first training data matrix held by a first training participant to obtain a target number of first split matrices, and determine a local matrix, a first shared matrix, and a second shared matrix from the first split matrix, wherein the local matrix is ​​different from the first shared matrix and the second shared matrix;

[0012] A matrix sending module, used to send the first shared matrix to the second training participant, and send the second shared matrix to the computing service provider;

[0013] a model parameter updating module, configured to update a first model parameter to be updated of a first model to be trained of the first training participant in a current iteration round according to a first gradient first slice value sent by the second training participant, a first gradient second slice value sent by the computing service provider, and a first gradient third slice value generated by the first training participant;

[0014] Among them, the first gradient first slice value is determined by the second training participant according to the first shared matrix, the first gradient second slice value is determined by the computing service provider according to the second shared matrix, and the first gradient third slice value is determined by the first training participant according to the local matrix.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to the at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the joint training method of the model described in any one of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the joint training method of the model described in any one of the present invention when executed.

[0020] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the joint training method of the model described in any one of the present invention.

[0021] The present invention introduces a computing service party in the joint training process, splits the first training data matrix held by the first training participant, obtains a local matrix, a first shared matrix, and a second shared matrix, and then sends the first shared matrix to the second training participant, and sends the second shared matrix to the computing service party. Finally, the first to-be-trained model of the first training participant is trained using the gradient slice values ​​respectively fed back by the second training participant and the computing service party and the gradient slice values ​​generated by the first training participant, so that the second training participant cannot independently restore the complete first training data matrix. Under the premise of ensuring the joint training effect, the privacy of the training data of the first training participant is protected, and the security of the training data is further improved.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 A flowchart of a joint training method of a model provided in Embodiment 1 of the present invention;

[0025] Figure 2 A flowchart of a joint training method of a model provided in Embodiment 2 of the present invention;

[0026] Figure 3 A schematic diagram of the structure of a joint training device for a model provided in Embodiment 3 of the present invention;

[0027] Figure 4 It is a structural schematic diagram of an electronic device for implementing the joint training method of the model of an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", "local", "shared", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Embodiment 1

[0031] Figure 1 This is a flow chart of a joint training method for a model provided in the first embodiment of the present invention. This embodiment is applicable to the case where a first training participant and a second training participant perform joint training of a model. The method can be performed by a joint training device for a model, and the joint training device for a model can be implemented in the form of hardware and / or software. Figure 1 As shown, the method includes:

[0032] S101, splitting a first training data matrix held by a first training participant to obtain a target number of first split matrices, and determining a local matrix, a first shared matrix, and a second shared matrix from the first split matrix.

[0033] The first training participant refers to any one of the at least two training participants participating in the joint model training. For example, assuming that the training participants participating in the joint model training include training participant 1 and training participant 2, the first training participant can be either training participant 1 or training participant 2. In other words, any training participant participating in the joint model training can serve as the first training participant in this embodiment.

[0034] The first training data matrix refers to the training data matrix held by the first training participant, and the training data matrix refers to the matrix expression of the training data.

[0035] Taking the model application scenario of loan amount prediction as an example, the training data matrix is ​​illustrated: In the loan amount prediction scenario, assuming that the training participants include a management agency and a lending bank, the training data matrix held by a management agency can be expressed as:

[0036] ;

[0037] The training data matrix held by a lending bank can be expressed as:

[0038] ;

[0039] This embodiment only uses the above examples to illustrate the training data matrix, but does not limit the specific content of the training data matrix. In addition, this embodiment also only uses the above examples to illustrate the model application scenarios, but does not limit the model application scenarios. In this embodiment, the model application scenarios include but are not limited to loan amount prediction, house price prediction, investment risk analysis, crop fertilizer analysis, student learning ability assessment, patient organ function prediction, etc.

[0040] In one implementation, the first training participant splits the first training data matrix to obtain a first split matrix of a target number. The target number is at least two, and can be set and adjusted according to actual business needs. Taking the target number of three as an example, how to split the first training data matrix is ​​illustrated:

[0041] Assume that the first training data matrix , then the first training data matrix Split into three first split matrices: , and , and satisfies .in, , and The matrix form can be expressed as:

[0042]

[0043]

[0044]

[0045] This embodiment only uses the above example to illustrate how to split the first training data matrix, but does not limit the target number corresponding to the first split matrix.

[0046] After obtaining the target number of first split matrices, the first training participant determines from the first split matrices that are not sent to the second training participant and the computing service provider as a local matrix, the first split matrix used to be sent to the second training participant as a first shared matrix, and the first split matrix used to be sent to the computing service provider as a second shared matrix, wherein the local matrix is ​​different from the first shared matrix and the second shared matrix, and the first shared matrix and the second shared matrix are only used to distinguish different first split matrices, but do not specifically refer to a certain first split matrix.

[0047] It is understandable that, in order to ensure the security of the training data, the first shared matrix and the second shared matrix are only a part of the first split matrix, rather than the entire first split matrix. For example, assuming that the first split matrix includes , and , then the first shared matrix / the second shared matrix can be { , }、{ , }or{ , }.

[0048] Preferably, in order to ensure the training effect of the joint model training, the number of matrices of the first shared matrix and the second shared matrix is ​​set to be the same, and the combination of the first shared matrix and the second shared matrix can restore the first training data matrix. For example, assuming that the first split matrix includes , and , when the first shared matrix is ​​{ , }, the second shared matrix can be { , }or{ , }; When the first shared matrix is ​​{ , }, the second shared matrix can be { , }or{ , }; When the first shared matrix is ​​{ , }, the second shared matrix can be { , }or{ , }.

[0049] This embodiment only uses the above example to illustrate the first sharing matrix and the second sharing matrix, but does not limit the first sharing matrix and the second sharing matrix.

[0050] S102: Send the first shared matrix to the second training participant, and send the second shared matrix to the computing service provider.

[0051] The second training participant refers to the training participant other than the first training participant among the training participants participating in the joint model training. For example, assuming that the training participants participating in the joint model training include training participant 1 and training participant 2, then if training participant 1 is the first training participant, training participant 2 is the second training participant; if training participant 2 is the first training participant, training participant 1 is the second training participant. A computing service provider is a third-party service provider that can provide data computing services to any training participant, such as a data computing server.

[0052] In one implementation, the first training participant sends the first shared matrix to the second training participant using a data channel between the first training participant and the second shared matrix to the computing service provider using a data channel between the first training participant and the computing service provider.

[0053] Exemplarily, assuming that the first shared matrix is ​​{ , }, the second shared matrix is ​​{ , }, the first training participant will { , } is sent to the second training participant, and { , }Sent to the computing service provider.

[0054] S103. Update the first model parameter to be updated of the first model to be trained of the first training participant in the current iteration round according to the first gradient first slice value sent by the second training participant, the first gradient second slice value sent by the calculation service provider, and the first gradient third slice value generated by the first training participant.

[0055] Among them, the first gradient first slice value is determined by the second training participant according to the first shared matrix, the first gradient second slice value is determined by the computing service provider according to the second shared matrix, and the first gradient third slice value is determined by the first training participant according to the local matrix.

[0056] In one embodiment, the second training participant determines a second error vector based on the second model parameters to be updated of the corresponding second model to be trained in the current iteration round, and the second training data matrix held by the second training participant. The second training participant splits the second error vector to obtain a target number of first split vectors, and determines a local vector, a first shared vector, and a second shared vector from the first split vector. After receiving the first shared matrix, the second training participant determines a first gradient first slice value based on the local vector and the first shared matrix, and sends the first gradient first slice value to the first training participant.

[0057] At the same time, the second training participant sends the second shared vector to the computing service provider. The computing service provider determines the first gradient second slice value based on the second shared vector sent by the second training participant and the second shared matrix sent by the first training participant. The computing service provider sends the first gradient second slice value to the first training participant.

[0058] At the same time, the first training participant calculates the first gradient third slice value according to the local matrix and the first shared vector sent by the second training participant.

[0059] Further, the first training participant determines the first gradient value according to the first gradient first slice value, the first gradient second slice value and the first gradient third slice value, and determines the first error vector according to the first model parameter to be updated and the first training data matrix. Further, the first training participant determines the second gradient value according to the first error vector, and determines the first iteration gradient total value of the first model to be trained in the current iteration round according to the first gradient value and the second gradient value, and finally performs model training on the first model to be trained of the first training participant according to the first iteration gradient total value, that is, updates the first model parameter to be updated of the first model to be trained of the first training participant in the current iteration round.

[0060] The embodiment of the present invention introduces a computing service provider in the joint training process, splits the first training data matrix held by the first training participant, obtains a local matrix, a first shared matrix, and a second shared matrix, and then sends the first shared matrix to the second training participant, and sends the second shared matrix to the computing service provider. Finally, the first to-be-trained model of the first training participant is trained using the gradient slice values ​​respectively fed back by the second training participant and the computing service provider and the gradient slice values ​​generated by the first training participant, so that the second training participant cannot independently restore the complete first training data matrix. Under the premise of ensuring the joint training effect, the privacy of the training data of the first training participant is protected, and the security of the training data is further improved.

[0061] Embodiment 2

[0062] Figure 2 This is a flow chart of a joint training method of a model provided in the second embodiment of the present invention. This embodiment further optimizes and expands the above embodiment and can be combined with the above optional implementations. Figure 2 As shown, the method includes:

[0063] S201. Split a first training data matrix held by a first training participant to obtain a target number of first split matrices, and determine a local matrix, a first shared matrix, and a second shared matrix from the first split matrix.

[0064] S202: Send the first shared matrix to the second training participant, and send the second shared matrix to the computing service provider.

[0065] S203, determining a first gradient value according to the first gradient first slice value, the first gradient second slice value and the first gradient third slice value, and determining a first prediction vector according to the first model parameter to be updated of the first model to be trained and the first training data matrix.

[0066] In one embodiment, the first training participant determines the first gradient value according to the sum of the first gradient first slice value, the first gradient second slice value and the first gradient third slice value. In addition, the first training participant determines the first prediction vector according to the product result between the first model parameter to be updated and the first training data matrix.

[0067] Exemplarily, assuming that the first model parameter to be updated is , the first training data matrix is , then the first prediction vector .

[0068] Optionally, determining the first gradient value according to the first gradient first slice value, the first gradient second slice value, and the first gradient third slice value includes:

[0069] S2031. Obtain a first shared vector sent by the second training participant, and calculate a first gradient third slice value according to the first shared vector and the local matrix.

[0070] in,

[0071] The first shared vector is determined as follows:

[0072] The second training participants determine the second error vector based on the second model parameters to be updated of the corresponding second model to be trained in the current iteration round and the second training data matrices respectively held by the second training participants; the second training participants split the second error vector to obtain the target number of first split vectors, and determine the first shared vector from the first split vectors.

[0073] The second models to be trained refer to the models to be trained corresponding to the second training participants respectively.

[0074] In one embodiment, the second training participant determines the second error vector based on the second model parameter to be updated and the second training data matrix, and splits the second error vector to obtain the target number of first split vectors. After obtaining the target number of first split vectors, the first training participant determines the first split vector to be sent to the first training participant from the first split vector as the first shared vector. Further, the second training participant sends the first shared vector to the first training participant.

[0075] The first training participant obtains the first shared vector sent by the second training participant, and determines the third slice value of the first gradient according to the product result between the first shared vector and the local matrix.

[0076] Exemplarily, assuming that the first shared vector includes and The local matrix includes .

[0077] According to The first and third gradient shard values ​​are:

[0078] .

[0079] S2032: Determine a first gradient value according to the sum of the first gradient first slice value, the first gradient second slice value, and the first gradient third slice value.

[0080] For example, assuming that the first gradient first slice value is , the first gradient second slice value is The third slice value of the first gradient is , then the first gradient value is + +

[0081] By obtaining the first shared vector sent by the second training participant, and calculating the first gradient third slice value according to the first shared vector and the local matrix; determining the first gradient value according to the sum of the first gradient first slice value, the first gradient second slice value and the first gradient third slice value, so that the training of the first model to be trained not only depends on the gradient slice value generated by the first model to be trained itself, but also depends on the gradient slice value generated by the second model to be trained, thereby ensuring the training effect of the joint training of the models.

[0082] S204 , determining a first error vector according to the first standard vector and the first prediction vector, and determining a second gradient value according to the first error vector and the first training data matrix.

[0083] In one embodiment, the first training participant determines a first error vector according to a difference between a first standard vector and a first prediction vector, and determines a second gradient value according to a product result between the first error vector and a first training data matrix.

[0084] Exemplarily, assuming that the first error vector is , the first training data matrix is Second gradient value .

[0085] S205. Determine the total first iteration gradient value of the first model to be trained in the current iteration round according to the first gradient value and the second gradient value, and update the first model parameter to be updated according to the total first iteration gradient value.

[0086] In one embodiment, the first training participant determines the total first iteration gradient value of the first to-be-trained model in the current iteration round according to the sum of the first gradient value and the second gradient value. For example, assuming that the first gradient value is , the second gradient value is , then the total gradient of the first iteration is = .

[0087] After determining the first iterative gradient total value of the current iterative round, the first training participant uses the first iterative gradient total value to perform a model update on the first model to be trained of the first training participant, that is, updates the first model parameter to be updated of the first model to be trained of the first training participant in the current iterative round.

[0088] The first gradient value is determined according to the first gradient first slice value, the first gradient second slice value and the first gradient third slice value, and the first prediction vector is determined according to the first model parameter to be updated of the first model to be trained and the first training data matrix; the first error vector is determined according to the first standard vector and the first prediction vector, and the second gradient value is determined according to the first error vector and the first training data matrix; the first iteration gradient total value of the first model to be trained in the current iteration round is determined according to the first gradient value and the second gradient value, and the first model parameter to be updated is updated according to the first iteration gradient total value, so that the first model to be trained is jointly trained, thereby ensuring the training effect of the model joint training.

[0089] Optionally, updating the first to-be-updated model parameter according to the first iterative gradient total value includes:

[0090] S2051. Obtain the current learning rate of the first model to be trained in the current iteration round, and obtain the current sample size corresponding to the first training data matrix.

[0091] The current learning rate refers to the speed at which the first model to be trained updates its knowledge or parameters in the current iteration round. The current sample size reflects the training data scale of the current training data.

[0092] S2052. Update the first model parameters to be updated according to the current learning rate, the current sample size and the total value of the first iteration gradient to obtain the first updated model parameters of the first model to be trained in the current iteration round.

[0093] In one embodiment, the first training participant determines the model change parameters generated by the current iteration round based on the current learning rate, the current sample size and the total value of the first iteration gradient, updates the first model parameters to be updated based on the model change parameters, and uses the updated model parameters as the first updated model parameters.

[0094] By obtaining the current learning rate of the first model to be trained in the current iteration round, and obtaining the current sample size corresponding to the first training data matrix; updating the first model parameters to be updated according to the current learning rate, the current sample size and the total value of the first iteration gradient, and obtaining the first updated model parameters of the first model to be trained in the current iteration round, the effect of training the first model to be trained of the first training participant in the model joint training scenario is achieved, and the business needs of the first training participant for model training are met.

[0095] Optionally, updating the first model parameter to be updated according to the current learning rate, the current sample size, and the total value of the first iteration gradient to obtain the first updated model parameter of the first model to be trained in the current iteration round includes:

[0096] The first updated model parameters are obtained by the following formula:

[0097] ;

[0098] in, is the first update model parameter, is the first model parameter to be updated, The current learning rate, is the total gradient value of the first iteration, is the current sample size.

[0099] By formula Determining the first updated model parameters can ensure the effect and accuracy of parameter updating.

[0100] Optionally, the second training participant determines the first gradient first slice value in the following manner:

[0101] A1. Determine a second prediction vector according to second model parameters to be updated corresponding to the second model to be trained and a corresponding second training data matrix.

[0102] In one implementation, the second training participant determines the second prediction vector based on the product result between the second model parameter to be updated and the second training data matrix.

[0103] Exemplarily, assuming that the second model parameter to be updated is , the second training data matrix is , then the second prediction vector .

[0104] B1. Determine a second error vector according to the second standard vector and the second prediction vector, split the second error vector to obtain a target number of first split vectors, and determine a local vector, a second shared vector and a first shared vector from the first split vectors.

[0105] In one implementation, the second training participant determines the second error vector based on the difference between the second standard vector and the second prediction vector. Further, the second training participant splits the second error vector to obtain a target number of first split vectors. The target number of the first split vectors is the same as the target number of the first split matrix. Take the target number of three as an example for illustration:

[0106] For example, suppose the second error vector , then the second error vector Split into three first split vectors: , and , and satisfies .in, , and The matrix form can be expressed as:

[0107]

[0108] This embodiment only uses the above example to illustrate how to split the second error vector, but does not limit the target number corresponding to the first split vector.

[0109] After obtaining the target number of first split vectors, the second training participant determines from the first split vectors the first split vectors that are not sent to the first training participant and the computing service provider as local vectors, the first split vectors used to be sent to the first training participant as first shared vectors, and the first split vectors used to be sent to the computing service provider as second shared vectors, wherein the first shared vector and the second shared vector are only used to distinguish different first split vectors, but do not specifically refer to a certain first split vector.

[0110] The local vector refers to the first split vector selected by the second training participant from the first split vector and not sent to the first training participant and the computing service provider. The local vector is used to calculate the first gradient first slice value in combination with the first shared matrix sent by the first training participant. The local vector is different from the first shared vector and the second shared vector.

[0111] C1. Determine a first gradient first slice value according to a first shared matrix and a local vector.

[0112] In one implementation, the second training participant determines the first gradient first slice value according to the product result between the first shared matrix and the local vector.

[0113] For example, assuming that the local vector includes and E 23 =[ e2 11 3 … e2 n1 3 ] The first shared matrix includes .

[0114] According to The first gradient first slice value is:

[0115] .

[0116] The second training participant determines the second prediction vector according to the second model parameters to be updated corresponding to the second model to be trained and the corresponding second training data matrix; determines the second error vector according to the second standard vector and the second prediction vector, splits the second error vector to obtain the target number of first split vectors, and determines the local vector, the second shared vector and the first shared vector from the first split vector; determines the first gradient first slice value according to the first shared matrix and the local vector, thereby achieving the effect of using the error vector of the second training participant to calculate the gradient value required for the first training participant to perform model training, so that the first model to be trained can learn the data value of both itself and the second model to be trained, further ensuring the effect of model joint training.

[0117] Optionally, the computing service provider determines the second shard value of the first gradient in the following manner:

[0118] A second shared vector sent by a second training participant is obtained; and a second slice value of the first gradient is determined according to the second shared matrix and the second shared vector.

[0119] In one implementation, the second training participant sends the obtained second shared vector to the computing service provider. After the computing service provider obtains the second shared vector sent by the second training participant, it determines the first gradient second slice value according to the product result between the second shared matrix and the second shared vector.

[0120] Exemplarily, assuming that the second shared vector includes and E 23 =[ e2 11 3 … e2 n1 3 ] The second shared matrix includes .

[0121] According to , , The second slice value of the first gradient is:

[0122] .

[0123] The computing service provider obtains the second shared vector sent by the second training participant; determines the second slice value of the first gradient according to the second shared matrix and the second shared vector, and then uses the computing service provider and the second training participant to jointly calculate the gradient slice value. Under the premise of ensuring the joint training effect, the privacy of the training data of the first training participant is protected, and the security of the training data is further improved.

[0124] Optionally, also include:

[0125] A2. Determine the total value of the second iteration gradient of the second model to be trained in the current iteration round.

[0126] Among them, the second training participant is regarded as the first training participant, and the second model to be trained is regarded as the first model to be trained. The second iteration gradient total value of the second model to be trained in the current iteration round can be determined by referring to the method for determining the first iteration gradient total value of the first training participant in the current iteration round, which will not be repeated here.

[0127] B2. Determine a first gradient difference value according to the first historical gradient total value and the first iterative gradient total value, and determine a second gradient difference value according to the second historical gradient total value and the second iterative gradient total value.

[0128] The first historical gradient total value is the gradient total value of the first model to be trained in the previous iteration round. The second historical gradient total value is the gradient total value of the second model to be trained in the previous iteration round. For example, assuming that the current iteration round is N, the previous iteration round is N-1.

[0129] In one embodiment, the first gradient difference is determined based on the absolute value of the difference between the first historical gradient total value and the first iterative gradient total value, and the second gradient difference is determined based on the absolute value of the difference between the second historical gradient total value and the second iterative gradient total value.

[0130] For example, assuming that the total gradient value of the first iteration is , the total value of the first historical gradient is , then the first gradient difference . Assume that the total gradient of the second iteration is , the total value of the second historical gradient is , then the second gradient difference .

[0131] C2. When the first gradient difference and the second gradient difference are both less than or equal to the gradient difference threshold, a first training completion model is generated according to the first updated model parameters, and a second training completion model is generated according to the second updated model parameters corresponding to the second model to be trained in the current iteration round.

[0132] Among them, the gradient difference threshold is used to identify whether the model to be trained has completed iterative convergence, that is, if the gradient difference between the current iteration round and the previous iteration round of any model to be trained is less than or equal to the gradient difference threshold, it means that the model to be trained has completed iterative convergence. It can be understood that for the model joint training scenario, the gradient difference corresponding to the second model to be trained and the first model to be trained must be less than or equal to the gradient difference threshold to indicate that the model joint training has completed iterative convergence. Furthermore, the first training completion model is generated according to the first updated model parameters, and the second training completion model is generated according to the second updated model parameters.

[0133] Correspondingly, if the first gradient difference or the second gradient difference is greater than the gradient difference threshold, it means that there is at least one model to be trained that has not completed the iteration convergence, so the next iteration round is continued to continue model training until the first gradient difference and the second gradient difference are both less than or equal to the gradient difference threshold.

[0134] For example, assuming that the first gradient difference is , the second gradient difference is , the gradient difference threshold is ,like , then the iteration ends, the model training ends, the first training completion model is generated according to the first updated model parameters, and the second training completion model is generated according to the second updated model parameters. , then continue to iterate and continue to execute the joint training method of the model provided in this embodiment until .

[0135] By determining the second iterative gradient total value of the second model to be trained in the current iteration round; determining the first gradient difference according to the first historical gradient total value and the first iterative gradient total value, and determining the second gradient difference according to the second historical gradient total value and the second iterative gradient total value; wherein the first historical gradient total value is the gradient total value of the first model to be trained in the previous iteration round, and the second historical gradient total value is the gradient total value of the second model to be trained in the previous iteration round; when the first gradient difference and the second gradient difference are both less than or equal to the gradient difference threshold, generating the first training completion model according to the first updated model parameters, and generating the second training completion model according to the second updated model parameters corresponding to the second model to be trained in the current iteration round, so that only after the second model to be trained and the first model to be trained have both iteratively converged, will it be determined that the model joint training has iteratively converged, thereby ensuring the training effect of the model joint training.

[0136] Embodiment 3

[0137] Figure 3 This is a schematic diagram of the structure of a joint training device of a model provided in Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:

[0138] A matrix splitting module 31 is used to split the first training data matrix held by the first training participant to obtain a target number of first split matrices, and determine a local matrix, a first shared matrix, and a second shared matrix from the first split matrix, wherein the local matrix is ​​different from the first shared matrix and the second shared matrix;

[0139] A matrix sending module 32, configured to send the first shared matrix to a second training participant, and send the second shared matrix to a computing service provider;

[0140] A model parameter updating module 33, configured to update a first model parameter to be updated of a first model to be trained of the first training participant in a current iteration round according to the first gradient first slice value sent by the second training participant, the first gradient second slice value sent by the computing service provider, and the first gradient third slice value generated by the first training participant;

[0141] Among them, the first gradient first slice value is determined by the second training participant according to the first shared matrix, the first gradient second slice value is determined by the computing service provider according to the second shared matrix, and the first gradient third slice value is determined by the first training participant according to the local matrix.

[0142] Optionally, the model parameter updating module 33 is specifically used for:

[0143] Determine a first gradient value according to the first gradient first slice value, the first gradient second slice value, and the first gradient third slice value, and determine a first prediction vector according to the first to-be-trained model parameter to be updated and the first training data matrix of the first to-be-trained model;

[0144] Determine a first error vector according to a first standard vector and the first prediction vector, and determine a second gradient value according to the first error vector and the first training data matrix;

[0145] According to the first gradient value and the second gradient value, a first iteration gradient total value of the first model to be trained in the current iteration round is determined, and the first model parameter to be updated is updated according to the first iteration gradient total value.

[0146] Optionally, the model parameter updating module 33 is further configured to:

[0147] Obtaining a first shared vector sent by the second training participant, and calculating a first gradient third slice value according to the first shared vector and the local matrix;

[0148] Determine the first gradient value according to the sum of the first gradient first slice value, the first gradient second slice value and the first gradient third slice value;

[0149] The first shared vector is determined in the following manner:

[0150] The second training participants determine the second error vector according to the second model parameters to be updated of the corresponding second model to be trained in the current iteration round and the second training data matrices respectively held by the second training participants;

[0151] The second training participant splits the second error vector to obtain a target number of first split vectors, and determines the first shared vector from the first split vectors.

[0152] Optionally, the model parameter updating module 33 is further configured to:

[0153] Obtaining a current learning rate of the first model to be trained in a current iteration round, and obtaining a current sample size corresponding to the first training data matrix;

[0154] According to the current learning rate, the current sample size and the first iterative gradient total value, the first model parameters to be updated are updated to obtain first updated model parameters of the first model to be trained in the current iterative round.

[0155] Optionally, the model parameter updating module 33 is further configured to:

[0156] The first updated model parameter is obtained by the following formula:

[0157] ;

[0158] in, Update the model parameters for the first step, is the first model parameter to be updated, The current learning rate, is the total gradient value of the first iteration, is the current sample size.

[0159] Optionally, the second training participant determines the first gradient first slice value in the following manner:

[0160] Determine a second prediction vector according to the second to-be-updated model parameters corresponding to the second to-be-trained model and the corresponding second training data matrix;

[0161] Determine the second error vector according to the second standard vector and the second prediction vector, split the second error vector to obtain a target number of first split vectors, and determine a local vector, a second shared vector, and the first shared vector from the first split vectors;

[0162] The first gradient first slice value is determined according to the first shared matrix and the local vector.

[0163] Optionally, the computing service provider determines the second shard value of the first gradient in the following manner:

[0164] Acquire the second shared vector sent by the second training participant;

[0165] The first gradient second slice value is determined according to the second shared matrix and the second shared vector.

[0166] Optionally, the device further comprises a gradient value comparison module, which is specifically used for:

[0167] Determine a second iteration gradient total value of the second to-be-trained model in the current iteration round;

[0168] Determine a first gradient difference value according to a first historical gradient total value and the first iteration gradient total value, and determine a second gradient difference value according to a second historical gradient total value and the second iteration gradient total value; wherein the first historical gradient total value is the gradient total value of the first to-be-trained model in the previous iteration round, and the second historical gradient total value is the gradient total value of the second to-be-trained model in the previous iteration round;

[0169] When the first gradient difference and the second gradient difference are both less than or equal to the gradient difference threshold, a first training completion model is generated according to the first updated model parameters, and a second training completion model is generated according to the second updated model parameters corresponding to the second model to be trained in the current iteration round.

[0170] The joint training device for models provided in the embodiment of the present invention can execute the joint training method for models provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0171] Embodiment 4

[0172] Figure 4 A schematic diagram of an electronic device 40 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0173] like Figure 4 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.

[0174] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0175] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 41 executes the various methods and processes described above, such as a joint training method of a model.

[0176] In some embodiments, the joint training method of the model may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the joint training method of the model described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to perform the joint training method of the model in any other appropriate manner (e.g., by means of firmware).

[0177] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0178] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0179] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0180] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0181] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0182] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0183] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0184] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A joint training method of a model, characterized in that: include: Splitting a first training data matrix held by a first training participant to obtain a target number of first split matrices, and determining a local matrix, a first shared matrix, and a second shared matrix from the first split matrix, wherein the local matrix is ​​different from the first shared matrix and the second shared matrix; Sending the first shared matrix to a second training participant, and sending the second shared matrix to a computing service provider; Update the first model parameter to be updated of the first model to be trained of the first training participant in the current iteration round according to the first gradient first slice value sent by the second training participant, the first gradient second slice value sent by the computing service provider, and the first gradient third slice value generated by the first training participant; Among them, the first gradient first slice value is determined by the second training participant according to the first shared matrix, the first gradient second slice value is determined by the computing service provider according to the second shared matrix, and the first gradient third slice value is determined by the first training participant according to the local matrix.

2. The method according to claim 1, characterized in that The updating of the first model parameter to be updated of the first model to be trained of the first training participant in the current iteration round according to the first gradient first slice value sent by the second training participant, the first gradient second slice value sent by the computing service provider, and the first gradient third slice value generated by the first training participant includes: Determine a first gradient value according to the first gradient first slice value, the first gradient second slice value, and the first gradient third slice value, and determine a first prediction vector according to the first to-be-trained model parameter to be updated and the first training data matrix of the first to-be-trained model; Determine a first error vector according to a first standard vector and the first prediction vector, and determine a second gradient value according to the first error vector and the first training data matrix; According to the first gradient value and the second gradient value, a first iteration gradient total value of the first model to be trained in the current iteration round is determined, and the first model parameter to be updated is updated according to the first iteration gradient total value.

3. The method according to claim 2, characterized in that The determining the first gradient value according to the first gradient first slice value, the first gradient second slice value and the first gradient third slice value includes: Obtaining a first shared vector sent by the second training participant, and calculating a first gradient third slice value according to the first shared vector and the local matrix; Determine the first gradient value according to the sum of the first gradient first slice value, the first gradient second slice value and the first gradient third slice value; The first shared vector is determined in the following manner: The second training participants determine the second error vector according to the second model parameters to be updated of the corresponding second model to be trained in the current iteration round and the second training data matrices respectively held by the second training participants; The second training participant splits the second error vector to obtain a target number of first split vectors, and determines the first shared vector from the first split vectors.

4. The method according to claim 3, characterized in that The updating of the first to-be-updated model parameter according to the first iterative gradient total value includes: Obtaining a current learning rate of the first model to be trained in a current iteration round, and obtaining a current sample size corresponding to the first training data matrix; According to the current learning rate, the current sample size and the first iterative gradient total value, the first model parameters to be updated are updated to obtain first updated model parameters of the first model to be trained in the current iterative round.

5. The method according to claim 4, characterized in that The updating of the first to-be-updated model parameters according to the current learning rate, the current sample size, and the first iterative gradient total value to obtain first updated model parameters of the first to-be-trained model in the current iterative round includes: The first updated model parameter is obtained by the following formula: ; in, Update the model parameters for the first step, is the first model parameter to be updated, The current learning rate, is the total gradient value of the first iteration, is the current sample size.

6. The method according to claim 3, characterized in that: The second training participant determines the first gradient first slice value in the following manner: Determine a second prediction vector according to the second to-be-updated model parameters corresponding to the second to-be-trained model and the corresponding second training data matrix; Determine the second error vector according to the second standard vector and the second prediction vector, split the second error vector to obtain a target number of first split vectors, and determine a local vector, a second shared vector, and the first shared vector from the first split vectors; The first gradient first slice value is determined according to the first shared matrix and the local vector.

7. The method according to claim 6, characterized in that The computing service provider determines the second slice value of the first gradient in the following manner: Acquire the second shared vector sent by the second training participant; The first gradient second slice value is determined according to the second shared matrix and the second shared vector.

8. The method according to claim 4, characterized in that Also includes: Determine a second iteration gradient total value of the second to-be-trained model in the current iteration round; Determine a first gradient difference value according to a first historical gradient total value and the first iteration gradient total value, and determine a second gradient difference value according to a second historical gradient total value and the second iteration gradient total value; wherein the first historical gradient total value is the gradient total value of the first to-be-trained model in the previous iteration round, and the second historical gradient total value is the gradient total value of the second to-be-trained model in the previous iteration round; When the first gradient difference and the second gradient difference are both less than or equal to the gradient difference threshold, a first training completion model is generated according to the first updated model parameters, and a second training completion model is generated according to the second updated model parameters corresponding to the second model to be trained in the current iteration round.

9. A joint training device for a model, characterized in that: include: a matrix splitting module, configured to split a first training data matrix held by a first training participant to obtain a target number of first split matrices, and determine a local matrix, a first shared matrix, and a second shared matrix from the first split matrix, wherein the local matrix is ​​different from the first shared matrix and the second shared matrix; A matrix sending module, used to send the first shared matrix to the second training participant, and send the second shared matrix to the computing service provider; a model parameter updating module, configured to update a first model parameter to be updated of a first model to be trained of the first training participant in a current iteration round according to a first gradient first slice value sent by the second training participant, a first gradient second slice value sent by the computing service provider, and a first gradient third slice value generated by the first training participant; Among them, the first gradient first slice value is determined by the second training participant according to the first shared matrix, the first gradient second slice value is determined by the computing service provider according to the second shared matrix, and the first gradient third slice value is determined by the first training participant according to the local matrix.

10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the joint training method of the model described in any one of claims 1-8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute the joint training method of the model described in any one of claims 1-8.

12. A computer program product, comprising a computer program, which, when executed by a processor, implements the joint training method of the model according to any one of claims 1-8.

Citation Information

Patent Citations

  • Method and device for jointly training logistic regression model by multiple computing units

    CN110728375A

  • Machine learning model training method, prediction method and device based on artificial intelligence

    CN110990871A

  • Method and device for jointly training service prediction model by two parties for protecting data privacy

    CN111178549A

  • Model training method, device and system

    CN111523673A

  • Model training method, device and system

    CN112183566A