Private data protection method and device, storage medium and computer program product

By using the encryption and decryption model in a small language model to encrypt the plaintext prompt words, generate the encryption perturbation prompt words, use the large language model to generate thinking chains, and use them for training through the encryption and decryption model, the calculation of small and medium-sized enterprises is solved. The issues of resource limitation and data privacy protection have realized the training of large language models to guide small language models, and improved the performance of small language models.

CN119323051APending Publication Date: 2025-01-17WEBANK (CHINA)
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202411372719.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

Due to the limitation of computing resources, small and medium-sized enterprises cannot directly train and fine-tune large language models, and training with only small language models may not achieve the expected results. How to complete the training of large language models to guide small language models while ensuring data privacy is an urgent need. The problem solved.

Method used

By deploying a pre-trained encryption and decryption model in a small language model, local privacy data are obtained, plain text prompt words are filtered out, encryption processing is performed, encryption is generated, encryption is generated, and prompt words are sent to the large language model to generate disturbed thinking chains, and then adding Decrypted model is used for small language model training after decryption.

Benefits of technology

While ensuring privacy, the training of small language models is guided through large language models, which improves the performance of small language models and avoids exposure of sensitive data in the process of generating thinking chains.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323051A_ABST
    Figure CN119323051A_ABST
Patent Text Reader

Abstract

The invention discloses a privacy data protection method and device, a storage medium and a computer program product, and relates to the technical field of natural language processing, and the method comprises the steps: obtaining local privacy data, and screening the local privacy data to obtain a plaintext prompt word corresponding to a to-be-trained small language model; the encryption and decryption model encrypts the plaintext cue word, generates an encrypted perturbed cue word, and sends the encrypted perturbed cue word to the second device, so that the second device generates a perturbed thinking chain according to the encrypted perturbed cue word based on the large language model, and sends the perturbed thinking chain to the first device; the encryption and decryption model decrypts the disturbed thinking chain to obtain a decrypted thinking chain; and training a to-be-trained small language model based on the decrypted thinking chain to obtain a trained small language model. Through the encryption and decryption model, under the condition that the data privacy of the first equipment is ensured, the small privacy data protection of the first equipment guided by the large language model of the second equipment is completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and in particular to a privacy data protection method, device, storage medium and computer program product. Background Art

[0002] With the rapid development of large language model (LLM) technology, their powerful performance has brought significant productivity improvements in various industries. Large language models require a lot of computing resources, which means that only a few large enterprises are able to run and fully utilize these models. Due to the limitation of computing resources, small and medium-sized enterprises cannot directly train and fine-tune large language models with particularly large model parameters, and can only run language models with relatively limited model parameters. However, using only local data to train model parameters with relatively small model parameters may not achieve the expected results. By learning from the powerful capabilities of LLM and distilling knowledge to train small models, the capabilities of small models can be improved. When these small and medium-sized enterprises cannot deploy LLM, they can only upload the data of small and medium-sized enterprises to the server on the cloud (the party running LLM), let these enterprise data prompt LLM to generate label data, and then send these LLM-generated data to the small models of small and medium-sized enterprises for training. However, the training data of small and medium-sized enterprises often contains sensitive data and is not allowed to be directly exposed. This challenges the current paradigm of using large model LLM to generate data to guide local small model learning.

[0003] Therefore, how to use a large language model to guide the training of an enterprise's small language model while ensuring the enterprise's data privacy is an urgent problem that needs to be solved.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a privacy data protection method, device, storage medium and computer program product, aiming to solve the technical problem of privacy data protection in the model training process.

[0006] To achieve the above-mentioned purpose, the present application provides a privacy data protection method, which is applied to a first device, the first device is communicatively connected to a second device, a small language model to be trained and a pre-trained encryption and decryption model are deployed in the first device, and a large language model is deployed in the second device, and the method includes:

[0007] Acquire local private data, and filter out the plaintext prompt words corresponding to the small language model to be trained from the local private data;

[0008] Encrypting the plaintext prompt word by the encryption and decryption model to generate an encrypted perturbed prompt word, and sending the encrypted perturbed prompt word to the second device, so that the second device generates a perturbed thought chain according to the encrypted perturbed prompt word based on the large language model, and sends the perturbed thought chain to the first device;

[0009] Decrypting the disturbed thought chain based on the plaintext prompt word and the encrypted disturbed prompt word through the encryption and decryption model to obtain a decrypted thought chain;

[0010] The small language model to be trained is trained based on the decrypted thought chain to obtain a trained small language model.

[0011] In one embodiment, before the step of encrypting the plaintext prompt word by using the encryption and decryption model to generate an encrypted perturbed prompt word, and sending the encrypted perturbed prompt word to the second device, the step further includes:

[0012] The encryption and decryption model is obtained by training, specifically including:

[0013] Acquire a sample training data set, wherein the sample training data set includes a plaintext prompt word sample and its corresponding perturbed prompt word sample and perturbed thought chain sample;

[0014] The preset first small language model is encrypted and trained based on the plaintext prompt word samples and their corresponding perturbed prompt word samples, and the first small language model is decrypted and trained based on the plaintext prompt word samples and their corresponding perturbed prompt word samples and perturbed thought chain samples to obtain the encryption and decryption model.

[0015] In one embodiment, the first device further includes a differential privacy disruption module, and the step of obtaining a sample training data set includes:

[0016] Obtaining the plaintext prompt word sample;

[0017] Performing perturbation processing on the plaintext prompt word sample by the differential privacy perturbation module to generate the perturbed prompt word sample;

[0018] The plaintext prompt word sample is sent to the large language model, so that the large language model generates the disturbed thought chain sample according to the plaintext prompt word sample.

[0019] In one embodiment, the step of perturbing the plaintext prompt word sample by the differential privacy perturbation module to generate the perturbed prompt word sample includes:

[0020] Convert each word in the plaintext prompt word sample into a word vector;

[0021] Shifting the position of the word vector by the differential privacy perturbation module to obtain a shift vector;

[0022] Calculate the distance between the word vector and the offset vector, and obtain similar words within the distance;

[0023] Each text component unit in the plain text prompt word sample is replaced according to the similar word to obtain the disturbed prompt word sample.

[0024] In one embodiment, the step of decrypting the disturbed thought chain based on the plaintext prompt word and the encrypted disturbed prompt word by the encryption and decryption model to obtain the decrypted thought chain includes:

[0025] Determining encryption rules according to the plaintext prompt word and the encrypted perturbation prompt word;

[0026] The disturbed thought chain is decrypted according to the encryption rule to obtain the decrypted thought chain.

[0027] In one embodiment, the first device further includes a thought chain post-processing module, and the step of training the small language model to be trained based on the decrypted thought chain to obtain the trained small language model includes:

