Model training proof generation method and model verification method
By generating model training proof, the problem of difficulty for users to confirm the training data set is solved, and the verifiability and security of the model training process are realized.
Patent Information
- Application Number
- CN202411978074.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-18
AI Technical Summary
During the training of large language models, it is difficult for users to confirm whether the trainer uses the specified data set for standardized training, which makes it difficult to arbitrate when there are problems with the model.
A method for generating a model training proof is provided, by receiving a proof acquisition request, obtaining a target data set, training the target model based on the data set, and generating a proof set based on the model's weight information and interval parameters, including at least two training proofs.
Through the generated training proof, users can verify whether the target model is trained based on the target dataset, which solves the problem of difficulty in reproducing the model training process and unverifiable dataset usage, and improves the security and credibility of model use.
Smart Images

Figure CN119849573A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a method for generating a model training certificate, a model verification method and a device. Background Art
[0002] As the scale of large language models continues to grow, model users often need to use the computing power provided by remote service providers to complete model training. Since the model training process is difficult to reproduce, in this case, users cannot confirm whether the training party uses the specified data set for standardized training, and it is difficult to arbitrate after problems with the model occur. Summary of the invention
[0003] In view of this, the present disclosure provides a method for generating a model training certificate, a model verification method and a device.
[0004] One aspect of the present disclosure provides a method for generating a model training certificate, including: receiving a certificate acquisition request, the certificate acquisition request including a specified target data set; acquiring the target data set according to the certificate acquisition request, the target data set being used to train a target model; training the target model based on the target data set, generating a certificate set according to weight information and interval parameters of the target model, the certificate set including at least two training certificates; and sending the certificate set.
[0005] According to an embodiment of the present disclosure, a certificate acquisition request includes model parameters, and generating a certificate set according to weight information and interval parameters of a target model includes: determining the number of training certificates according to the model parameters and interval parameters; generating training certificates according to the number of training certificates, weight information of the target model and adjustment operations during the calculation of the weight information; and determining a certificate set based on the training certificates.
[0006] According to an embodiment of the present disclosure, the adjustment operation in the weight information calculation process includes: for the calculation result of the first precision type obtained through the weight information calculation process, rounding the calculation result to a specified rounding direction to obtain a rounding result of the second precision type; wherein the precision of the first precision type is higher than that of the second precision type.
[0007] According to an embodiment of the present disclosure, the calculation result includes the output result of the target model, and the adjustment operation in the weight information calculation process includes: rounding the output result of the target model of the first precision type in a specified rounding direction to obtain a rounding result of the second precision type, and the rounding result of the second precision type is used to calculate the loss.
[0008] According to an embodiment of the present disclosure, the calculation result includes a gradient value corresponding to the weight information, and the adjustment operation in the weight information calculation process includes: rounding the gradient value of the first precision type to a specified rounding direction to obtain a rounding result of the second precision type, and the rounding result is used to update the weight information.
[0009] According to an embodiment of the present disclosure, the adjustment operation is determined by the following method: determining the rounding reference value closest to the calculation result; when the distance between the calculation result and the rounding reference value is less than or equal to a preset threshold, determining the rounding result through the adjustment operation; when the distance between the calculation result and the rounding reference value is greater than the preset threshold, determining the rounding result based on the effective value that is closer to the calculation result.
[0010] According to an embodiment of the present disclosure, the specified rounding direction of the adjustment operation is determined in the following manner: determining a reference sequence based on preset seed information and the number of iterations of the target model; determining a reference value of the adjustment operation from the reference sequence based on the number of adjustment operations and the length of the reference sequence; and determining the specified rounding direction of the adjustment operation based on the reference value.
[0011] According to an embodiment of the present disclosure, generating a training proof includes: performing a parity check according to the number of adjustment operations to determine a first proof value; calculating a hash value according to weight information and the number of adjustment operations to obtain a second proof value; and determining the training proof according to the first proof value and the second proof value.
[0012] According to an embodiment of the present disclosure, the method further includes obtaining target weight information of the target model when training is completed; and sending the target weight information of the target model.
[0013] Another aspect of the present disclosure also provides a model verification method, including: sending a model verification request and a proof set, the proof set including at least two training proofs, the training proofs being determined based on an interval parameter and weight information of a target model; receiving a verification result; and determining whether the target model is trained based on a target data set based on the verification result.
[0014] Another aspect of the present disclosure also provides a device for generating a model training certificate, including: a first receiving module, used to receive a certificate acquisition request, the certificate acquisition request includes a specified target data set; an acquisition module, used to acquire the target data set according to the certificate acquisition request, the target data set is used to train the target model; a generation module, used to train the target model based on the target data set, and generate a certificate set according to the weight information and interval parameters of the target model, the certificate set includes at least two training certificates; a first sending module, used to send the certificate set.
[0015] Another aspect of the present disclosure also provides a model verification device, including: a second sending module, used to send a model verification request and a proof set, the proof set including at least two training proofs, the training proofs are determined based on an interval parameter and weight information of a target model; a second receiving module, used to receive a verification result; and a determination module, used to determine whether the target model is trained based on a target data set according to the verification result.
[0016] Another aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above method.
[0017] Another aspect of the present disclosure further provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to perform the above method.
[0018] Another aspect of the present disclosure further provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0021] Figure 1 It is a schematic diagram of an exemplary system architecture that can be applied to a method for generating a model training proof, a model verification method and a device according to an embodiment of the present disclosure;
[0022] Figure 2 A flowchart of a method for generating a model training certificate according to an embodiment of the present disclosure is schematically shown;
[0023] Figure 3 A schematic diagram schematically shows a model calculation process according to an embodiment of the present disclosure;
[0024] Figure 4 A schematic diagram schematically illustrates an adjustment operation according to an embodiment of the present disclosure;
[0025] Figure 5 A flowchart of a model verification method according to an embodiment of the present disclosure is schematically shown;
[0026] Figure 6A schematic diagram schematically shows user-side interaction according to an embodiment of the present disclosure;
[0027] Figure 7 The structure block diagram of the device for generating the model training proof according to the embodiment of the present disclosure is schematically shown;
[0028] Figure 8 A structural block diagram of a model verification device according to an embodiment of the present disclosure is schematically shown; and
[0029] Fig. 9 A schematic block diagram of an electronic device that can be used to implement the method for generating a model training certificate and the method for model verification according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0030] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered as merely exemplary. Therefore, it should be appreciated by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Likewise, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0031] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of the data involved (including but not limited to user personal information) comply with the provisions of relevant laws and regulations, take necessary confidentiality measures, and do not violate public order and good morals.
[0032] In the technical solution of the present invention, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0033] Figure 1 is a schematic diagram of an exemplary system architecture of a method for generating a model training proof, a model verification method and a device according to an embodiment of the present disclosure. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0034] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a terminal device 101, a network 102, and servers 103 and 104. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the servers 103 and 104. The network 102 may include various connection types, such as wired and / or wireless communication links, etc.
[0035] The user can use the terminal device 101 to interact with the servers 103 and 104 through the network 102 to receive or send messages, etc. The terminal device 101 can be any electronic device with a display screen and supporting the operation of the model, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.
[0036] Servers 103 and 104 may be servers that provide various services, such as obtaining model parameters and training sets specified by the user according to the instructions sent by the user, performing training tasks for the target model, and sending the trained model weights and the training proof set generated based on the training process to the user. Servers 103 and 104 may also obtain the training proof set according to the instructions sent by the user, restore the training process of the target model based on the training proof set and the specified training set, and perform verification.
[0037] It should be noted that the method for generating the model training certificate provided in the embodiment of the present disclosure can generally be executed by the server 103. The model verification method provided in the embodiment of the present disclosure can generally be executed by the server 104. Accordingly, the device for generating the model training certificate provided in the embodiment of the present disclosure can generally be set in the server 103. The model verification device provided in the embodiment of the present disclosure can generally be set in the server 104. The method for generating the model training certificate and the model verification method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the servers 103 and 104 and can communicate with the terminal device 101 and / or the servers 103 and 104. Accordingly, the device for generating the model training certificate and the model verification device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the servers 103 and 104 and can communicate with the terminal device 101 and / or the servers 103 and 104.
[0038] Figure 2 A flowchart of a method for generating a model training proof according to an embodiment of the present disclosure is schematically shown.
[0039] like Figure 2 As shown, the method for generating the model training proof of this embodiment includes operations S210 to S240.
[0040] In operation S210 , a certificate acquisition request is received, where the certificate acquisition request includes a specified target data set.
[0041] In an embodiment of the present disclosure, the certificate acquisition request may be a request initiated by a user, which is used to instruct to train a model and obtain a training certificate generated based on the training process. The target data set may refer to a data set specified by the user for training the model.
[0042] In operation S220, a target data set is acquired according to the proof acquisition request, and the target data set is used to train a target model.
[0043] In the embodiments of the present disclosure, the training process may refer to a complete training of the target model according to the target data set, or may refer to fine-tuning the target model according to the target data set.
[0044] In operation S230, a target model is trained based on the target data set, and a proof set is generated according to weight information and interval parameters of the target model, where the proof set includes at least two training proofs.
[0045] In an embodiment of the present disclosure, an interval parameter represents the frequency of generating training proofs. The higher the generation frequency represented by the interval parameter, the more training proofs are generated based on the training process. Conversely, the lower the generation frequency represented by the interval parameter, the fewer the training proofs are generated based on the training process. The proof set includes all training proofs generated during the training process.
[0046] For example, the interval parameter t indicates that a training proof is generated every t steps. According to the total number of training steps T and the interval parameter t, the number of training proofs generated during the training process can be determined to be T / t.
[0047] In operation S240, a set of certificates is sent.
[0048] In an embodiment of the present disclosure, the proof set can record the complete training process of training the target model based on the target data set. The training process of the model can be reproduced through the proof set.
[0049] According to an embodiment of the present disclosure, a proof set is obtained by generating training proofs at a fixed frequency during the training process of the model. When reproducing the training process of the model, the proof set can eliminate the randomness in the model training process and restore the model training process so that the user can confirm whether the model is trained by the specified data set. At the same time, it can also avoid tampering or adding irrelevant information when the model is trained across platforms, thereby improving the user's model usage experience.
[0050] According to an embodiment of the present disclosure, a certificate acquisition request includes model parameters, and generating a certificate set according to weight information and interval parameters of a target model includes: determining the number of training certificates according to the model parameters and interval parameters; generating training certificates according to the number of training certificates, weight information of the target model and adjustment operations during the calculation of the weight information; and determining a certificate set based on the training certificates.
[0051] In the embodiments of the present disclosure, model parameters refer to parameters specified by the user for the target model. Model parameters may include the number of iterations, batch sample size, learning rate, loss function, etc. The number of training proofs is determined according to the model parameters and interval parameters specified by the user.
[0052] For example, the total number of training steps T can be determined based on the model parameters, and the number of training proofs generated during the training process can be determined to be T / t based on the total number of training steps T and the interval parameter t.
[0053] In an embodiment of the present disclosure, the total number of training steps T can be determined by the following formula:
[0054]
[0055] Among them, N represents the number of target data sets, Batchsize is the batch sample size, which represents the number of target data sets used in one training step, and epoch is the number of iterations. for .
[0056] In the embodiments of the present disclosure, the training proof is continuously generated during the model training process, and the weight information of the target model used to generate the training proof is the weight information updated by the current training step. The weight information calculation process refers to the calculation process generated by obtaining the weight information. The adjustment operation may refer to a deterministic operation that replaces the random operation in the calculation process.
[0057] For example, the adjustment operation may refer to adjusting the random input of the data set to input by number. The adjustment operation may also refer to adjusting the initial value of the model parameter from randomly generated to pre-set.
[0058] In an embodiment of the present disclosure, the training proof may be determined based on the interval parameters, the weight information of the target model, and the adjustment operations during the calculation process.
[0059] For example, the interval parameter is t. After the tth step in the target model training process, get the updated weight information , and record all adjustment operations from step 1 to step t to obtain parameter c. According to the interval parameter t and the weight information of the target model And the adjustment operation c in the calculation process is encrypted or encoded to obtain the unique corresponding encrypted information or encoded information as the training proof.
[0060] According to the embodiments of the present disclosure, by adjusting the calculation process in model training, eliminating the randomness of model training, and reproducing the model training process in the form of training proof, the problem of difficulty in restoring the model training process is overcome and the computing power cost of restoring the model training process is reduced.
[0061] According to an embodiment of the present disclosure, the adjustment operation in the weight information calculation process includes: for the calculation result of the first precision type obtained through the weight information calculation process, rounding the calculation result to a specified rounding direction to obtain a rounding result of the second precision type; wherein the precision of the first precision type is higher than that of the second precision type.
[0062] In an embodiment of the present disclosure, during the calculation of weight information, rounding operations involving calculation results (such as high-precision floating-point numbers) may generate randomness. When the distance between the calculation result and the adjacent approximate values on both sides is relatively close, different rounding directions may cause deviations in the training of the model and affect the reproduction of the model training. Therefore, the adjustment operation may refer to changing the random rounding operation in the calculation process to a deterministic rounding operation. Specifying the rounding direction refers to the rounding direction when a deterministic rounding operation is performed on the calculation result. The specified rounding direction may be pre-set or determined based on a reference value. The precision of the first precision type is higher than that of the second precision type.
[0063] For example, if the calculation result is a floating point number, the first precision type may be float64, and the second precision type may be float32.
[0064] According to an embodiment of the present disclosure, generating a training proof includes: performing a parity check according to the number of adjustment operations to determine a first proof value; calculating a hash value according to weight information and the number of adjustment operations to obtain a second proof value; and determining the training proof according to the first proof value and the second proof value.
[0065] In the embodiment of the present disclosure, the training proof i It can be composed of a first proof value and a second proof value, or it can be encrypted based on the first proof value and the second proof value. The first proof value can be set as a check bit, and the second proof value can be set as more complex encryption information than the first proof value. When restoring the model training process, verification is first performed based on the first proof value. If the verification fails, it means that the target model is not trained by the target data set. If the verification passes, verification is performed based on the second proof value.
[0066] In an embodiment of the present disclosure, a parity check value parity(c) may be determined as a first proof value according to the number c of deterministic rounding operations within t steps in a weight information calculation process.
[0067] In the embodiment of the present disclosure, the second proof value can be expressed as , where hash refers to hash value calculation, t is the interval parameter, c refers to the number of deterministic rounding operations within t steps, and parity(c) is the first proof value. θt is the weight information updated after the tth step. The hash value is calculated for the first proof value, the interval parameter, and the weight information, and the calculated result is used as the second proof value.
[0068] According to the embodiments of the present disclosure, the training process reproduced by the model is verified through the generated training proof, and preliminary verification is performed through the first proof value. Only when the preliminary verification passes will further verification be performed based on the second proof value. The step-by-step verification can improve the verification efficiency, more quickly screen out the target model with problems in the training process, and improve the user's model usage experience.
[0069] Figure 3 The figure schematically shows a model calculation process according to an embodiment of the present disclosure.
[0070] like Figure 3 As shown, from the model weight θ i 310 get model weight θ i+1 The process of 320 can be regarded as a calculation process in one training step.
[0071] According to an embodiment of the present disclosure, the calculation result includes the output result of the target model, and the adjustment operation in the weight information calculation process includes: rounding the output result of the target model of the first precision type in a specified rounding direction to obtain a rounding result of the second precision type, and the rounding result of the second precision type is used to calculate the loss.
[0072] In the embodiment of the present disclosure, the target data set 301 is input into the model weight θ i Each layer of 310 is trained to obtain an output result of the first precision type 302. The output result of the first precision type 302 is adjusted to obtain an output result of the second precision type rounded to a specified rounding direction 303. The rounded output result of the second precision type is used for the next step of loss calculation.
[0073] According to an embodiment of the present disclosure, the calculation result includes a gradient value corresponding to the weight information, and the adjustment operation in the weight information calculation process includes: rounding the gradient value of the first precision type to a specified rounding direction to obtain a rounding result of the second precision type, and the rounding result is used to update the weight information.
[0074] In the embodiment of the present disclosure, the rounded output result 303 of the second precision type is used to calculate the loss, and the gradient value 305 of the first precision type is determined based on the loss 304. The gradient value 305 of the first precision type is rounded to the specified rounding direction, and the rounding result is the gradient value 306 of the second precision type. The gradient value 306 of the second precision type is used to update the model weight to obtain the updated model weight θ i+1 320.
[0075] For example, the number of deterministic rounding operations c may include the number of rounding operations c1 for the output result and the number of rounding operations c2 for the gradient value. After t steps, the corresponding training proof is determined according to the total number of rounding operations c in the t steps.
[0076] According to the embodiments of the present disclosure, high-precision floating-point numbers are used in calculations, and deterministic rounding operations are performed after the calculations are completed to ensure the consistency of the model training process across platforms and devices. At the same time, checkpoints will be set up at certain intervals of training steps, and the number of rounding times and weight information will be integrated to build a training certificate for the target model. The verifier can verify this certificate in the process of reproducing the training steps to ensure that the training process has completed the training using the specified data set, thereby improving the security of model use.
[0077] According to an embodiment of the present disclosure, the adjustment operation is determined by the following method: determining the rounding reference value closest to the calculation result; when the distance between the calculation result and the rounding reference value is less than or equal to a preset threshold, determining the rounding result through the adjustment operation; when the distance between the calculation result and the rounding reference value is greater than the preset threshold, determining the rounding result based on the effective value that is closer to the calculation result.
[0078] Next, combine Figure 4 The adjustment operation of the embodiment of the present disclosure is further explained.
[0079] Figure 4 A schematic diagram schematically illustrates an adjustment operation according to an embodiment of the present disclosure.
[0080] like Figure 4 As shown, point M and point N may be two adjacent points of the second precision type. When the calculation result of the first precision type is between point M and point N, the calculation result may be rounded, and two results, point M or point N, may be obtained according to different rounding directions. Among them, the rounding reference value 401 may refer to the middle value of two adjacent points of the calculation result, located at the midpoint of MN, and a preset threshold value 402 is set. When the distance between the calculation result and the rounding reference value 401 is greater than the preset threshold value 402, the point with a closer distance may be directly determined as the rounding result.
[0081] For example, if the calculation result is at point A, and the distance between point A and the rounding reference value 401 is greater than the preset threshold 402, the calculation result after rounding can be taken at point M according to the distance between point A and points M and N.
[0082] For example, if the calculation result is at point B, and the distance between point B and the rounding reference value 401 is greater than the preset threshold 402, the calculation result after rounding can be taken at point N according to the distance between point B and points M and N.
[0083] When the distance between the calculation result and the rounding reference value 401 is smaller than the preset threshold 402, the rounding result needs to be determined according to the adjustment operation.
[0084] For example, if the calculation result is at point C and the distance between point C and the rounding reference value 401 is greater than the preset threshold 402, it is necessary to determine the designated rounding direction according to the adjustment operation to obtain the rounding result.
[0085] According to an embodiment of the present disclosure, the specified rounding direction of the adjustment operation is determined in the following manner: determining a reference sequence based on preset seed information and the number of iterations of the target model; determining a reference value of the adjustment operation from the reference sequence based on the number of adjustment operations and the length of the reference sequence; and determining the specified rounding direction of the adjustment operation based on the reference value.
[0086] In an embodiment of the present disclosure, the preset seed information may be a seed value generated by a preset seed function so that the seed value used in each model training process is unique. The reference sequence may be a corresponding sequence information obtained by encrypting or encoding the preset seed information and the number of iterations in a specified manner, and the sequence information may be composed of a number of 0s and 1s. The length of the reference sequence may be modulo the number of adjustment operations, and the result obtained is the number of digits in the reference sequence, and the specified rounding direction is determined according to the reference value at the corresponding position.
[0087] For example, the preset seed information and the number of iterations may be hashed to obtain an 8-bit reference sequence of 10100111. When the fifth adjustment operation is performed, the corresponding reference sequence may have a number of 5 bits, and the fifth bit 0 in the reference sequence is used as a reference value to determine the specified rounding direction.
[0088] For example, the specified rounding direction can be set in advance. When the reference value in the reference sequence is 0, the specified rounding direction is left, and when the reference value in the reference sequence is 1, the specified rounding direction is right.
[0089] According to an embodiment of the present disclosure, high-precision floating-point numbers are used in calculations, and rounding is performed based on a threshold judgment after the calculation is completed. The floating-point numbers within the judgment threshold will use deterministic rounding operations and be recorded, and the rounding direction will be determined through a specified reference sequence to ensure the consistency and security of calculation results across platforms and devices.
[0090] Figure 5 The flowchart of the model verification method according to the embodiment of the present disclosure is schematically shown.
[0091] like Figure 5 As shown, the model verification method of this embodiment includes operations S510 to S530.
[0092] In operation S510, a model verification request and a proof set are sent, where the proof set includes at least two training proofs, and the training proofs are determined based on an interval parameter and weight information of a target model.
[0093] The model verification request refers to a request for determining the model training status. The proof set is obtained through operation S230.
[0094] In operation S520, a verification result is received.
[0095] In the embodiments of the present disclosure, the verification result may be a result provided by a verification platform, verification software, etc.
[0096] In operation S530 , it is determined whether the target model is trained based on the target data set according to the verification result.
[0097] In an embodiment of the present disclosure, when verifying the target model, it is also necessary to obtain the preset seed information used in the model training process, and generate a corresponding reference sequence based on the preset seed information and the number of iterations, so as to determine the specified rounding direction of the adjustment operation and restore the training process of the target model.
[0098] Figure 6 A schematic diagram schematically shows user-side interaction according to an embodiment of the present disclosure.
[0099] like Figure 6 As shown, in an embodiment of the present disclosure, user 610 sends a proof acquisition request to training terminal 620. After training the target model according to the target data set specified by user 610, training terminal 620 sends the generated proof set to user 610. User 610 sends a model verification request and a proof set to verification terminal 630. Verification terminal 630 restores the training process of the target model based on the proof set and sends the generated verification result to user 610. User 610 determines whether the target model is obtained by training based on the target data set based on the verification result.
[0100] According to an embodiment of the present disclosure, the method further includes obtaining target weight information of the target model when training is completed; and sending the target weight information of the target model.
[0101] In the embodiment of the present disclosure, after verifying the training process of the model, the user can obtain the trained model and put it into use. Therefore, in addition to obtaining the proof set sent by the trainer 620 for training, it is also necessary to obtain the target weight information when the trainer 620 completes the training.
[0102] According to the embodiments of the present disclosure, the model training and verification process includes three types of roles, namely, users, trainers, and verifiers, where the trainer provides model training services to the user, and the verifier helps the user verify the model training certificate provided by the trainer. When performing cross-platform and cross-device model training, the consistency of model training can be guaranteed through the above three types of roles to ensure that the training process is completed completely using the specified data set, ensuring the safety of users' model use.
[0103] Figure 7 The structural block diagram of a device for generating a model training proof according to an embodiment of the present disclosure is schematically shown.
[0104] like Figure 7 As shown, the device 700 for generating the model training proof of this embodiment includes a first receiving module 710, an acquisition module 720, a generation module 730 and a first sending module 740.
[0105] The first receiving module 710 is used to receive a certificate acquisition request, where the certificate acquisition request includes a specified target data set.
[0106] The acquisition module 720 is used to acquire a target data set according to a proof acquisition request, and the target data set is used to train a target model.
[0107] The generation module 730 is used to train the target model based on the target data set, and generate a proof set according to the weight information and interval parameters of the target model, and the proof set includes at least two training proofs.
[0108] The first sending module 740 is used to send a set of certificates.
[0109] According to an embodiment of the present disclosure, the proof acquisition request includes model parameters, and the generation module 730 includes a first determination submodule, a generation submodule and a second determination submodule.
[0110] The first determination submodule is used to determine the number of training proofs according to the model parameters and the interval parameters. The generation submodule is used to generate the training proof according to the number of training proofs, the weight information of the target model and the adjustment operation in the weight information calculation process. The second determination submodule is used to determine the proof set according to the training proof.
[0111] According to an embodiment of the present disclosure, the adjustment operation in the weight information calculation process is performed by a designated rounding unit. The designated rounding unit is used to round the calculation result of the first precision type obtained by the weight information calculation process to a designated rounding direction to obtain a rounding result of the second precision type; wherein the precision of the first precision type is higher than that of the second precision type.
[0112] According to an embodiment of the present disclosure, the calculation result includes an output result of the target model, and the adjustment operation in the weight information calculation process is performed by a first rounding subunit. The first rounding subunit is used to round the output result of the target model of the first precision type to a specified rounding direction to obtain a rounding result of the second precision type, and the rounding result of the second precision type is used to calculate the loss.
[0113] According to an embodiment of the present disclosure, the calculation result includes a gradient value corresponding to the weight information, and the adjustment operation in the weight information calculation process is performed by a second rounding subunit. The second rounding subunit is used to round the gradient value of the first precision type to a specified rounding direction to obtain a rounding result of the second precision type, and the rounding result is used to update the weight information.
[0114] According to an embodiment of the present disclosure, the adjustment operation is determined by the following units: a reference value determination unit, configured to determine a rounding reference value closest to a calculation result. A first rounding unit, configured to determine a rounding result by an adjustment operation when the distance between the calculation result and the rounding reference value is less than or equal to a preset threshold. A second rounding unit, configured to determine a rounding result according to a valid value closer to the calculation result when the distance between the calculation result and the rounding reference value is greater than a preset threshold.
[0115] According to an embodiment of the present disclosure, the specified rounding direction of the adjustment operation is determined by the following subunits: a sequence determination subunit, which is used to determine a reference sequence according to preset seed information and the number of iterations of the target model. A reference value determination subunit, which is used to determine a reference value of the adjustment operation from the reference sequence according to the number of adjustment operations and the length of the reference sequence. A rounding direction determination subunit, which is used to determine the specified rounding direction of the adjustment operation according to the reference value.
[0116] According to an embodiment of the present disclosure, the generation module 730 includes a first proof value determination submodule, a second proof value determination submodule and a proof determination submodule. The first proof value determination submodule is used to perform a parity check according to the number of adjustment operations to determine the first proof value. The second proof value determination submodule is used to calculate a hash value according to the weight information and the number of adjustment operations to obtain a second proof value. The proof determination submodule is used to determine the training proof according to the first proof value and the second proof value.
[0117] According to an embodiment of the present disclosure, the device 700 for generating a model training certificate further includes a weight acquisition module and a weight sending module. The weight acquisition module is used to acquire the target weight information of the target model when the training is completed. The weight sending module is used to send the target weight information of the target model.
[0118] Figure 8 The structure block diagram of the model verification device according to the embodiment of the present disclosure is schematically shown.
[0119] like Figure 8 As shown, the model verification device 800 of this embodiment includes a second sending module 810 , a second receiving module 820 and a determining module 830 .
[0120] The second sending module 810 is used to send a model verification request and a proof set, where the proof set includes at least two training proofs, and the training proofs are determined based on the interval parameter and the weight information of the target model.
[0121] The second receiving module 820 is used to receive the verification result.
[0122] The determination module 830 is used to determine whether the target model is trained based on the target data set according to the verification result.
[0123] Fig. 9 A schematic block diagram of an electronic device that can be used to implement the method for generating a model training certificate and the method for model verification according to an embodiment of the present disclosure is schematically shown.
[0124] like Fig. 9 As shown, the electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 to a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0125] In RAM 903, various programs and data required for the operation of electronic device 900 are stored. Processor 901, ROM 902 and RAM 903 are connected to each other via bus 904. Processor 901 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 902 and / or RAM 903. It should be noted that the program can also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 can also implement the method provided by the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0126] According to an embodiment of the present disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the I / O interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 908 including a hard disk, etc.; and a communication portion 909 including a network interface card such as a LAN card, a modem, etc. The communication portion 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage portion 908 as needed.
[0127] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0128] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 902 and / or RAM 903 described above and / or one or more memories other than ROM 902 and RAM 903.
[0129] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the method provided by the embodiment of the present disclosure.
[0130] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 901. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0131] In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 909, and / or installed from a removable medium 911. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0132] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0133] It should be noted that the collection, storage, use, processing, transmission, provision, disclosure and application of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and they do not violate public order and good morals. In the technical solution of this disclosure, the user's authorization or consent is obtained before obtaining or collecting user personal information.
[0134] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0135] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or coupled in a variety of ways, even if such combinations and / or couplings are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or coupled in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or couplings fall within the scope of the present disclosure.
[0137] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A method for generating a model training proof, comprising: receiving a certificate acquisition request, wherein the certificate acquisition request includes a specified target data set; Acquire the target data set according to the proof acquisition request, where the target data set is used to train the target model; Training the target model based on the target data set, generating a proof set according to weight information and interval parameters of the target model, the proof set including at least two training proofs; The set of certificates is sent.
2. According to the method of claim 1, the proof acquisition request includes model parameters, and the generating of the proof set according to the weight information and interval parameters of the target model includes: determining a number of the training proofs based on the model parameters and the interval parameters; Generating the training certificate according to the number of the training certificates, the weight information of the target model and the adjustment operation in the calculation process of the weight information; The proof set is determined based on the training proof.
3. According to the method of claim 2, the adjustment operation in the weight information calculation process comprises: For a calculation result of the first precision type obtained through the weight information calculation process, rounding the calculation result to a specified rounding direction to obtain a rounding result of the second precision type; The first precision type has a higher precision than the second precision type.
4. The method according to claim 3, wherein the calculation result comprises an output result of the target model, and the adjustment operation in the weight information calculation process comprises: The output result of the target model of the first precision type is rounded in a specified rounding direction to obtain a rounding result of the second precision type, and the rounding result of the second precision type is used to calculate the loss.
5. The method according to claim 3, wherein the calculation result includes a gradient value corresponding to the weight information, and the adjustment operation in the weight information calculation process includes: The gradient value of the first precision type is rounded in a specified rounding direction to obtain a rounding result of the second precision type, and the rounding result is used to update the weight information.
6. The method according to claim 3, wherein the adjustment operation is determined by: Determine the rounding reference value closest to the calculated result; In the case where the distance between the calculation result and the rounding reference value is less than or equal to a preset threshold, determining a rounding result through an adjustment operation; In the case that the distance between the calculation result and the rounding reference value is greater than the preset threshold, the rounding result is determined according to a valid value that is closer to the calculation result.
7. The method of claim 3, wherein the specified rounding direction of the adjustment operation is determined by: Determining a reference sequence according to preset seed information and the number of iterations of the target model; determining a reference value of the adjustment operation from the reference sequence according to the number of the adjustment operations and the length of the reference sequence; A specified rounding direction for the adjustment operation is determined based on the reference value.
8. The method according to claim 2, wherein generating the training proof comprises: Performing a parity check according to the number of adjustment operations to determine a first proof value; Calculating a hash value according to the weight information and the number of adjustment operations to obtain a second proof value; The training proof is determined based on the first proof value and the second proof value.
9. The method according to claim 1, further comprising: Obtaining target weight information of the target model when training is completed; Send target weight information of the target model.
10. A device for generating a model training certificate, comprising: A first receiving module, configured to receive a certificate acquisition request, wherein the certificate acquisition request includes a specified target data set; An acquisition module, used to acquire the target data set according to the proof acquisition request, wherein the target data set is used to train the target model; A generating module, configured to train the target model based on the target data set, and generate a proof set according to the weight information and interval parameters of the target model, wherein the proof set includes at least two training proofs; The first sending module is used to send the certificate set.