A method, system, and device for protecting data privacy during large language model training.

By introducing the privacy protection mechanism Adapter module into large language model training, sensitive data is processed and encrypted, which solves the problem of data privacy protection affecting model performance in the existing technology, and achieves efficient data privacy protection and improvement of work efficiency. .

CN118171325BActive Publication Date: 2024-08-30NORTH CHINA DIGITAL HEALTH TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410591839.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-08-30
Estimated Expiration
2044-05-14

AI Technical Summary

Technical Problem

Existing data privacy protection methods in large language model training usually sacrifice model performance and consume large amounts of computing resources, affecting work efficiency.

Method used

Introduce an Adapter module with a pre-designed privacy protection mechanism to process large language model training data containing sensitive information, perform data conversion and encryption through differential privacy or homomorphic encryption, retain the target training data, and use the processed data to The model is fine-tuned until a target model is obtained that achieves expected performance while maintaining data privacy.

Benefits of technology

Without affecting the overall model performance, more effective data privacy protection is achieved, work efficiency is improved, and computing resource consumption and model training time are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118171325B
    Figure CN118171325B
Patent Text Reader

Abstract

The present invention provides a method, system and device for protecting data privacy in large language model training, which belongs to the field of artificial intelligence. The method includes: obtaining large language model training data containing sensitive information; using an Adapter module to perform data processing on the large language model training data containing sensitive information to obtain processed training data, wherein a privacy protection mechanism is pre-designed in the Adapter module to protect sensitive information from being leaked when the Adapter module performs data processing; using the processed training data to fine-tune the initial large language model to obtain a target large language model. Through the above technical solution, by introducing an Adapter module pre-designed with a privacy protection mechanism to process the large language model training data containing sensitive information, more effective data privacy protection can be achieved without affecting the overall model performance, thereby improving later work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, system and device for protecting data privacy in large language model training. Background Art

[0002] With the development of artificial intelligence technology, large language models have shown powerful capabilities in various tasks, such as natural language understanding, text generation, etc. However, training these models usually requires a large amount of data, which may contain sensitive personal information. Data privacy protection is particularly important in the current digital age. The collection, storage and processing of personal and corporate data continues to expand, and the risk of data leakage and abuse also increases. Therefore, data privacy protection technology has emerged to ensure the confidentiality, integrity and availability of data.

[0003] In the field of data privacy protection, a series of advanced technical means are widely used. For example, differential privacy technology is a data privacy protection method that has attracted much attention in recent years. It adds a certain amount of noise to the data so that the analysis results of the data are still statistically accurate, but cannot be accurate to the individual level, thereby protecting the privacy of individuals.

[0004] Although this technology can protect data privacy to a certain extent, it often sacrifices the performance of the model itself. In addition, these methods often require the entire model to be retrained, which consumes a lot of computing resources and takes a long time to train the model, affecting the efficiency of later work. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a method, system and device for protecting data privacy in large language model training, which is used to achieve more effective data privacy protection by introducing Adapter technology without affecting the performance of the overall model.

[0006] In order to achieve the above object, an embodiment of the present invention provides a method for protecting data privacy in large language model training, including:

[0007] Obtaining large language model training data containing sensitive information;

[0008] Using an Adapter module to process the large language model training data containing sensitive information to obtain processed training data, wherein a privacy protection mechanism is pre-designed in the Adapter module to protect the sensitive information from being leaked when the Adapter module processes the data;

[0009] The processed training data is used to fine-tune the initial large language model to obtain the target large language model.

[0010] Optionally, the Adapter module is pre-embedded into the large language model according to the architecture of the large language model.

[0011] Optionally, the using a pre-designed Adapter module to process the large language model training data containing sensitive information to obtain processed training data includes:

[0012] Based on the pre-designed Adapter module, the large language model training data containing sensitive information is converted using differential privacy or homomorphic encryption to remove or encrypt the sensitive information, while retaining the target training data.