[0028] The decrypted thought chains are screened by the thought chain post-processing module to obtain screened thought chains;

[0029] The small language model to be trained is subjected to multi-task training according to the screened thought chain to obtain the trained small language model.

[0030] In one embodiment, the step of performing multi-task training on the small language model to be trained according to the screened thought chain to obtain the trained small language model comprises:

[0031] Input the screened thought chain into the small language model to be trained to obtain the output of each task of the model, and calculate the loss function according to the output of each task of the model combined with the real label data corresponding to the plain text prompt word;

[0032] The gradient is calculated according to the loss function, and the model parameters of the small language model to be trained are updated by back propagation according to the gradient until a preset training end condition is met, thereby obtaining a trained small language model.

[0033] In one embodiment, the first device further includes a prompt word pre-screening module, and the step of obtaining local private data and screening the local private data to obtain the plain text prompt word corresponding to the small language model to be trained includes:

[0034] Get local private data;

[0035] Evaluate the local privacy data by using the pre-screening module to obtain an evaluation index of the local privacy data;

[0036] Screening the local privacy data according to the evaluation index to obtain the plaintext prompt word;

[0037] The evaluation index includes at least one of a quality evaluation index, a contribution evaluation index and a difficulty evaluation index.

[0038] In addition, to achieve the above purpose, the present application also proposes a privacy data protection method, which is applied to a second device, the second device is communicatively connected to the first device, a small language model to be trained and a pre-trained encryption and decryption model are deployed in the first device, and a large language model is deployed in the second device, the method includes:

[0039] Receiving an encrypted perturbed prompt word sent by the first device, wherein the encrypted perturbed prompt word is generated by the first device encrypting the acquired plaintext prompt word through the encryption and decryption model;

[0040] A disturbed thought chain is generated according to the encrypted perturbed prompt word, and the disturbed thought chain is sent to the first device, so that the first device decrypts the disturbed thought chain based on the plaintext prompt word and the encrypted perturbed prompt word through the encryption and decryption model to obtain the decrypted thought chain, and trains the small language model to be trained based on the decrypted thought chain to obtain a trained small language model.

[0041] In addition, to achieve the above purpose, the present application also proposes a privacy data protection device, which is applied to a first device, the first device is communicatively connected to a second device, a small language model to be trained and a pre-trained encryption and decryption model are deployed in the first device, and a large language model is deployed in the second device, and the privacy data protection device includes:

[0042] An acquisition module, used to acquire local private data, and filter out the plain text prompt words corresponding to the small language model to be trained from the local private data;

[0043] an encryption module, configured to encrypt the plaintext prompt word through the encryption and decryption model to generate an encrypted perturbed prompt word, and send the encrypted perturbed prompt word to the second device, so that the second device generates a perturbed thought chain according to the encrypted perturbed prompt word based on the large language model, and sends the perturbed thought chain to the first device;

[0044] A decryption module, used for decrypting the disturbed thought chain based on the plain text prompt word and the encrypted disturbed prompt word through the encryption and decryption model to obtain a decrypted thought chain;

[0045] The training module is used to train the small language model to be trained based on the decrypted thought chain to obtain a trained small language model.

[0046] In addition, to achieve the above-mentioned purpose, the present application also proposes a privacy data protection device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the privacy data protection method as described above.

[0047] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the privacy data protection method described above are implemented.

[0048] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the privacy data protection method described above.

[0049] One or more technical solutions proposed in this application have at least the following technical effects:

[0050] Local privacy data is obtained, and the plaintext prompt words corresponding to the small language model to be trained are obtained by screening from the local privacy data; the plaintext prompt words are encrypting by the encryption and decryption model to generate encrypted perturbed prompt words, and the encrypted perturbed prompt words are sent to the second device, so that the second device generates a perturbed thought chain based on the large language model according to the encrypted perturbed prompt words, and sends the perturbed thought chain to the first device; the encryption and decryption model decrypts the perturbed thought chain based on the plaintext prompt words and the encrypted perturbed prompt words to obtain a decrypted thought chain; the small language model to be trained is trained based on the decrypted thought chain to obtain a trained small language model. In the present application, the plaintext prompt word can be encrypted through the pre-trained encryption and decryption model to generate an encrypted perturbed prompt word, which is then sent to the large language model in the second device, so that the large language model generates a perturbed thought chain based on the encrypted perturbed prompt word, thereby ensuring the privacy of the data sent from the first device to the second device and avoiding exposure of sensitive data of the first device in the process of generating the thought chain using the large language model; the perturbed thought chain is decrypted based on the plaintext prompt word and the encrypted perturbed prompt word through the encryption and decryption model to obtain the decrypted thought chain, which is then used to train the small language model to be trained to obtain the trained small language model, thereby achieving the guidance of the training of the small language model by the large language model, thereby improving the performance of the small language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0052] 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0053] Figure 1 A flowchart of the first embodiment of the privacy data protection method of this application is provided;

[0054] Figure 2 A flowchart of the second embodiment of the privacy data protection method of this application is provided;

[0055] Figure 3 is a schematic diagram of encryption and decryption model data processing according to the second embodiment;

[0056] Figure 4 is a schematic diagram of an encryption and decryption model training target according to the second embodiment;

[0057] Figure 5 This is a flowchart of the third embodiment of the privacy data protection method of this application;

[0058] Figure 6 is a schematic diagram of an overall process according to a third embodiment;

[0059] Figure 7 This is a flowchart of the fourth embodiment of the privacy data protection method of this application;

[0060] Figure 8 This is a schematic diagram of the module structure of the privacy data protection device according to an embodiment of the present application;

[0061] Fig. 9 Schematic diagram of the device structure of the hardware operating environment involved in the privacy data protection method in the embodiment of the present application.

[0062] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0063] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0064] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0065] The main solution of the embodiment of the present application is: by acquiring local privacy data, and screening the plaintext prompt words corresponding to the small language model to be trained from the local privacy data; the plaintext prompt words are encrypting by the encryption and decryption model to generate encrypted perturbed prompt words, and the encrypted perturbed prompt words are sent to the second device, so that the second device can generate a perturbed thought chain based on the large language model according to the encrypted perturbed prompt words, and send the perturbed thought chain to the first device; the encryption and decryption model decrypts the perturbed thought chain based on the plaintext prompt words and the encrypted perturbed prompt words to obtain a decrypted thought chain; the small language model to be trained is trained based on the decrypted thought chain to obtain a trained small language model. In the present application, the plaintext prompt word can be encrypted through the pre-trained encryption and decryption model to generate an encrypted perturbed prompt word, which is then sent to the large language model in the second device, so that the large language model generates a perturbed thought chain based on the encrypted perturbed prompt word, thereby ensuring the privacy of the data sent from the first device to the second device and avoiding exposure of sensitive data of the first device in the process of generating the thought chain using the large language model; the perturbed thought chain is decrypted based on the plaintext prompt word and the encrypted perturbed prompt word through the encryption and decryption model to obtain the decrypted thought chain, which is then used to train the small language model to be trained to obtain the trained small language model, thereby achieving the guidance of the training of the small language model by the large language model, thereby improving the performance of the small language model.

