Large model training method, data processing method and device
By avoiding the use of target data containing private data during the training process of large-scale pre-training language models, through iterative training and loss function convergence mechanism, the problem of large-scale models leaking private data during training is solved, and its security is improved and credibility.
Patent Information
- Application Number
- CN202410368545.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-03-28
AI Technical Summary
Large-scale pre-trained language models are prone to leaking citizens' privacy data during training, resulting in lower security.
By obtaining training samples, including target data and labeled answers, inputting them into the big model for iterative training, outputting predicted answers, and adjusting model parameters through predicted answers and labeled answers until the loss function converges, avoiding the use of target data containing private data for training to improve the security of the big model.
It effectively avoids the large model leaking citizens' privacy data during training, improves the security of the large model, and enhances the credibility of the output.
Smart Images

Figure CN118364504B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a large model training method, data processing method, device, electronic equipment, storage medium and program product. Background Art
[0002] In recent years, large-scale pre-trained language models have developed rapidly. By collecting massive data from the Internet and other platforms, large-scale pre-trained language models have achieved good results in model development and scenario applications. In this context, large-scale pre-trained language models in various industries have also been born, such as medical big models and education big models.
[0003] In some scenarios, the training process of the big model is to use business corpus to train the big model. The business corpus contains citizens' private data and other types of private data. The big model trained with these private data will directly output citizens' private information. Therefore, the security of the big model is relatively low and it is easy to leak private data. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a large model training method, data processing method, device, electronic device and storage medium, which can improve the security of the large model and avoid the leakage of privacy data.
[0005] In order to solve the above technical problems, the embodiments of the present application are implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a large model training method, which includes: obtaining training samples, wherein the training samples include target data, wherein the target data includes a target question and a labeled answer corresponding to the target question; inputting the training samples into the large model to be trained for iterative training, and outputting a predicted answer to the target question; adjusting the model parameters of the large model according to the predicted answer and the labeled answer until the loss function of the large model to be trained converges.
[0007] In a second aspect, an embodiment of the present application provides a data processing method, which obtains a target question; inputs the target question into a large model for data processing, wherein, when the target question contains privacy data, outputs a predicted answer to the target question as an executable command, and the executable command instructs to search a target database for a target answer corresponding to the privacy data; and when the target question does not contain the privacy data, outputs a predicted answer corresponding to the target question.
[0008] In the third aspect, an embodiment of the present application provides a large model training device, which includes: an acquisition module for acquiring training samples, wherein the training samples include target data, and the target data includes a target question and a labeled answer corresponding to the target question; a training module for inputting the training samples into a large model to be trained for iterative training, and outputting a predicted answer to the target question; an adjustment module for adjusting the model parameters of the large model through the predicted answer and the labeled answer until the loss function of the large model to be trained converges.
[0009] In a fourth aspect, an embodiment of the present application provides a data processing device, comprising: an acquisition module, used to acquire a target question; a processing module, used to input the target question into a large model for data processing, wherein, when the target question contains privacy data, the predicted answer to the target question is output as an executable command, and the executable command instructs to search a target database for a target answer corresponding to the privacy data; and an output module, used to output a predicted answer corresponding to the target question when the target question does not contain the privacy data.
[0010] In the fifth aspect, an embodiment of the present application provides an electronic device, including a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the communication bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the steps of the large model training method mentioned in the first aspect or the second aspect.
[0011] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the training method of the large model mentioned in the first aspect or the second aspect are implemented.
[0012] In the seventh aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps of the large model training method mentioned in the first aspect or the second aspect.
[0013] It can be seen from the technical solution provided by the above embodiments of the present application that by obtaining training samples, the training samples include target data, the target data includes a target question and a labeled answer corresponding to the target question, and then the training samples are input into the large model to be trained for iterative training, and the predicted answer to the target question is output; finally, the model parameters of the large model are adjusted by the predicted answer and the labeled answer until the loss function of the large model to be trained converges. In this way, the large model is trained by target data that does not contain privacy data. During the training process, the loss function of the large model continues to converge until the training of the large model is completed. Therefore, the large model is trained by using target data that does not contain privacy data, so that the large model will not output privacy information related to the privacy data of citizens, and the security of the large model is high, and the leakage of privacy data is avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0015] Figure 1 A flowchart of a large model training method provided in an embodiment of the present application;
[0016] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;
[0017] Figure 3 A schematic diagram of the module composition of a large model training device provided in an embodiment of the present application;
[0018] Figure 4 A schematic diagram of a module composition of a data processing device provided in an embodiment of the present application;
[0019] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0020] The purpose of the embodiments of the present application is to provide a large model training method, device, electronic device and storage medium, which can improve the security of the large model and avoid the leakage of privacy data.
[0021] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0022] For example, Figure 1 As shown, the embodiment of the present application provides a large model training method, the execution subject of the method may be a server, and the large model training method may specifically include the following steps:
[0023] In step S101, a training sample is obtained.
[0024] The training samples include target data, and the target data includes target questions and labeled answers corresponding to the target questions.
[0025] Specifically, the training samples are used to train the big government model to be trained. The training samples contain the target question and the annotated answer corresponding to the target question. Privacy data includes but is not limited to the private information of citizens and private data of enterprises, etc. The private information of citizens includes but is not limited to the personal basic information, personal health information, personal asset information and the relationship information between citizens, etc. The target question refers to the question input by the user, and the annotated answer refers to the standard answer to the target question.
[0026] In step S103, the training samples are input into the large model to be trained for iterative training, and the predicted answer to the target question is output.
[0027] Specifically, the training samples are input into the large model to be trained for training. If the training samples include the target question, the output is the predicted answer to the target question. If the target question of the training sample contains private data, the private data is converted into a non-privacy description, and the predicted answer to the target question is output as an executable command. The executable command is an instruction to search the target database for the target answer corresponding to the private data. The target database stores data related to the private data, and the executable command includes but is not limited to SQL statements, commands to execute .exe files, etc.
[0028] Among them, the large model can use ChatGLM-6B, which consists of 28 layers of GLMBlock, has about 6.2 billion parameters, and uses GELU as the activation function, which can be approximately expressed as:
[0029]
[0030] The core principle of the large model is the self-attention mechanism, which can be expressed in the following form:
[0031]
[0032] Among them, the three matrices Q, K, and V all come from the linear transformation of the same input; QK T is a square matrix that stores the result of the inner product operation of each vector with itself and other vectors, that is, the projection of a vector on another vector; d k is the dimension of the representation vector, is the scale, divided by The purpose is to obtain computational stability; softmax normalizes the vector into a probability distribution.
[0033] In step S105, the model parameters of the large model are adjusted by predicting answers and labeling answers until the loss function of the large model to be trained converges.
[0034] The loss function is determined by the final vector obtained by the fully connected layer of the large model to be trained and the feature vector of the private data. The loss function indicates that the inverse of the difference between the final vector and the feature vector approaches a preset value to filter the private data from the target data.
[0035] Specifically, the training samples are input into the large model to be trained, and the large model outputs the predicted answer to the target question. Then, the weight of the large model is adjusted based on the predicted answer and labeled answer to the target question output by the large model.
[0036] The loss function of the large model can be determined by the final vector obtained by the fully connected layer and the feature vector of the privacy data. The final vector f is obtained at the terminal linear fully connected layer of the structure of the general large model. 1 Then, we use word2vec and other methods to extract the feature vector f of the private data. 2 , then vectorize the private data. Finally, add the following part to the loss function of the large model and train it together with the original loss function of the large model:
[0037]
[0038] The optimization goal is that the reciprocal of the difference between the final vector and the eigenvector approaches a preset value, which may be zero.
[0039] Through the technical solution disclosed in the embodiment of the present application, a training sample is obtained, the training sample includes target data, the target data includes a target question and a labeled answer corresponding to the target question, and then the training sample is input into the large model to be trained for iterative training, and the predicted answer to the target question is output; finally, the model parameters of the large model are adjusted by the predicted answer and the labeled answer until the loss function of the large model to be trained converges. In this way, the large model is trained by target data that does not contain privacy data. During the training process, the loss function of the large model continues to converge until the training of the large model is completed. Therefore, the large model is trained by target data that does not contain privacy data, so that the large model will not output privacy information related to the privacy data of citizens, and the security of the large model is high, and the leakage of privacy data is avoided.
[0040] In one possible implementation, the large model includes constraint rules, which indicate that privacy data in the target data is filtered. The constraint rules include: constraint rules for model input and constraint rules during the training process; the constraint rules for model input include at least one of the following: shielding privacy words input to the large model to be trained; shielding non-standard training samples input to the large model to be trained; the constraint rules during the training process include at least one of the following: setting the vectors corresponding to privacy words and / or non-standard training samples to zero; inactivating the hidden layer outputs of privacy words and / or non-standard training samples; directly setting the feature vectors of privacy words and / or non-standard training samples to zero and inactivating them. The constraint rules also include constraint rules for model output; the constraint rules for model output include at least one of the following: filtering the initial predicted answer of the output for privacy words; performing non-compliance checks on the initial predicted answer of the output; and verifying the correctness of the initial predicted answer of the output.
[0041] Specifically, constraints on the input can be added to the input link of the large model to block inputs that should not enter the large model, mainly blocking privacy words that are input into the large model to be trained, such as information that undermines national unity, territorial integrity, and social stability, disrupts social order, spreads superstition, promotes religion, racial discrimination, etc., and blocks non-standard training samples that are input into the large model to be trained, such as relevant terms prohibited by laws and regulations and non-compliant relationships, such as incorrect administrative divisions and affiliations.
[0042] The constraints in the training process include: setting the vectors corresponding to the privacy words and / or non-standard training samples to zero, for example, setting the vectors corresponding to the inputs of the corresponding privacy data and / or non-standard training samples to zero when initializing trainable parameters; inactivating the hidden layer outputs of the privacy words and / or non-standard training samples; for example, inactivating the privacy data and / or non-standard hidden layer outputs when activating outputs; (4) Prior knowledge constraints: for example, adding prior knowledge in the government affairs field so that the model can grasp the existing common sense in the government affairs field; directly setting the feature vectors of the privacy words and / or the feature vectors of the non-standard training samples to zero and inactivating them.
[0043] The constraint rules of the model output mainly include: filtering the initial predicted answers of the output with privacy terms, such as establishing a privacy vocabulary and performing the last layer of filtering before output; checking the initial predicted answers of the output for non-compliance, such as establishing a privacy vocabulary and performing the last layer of filtering before output; verifying the correctness of the initial predicted answers of the output, such as checking and verifying the correctness of the output, setting the output that conforms to the logical relationship (mathematical principles, physical laws, common sense, etc.) as correct, and vice versa. Delete the wrong output directly.
[0044] For example, Figure 2 As shown, an embodiment of the present application provides a data processing method, the execution subject of the data processing method may be a server, and the data processing method may specifically include the following steps:
[0045] Step S201, obtaining a target question.
[0046] Specifically, target issues refer to target issues related to government affairs.
[0047] Step S203, input the target problem into the large model for data processing.
[0048] Among them, when the target question contains private data, the predicted answer to the target question is output as an executable command, and the executable command instructs to search the target database for the target answer corresponding to the private data; when the target question does not contain private data, the predicted answer corresponding to the target question is output.
[0049] Specifically, the large model in the embodiment of the present application is the large model trained in the embodiment of the large model training method described above. The executable command is an instruction to search the target answer corresponding to the private data from the target database. The target database stores data related to the private data, and the executable command includes but is not limited to SQL statements, commands to execute .exe files, etc.
[0050] For example, the target question "Output my bank card account balance" is input into the big model. Since the target question contains the private data "bank card account balance", the big model will output executable commands that can operate the target database accordingly, such as "SELECT COUNT(*)FROMACCOUNT WHERE ID=myid;".
[0051] Then, the executable command operates the database storing the standard answer to the target question and obtains the output "100,000¥". Obviously, the output of the large model does not involve personal privacy data, that is, it will not directly output personal privacy data, thereby improving the security of the large model and avoiding privacy leakage.
[0052] It can be seen from the technical solutions provided by the above embodiments of the present application that the large model will not output private information related to private data, the large model has high security, and avoids the leakage of private data, which greatly enhances the credibility of the large model output.
[0053] The data processing method provided in the embodiment of the present application and the training method of the large model provided in the above-mentioned embodiment that are the same or similar implementation methods can refer to each other, and the embodiment of the present application will not be repeated here.
[0054] Corresponding to the large model training method provided in the above embodiment, based on the same technical concept, the embodiment of the present application also provides a large model training device, Figure 3 A schematic diagram of the module composition of a large model training device provided in an embodiment of the present application, wherein the large model training device is used to execute Figure 1 The training method of large models described in Figure 3 As shown, the training device 300 of the large model includes: an acquisition module 301, used to acquire training samples, the training samples include target data, the target data include target questions and labeled answers corresponding to the target questions; a training module 302, used to input the training samples into the large model to be trained for iterative training, and output the predicted answers to the target questions; an adjustment module 303, used to adjust the model parameters of the large model through the predicted answers and the labeled answers until the loss function of the large model to be trained converges.
[0055] Through the technical solution disclosed in the embodiment of the present application, a training sample is obtained, the training sample includes target data, the target data includes a target question and a labeled answer corresponding to the target question, and then the training sample is input into the large model to be trained for iterative training, and the predicted answer to the target question is output; finally, the model parameters of the large model are adjusted by the predicted answer and the labeled answer until the loss function of the large model to be trained converges. In this way, the large model is trained by target data that does not contain privacy data. During the training process, the loss function of the large model continues to converge until the training of the large model is completed. Therefore, the large model is trained by target data that does not contain privacy data, so that the large model will not output privacy information related to the privacy data of citizens, and the security of the large model is high, and the leakage of privacy data is avoided.
[0056] In one possible implementation, the training module 302 is further used to output a predicted answer to the target question as an executable command when the target question of the training sample contains privacy data; the executable command instructs to search the target database for a target answer corresponding to the privacy data, and the loss function is determined by the final vector obtained by the fully connected layer of the large model to be trained and the feature vector of the privacy data, and the loss function indicates that the inverse of the difference between the final vector and the feature vector approaches a preset value to filter the privacy data from the target data.
[0057] In a possible implementation, the large model includes a constraint rule, where the constraint rule indicates to filter the privacy data in the target data.
[0058] In one possible implementation, the constraint rules include: constraint rules for model input and constraint rules during the training process; the constraint rules for model input include at least one of the following: shielding privacy words input into the large model to be trained; shielding non-standard training samples input into the large model to be trained; the constraint rules during the training process include at least one of the following: setting the vectors corresponding to privacy words and / or non-standard training samples to zero; inactivating the hidden layer outputs of privacy words and / or non-standard training samples; directly setting the feature vectors of privacy words and / or non-standard training samples to zero and inactivating them.
[0059] In one possible implementation, the constraint rules also include constraint rules for model output; the constraint rules for model output include at least one of the following: filtering privacy vocabulary on the output initial prediction answer; performing non-compliance checking on the output initial prediction answer; and verifying the correctness of the output initial prediction answer.
[0060] The large model training device provided in the embodiment of the present application can implement each process in the embodiment corresponding to the above-mentioned large model training method, and has the same or similar beneficial effects. To avoid repetition, it will not be repeated here.
[0061] Corresponding to the document processing method provided in the above embodiment, based on the same technical concept, the embodiment of the present application also provides a data processing device, Figure 4 A schematic diagram of the module composition of a data processing device provided in an embodiment of the present application, wherein the data processing device is used to execute Figure 2 The data processing methods described, such as Figure 4 As shown, the data processing device 400 includes: an acquisition module 401, used to obtain a target question; a processing module 402, used to input the target question into a large model for data processing, wherein, when the target question contains privacy data, the predicted answer to the target question is output as an executable command, and the executable command indicates to search the target database for the target answer corresponding to the privacy data; an output module 403, used to output the predicted answer corresponding to the target question when the target question does not contain privacy data.
[0062] Through the technical solution disclosed in the embodiment of the present application, the large model will not output private information related to private data, the large model has high security, and the leakage of private data is avoided, which greatly enhances the credibility of the large model output.
[0063] It should be noted that the data processing device provided in the embodiment of the present application and the data processing method provided in the embodiment of the present application are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned data processing method, and has the same or similar beneficial effects, and the repetitive parts will not be repeated.
[0064] Corresponding to the large model training method provided in the above embodiment, based on the same technical concept, the embodiment of the present application also provides an electronic device, which is used to execute the above large model training method or data processing method. Figure 5 A schematic diagram of the structure of an electronic device for implementing each embodiment of the present application is shown in FIG. Figure 5 As shown. The electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 501 and memory 502, and the memory 502 may store one or more storage applications or data. Among them, the memory 502 may be a temporary storage or a permanent storage. The application stored in the memory 502 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device.
[0065] Furthermore, the processor 501 may be configured to communicate with the memory 502 to execute a series of computer executable instructions in the memory 502 on the electronic device. The electronic device may also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input and output interfaces 505, and one or more keyboards 506.
[0066] Specifically in this embodiment, the electronic device includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to achieve the above Figure 1 or Figure 2 The various steps in the method embodiment are similar to those in the method embodiment, and have the beneficial effects of the above method embodiments. To avoid repetition, the embodiments of the present application will not be described again here.
[0067] This embodiment also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above Figure 1 or Figure 2 Each step in the method embodiment has the beneficial effects of the above method embodiments. To avoid repetition, the embodiments of the present application will not be described again here.
[0068] The present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the above Figure 1 or Figure 2 Each step in the method embodiment has the beneficial effects of the above method embodiments. To avoid repetition, the embodiments of the present application will not be described again here.
[0069] The present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the above Figure 1 or Figure 2 Each step in the method embodiment has the beneficial effects of the above method embodiments. To avoid repetition, the embodiments of the present application will not be described again here.
[0070] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0071] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0072] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0073] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0074] In a typical configuration, an electronic device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0075] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0076] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0077] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0078] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0079] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A large model training method, characterized in that: The training method of the large model includes: Acquire a training sample, wherein the training sample includes target data, and the target data includes a target question and a labeled answer corresponding to the target question; Inputting the training samples into the large model to be trained for iterative training, and outputting the predicted answer to the target question; Adjusting the model parameters of the large model by using the predicted answer and the labeled answer until the loss function of the large model to be trained converges; The step of inputting the training samples into the large model to be trained for iterative training and outputting the predicted answer to the target question comprises: When the target question of the training sample contains private data, outputting the predicted answer to the target question as an executable command; The executable command instructs to search a target database for a target answer corresponding to the privacy data; The loss function is determined by a final vector obtained by a fully connected layer of the large model to be trained and a feature vector of the private data, wherein the loss function indicates that the inverse of the difference between the final vector and the feature vector approaches a preset value to filter the private data from the target data, wherein the feature vector of the private data is extracted by a word2vec method; The large model includes constraint rules, and the constraint rules indicate filtering of privacy data in the target data; The constraint rules include: constraint rules in the training process; The constraint rules in the training process include at least one of the following: Set the vectors corresponding to the privacy words and / or non-compliant training samples to zero; Inactivating the privacy vocabulary and / or the hidden layer output of the non-compliant training sample; Directly setting the feature vector of the privacy vocabulary and / or the feature vector of the non-standard training sample to zero and inactivating it; Among them, the core principle of the large model is the self-attention mechanism, which is expressed as: , Among them, the three matrices Q, K, and V all come from the linear transformation of the same input. T is a square matrix that stores the result of the inner product operation of each vector with itself and other vectors; d k is the dimension of the representation vector, To scale, softmax normalizes the vector into a probability distribution.
2. The large model training method according to claim 1, characterized in that: The constraint rules also include: constraint rules for model input; The constraint rules for model input include at least one of the following: Shielding privacy words input into the large model to be trained; Shielding the non-standard training samples input into the large model to be trained.
3. The large model training method according to claim 2, characterized in that: The constraint rules also include constraint rules for model output; The constraint rules for model output include at least one of the following: Perform privacy vocabulary filtering on the output initial prediction answer; Perform non-compliance checks on the output initial prediction answers; Verify the correctness of the output initial prediction answer.
4. The large model training method according to claim 1, characterized in that: The method further comprises: Get the target question; Input the target question into the big model for data processing, wherein, if the target question contains private data, output the predicted answer of the target question as an executable command, wherein the executable command instructs to search the target database for the target answer corresponding to the private data; When the target question does not contain the private data, a predicted answer corresponding to the target question is output.
5. A large model training device, characterized in that: include: An acquisition module, configured to acquire a training sample, wherein the training sample includes target data, and the target data includes a target question and a labeled answer corresponding to the target question; A training module, used for inputting the training samples into the large model to be trained for iterative training, and outputting the predicted answer to the target question; An adjustment module, used for adjusting the model parameters of the large model according to the predicted answer and the labeled answer, until the loss function of the large model to be trained converges; The training module is specifically configured to output a predicted answer to the target question as an executable command when the target question of the training sample contains private data; The executable command instructs to search a target database for a target answer corresponding to the privacy data; The loss function is determined by a final vector obtained by a fully connected layer of the large model to be trained and a feature vector of the private data, wherein the loss function indicates that the inverse of the difference between the final vector and the feature vector approaches a preset value to filter the private data from the target data, wherein the feature vector of the private data is extracted by a word2vec method; The large model includes constraint rules, and the constraint rules indicate filtering of privacy data in the target data; The constraint rules include: constraint rules in the training process; The constraint rules in the training process include at least one of the following: Set the vectors corresponding to the privacy words and / or non-compliant training samples to zero; Inactivating the privacy vocabulary and / or the hidden layer output of the non-compliant training sample; Directly setting the feature vector of the privacy vocabulary and / or the feature vector of the non-standard training sample to zero and inactivating it; Among them, the core principle of the large model is the self-attention mechanism, which is expressed as: , Among them, the three matrices Q, K, and V all come from the linear transformation of the same input. T is a square matrix that stores the result of the inner product operation of each vector with itself and other vectors; d k is the dimension of the representation vector, To scale, softmax normalizes the vector into a probability distribution.
6. The large model training device according to claim 5, characterized in that: The large model training device also includes: An acquisition module is used to obtain the target problem; a processing module, configured to input the target question into the large model for data processing, wherein, when the target question contains private data, output the predicted answer to the target question as an executable command, wherein the executable command instructs to search a target database for a target answer corresponding to the private data; An output module is used to output a predicted answer corresponding to the target question when the target question does not contain the private data.
7. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the communication bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the steps of the large model training method as described in any one of claims 1-4.
8. A computer program product, comprising a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program comprises program instructions, and when the program instructions are executed by a computer, the computer executes the steps of the large model training method as described in any one of claims 1-4.
