Model training, fine tuning and reasoning system and method involving privacy protection
Through the combination of local encryption and decryption modules and cloud training modules, encryption processing of large language models is realized, privacy and security issues in large language model training and inference are solved, GPU costs are reduced, and resource utilization is improved.
Patent Information
- Application Number
- CN202410847391.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-27
AI Technical Summary
There are data and model privacy and security issues in the training and inference process of large language models, which results in companies needing to purchase physical GPUs, resulting in high costs and inability to effectively utilize cloud service resources. Existing technologies such as differential privacy and federated training have a significant impact on privacy. There are deficiencies in protection.
It uses a combination of local encryption and decryption modules, cloud training modules and model storage modules to encrypt and process large-scale data sets and prompt words to achieve model training, fine-tuning and inference in the cloud, ensuring the privacy protection of data and models, and reducing GPU costs. .
It enables safe and low-cost model training, fine-tuning and inference in the cloud, improves the utilization of GPU resources, reduces social energy consumption, and improves work efficiency.
Smart Images

Figure CN118709228A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of big data analysis, and in particular, relates to a model training, fine-tuning and reasoning system and method involving privacy protection. Background Art
[0002] The booming development of large language models has led to a surge in demand for computing power. Due to concerns about data and model privacy and security, model companies must purchase physical GPUs for private deployment to train basic models and cannot use the elastic resources of cloud services. If the GPU cannot be fully utilized for a long time, it will increase costs and cause waste for the company.
[0003] Some large language models have strong generalization capabilities, but they also require vertical industry knowledge, so small industry companies need to fine-tune the large models, but due to data privacy and security issues, they have to purchase physical GPUs for fine-tuning training. This is more expensive for small industry companies. If they want to reduce GPU costs and use elastic cloud GPUs, they must take the risk of data and model leakage.
[0004] After the model is trained, it needs to be used for inference services. Similarly, if elastic cloud GPU resources are used, there is also a risk of model leakage.
[0005] Differential privacy technology is used in existing technologies. The core idea is to add random noise during model training or inference so that the model output is not sensitive to any single training sample or input sample, thereby achieving the purpose of privacy protection. However, differential privacy technology only protects individual privacy and cannot guarantee complete protection of all data.
[0006] Existing technologies also use federated training and federated reasoning to solve data privacy protection, but they mainly use distributed methods and still have shortcomings in communication efficiency, model convergence speed, trust between participants, etc. Summary of the invention
[0007] The technical objective of the present invention is to provide a model training, fine-tuning and reasoning system and method involving privacy protection to solve the problem that the model cannot be used safely and at low cost.
[0008] To solve the above problems, the technical solution of the present invention is:
[0009] A privacy-preserving model training, fine-tuning, and inference system, including:
[0010] A first input terminal, a local encryption and decryption module, a cloud training module, and a cloud model storage module;
[0011] Obtaining a large-scale data set data inputted from a first input terminal;
[0012] The local encryption and decryption module is connected to the first input terminal signal and is configured to receive data set data and convert it into encrypted data set data;
[0013] The cloud training module is in communication connection with the local encryption and decryption module, and is configured to receive the encrypted data set data and train to obtain the encrypted large language model and store it in the cloud model storage module;
[0014] Among them, the first input end and the local encryption and decryption module are located at the local data set providing end, and the cloud training module and the cloud model storage module are located at the cloud server.
[0015] Further preferably, it further comprises a second input terminal;
[0016] Obtaining a prompt word inputted from a second input terminal;
[0017] The local encryption and decryption module is in communication connection with the second input terminal and is configured to receive the prompt word and convert it into an encrypted prompt word;
[0018] The cloud training module is configured to receive the encrypted prompt word from the local encryption and decryption module, receive the encrypted large language model from the cloud model storage module, implement model reasoning on the encrypted prompt word, and obtain the encrypted reasoning result;
[0019] The local encryption and decryption module is also configured to receive the encrypted inference result and decrypt it, and transmit it back to the cloud server after obtaining the normal inference result;
[0020] Among them, the second input end is located in the cloud server, and the data source of the second input end is consistent with that of the first input end.
[0021] Further preferably, it further comprises a third input terminal;
[0022] Acquire data of a data set of a vertical industry inputted from a third input terminal;
[0023] The local encryption and decryption module is in communication connection with the third input terminal and is configured to receive data set data and convert it into encrypted data set data;
[0024] The cloud training module is also configured to receive the encrypted data set data from the local encryption and decryption module, and receive the encrypted large language model from the cloud model storage module, to fine-tune the encrypted large language model based on the encrypted data set data, and to train the encrypted LoRA model and store it in the cloud model storage module;
[0025] Among them, the third input terminal is located in the cloud server, and the data source of the third input terminal is inconsistent with that of the first input terminal.
[0026] Further preferably, it further comprises a fourth input terminal;
[0027] Obtaining a prompt word inputted from a fourth input terminal;
[0028] The local encryption and decryption module is in communication connection with the fourth input terminal and is configured to receive the prompt word and convert it into an encrypted prompt word;
[0029] The cloud training module is configured to receive the encrypted prompt word from the local encryption and decryption module, receive the encrypted LoRA model and the encrypted large language model from the cloud model storage module, implement model reasoning on the encrypted prompt word, and obtain the encrypted reasoning result;
[0030] The local encryption and decryption module is also configured to receive the encrypted inference results and decrypt them, and then transmit the normal inference results back to the cloud server.
[0031] Among them, the fourth input terminal is located in the cloud server, and the data source of the fourth input terminal is consistent with that of the third input terminal.
[0032] A privacy-preserving model training, fine-tuning, and reasoning method is applied to any of the privacy-preserving model training, fine-tuning, and reasoning systems described above, wherein the model training comprises the following steps:
[0033] Acquire large-scale data sets; encrypt the data sets to obtain encrypted data sets; receive the encrypted data sets and train to obtain an encrypted large language model, which is then stored in a cloud model storage module.
[0034] Further preferably, the model reasoning includes the following steps:
[0035] Obtain a prompt word; encrypt the received prompt word to obtain an encrypted prompt word; send the encrypted prompt word to the encrypted large language model, perform model reasoning, and obtain an encrypted reasoning result; then decrypt the encrypted reasoning result to obtain a normal reasoning result.
[0036] Further preferably, the model fine-tuning includes the following steps:
[0037] Obtain data sets of vertical industries; encrypt data sets to obtain encrypted data sets; send encrypted data sets to the encrypted large language model to fine-tune the model, and train to obtain an encrypted LoRA model.
[0038] Further preferably, the fine-tuned model reasoning includes the following steps:
[0039] Obtain a prompt word; encrypt the prompt word to obtain an encrypted prompt word; send the encrypted prompt word to the encrypted LoRA model and the encrypted large language model, perform model reasoning, and obtain an encrypted reasoning result; then decrypt the encrypted reasoning result to obtain a normal reasoning result.
[0040] An electronic device includes a processor and a memory, wherein the memory stores computer instructions that can be executed on the processor, and the processor is used to call the computer instructions in the memory to execute any of the above-mentioned model training, fine-tuning and reasoning methods involving privacy protection.
[0041] A storage medium is used to store computer instructions, wherein when the computer instructions are executed, the device where the storage medium is located is controlled to execute any of the above-mentioned model training, fine-tuning and reasoning methods involving privacy protection.
[0042] Due to the adoption of the above technical solution, the present invention has the following advantages and positive effects compared with the prior art:
[0043] The present invention achieves privacy protection through encryption, and can implement model training, fine-tuning and reasoning in the cloud processor, reducing the model training, fine-tuning and reasoning costs of large model companies and small industries. Flexible use of the GPU resources of the cloud processor improves the overall utilization rate of the society and reduces the overall energy consumption of the society. The division of labor is clearer, and the GPU resources of the cloud are used reasonably. The model company focuses on data and algorithms, and the cloud company focuses on computing power, which improves the overall work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the following detailed description of the preferred embodiment.The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting the invention.
[0045] Figure 1 A flowchart of the model training process of the present invention;
[0046] Figure 2 It is a flow chart of the model reasoning process of the present invention;
[0047] Figure 3 A flow chart of fine-tuning of the model of the present invention;
[0048] Figure 4 This is a flowchart of the fine-tuned model reasoning process of the present invention. DETAILED DESCRIPTION
[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.
[0050] In order to simplify the drawings, only the parts related to the present invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".
[0051] The following is a further detailed description of a model training, fine-tuning and reasoning system involving privacy protection proposed by the present invention in conjunction with the accompanying drawings and specific embodiments. The advantages and features of the present invention will become more apparent from the following description and claims.
[0052] Example
[0053] See also Figures 1 to 4 This embodiment provides a model training, fine-tuning and reasoning system and method involving privacy protection. The character set of the data is mapped to another character set through an encryption algorithm, and then all the training data is encrypted, and the encrypted data is used to train a large model. When reasoning, the input data is first encrypted with the same encryption algorithm, and then the encrypted large model is used for reasoning. The inference result is then decrypted using the corresponding decryption algorithm to obtain the correct reasoning result.
[0054] See also Figure 1 In this embodiment, the first input terminal, local encryption and decryption module, cloud training module and cloud model storage module required for model training are targeted at companies with large-scale data sets and the need to train basic models. Figure 1 Company A is shown. Company A inputs its large-scale data set data into the local encryption and decryption module through the first input terminal, and in the local encryption and decryption module, the data set data is converted into encrypted data set data. Among them, the local encryption and decryption module is the key of Company A, and an encryption algorithm is loaded inside it, including but not limited to a symmetric encryption algorithm. Then, through network communication, the encrypted data set data is uploaded to the cloud training module located on the cloud server, and the cloud training module provides GPU computing power. Thereby receiving the encrypted data set data and training to obtain an encrypted large language model and storing it in the cloud model storage module, that is, the basic large model required by Company A. Among them, the first input terminal and the local encryption and decryption module are located at the local data set providing end, that is, located at the local processing terminal of Company A, and the cloud training module and the cloud model storage module are located on the cloud server.
[0055] See also Figure 2, preferably, a second input terminal is required to perform model reasoning on the above-mentioned basic large model. The second input terminal is set on the cloud server as the input terminal of the prompt word, and the prompt word is proposed by the user who needs to use the above-mentioned basic large model. The prompt word is transmitted to the local encryption and decryption module through network communication, and the prompt word is converted into an encrypted prompt word. Then the encrypted prompt word is sent back to the cloud server, and the encrypted prompt word is received by the cloud training module. The cloud training module also receives the encrypted large language model from the cloud model storage module, so as to use the encrypted prompt word to perform model reasoning on the encrypted large language model to obtain an encrypted reasoning result. Then, the encrypted reasoning result is sent to the local encryption and decryption module for decryption processing, and finally the normal reasoning result is obtained and transmitted back to the cloud server, and the user can get the required result from the cloud server.
[0056] See also Figure 3 Preferably, if the basic large model needs to be fine-tuned, a third input terminal needs to be set, and the third input terminal is arranged on the cloud server. The third input terminal inputs the data set data of the vertical industry, that is, Figure 3 Company B in the example is an industry company with a vertical industry data set. It needs to fine-tune and train a LoRA model based on the existing basic large model. Specifically, the data set data is transmitted to the local encryption and decryption module through communication, and the data set data is converted into encrypted data set data and then transmitted back to the cloud training module. The cloud training module receives the encrypted large language model from the cloud model storage module, and fine-tunes the encrypted large language model based on the encrypted data set data. The encrypted LoRA model is trained and stored in the cloud model storage module.
[0057] See also Figure 4 Preferably, a fourth input terminal located in the cloud server is further provided for model reasoning using the above-mentioned fine-tuned model. If the user needs to use the above-mentioned fine-tuned model for fine-tuning, the prompt word is input through the fourth input terminal, and then the prompt word is transmitted to the local encryption and decryption module through communication, and the received prompt word is converted into an encrypted prompt word. Then, the cloud training module receives the encrypted prompt word from the local encryption and decryption module, receives the encrypted LoRA model and the encrypted large language model from the cloud model storage module, realizes model reasoning on the encrypted prompt word, and obtains the encrypted reasoning result. Then, the encrypted reasoning result is sent to the local encryption and decryption module for decryption, and after obtaining the normal reasoning result, it is transmitted back to the cloud server, and the user can obtain the required result from the cloud server.
[0058] Preferably, this embodiment also provides an electronic device, comprising a processor and a memory, wherein the memory stores computer instructions that can be executed on the processor, and the processor is used to call the computer instructions in the memory to execute any of the above-mentioned model training, fine-tuning and reasoning methods involving privacy protection.
[0059] Further preferably, this embodiment also provides a storage medium, which is used to store computer instructions, wherein when the computer instructions are executed, the device where the storage medium is located is controlled to execute any of the above-mentioned model training, fine-tuning and reasoning methods involving privacy protection.
[0060] The embodiments of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above embodiments. Even if various changes are made to the present invention, if these changes fall within the scope of the claims of the present invention and their equivalents, they still fall within the protection scope of the present invention.
Claims
1. A privacy-preserving model training, fine-tuning, and reasoning system, characterized in that: include: A first input terminal, a local encryption and decryption module, a cloud training module, and a cloud model storage module; Acquire a large-scale data set inputted from the first input end; The local encryption and decryption module is connected to the first input terminal signal, and is configured to receive data set data and convert it into encrypted data set data; The cloud training module is in communication with the local encryption and decryption module, and is configured to receive encrypted data set data and train to obtain an encrypted large language model and store it in the cloud model storage module; Among them, the first input end and the local encryption and decryption module are located at the local data set providing end, and the cloud training module and the cloud model storage module are located at the cloud server.
2. The privacy-preserving model training, fine-tuning, and reasoning system according to claim 1, characterized in that: Also comprising a second input terminal; Acquire a prompt word inputted from the second input terminal; The local encryption and decryption module is in communication with the second input terminal and is configured to receive the prompt word and convert it into an encrypted prompt word; The cloud training module is configured to receive the encrypted prompt word from the local encryption and decryption module, receive the encrypted large language model from the cloud model storage module, perform model reasoning on the encrypted prompt word, and obtain an encrypted reasoning result; The local encryption and decryption module is further configured to receive the encrypted reasoning result and decrypt it, and transmit the normal reasoning result back to the cloud server after obtaining it; The second input terminal is located in a cloud server, and a data source of the second input terminal is consistent with that of the first input terminal.
3. The privacy-preserving model training, fine-tuning, and reasoning system according to claim 1, characterized in that: Also comprising a third input terminal; Acquire data of a data set of a vertical industry inputted from the third input terminal; The local encryption and decryption module is in communication connection with the third input terminal and is configured to receive data set data and convert it into encrypted data set data; The cloud training module is also configured to receive the encrypted data set data from the local encryption and decryption module, and receive the encrypted large language model from the cloud model storage module, to fine-tune the encrypted large language model based on the encrypted data set data, and to train the encrypted LoRA model and store it in the cloud model storage module; Among them, the third input end is located in the cloud server, and the data source of the third input end is inconsistent with that of the first input end.
4. The privacy-preserving model training, fine-tuning, and reasoning system according to claim 3, characterized in that: Also comprising a fourth input terminal; Acquire a prompt word inputted from the fourth input terminal; The local encryption and decryption module is in communication with the fourth input terminal and is configured to receive the prompt word and convert it into an encrypted prompt word; The cloud training module is configured to receive the encrypted prompt word from the local encryption and decryption module, receive the encrypted LoRA model and the encrypted large language model from the cloud model storage module, implement model reasoning on the encrypted prompt word, and obtain an encrypted reasoning result; The local encryption and decryption module is also configured to receive the encrypted reasoning result and decrypt it, and then transmit the normal reasoning result back to the cloud server. Among them, the fourth input end is located in the cloud server, and the data source of the fourth input end is consistent with that of the third input end.
5. A privacy-preserving model training, fine-tuning and reasoning method, applied to the privacy-preserving model training, fine-tuning and reasoning system as claimed in any one of claims 1 to 4, characterized in that: Model training includes the following steps: Acquire large-scale data sets; encrypt the data sets to obtain encrypted data sets; receive the encrypted data sets and train to obtain an encrypted large language model, which is then stored in a cloud model storage module.
6. The privacy-preserving model training, fine-tuning and reasoning method according to claim 5, characterized in that: Model reasoning includes the following steps: Obtain a prompt word; encrypt the received prompt word to obtain an encrypted prompt word; send the encrypted prompt word to the encrypted large language model, perform model reasoning, and obtain an encrypted reasoning result; then decrypt the encrypted reasoning result to obtain a normal reasoning result.
7. The privacy-preserving model training, fine-tuning and reasoning method according to claim 5, characterized in that: Model fine-tuning includes the following steps: Obtain data sets of vertical industries; encrypt data sets to obtain encrypted data sets; send encrypted data sets to the encrypted large language model to fine-tune the model, and train to obtain an encrypted LoRA model.
8. The privacy-preserving model training, fine-tuning and reasoning method according to claim 7, characterized in that: Model inference after fine-tuning includes the following steps: Obtain a prompt word; encrypt the prompt word to obtain an encrypted prompt word; send the encrypted prompt word to the encrypted LoRA model and the encrypted large language model, perform model reasoning, and obtain an encrypted reasoning result; then decrypt the encrypted reasoning result to obtain a normal reasoning result.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores computer instructions that can be executed on the processor, and the processor is used to call the computer instructions in the memory to execute the model training, fine-tuning and reasoning method involving privacy protection as described in any one of claims 5-8.
10. A storage medium, characterized in that: The storage medium is used to store computer instructions, wherein, when the computer instructions are executed, the device where the storage medium is located is controlled to execute the model training, fine-tuning and reasoning method involving privacy protection as described in any one of claims 5-8.
Citation Information
Cited By
Large language model training method and device, interaction method and device, equipment and medium
CN119558411A
Ensuring the integrity and confidentiality of task-based model execution
WO2026092862A1