[0066] The following is a first embodiment of the privacy data protection method of this application. Figure 1 , Figure 1 This is a flowchart of the first embodiment of the privacy data protection method of this application. The privacy data protection method described in this embodiment is applied to a first device, and the first device is connected to the second device in communication. Both the first device and the second device can be a computing service device with data processing, network communication and program running functions, such as a server, a tablet computer, a personal computer, a mobile phone, etc. The first device and the second device can be devices deployed in different enterprises, that is, each enterprise uses its own equipment to jointly train the language model to perform the natural language processing task through the trained small language model. In a specific implementation, specific natural language processing tasks can be set according to the specific needs of each enterprise. For example, in a dialogue scenario, a task of generating a reply for the above text is set, and in a summary generation scenario, a task of generating a text summary for the text is set. The operations performed or functions implemented by the first device and the second device in the process of training the language model are different. Therefore, in the following embodiments, the two devices are distinguished as "first" and "second". In some application scenarios, the first device can also be called a server or a coordination end, etc., and the second device can be called a client or a participating end, etc.

[0067] A small language model (SML) to be trained is deployed in the first device, and a large language model (LLM) is deployed in the second device. A language model is a model that can be used to perform natural language processing tasks, such as LLaMa2 13B, LLaMa2 7B, OPT 7B, etc. In this embodiment, both the large language model and the small language model belong to language models. The structure of the large language model is more complex and the number of parameters is more, while the structure of the small language model is relatively simple and the number of parameters is less. In the embodiment of the present application, the computing resources of the second device can be better than the computing resources of the first device, that is, the computing power is stronger than the first device. The advantages and disadvantages of the computing resources are specifically reflected by some parameters, such as the number of CPU cores, clock frequency, memory bandwidth and capacity, etc., which are not limited in this embodiment. In the specific implementation process, an enterprise with strong computing resources can provide equipment as the second device, and an enterprise with text data in various subdivided fields but limited computing resources can provide equipment as the first device. Each enterprise jointly trains the language model and uses the advantages of both parties to jointly train to obtain a language model with higher natural language processing capabilities. For example, banks, insurance companies and other companies need to train language models to perform natural language processing tasks in their business scenarios to improve business service effectiveness. Although banks, insurance companies and other companies have text data in sub-sectors such as banking business and insurance business, they have limited computing resources. These companies use their own equipment to find it difficult to train small language models that require powerful computing power alone, making it difficult for them to successfully deploy language models that can improve business service effectiveness in business scenarios.

[0068] In the embodiment of the present application, a privacy-preserving large language model-guided small language model learning method is proposed. For example, it is assumed that there are two roles: a server (Server: with strong computing power) and a client (Client: with weak computing power). It is assumed that a large language model LLM with a relatively large number of parameters is deployed on the server, and a small language model SLM with a relatively small number of parameters is deployed on the client. For example, LLM is LLaMa2 7B, and SLM is LLaMa2 70B.

[0069] The core of the large language model guiding the small language model is to use the chain-of-thought technology (COT), allowing the large language model to generate the reasoning steps and reasons (Rationales) of the results for each sample prompt, and then let the small language model learn these reasoning steps and reasons, thereby improving the ability of the small language model.

[0070] However, due to privacy leakage issues, local text data cannot be sent directly to a remote large language model to generate a chain of thoughts. Therefore, in the embodiments of the present application, consideration is given to performing certain privacy protection processing on the local data, and then sending the text after the privacy protection processing to a remote large language model to assist in generating a chain of thoughts through the large language model.

[0071] In the embodiment of the present application, an encryption and decryption model is introduced as the key to privacy protection. The benefit of training an encryption and decryption model is that while retaining the approximate effect of differential privacy perturbation, the encryption and decryption model can better generate thought chains (Rationales) based on the perturbed data, and the obtained thought chains can be more correct, which is a clear advantage over untrained models. Use a local encryption and decryption model to protect the client's prompt. The client provides encrypted prompts to the server's large language model, and the large language model infers these encrypted prompts to generate encrypted (perturbed) Rationales. These encrypted Rationales are returned to the client and then decrypted by the encryption and decryption model before being provided to the small language model to be trained for training.

[0072] The model to be trained refers to the model parameters in the model that need to be optimized through the training process, and its initial model parameters can be obtained after model pre-training (or the pre-trained model can be used as the model to be trained), or, its initial model parameters can also be initialized according to experience or randomly initialized. The process of using a pre-trained model as the model to be trained and training the model to be trained on a specific natural language processing task is also called "fine-tuning", and "training" is used to represent this process in the following embodiments. In a specific implementation, a pre-trained language model is used as the language model to be trained, and the language model to be trained is further trained, so that a better training effect can be obtained, that is, the trained language model can have a stronger natural language processing capability. In this embodiment, it is not limited to using a pre-trained language model as the language model to be trained, nor is it limited to a specific pre-training method.

[0073] In this embodiment, the privacy data protection method includes steps S10 to S40:

[0074] Step S10, obtaining local private data, and screening the local private data to obtain the plain text prompt words corresponding to the small language model to be trained;

[0075] Specifically, the first device is respectively deployed with text data for training the language model. Generally speaking, there are multiple text data for training the language model, which constitute a training data set. Each text data includes a plaintext prompt word as a model input and real label data as a model training label. For example, in a dialogue scenario, it is necessary to train a language model to generate corresponding answers based on specific questions. Then, the plaintext prompt word can be a question and the real label data can be an answer. The private text data in the first device can be business data from an enterprise, such as conversation business data from customer service personnel of a bank or insurance company when serving customers. These private text data belong to text data in subdivided fields such as the banking business field and the insurance business field. It should be noted that in a specific implementation method, the business data used needs to be agreed by the customer and can be desensitized to avoid leaking the customer's privacy.

[0076] In a feasible implementation manner, the first device further includes a prompt word pre-screening module, and the step of obtaining local private data and screening the local private data to obtain the plain text prompt word corresponding to the small language model to be trained includes:

[0077] Get local private data;

[0078] Evaluate the local privacy data by using the pre-screening module to obtain an evaluation index of the local privacy data;

[0079] Screening the local privacy data according to the evaluation index to obtain the plaintext prompt word;

[0080] The evaluation index includes at least one of a quality evaluation index, a contribution evaluation index and a difficulty evaluation index.