[0013] Optionally, based on the pre-designed Adapter module, the large language model training data containing sensitive information is processed using a BGN homomorphic encryption method, and the target training data is retained, including:

[0014] Generate a BGN key pair and use the public key in the BGN key pair to encrypt sensitive information to obtain encrypted large language model training data;

[0015] Use BGN homomorphic multiplication and BGN homomorphic addition to modify the calculation logic of the Adapter module, and use the modified Adapter module to perform homomorphic calculation processing on the encrypted large language model training data to obtain the calculation results;

[0016] Use the private key in the BGN key pair to decrypt the calculation result to obtain the target training data.

[0017] Optionally, the data privacy protection method in the large language model training further includes:

[0018] After fine-tuning the initial large language model using the processed training data, the performance of the fine-tuned initial large language model on a specific task is evaluated, and it is verified whether the fine-tuned initial large language model achieves the expected performance while maintaining data privacy. If so, the target large language model is obtained; otherwise, the parameters of the Adapter module are updated until the target large language model is obtained.

[0019] On the other hand, the present invention provides a system for protecting data privacy in large language model training, comprising:

[0020] An acquisition unit, used to acquire large language model training data containing sensitive information;

[0021] A processing unit, configured to use an Adapter module to perform data processing on the large language model training data containing sensitive information to obtain processed training data, wherein a privacy protection mechanism is pre-designed in the Adapter module to protect the sensitive information from being leaked when the Adapter module performs data processing;

[0022] The fine-tuning unit is used to fine-tune the initial large language model using the processed training data to obtain a target large language model.

[0023] On the other hand, the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned protection method when executing the program.

[0024] On the other hand, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the protection method described above when executed by a processor.

[0025] Through the above technical solution, by introducing the Adapter module with a pre-designed privacy protection mechanism to process the large language model training data containing sensitive information, more effective data privacy protection can be achieved without affecting the overall model performance, thereby improving the efficiency of subsequent work.

[0026] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:

[0028] Figure 1 It is an implementation flow chart of a method for protecting data privacy in large language model training provided by an embodiment of the present invention;

[0029] Figure 2 is a schematic diagram of an Adapter module provided by an embodiment of the present invention being embedded in a large language model;

[0030] Figure 3 It is a detailed implementation flow chart of a method for protecting data privacy in large language model training provided by an embodiment of the present invention;

[0031] Figure 4 It is a structural diagram of a system for protecting data privacy in large language model training provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.

[0033] See also Figure 1 As shown, it is a flowchart of an implementation method of a data privacy protection method in a large language model training provided by an embodiment of the present invention, including the following execution steps:

[0034] Step 100: Obtain large language model training data containing sensitive information.

[0035] Optionally, large language model training data containing sensitive information can be obtained from various channels, such as social media, medical records, etc., if permitted.

[0036] In some implementations, the acquired large language model training data containing sensitive information is cleaned and preprocessed to ensure that the data is suitable for training the large language model.

[0037] Step 101: Use the Adapter module to process the large language model training data containing sensitive information to obtain processed training data.

[0038] The Adapter module is pre-designed with a privacy protection mechanism for protecting sensitive information from being leaked when the Adapter module processes data.

[0039] Preferably, the Adapter module is pre-embedded into the large language model according to the architecture of the large language model.

[0040] See also Figure 2 As shown, it is a schematic diagram of an Adapter module provided by an embodiment of the present invention being embedded in a large language model. In offsite-tuning, based on the architecture (Layer_1, Layer_2...Layer_n) of the large language model, Figure 2 In the figure, transparent blocks represent pre-trained LLMs, dark blocks represent added Adapter modules, an embedding layer is added above Layer_1, an Adapter_1 module is added between Layer_2 and Layer_3, an Adapter_2 module is added after Layer_n, and fine-tuning is performed on the external network.

[0041] It should be understood that the Adapter module is a lightweight neural network module. It is an independent module and can be inserted into an existing pre-trained model to learn the representation of a specific task. Moreover, the size of the Adapter is much smaller than the entire model, so it can greatly reduce the training time and computing resource consumption.

[0042] In some embodiments, when executing step 101, the following specific steps may be performed: based on a pre-designed Adapter module, the large language model training data containing sensitive information is converted using differential privacy or homomorphic encryption to remove or encrypt the sensitive information, and the target training data is retained.

[0043] Specifically, when executing the step of processing the sensitive information of the large language model training data containing sensitive information by using the BGN homomorphic encryption method based on the pre-designed Adapter module and retaining the target training data, the following sub-steps may be specifically performed:

[0044] S1: Generate a BGN key pair and use the public key in the BGN key pair to encrypt sensitive information to obtain encrypted large language model training data.

[0045] S2: Use BGN homomorphic multiplication and BGN homomorphic addition to modify the calculation logic of the Adapter module, and use the modified Adapter module to perform homomorphic calculation processing on the encrypted large language model training data to obtain the calculation result.

[0046] S3: Use the private key in the BGN key pair to decrypt the calculation result to obtain the target training data.

[0047] In some embodiments, the BGN homomorphic encryption method is used to process sensitive data. It allows the encrypted data to be added and multiplied without decrypting the data, and ensures the correctness of the operation results. The specific operation process is as follows:

[0048] 1) Generate a key pair (r, p) for encryption and decryption of sensitive information;

[0049] 2) Encrypted plaintext: Assuming the message to be encrypted is m, the encrypted message is E(m, r);

[0050] 3) Homomorphic computing: In the Adapter module, the encrypted data is processed homomorphically to implement the same data processing logic as when it is not encrypted, so as to achieve the purpose of using sensitive data for model training. Homomorphic computing includes homomorphic addition and homomorphic multiplication:

[0051] A. Homomorphic addition: Homomorphic addition ensures that the result obtained by directly adding ciphertext is the same as the result obtained by directly adding and encrypting the plaintext; for example: E(m1, r1) and E(m2, r2) are two ciphertexts, then E(m1, r1) + E(m2, r2) = E(m1 + m2, r1 + r2)

[0052] B. Homomorphic multiplication: Homomorphic multiplication ensures that the result obtained by directly multiplying the ciphertext is the same as the result obtained by multiplying the plaintext and encrypting it; for example: E(m1, r1) and E(m2, r2) are two ciphertexts, then E(m1, r1)*E(m2, r2)=E(m*+m2, r1*r2)

[0053] 4) Decryption: Decrypt the encrypted and homomorphically processed calculation results for subsequent calculations.

[0054] Step 102: Use the processed training data to fine-tune the initial large language model to obtain a target large language model.

[0055] By fine-tuning the pre-trained model using processed data, you can improve the performance of the model and make it better suited for a specific task.

[0056] In some implementations, after executing step 102, the following steps may also be performed:

[0057] After fine-tuning the initial large language model using the processed training data, the performance of the fine-tuned initial large language model on a specific task is evaluated, and it is verified whether the fine-tuned initial large language model achieves the expected performance while maintaining data privacy. If so, the target large language model is obtained; otherwise, the parameters of the Adapter module are updated until the target large language model is obtained.

[0058] See also Figure 3 As shown, a detailed implementation flow chart of a method for protecting data privacy in large language model training provided by an embodiment of the present invention includes the following steps:

[0059] S300: Obtain large language model training data containing sensitive information.

[0060] S301: Generate a BGN key pair, and use the public key in the BGN key pair to encrypt sensitive information to obtain encrypted large language model training data.

[0061] S302: Use BGN homomorphic multiplication and BGN homomorphic addition to modify the calculation logic of the Adapter module, and use the modified Adapter module to perform homomorphic calculation processing on the encrypted large language model training data to obtain a calculation result.