[0081] Taking privacy protection and communication costs into consideration, in the embodiment of the present application, a prompt word pre-screening module (Prompt Pre-Selection) is used to screen out the plain text prompt words (prompt) corresponding to the small language model to be trained from the local privacy data of the first device, that is, to screen out the prompts that require the guidance of the large language model for training to obtain the corresponding small language model. The mechanism here may include prompt quality assessment to screen out high-quality prompts; assess the effect contribution of the small language model to screen out the ones with large contributions; assess the learning difficulty of the local small language model to screen out prompts with low learning difficulty, etc.

[0082] Step S20, encrypting the plaintext prompt word through the encryption and decryption model to generate an encrypted perturbed prompt word, and sending the encrypted perturbed prompt word to the second device, so that the second device generates a perturbed thought chain according to the encrypted perturbed prompt word based on the large language model, and sends the perturbed thought chain to the first device;

[0083] The first device deploys a pre-trained encryption and decryption model, which can encrypt the selected plaintext prompt words and generate encrypted perturbed prompt words to ensure the privacy of the plaintext prompt words, and then send the encrypted perturbed prompt words to the large language model in the second device. The large language model in the second device processes the encrypted perturbed prompt words and outputs the predicted result, which is the corresponding generated perturbed thought chain Rationales.

[0084] In the embodiments of the present application, the encryption and decryption model is mainly used for secure reasoning, and its main functions include privacy-preserving encryption and privacy-preserving decryption. Privacy-preserving encryption means that the encryption and decryption model generates target disturbed text through learning, and can apply disturbance technology similar to differential privacy to the local model to protect the text sent out.

[0085] Step S30, decrypting the disturbed thought chain based on the plain text prompt word and the encrypted disturbed prompt word through the encryption and decryption model to obtain a decrypted thought chain;

[0086] After the large language model in the second device generates the disturbed thought chain corresponding to the encrypted perturbed prompt word, the disturbed thought chain can be returned to the first device. The encryption and decryption model in the first device decrypts the disturbed thought chain according to the plaintext prompt word and the encrypted perturbed prompt word to obtain the decrypted thought chain.

[0087] Optionally, the step of decrypting the disturbed thought chain based on the plaintext prompt word and the encrypted disturbed prompt word by the encryption and decryption model to obtain the decrypted thought chain includes:

[0088] Determining encryption rules according to the plaintext prompt word and the encrypted perturbation prompt word;

[0089] The disturbed thought chain is decrypted according to the encryption rule to obtain the decrypted thought chain.

[0090] Specifically, the encrypted perturbation prompt word is generated by encrypting the plaintext prompt word through a symmetric or asymmetric encryption algorithm by the encryption and decryption model. Therefore, the specific encryption algorithm used in the encryption process, that is, the encryption rule, can be determined according to the plaintext prompt word and the encrypted perturbation prompt word. Since the perturbed thought chain is generated by the large language model according to the encrypted perturbation prompt word, it is necessary to use the corresponding encryption rule for decryption to obtain the decrypted thought chain. Specific encryption rules may include differential privacy, data shielding, and data obfuscation. Among them, differential privacy is a technology that protects individual data by adding noise so that changes in a single input will not significantly affect the output; data shielding refers to applying masks to certain sensitive fields or words in a data set, that is, replacing the values ​​in the original data with special tags (such as [MASK]). This can protect the original data while still allowing the model to learn useful patterns; data obfuscation refers to hiding its original features by transforming or replacing the data. For example, personal information such as name and address can be replaced with random strings or other identifiers.

[0091] The encryption and decryption model has two simultaneous training goals, namely, while generating encrypted text, it tries to generate the correct answer (i.e., thought chain) from the plaintext, scrambled text, and scrambled questions and answers. Therefore, when the scrambled text is sent to the large language model end, and the large language model end sends the scrambled text back, the local encryption and decryption model can better restore the meaningful answer (i.e., thought chain) from it, which is the privacy protection decryption function of the encryption and decryption model.

[0092] Step S40, training the small language model to be trained based on the decrypted thought chain to obtain a trained small language model.

[0093] Considering the accuracy and quality of the decryption of the encryption and decryption model and the ability of the large language model, the embodiment of the present application considers screening out high-quality Rationales through a certain post-processing mechanism. For example, the first device also includes a thinking chain post-processing module (Rationales Post-Selection), through which the correctness of the Rationales can be judged, compared with the effect of the local small language model, and whether the performance of the small language model can be improved, so as to obtain the screened thinking chain.

[0094] The screened thought chains can be used to perform multi-task training on the small language model to be trained, which not only includes task training based on the screened thought chains and the real label data corresponding to the plaintext prompt words to improve the ability of the small language model, but also includes training the small language model to be trained to generate thought chains, so as to further reduce the dependence of the small language model on the large language model and improve the quality of the small language model.

[0095] This embodiment adopts the above scheme, specifically by acquiring local privacy data, and screening the plaintext prompt words corresponding to the small language model to be trained from the local privacy data; the plaintext prompt words are encrypting by the encryption and decryption model to generate encrypted perturbed prompt words, and the encrypted perturbed prompt words are sent to the second device, so that the second device generates a perturbed thought chain based on the large language model according to the encrypted perturbed prompt words, and sends the perturbed thought chain to the first device; the encryption and decryption model decrypts the perturbed thought chain based on the plaintext prompt words and the encrypted perturbed prompt words to obtain a decrypted thought chain; the small language model to be trained is trained based on the decrypted thought chain to obtain a trained small language model. In the present application, the plaintext prompt word can be encrypted through the pre-trained encryption and decryption model to generate an encrypted perturbed prompt word, which is then sent to the large language model in the second device, so that the large language model generates a perturbed thought chain based on the encrypted perturbed prompt word, thereby ensuring the privacy of the data sent from the first device to the second device and avoiding exposure of sensitive data of the first device in the process of generating the thought chain using the large language model; the perturbed thought chain is decrypted based on the plaintext prompt word and the encrypted perturbed prompt word through the encryption and decryption model to obtain the decrypted thought chain, which is then used to train the small language model to be trained to obtain the trained small language model, thereby achieving the guidance of the training of the small language model by the large language model, thereby improving the performance of the small language model.

[0096] Based on the above first embodiment, a second embodiment of the privacy data protection method of this application is proposed. In this embodiment, the same or similar contents as those of the above first embodiment can be referred to the above introduction, and will not be repeated in the following. Figure 2 , Figure 2 This is a flow chart of the second embodiment of the privacy data protection method of the present application. In this embodiment, the first device also includes a differential privacy disturbance module. Before the step of encrypting the plaintext prompt word by the encryption and decryption model to generate an encrypted perturbed prompt word, and sending the encrypted perturbed prompt word to the second device, it also includes:

[0097] Step S00, training to obtain the encryption and decryption model, specifically includes:

[0098] Step S01, obtaining a sample training data set, wherein the sample training data set includes a plain text prompt word sample and its corresponding perturbed prompt word sample and perturbed thought chain sample;

[0099] Optionally, the first device further includes a differential privacy perturbation module (Perturbation Module), and the step of obtaining a sample training data set includes:

[0100] Obtaining the plaintext prompt word sample;

[0101] Performing perturbation processing on the plaintext prompt word sample by the differential privacy perturbation module to generate the perturbed prompt word sample;

[0102] The plaintext prompt word sample is sent to the large language model, so that the large language model generates the disturbed thought chain sample according to the plaintext prompt word sample.

[0103] Optionally, the step of performing perturbation processing on the plaintext prompt word sample by the differential privacy perturbation module to generate the perturbed prompt word sample includes:

[0104] Convert each word in the plaintext prompt word sample into a word vector;

[0105] Shifting the position of the word vector by the differential privacy perturbation module to obtain a shift vector;

[0106] Calculate the distance between the word vector and the offset vector, and take similar words within the distance;

[0107] Each text component unit in the plain text prompt word sample is replaced according to the similar word to obtain the disturbed prompt word sample.

[0108] Specifically, "Perturbation Module" is a technical module used in machine learning and deep learning, mainly used to generate perturbations to evaluate the robustness and stability of the model or for data enhancement. In some privacy protection technologies, such as differential privacy, the differential privacy perturbation module is used to add noise to the data to ensure that personal data cannot be easily inferred from the model output.

[0109] In the embodiment of the present application, the prompt is disturbed by the differential privacy perturbation module, and each word in a prompt is converted into a word vector. For a certain word vector, its position is slightly offset by means of differential privacy, and the distance between the original vector and the offset vector is calculated. Then, all similar words within this distance are taken out, and each text component unit (token) of the original prompt is replaced by sampling similar words. The text component unit is the basic unit that constitutes the text, which is obtained by artificial division. The various text component units divided based on a set of division rules constitute a vocabulary. By replacing each text component unit of the prompt, a disturbed prompt word sample can be generated.

[0110] Step S02: encrypting and training the first small language model based on the plaintext prompt word samples and their corresponding perturbed prompt word samples, and decrypting and training the first small language model based on the plaintext prompt word samples and their corresponding perturbed prompt word samples and perturbed thought chain samples to obtain the encryption and decryption model.

[0111] Reference Figure 3 , Figure 3 FIG. 1 is a schematic diagram of encryption and decryption model data processing according to the second embodiment. Figure 3 As shown, the encryption and decryption model in the embodiment of the present application is trained using a common small language model SLM (i.e., the first small language model). The model training process has two training objectives: (1) input plaintext, and the model returns scrambled text; (2) input plaintext, scrambled text, and scrambled answers, and the model generates a coherent and correct answer based on the plaintext, scrambled text, and scrambled answers.

[0112] Reference Figure 4 , Figure 4 FIG. 1 is a schematic diagram of an encryption and decryption model training target according to the second embodiment. Figure 4 As shown in the figure, from the training objectives, we can see that the functions of the encryption and decryption model obtained through training are: (1) Privacy-preserving encryption: the model can apply a perturbation technique similar to differential privacy to the local small language model by learning to generate target perturbation text, thus protecting the text sent out; (2) Privacy-preserving decryption: the model has two simultaneous training objectives, namely, while generating encrypted text, it tries to generate the correct answer (thinking chain) from the plaintext, perturbation text and perturbation questions and answers. Therefore, when the perturbation text is sent to the large language model end, and the large language model end sends back the perturbation text, the local encryption and decryption model can restore a meaningful answer (thinking chain) from it.

[0113] The client encrypts the plaintext prompt word through the encryption and decryption model, introduces random noise, generates encrypted perturbed prompt words, and sends the encrypted perturbed prompt words to the large language model. The large language model attempts to understand the meaning and context of the encrypted perturbed prompt words, performs logical reasoning based on the encrypted perturbed prompt words, generates a perturbed thought chain, and then returns the generated perturbed thought chain to the client. Compared with the large language model directly generating a thought chain based on the plaintext prompt words sent by the client and returning it to the client, using encrypted perturbed prompt words to send to the large language model can reduce the risk of information leakage and strengthen the protection of privacy data. For example:

[0114] Suppose we have a prompt: "Alice is going to the store to buy milk."

[0115] Normal prompt processing:

[0116] Prompt: Alice is going to the store to buy milk.

[0117] Rationale: Alice needs milk for her breakfast cereal, and the store is the place where she can purchase it.

[0118] Prompt processing of encrypted perturbations:

[0119] Original Prompt: Alice is going to the store to buy milk.

[0120] Prompt after encryption perturbation: [encrypted text] + [random noise], for example: Xorq vf nccyvpngrgur pbzzhavgl ovgf.

[0121] Perturbation Rationale generated by LLM: Xorq vf nccyvpngr gur[noise]pbzzhavgl[noise]vf nobql vf gur[noise]pbzzhavgl.

[0122] This makes it possible to protect privacy data while leveraging the reasoning capabilities of large language models to improve the performance of small language models.

[0123] This embodiment uses the above scheme, specifically by obtaining a sample training data set, wherein the sample training data set includes a plaintext prompt word sample and its corresponding perturbed prompt word sample and a perturbed thought chain sample; encrypting and training the first small language model based on the plaintext prompt word sample and its corresponding perturbed prompt word sample, and decrypting and training the first small language model based on the plaintext prompt word sample and its corresponding perturbed prompt word sample and perturbed thought chain sample, to obtain the encryption and decryption model. By encrypting and training the first small language model based on the plaintext prompt word sample and its corresponding perturbed prompt word sample, an encryption function can be provided for the local small language model to protect the text that needs to be sent to the large language model; by decrypting and training the first small language model based on the plaintext prompt word sample and its corresponding perturbed prompt word sample and perturbed thought chain sample, the thought chain corresponding to the perturbed text returned by the large language model can be decrypted, thereby obtaining the restored thought chain, which is then used to train the small language model and improve the ability of the small language model.

[0124] Based on the above first and / or second embodiments, a third embodiment of the privacy data protection method of the present application is proposed. In this embodiment, the same or similar contents as those of the above first and second embodiments can be referred to the above introduction, and will not be repeated in the following. Figure 5 , Figure 5 This is a flow chart of the third embodiment of the privacy data protection method of this application. In this embodiment, the first device also includes a thought chain post-processing module, and the step S40 includes steps S41-S42:

[0125] Step S41, filtering the decrypted thought chains through the thought chain post-processing module to obtain filtered thought chains;

[0126] Considering the accuracy and quality of the decryption of the encryption and decryption model and the ability of the large language model, the embodiment of the present application considers screening out high-quality Rationales through a certain post-processing mechanism. For example, the first device also includes a thinking chain post-processing module (Rationales Post-Selection), through which the correctness of the Rationales can be judged, compared with the effect of the local small language model, and whether the performance of the small language model can be improved, so as to obtain the screened thinking chain.

[0127] Step S42, performing multi-task training on the small language model to be trained according to the screened thought chain to obtain the trained small language model.

[0128] Optionally, the step of performing multi-task training on the small language model to be trained according to the screened thought chain to obtain the trained small language model includes:

[0129] Input the screened thought chain into the small language model to be trained to obtain the output of each task of the model, and calculate the loss function according to the output of each task of the model combined with the real label data corresponding to the plain text prompt word;

[0130] The gradient is calculated according to the loss function, and back propagation is performed to update the model parameters of the small language model to be trained, until a preset training end condition is met, thereby obtaining a trained small language model.

[0131] The screened thought chains can be used to perform multi-task training on the small language model to be trained, which not only includes task training based on the screened thought chains and the real label data corresponding to the plaintext prompt words to improve the ability of the small language model, but also includes training the small language model to be trained to generate thought chains, so as to further reduce the dependence of the small language model on the large language model and improve the quality of the small language model.

[0132] Reference Figure 6 , Figure 6 FIG. 1 is a schematic diagram of an overall process according to the third embodiment. Figure 6 As shown, in this embodiment, the first device is a client and the second device is a server. In this embodiment, the client first performs a preliminary selection of prompts and selects the prompts that need to be guided by the large model; the client uses the encryption and decryption model to encrypt and protect the prompt, and then sends it to the server LLM; the server LLM generates a perturbed Rationales for the protected prompt and sends it to the client; the client uses the encryption and decryption model, combined with the local plaintext prompt, the perturbed prompt and the perturbed Rationales, to decrypt the perturbed Rationales to obtain the decrypted Rationales; the client evaluates and screens the decrypted Rationales to retain the correct and high-quality Rationales data; the client Task Spec SLM uses the original label data (label) and Rationales data for multi-task learning.

[0133] Specifically, in multi-task learning, the loss functions of different tasks are usually combined by weight. The multi-task learning loss function designed in this embodiment is defined as follows:

[0134]

[0135] Among them, λ is the weight of Rationales data, which can be adjusted according to actual conditions; N is the total number of prompt samples, is the loss function of the original task, is the loss function of the thought chain task, is the total loss function of multi-task learning, f(x i ) is the sample input, The thought chain for input.

[0136] In multi-task learning, including the training tasks of the small language model and the training tasks of the thought chain generation ability, the screened thought chains are used as the training set to input the small language model to be trained. In each epoch iteration, for each sample in the training set, the following steps are performed:

[0137] Forward propagation: Input samples into the model and obtain model output.

[0138] Calculate loss: Calculate the loss function for each task separately.

[0139] Back propagation: Calculate the gradient according to the loss function and perform back propagation to update the model parameters.

[0140] Parameter update: Update the model parameters according to the selected optimization algorithm.

[0141] During the model training process, it is necessary to monitor the training loss of each task, as well as possible evaluation indicators (such as accuracy, recall, etc.) to detect problems and make adjustments in a timely manner. After the model training is completed, the model is finally evaluated using the test set to ensure that the model can achieve good generalization performance on each task. Based on the verification and test results, it may be necessary to further adjust the model architecture, optimization algorithm, or loss function combination until the model achieves satisfactory performance on all tasks, thereby obtaining a small language model with improved capabilities.

[0142] This embodiment uses the above scheme, specifically through the thought chain post-processing module to screen the decrypted thought chain to obtain the screened thought chain; according to the screened thought chain, the small language model to be trained is multi-tasked to obtain the trained small language model. Through the pre-trained encryption and decryption model, the plaintext prompt word can be encrypted to generate an encrypted perturbed prompt word, which is then sent to the large language model in the second device, so that the large language model generates a perturbed thought chain according to the encrypted perturbed prompt word, thereby ensuring the privacy of the first device sending to the second device, and avoiding the exposure of sensitive data of the first device in the process of using the large language model to generate the thought chain; through the encryption and decryption model, the perturbed thought chain is decrypted based on the plaintext prompt word and the encrypted perturbed prompt word to obtain the decrypted thought chain, which is then used to train the small language model to be trained, and the trained small language model is obtained, which realizes the training of the small language model guided by the large language model, thereby improving the performance of the small language model.

[0143] Based on the above first, second and / or third embodiments, a fourth embodiment of the privacy data protection method of the present application is proposed. Figure 7 , Figure 7 This is a flowchart of the fourth embodiment of the privacy data protection method of this application. The privacy data protection method in this embodiment is applied to a second device, the second device is connected to the first device for communication, the first device deploys a small language model to be trained and a pre-trained encryption and decryption model, and the second device deploys a large language model. The method includes steps A10-A20:

[0144] Step A10, receiving the encrypted perturbed prompt word sent by the first device, wherein the encrypted perturbed prompt word is generated by the first device encrypting the obtained plaintext prompt word through the encryption and decryption model;

[0145] Step A20, generates a disturbed thought chain according to the encrypted perturbed prompt word, and sends the disturbed thought chain to the first device, so that the first device decrypts the disturbed thought chain based on the plaintext prompt word and the encrypted perturbed prompt word through the encryption and decryption model to obtain the decrypted thought chain, and trains the small language model to be trained based on the decrypted thought chain to obtain a trained small language model.

[0146] Specifically, the first device is respectively deployed with text data for training the language model. Generally speaking, there are multiple text data for training the language model, which constitute a training data set. Each text data includes a plaintext prompt word as a model input and real label data as a model training label. For example, in a dialogue scenario, it is necessary to train a language model to generate corresponding answers based on specific questions. Then, the plaintext prompt word can be a question and the real label data can be an answer. The private text data in the first device can be business data from an enterprise, such as conversation business data from customer service personnel of a bank or insurance company when serving customers. These private text data belong to text data in subdivided fields such as the banking business field and the insurance business field. It should be noted that in a specific implementation method, the business data used needs to be agreed by the customer and can be desensitized to avoid leaking the customer's privacy.

[0147] Considering privacy protection and communication cost, the prompt pre-screening module (Prompt Pre-Selection) is used in the embodiment of the present application to screen out prompts that require guidance from a large language model. The mechanism here may include prompt quality assessment to screen out high-quality prompts; assessing the effect contribution of small language models to screen out prompts with large contributions; assessing the learning difficulty of local small language models to screen out prompts with low learning difficulty, etc.