[0062] S303: Use the private key in the BGN key pair to decrypt the calculation result to obtain target training data.

[0063] S304: Fine-tune the initial large language model using the processed target training data.

[0064] S305: After fine-tuning, determine whether the initial large language model has achieved the expected performance while maintaining data privacy. If so, execute step S306; otherwise, execute step 307.

[0065] S306: Obtain a target large language model.

[0066] S307: Update the parameters of the Adapter module and continue to execute step S301.

[0067] By introducing an Adapter module with a pre-designed privacy protection mechanism to process large language model training data containing sensitive information, more effective data privacy protection can be achieved without affecting the overall model performance, thereby improving subsequent work efficiency.

[0068] See also Figure 4 As shown, it is a structural diagram of a system for protecting data privacy in large language model training provided by an embodiment of the present invention, including:

[0069] The acquisition unit 400 is used to acquire large language model training data containing sensitive information.

[0070] The processing unit 401 is used to use the Adapter module to perform data processing on the large language model training data containing sensitive information to obtain processed training data, wherein the Adapter module is pre-designed with a privacy protection mechanism to protect sensitive information from being leaked when the Adapter module performs data processing.

[0071] The fine-tuning unit 402 is used to fine-tune the initial large language model using the processed training data to obtain a target large language model.

[0072] On the other hand, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the protection method described in any one of the above embodiments when executing the program.

[0073] On the other hand, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of any of the above-mentioned protection methods when executed by a processor.

Claims

1. A method for protecting data privacy in large language model training, characterized in that: include: Obtaining large language model training data containing sensitive information; Using an Adapter module to process the large language model training data containing sensitive information to obtain processed training data, wherein a privacy protection mechanism is pre-designed in the Adapter module to protect the sensitive information from being leaked when the Adapter module processes the data; Use the processed training data to fine-tune the initial large language model to obtain the target large language model; The adapter module is pre-embedded into the large language model according to the architecture of the large language model; The pre-designed Adapter module is used to process the large language model training data containing sensitive information to obtain processed training data, including: Based on the pre-designed Adapter module, the large language model training data containing sensitive information is processed using the BGN homomorphic encryption method, and the target training data is retained; The method of processing the large language model training data containing sensitive information using the BGN homomorphic encryption method based on the pre-designed Adapter module and retaining the target training data includes: Generate a BGN key pair and use the public key in the BGN key pair to encrypt sensitive information to obtain encrypted large language model training data; Use BGN homomorphic multiplication and BGN homomorphic addition to modify the calculation logic of the Adapter module, and use the modified Adapter module to perform homomorphic calculation processing on the encrypted large language model training data to obtain the calculation results; Use the private key in the BGN key pair to decrypt the calculation result to obtain the target training data.

2. The protection method according to claim 1, characterized in that: The data privacy protection method in the large language model training also includes: After fine-tuning the initial large language model using the processed training data, evaluate the performance of the fine-tuned initial large language model on the specified task, and verify whether the fine-tuned initial large language model achieves the expected performance while maintaining data privacy. If so, obtain the target large language model; otherwise, update the parameters of the Adapter module until the target large language model is obtained.

3. A system for protecting data privacy in large language model training applied to the method for protecting data privacy in large language model training as described in any one of claims 1-2, characterized in that: include: An acquisition unit, used to acquire large language model training data containing sensitive information; A processing unit, configured to use an Adapter module to perform data processing on the large language model training data containing sensitive information to obtain processed training data, wherein a privacy protection mechanism is pre-designed in the Adapter module to protect the sensitive information from being leaked when the Adapter module performs data processing; The fine-tuning unit is used to fine-tune the initial large language model using the processed training data to obtain a target large language model.

4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the protection method according to any one of claims 1 to 2 are implemented.

5. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the protection method according to any one of claims 1 to 2 are implemented.

Citation Information

Patent Citations

  • Data privacy protection method and device

    CN114547634A