[0148] The first device deploys a pre-trained encryption and decryption model, which can encrypt the selected plaintext prompt words and generate encrypted perturbed prompt words to ensure the privacy of the plaintext prompt words, and then send the encrypted perturbed prompt words to the large language model in the second device. The large language model in the second device processes the encrypted perturbed prompt words and outputs the predicted result, which is the corresponding generated perturbed thought chain Rationales.

[0149] In the embodiments of the present application, the encryption and decryption model is mainly used for secure reasoning, and its main functions include privacy-preserving encryption and privacy-preserving decryption. Privacy-preserving encryption means that the encryption and decryption model generates target disturbed text through learning, and can apply disturbance technology similar to differential privacy to the local model to protect the text sent out.

[0150] After the large language model in the second device generates the disturbed thought chain corresponding to the encrypted perturbed prompt word, the disturbed thought chain can be returned to the first device. The encryption and decryption model in the first device decrypts the disturbed thought chain according to the plaintext prompt word and the encrypted perturbed prompt word to obtain the decrypted thought chain.

[0151] The encryption and decryption model has two simultaneous training goals, namely, while generating encrypted text, it tries to generate the correct answer (i.e., thought chain) from the plaintext, scrambled text, and scrambled questions and answers. Therefore, when the scrambled text is sent to the large language model end, and the large language model end sends the scrambled text back, the local encryption and decryption model can better restore the meaningful answer (i.e., thought chain) from it, which is the privacy protection decryption function of the encryption and decryption model.

[0152] Considering the accuracy and quality of the decryption of the encryption and decryption model and the ability of the large language model, the embodiment of the present application considers screening out high-quality Rationales through a certain post-processing mechanism. For example, the first device also includes a thinking chain post-processing module (Rationales Post-Selection), through which the correctness of the Rationales can be judged, compared with the effect of the local small language model, and whether the performance of the small language model can be improved, so as to obtain the screened thinking chain.

[0153] The screened thought chains can be used to perform multi-task training on the small language model to be trained, which not only includes task training based on the screened thought chains and the real label data corresponding to the plaintext prompt words to improve the ability of the small language model, but also includes training the small language model to be trained to generate thought chains, so as to further reduce the dependence of the small language model on the large language model and improve the quality of the small language model.

[0154] This embodiment adopts the above scheme, specifically by receiving the encrypted perturbed prompt word sent by the first device, wherein the encrypted perturbed prompt word is generated by the first device encrypting the acquired plaintext prompt word through the encryption and decryption model; generating a perturbed thought chain according to the encrypted perturbed prompt word, and sending the perturbed thought chain to the first device, so that the first device decrypts the perturbed thought chain based on the plaintext prompt word and the encrypted perturbed prompt word through the encryption and decryption model to obtain the decrypted thought chain, and trains the small language model to be trained based on the decrypted thought chain to obtain a trained small language model. In the present application, the plaintext prompt word can be encrypted through the pre-trained encryption and decryption model to generate an encrypted perturbed prompt word, which is then sent to the large language model in the second device, so that the large language model generates a perturbed thought chain based on the encrypted perturbed prompt word, thereby ensuring the privacy of the data sent from the first device to the second device and avoiding exposure of sensitive data of the first device in the process of generating the thought chain using the large language model; the perturbed thought chain is decrypted based on the plaintext prompt word and the encrypted perturbed prompt word through the encryption and decryption model to obtain the decrypted thought chain, which is then used to train the small language model to be trained to obtain the trained small language model, thereby achieving the guidance of the training of the small language model by the large language model, thereby improving the performance of the small language model.

[0155] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the privacy data protection method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0156] This application also provides a privacy data protection device, please refer to Figure 8 , applied to a first device, the first device is in communication connection with a second device, a small language model to be trained and a pre-trained encryption and decryption model are deployed in the first device, a large language model is deployed in the second device, and the privacy data protection device includes:

[0157] An acquisition module, used to acquire local private data, and filter out the plain text prompt words corresponding to the small language model to be trained from the local private data;

[0158] an encryption module, configured to encrypt the plaintext prompt word through the encryption and decryption model to generate an encrypted perturbed prompt word, and send the encrypted perturbed prompt word to the second device, so that the second device generates a perturbed thought chain according to the encrypted perturbed prompt word based on the large language model, and sends the perturbed thought chain to the first device;

[0159] A decryption module, used for decrypting the disturbed thought chain based on the plain text prompt word and the encrypted disturbed prompt word through the encryption and decryption model to obtain a decrypted thought chain;

[0160] The training module is used to train the small language model to be trained based on the decrypted thought chain to obtain a trained small language model.

[0161] The privacy data protection device provided by the present application adopts the privacy data protection method in the above embodiment, which can solve the technical problem of privacy data protection in the language model training process. Compared with the prior art, the beneficial effects of the privacy data protection device provided by the present application are the same as the beneficial effects of the privacy data protection method provided by the above embodiment, and the other technical features in the privacy data protection device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0162] The present application provides a privacy data protection device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the privacy data protection method in the above-mentioned embodiment one.

[0163] Reference below Fig. 9 , which shows a schematic diagram of the structure of a privacy data protection device suitable for implementing the embodiments of the present application. The privacy data protection device in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The privacy data protection device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0164] like Fig. 9As shown, the privacy data protection device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the privacy data protection device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the privacy data protection device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a privacy data protection device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0165] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0166] The privacy data protection device provided by the present application adopts the privacy data protection method in the above embodiment, which can solve the technical problem of privacy data protection. Compared with the prior art, the beneficial effects of the privacy data protection device provided by the present application are the same as the beneficial effects of the privacy data protection method provided by the above embodiment, and the other technical features in the privacy data protection device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0167] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0168] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0169] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the privacy data protection method in the above-mentioned embodiment.

[0170] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0171] The above-mentioned computer-readable storage medium may be included in the privacy data protection device; or it may exist independently without being assembled into the privacy data protection device.

[0172] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the privacy data protection device, the privacy data protection device: obtains local privacy data, and screens the plaintext prompt words corresponding to the small language model to be trained from the local privacy data; encrypts the plaintext prompt words through the encryption and decryption model to generate encrypted perturbed prompt words, and sends the encrypted perturbed prompt words to the second device, so that the second device generates a perturbed thought chain based on the large language model according to the encrypted perturbed prompt words, and sends the perturbed thought chain to the first device; decrypts the perturbed thought chain based on the plaintext prompt words and the encrypted perturbed prompt words through the encryption and decryption model to obtain a decrypted thought chain; trains the small language model to be trained based on the decrypted thought chain to obtain a trained small language model. In the present application, the plaintext prompt word can be encrypted through the pre-trained encryption and decryption model to generate an encrypted perturbed prompt word, which is then sent to the large language model in the second device, so that the large language model generates a perturbed thought chain based on the encrypted perturbed prompt word, thereby ensuring the privacy of the data sent from the first device to the second device and avoiding exposure of sensitive data of the first device in the process of generating the thought chain using the large language model; the perturbed thought chain is decrypted based on the plaintext prompt word and the encrypted perturbed prompt word through the encryption and decryption model to obtain the decrypted thought chain, which is then used to train the small language model to be trained to obtain the trained small language model, thereby achieving the guidance of the training of the small language model by the large language model, thereby improving the performance of the small language model.

[0173] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0174] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0175] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0176] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned privacy data protection method, and can solve the technical problem of privacy data protection. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the privacy data protection method provided in the above-mentioned embodiment, and will not be elaborated here.

[0177] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned privacy data protection method when executed by a processor.

[0178] The computer program product provided by this application can solve the technical problem of privacy data protection. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the privacy data protection method provided by the above embodiment, which will not be repeated here.

[0179] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A privacy data protection method, characterized in that: Applied to a first device, the first device is communicatively connected with a second device, a small language model to be trained and a pre-trained encryption and decryption model are deployed in the first device, and a large language model is deployed in the second device, the method includes: Acquire local private data, and filter out the plaintext prompt words corresponding to the small language model to be trained from the local private data; Encrypting the plaintext prompt word by the encryption and decryption model to generate an encrypted perturbed prompt word, and sending the encrypted perturbed prompt word to the second device, so that the second device generates a perturbed thought chain according to the encrypted perturbed prompt word based on the large language model, and sends the perturbed thought chain to the first device; Decrypting the disturbed thought chain based on the plaintext prompt word and the encrypted disturbed prompt word through the encryption and decryption model to obtain a decrypted thought chain; The small language model to be trained is trained based on the decrypted thought chain to obtain a trained small language model.

2. The method according to claim 1, characterized in that Before the step of encrypting the plaintext prompt word by using the encryption and decryption model to generate an encrypted perturbed prompt word, and sending the encrypted perturbed prompt word to the second device, the step further includes: The encryption and decryption model is obtained by training, specifically including: Acquire a sample training data set, wherein the sample training data set includes a plaintext prompt word sample and its corresponding perturbed prompt word sample and perturbed thought chain sample; The preset first small language model is encrypted and trained based on the plaintext prompt word samples and their corresponding perturbed prompt word samples, and the first small language model is decrypted and trained based on the plaintext prompt word samples and their corresponding perturbed prompt word samples and perturbed thought chain samples to obtain the encryption and decryption model.

3. The method according to claim 2, characterized in that The first device also includes a differential privacy disruption module, and the step of obtaining a sample training data set includes: Obtaining the plaintext prompt word sample; Performing perturbation processing on the plaintext prompt word sample by the differential privacy perturbation module to generate the perturbed prompt word sample; The plaintext prompt word sample is sent to the large language model, so that the large language model generates the disturbed thought chain sample according to the plaintext prompt word sample.

4. The method according to claim 3, characterized in that The step of perturbing the plaintext prompt word sample by the differential privacy perturbation module to generate the perturbed prompt word sample comprises: Convert each word in the plaintext prompt word sample into a word vector; Shifting the position of the word vector by the differential privacy perturbation module to obtain a shift vector; Calculate the distance between the word vector and the offset vector, and obtain similar words within the distance; Each text component unit in the plain text prompt word sample is replaced according to the similar word to obtain the disturbed prompt word sample.

5. The method according to claim 1, characterized in that The step of decrypting the disturbed thought chain based on the plaintext prompt word and the encrypted disturbed prompt word by the encryption and decryption model to obtain the decrypted thought chain includes: Determining encryption rules according to the plaintext prompt word and the encrypted perturbation prompt word; The disturbed thought chain is decrypted according to the encryption rule to obtain the decrypted thought chain.

6. The method according to claim 1, characterized in that The first device also includes a thought chain post-processing module, and the step of training the small language model to be trained based on the decrypted thought chain to obtain the trained small language model includes: The decrypted thought chains are screened by the thought chain post-processing module to obtain screened thought chains; The small language model to be trained is subjected to multi-task training according to the screened thought chain to obtain the trained small language model.

7. The method according to claim 6, characterized in that The step of performing multi-task training on the small language model to be trained according to the screened thought chain to obtain the trained small language model comprises: Input the screened thought chain into the small language model to be trained to obtain the output of each task of the model, and calculate the loss function according to the output of each task of the model combined with the real label data corresponding to the plain text prompt word; The gradient is calculated according to the loss function, and the model parameters of the small language model to be trained are updated by back propagation according to the gradient until a preset training end condition is met, thereby obtaining a trained small language model.

8. The method according to claim 1, characterized in that The first device further includes a prompt word pre-screening module, and the step of obtaining local privacy data and screening the local privacy data to obtain the plain text prompt word corresponding to the small language model to be trained includes: Get local private data; Evaluate the local privacy data by using the pre-screening module to obtain an evaluation index of the local privacy data; Screening the local privacy data according to the evaluation index to obtain the plaintext prompt word; The evaluation index includes at least one of a quality evaluation index, a contribution evaluation index and a difficulty evaluation index.

9. A privacy data protection method, characterized in that: Applied to a second device, the second device is communicatively connected to a first device, a small language model to be trained and a pre-trained encryption and decryption model are deployed in the first device, and a large language model is deployed in the second device, the method comprising: Receiving an encrypted perturbed prompt word sent by the first device, wherein the encrypted perturbed prompt word is generated by the first device encrypting the acquired plaintext prompt word through the encryption and decryption model; A disturbed thought chain is generated according to the encrypted perturbed prompt word, and the disturbed thought chain is sent to the first device, so that the first device decrypts the disturbed thought chain based on the plaintext prompt word and the encrypted perturbed prompt word through the encryption and decryption model to obtain the decrypted thought chain, and trains the small language model to be trained based on the decrypted thought chain to obtain a trained small language model.

10. A privacy data protection device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the privacy data protection method according to any one of claims 1 to 9.

11. A storage medium, characterized in that: The storage medium is 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 privacy data protection method according to any one of claims 1 to 9 are implemented.

12. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the privacy data protection method according to any one of claims 1 to 9 are implemented.

Citation Information

Cited By

  • Text evaluator cue word optimization method and device and storage medium

    CN120124622A

  • Business candidate person and member information management and storage method and system

    CN120372669A

  • A method and system for managing and storing business candidate information

    CN120372669B

  • Plaintext anti-disturbance method and device for encrypted traffic

    CN121077832A

  • Prompt word privacy protection method and device, equipment, product and medium

    CN121502824A