Content generation method, system and equipment based on privacy protection and medium
By performing privacy checks and task scoring on candidate content generated by large language models and dynamically integrating reward update strategies, the problem of generating sensitive information by large language models is solved, achieving higher privacy security and generation stability.
Patent Information
- Application Number
- CN202510957698.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-11
- Publication Date
- 2025-10-28
AI Technical Summary
Large language models are prone to leaking sensitive information when generating content, leading to privacy risks and affecting the security of the generated content.
After generating candidate content using a large language model, privacy detection and task scoring are performed. Rewards are dynamically integrated and model strategies are updated to suppress the generation of sensitive information and improve privacy and security.
It effectively suppresses the generation of sensitive content, improves the privacy security and stability of the generated content, and ensures that the model generates sensitive information during the training process, thus solving the problem of sensitive information generation by the model in the existing technology.
Smart Images

Figure CN120850342A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, system, device and medium for content generation based on privacy protection. Background Technology
[0002] With the continuous development of computer technology, large language models, trained on massive amounts of data, can generate fluent and coherent text, and are widely used in tasks such as intelligent question answering, content generation, translation, and text summarization. However, the training process of large language models typically relies on a large amount of publicly available data that has not undergone rigorous screening, which may contain sensitive information. This can easily lead to the leakage of sensitive information in the content generated by the model, resulting in privacy risks and affecting the security of the generated content.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0004] The main objective of this application is to propose a privacy-protected content generation method, system, device, and medium that can protect data privacy and improve data security.
[0005] To achieve the above objectives, one aspect of this application proposes a privacy-preserving content generation method, the method comprising:
[0006] The training data is processed by a large language model to generate multiple candidate content.
[0007] The candidate generated content is subjected to privacy detection processing to obtain a privacy reward;
[0008] The candidate generated content is subjected to task scoring processing to obtain task rewards;
[0009] The privacy reward and the task reward are dynamically merged to obtain a merged reward;
[0010] The large language model is updated according to the fusion reward to obtain a policy model;
[0011] The system acquires the data to be processed, inputs the data into the strategy model, and outputs the target generated content through the strategy model.
[0012] In some embodiments, the content generation process of the training data using a large language model to obtain multiple candidate generated content includes:
[0013] Obtain training data;
[0014] The training data is processed by text conversion to obtain the text content;
[0015] The text content is input into the large language model, and combined with the generated prompt words, the text content is processed to generate multiple candidate content.
[0016] In some embodiments, the privacy detection processing of the candidate generated content to obtain a privacy reward includes:
[0017] The candidate generated content is subjected to rule matching processing based on regular expressions to obtain the rule matching result;
[0018] The candidate generated content is subjected to sensitive word matching processing based on a preset sensitive word library to obtain sensitive word matching results;
[0019] The privacy reward is obtained by combining the pre-trained privacy discrimination model with the rule matching results and the sensitive word matching results to discriminate the candidate generated content.
[0020] In some embodiments, the step of performing task scoring processing on the candidate generated content to obtain task rewards includes:
[0021] Initialize the reward model;
[0022] Each candidate content is scored according to the reward model to obtain a group score.
[0023] The task reward is obtained by performing reward trimming on the scores within the group.
[0024] In some embodiments, the dynamic fusion processing of the privacy reward and the task reward to obtain a fused reward includes:
[0025] Set initial weights;
[0026] The initial weights are dynamically adjusted according to the training rounds to obtain the fusion weights.
[0027] The privacy reward and the task reward are merged according to the fusion weight to obtain the fused reward.
[0028] In some embodiments, the step of updating the policy model based on the fusion reward to obtain a policy model includes:
[0029] The fusion reward is processed by calculating the average value and standard deviation to obtain the reward average value and reward standard deviation;
[0030] The fusion reward is normalized based on the average reward and the standard deviation of the reward to obtain the advantage value;
[0031] The parameters of the large language model are updated based on the advantage value and the regularization term to obtain the policy model.
[0032] In some embodiments, the step of acquiring data to be processed, inputting the data to be processed into the strategy model, and outputting the target generated content through the strategy model includes:
[0033] The data to be processed is obtained through the user interface.
[0034] In response to the generation instruction, the data to be processed is input into the strategy model, and the strategy model is subjected to summary generation processing in conjunction with the generation instruction to output the target generated content.
[0035] To achieve the above objectives, another aspect of this application proposes a privacy-preserving content generation system, the system comprising:
[0036] The candidate content generation module is used to process the training data using a large language model to generate multiple candidate content.
[0037] The privacy detection module is used to perform privacy detection processing on the candidate generated content to obtain a privacy reward;
[0038] The task scoring module is used to score the candidate generated content to obtain task rewards.
[0039] The reward fusion module is used to dynamically fuse the privacy reward and the task reward to obtain a fused reward;
[0040] The strategy update module is used to perform strategy update processing on the large language model according to the fusion reward to obtain the strategy model;
[0041] The target content generation module is used to acquire data to be processed, input the data to be processed into the strategy model, and output the target generated content through the strategy model.
[0042] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above.
[0043] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.
[0044] To achieve the above objectives, another aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the methods described above.
[0045] The embodiments of this application include at least the following beneficial effects: This application provides a privacy-preserving content generation method, system, device, and medium. This scheme uses a large language model to process training data to obtain multiple candidate generated content, and performs privacy detection processing on the candidate generated content to obtain a privacy reward. This scheme can directly suppress the generation of sensitive content through privacy rewards, improving the privacy security of the generated content. Furthermore, this scheme performs task scoring processing on the candidate generated content to obtain a task reward, dynamically fuses the privacy reward and task reward to obtain a fusion reward, and updates the large language model based on the fusion reward to obtain a policy model. This allows for dynamic weight adjustment and optimization of the direction to balance the performance and privacy of the generated content, enhancing the stability of content generation. Attached Figure Description
[0046] Figure 1 This is a flowchart of a privacy-preserving content generation method provided in an embodiment of this application;
[0047] Figure 2 yes Figure 1 The flowchart of step S101 in the text;
[0048] Figure 3 yes Figure 1 The flowchart of step S102 in the document;
[0049] Figure 4 yes Figure 1 The flowchart of step S103 in the process;
[0050] Figure 5 yes Figure 1 The flowchart of step S104 in the process;
[0051] Figure 6 yes Figure 1 The flowchart of step S105 in the process;
[0052] Figure 7 yes Figure 1 The flowchart of step S106 in the process;
[0053] Figure 8 This is a flowchart of an abstract generation process provided in an embodiment of this application;
[0054] Figure 9 This is a schematic diagram of the structure of a privacy-protected content generation system provided in an embodiment of this application;
[0055] Figure 10This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of systems and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0057] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if,” “when,” or “in response to a determination” as used herein may be interpreted as “when…” or “when…” or “in response to a determination.”
[0058] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0060] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0061] 1) Artificial Intelligence (AI) is a new technological science that studies and develops theories, methods, technologies, and application systems to simulate, extend, and expand human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce new intelligent machines that can react in a way similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems.
[0062] 2) Machine learning is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and many other disciplines. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance.
[0063] 3) Reinforcement Learning (RL) is a machine learning method. Its fundamental framework is the Markov Decision Process, which allows an agent to learn optimal policies through trial and error in its interactions with the environment. The agent performs actions in the environment and receives feedback, or rewards, based on the outcomes of those actions. These reward signals guide the agent to adjust its policy to maximize long-term cumulative rewards.
[0064] In related technologies, large language models, trained on massive amounts of data, can generate fluent and coherent text, and are widely used in tasks such as intelligent question answering, content generation, translation, and text summarization. However, when large language models are applied to industries involving user privacy data, such as healthcare, finance, and customer service, these models cannot ensure that the generated content does not leak sensitive information. These models rely solely on task-related rewards and cannot constrain whether the generated content contains user privacy information (such as ID card numbers, bank card numbers, medical records, etc.). Even if the training data has been anonymized, the model may still learn patterns in generating privacy data and reproduce them during inference, or directly generate privacy information within a context containing privacy-sensitive background knowledge, leading to privacy leakage risks and affecting the security of the generated content.
[0065] In view of this, this application provides a privacy-preserving content generation method, system, device, and medium. This scheme uses a large language model to process training data to obtain multiple candidate generated content, and performs privacy detection processing on the candidate generated content to obtain a privacy reward. This scheme can directly suppress the generation of sensitive content through privacy rewards, improving the privacy security of the generated content. Furthermore, this scheme performs task scoring processing on the candidate generated content to obtain a task reward, dynamically fuses the privacy reward and task reward to obtain a fusion reward, and updates the large language model based on the fusion reward to obtain a policy model. This allows for dynamic weight adjustment and optimization to balance the performance and privacy of the generated content, enhancing the stability of content generation.
[0066] This application provides a privacy-preserving content generation method, relating to the field of artificial intelligence technology. This privacy-preserving content generation method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing a privacy-preserving content generation method, but is not limited to the above forms.
[0067] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0068] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0069] Figure 1This is an optional flowchart of a privacy-preserving content generation method provided in an embodiment of this application. Figure 1 The methods may include, but are not limited to, the following steps:
[0070] Step S101: The training data is processed by a large language model to generate multiple candidate content.
[0071] Step S102: Perform privacy detection processing on the candidate generated content to obtain a privacy reward;
[0072] Step S103: Perform task scoring on the candidate generated content to obtain task rewards;
[0073] Step S104: Dynamically fuse the privacy reward and the task reward to obtain a fused reward;
[0074] Step S105: Perform policy update processing on the large language model according to the fusion reward to obtain the policy model;
[0075] Step S106: Obtain the data to be processed, input the data to be processed into the strategy model, and output the target generated content through the strategy model.
[0076] Steps S101 to S106 of this embodiment involve using a large language model to process training data for content generation, generating multiple candidate generated content. The large language model is a pre-trained model, which can be trained with all parameters, with some parameters frozen, or with low-rank parameters, depending on user needs. This embodiment can be applied to the generation application of large language models, such as in summary generation scenarios. In this case, the large language model is used to process data for summary generation, obtaining generated summaries as candidate generated content. Privacy detection is then performed on each candidate generated content, and a corresponding privacy reward can be generated using a privacy reward function. Furthermore, a task score is applied to each candidate generated content, with accuracy and format rewards awarded based on the model's performance, resulting in a task reward. This embodiment dynamically fuses the privacy reward and task reward to obtain a fused reward. This fused reward can be used to update the large language model's strategy, iteratively updating the model's parameters until the model meets a preset convergence condition, resulting in a strategy-updated model. This application embodiment updates the large language model through a strategy update, enabling the model to proactively avoid generating content containing user privacy while maintaining original task performance. The convergence condition can be set to a specified number of iterations, etc., and can be configured according to actual needs. Finally, the data to be processed can be obtained through a user interface, etc. By inputting the data to be processed into the strategy model, the strategy model can output the target generated content that does not contain privacy data, thus improving the privacy and security of the generated content.
[0077] Please see Figure 2 In step S101 of some embodiments, the content generation process of the training data using a large language model to obtain multiple candidate generated content includes:
[0078] Step S201: Obtain training data;
[0079] Step S202: Perform text conversion processing on the training data to obtain text content;
[0080] Step S203: Input the text content into the large language model, and combine it with the generated prompt words to perform group candidate generation processing on the text content to obtain multiple candidate generated contents.
[0081] In this embodiment, training data can be obtained through a database or by web scraping. The training data can be a training dataset containing data from different industries. This embodiment performs text conversion processing on the training data, which can be audio files, image files, or text files, etc. By converting this training data into text data of a unified format, text content is obtained, and then the text content is input into a large language model for content generation. Furthermore, the text content can be combined with generated prompts to perform group candidate generation processing, generating candidate content that meets different requirements based on the generated prompts.
[0082] In one feasible embodiment, call recording data is used as training data. Text conversion processing is performed on the training data, and speech recognition technology is used to perform text recognition processing on the call recording data to generate recorded text. The recorded text is then formatted to obtain the text content. In this embodiment, the text content is input into a large language model, along with generation prompts for group candidate generation. These prompts can be phrased as "perform summary generation processing on the text content and output multiple different generation results." The large language model will then generate multiple different candidate generated content. This embodiment unifies the text format through text conversion processing, facilitating model recognition and processing. Furthermore, by combining the generation prompts with multiple candidate generated content, this embodiment can specify the model to output the required generated content, improving the model's generation performance.
[0083] Please see Figure 3 In step S102 of some embodiments, the privacy detection processing of the candidate generated content to obtain a privacy reward includes:
[0084] Step S301: Perform rule matching processing on the candidate generated content according to the regular expression to obtain the rule matching result;
[0085] Step S302: Perform sensitive word matching processing on the candidate generated content according to the preset sensitive word library to obtain sensitive word matching results;
[0086] Step S303: The candidate generated content is processed by combining the rule matching result and the sensitive word matching result with a pre-trained privacy discrimination model to obtain the privacy reward.
[0087] In this embodiment, privacy rewards can be obtained by performing privacy detection on multiple candidate generated content generated by a large language model. This embodiment can perform rule matching processing on the candidate generated content according to regular expressions. For example, a pre-set regular expression can be used to detect whether the candidate generated content contains special characters, and rule matching can be used to detect whether the candidate generated content contains sensitive information. This embodiment also performs sensitive word matching processing on the candidate generated content according to a preset sensitive word library. Through text recognition and matching processing, it is possible to detect whether the candidate generated content contains sensitive information. This embodiment can also use a privacy discrimination model to combine rule matching results and sensitive word matching results to discriminate the candidate generated content. This privacy discrimination model is a pre-trained discrimination model. A binary classification model with small parameters can be trained using privacy data as the privacy discrimination model, and the privacy discrimination model can be used to determine whether the candidate generated content contains privacy information. This embodiment can use a binary reward function to calculate the privacy reward, where the expression of the privacy reward function is shown in the following formula:
[0088]
[0089] Where, r privacy The algorithm represents the privacy reward, where `content` represents the candidate generated content and `privacy` represents the privacy information. The reward is 0 when the generated candidate content contains privacy information and 1 when it does not. This embodiment uses a privacy discrimination model to judge each generated candidate content. This model is a pre-trained binary classification model, a lightweight model designed to accelerate training performance, and only judges whether the generated candidate content contains privacy information. By performing privacy detection on multiple generated candidate contents, this embodiment can identify whether the model-generated content contains privacy information, thereby generating corresponding privacy rewards. This provides a data foundation for subsequent model training, enabling the model to learn to avoid generating sensitive information during the training phase without relying on post-processing.
[0090] Please see Figure 4 In step S103 of some embodiments, the step of performing task scoring processing on the candidate generated content to obtain task rewards includes:
[0091] Step S401: Initialize the reward model;
[0092] Step S402: Scoring each candidate generated content according to the reward model to obtain the group score;
[0093] Step S403: Perform reward trimming on the group scores to obtain the task reward.
[0094] In this embodiment, a reward model is initialized to guide the model to learn and optimize in the correct direction, i.e., to guide the large language model to generate content that meets the requirements. This embodiment can set accuracy rewards, format rewards, language consistency rewards, optimization constraints, and penalties for the reward model. This embodiment uses the reward model to score each candidate generated content, thereby obtaining score data for each candidate generated content, resulting in an in-group score. This embodiment also performs reward pruning on the in-group scores, limiting the magnitude of rewards and preventing abnormal rewards from having an excessive impact on model training, further improving training stability.
[0095] Please see Figure 5 In step S104 of some embodiments, the dynamic fusion processing of the privacy reward and the task reward to obtain a fused reward includes:
[0096] Step S501: Set initial weights;
[0097] Step S502: Dynamically adjust the initial weights according to the training rounds to obtain the fusion weights;
[0098] Step S503: The privacy reward and the task reward are fused according to the fusion weight to obtain the fused reward.
[0099] In this embodiment, an initial weight is set, which can be adjusted according to actual conditions; for example, the initial weight can be preset to 0.3. Then, during training, the initial weight can be dynamically adjusted based on the specified number of training epochs. For example, when the number of training epochs is less than or equal to one thousand, the initial weight is set to 0.3; when the number of training epochs is greater than one thousand, the initial weight is set to 0.7. This application obtains a fused reward by fusing the privacy reward and the task reward using a fused weight. The expression for the fused reward is as follows:
[0100] R new =λ·R old +(1-λ)·r privacy ;
[0101] In the formula, R new R represents the fusion reward, and λ represents a hyperparameter with a fusion weight less than 1, which can be dynamically adjusted. old Indicates the task reward, r privacyThis represents a privacy reward. The embodiments of this application balance the task performance of the model-generated content through dynamic weight adjustment. In the initial training phase (first 1000 rounds), λ is set to 0.3 to strengthen privacy constraints. In later training phases (after 1000 rounds), λ is gradually increased to 0.7 to balance task performance. Compared to using fixed weights or optimizing only a single objective, the embodiments of this application can dynamically adjust the optimization direction according to the training stage. In the early stages, it emphasizes privacy constraints to prevent the model from learning sensitive patterns, and in the later stages, it releases the potential for task performance, avoiding gradient conflicts caused by fixed weights.
[0102] Please see Figure 6 In step S105 of some embodiments, the step of updating the policy model based on the fusion reward to obtain a policy model includes:
[0103] Step S601: Calculate the average value and standard deviation of the fusion reward to obtain the average reward value and standard deviation of the reward.
[0104] Step S602: Normalize the fusion reward based on the average reward and the standard deviation of the reward to obtain the advantage value;
[0105] Step S603: Update the parameters of the large language model based on the advantage value and the regularization term to obtain the policy model.
[0106] In this embodiment, the fusion reward is processed by calculating the mean and standard deviation to obtain the reward mean and standard deviation. Based on the mean and standard deviation of the within-group reward, this embodiment can calculate the relative advantage of each candidate generated content. By normalizing the relative reward formula, the advantage value of each candidate generated content is calculated. This embodiment reflects the relative superiority or inferiority of the candidate generated content within the group through the advantage value, providing a guiding signal for subsequent policy updates. The higher the advantage value, the better the candidate generated content is within the group, and the more likely the model is to generate similar candidate generated content in subsequent updates; conversely, the probability of generating such candidate generated content will decrease. This embodiment updates the policy model using the policy gradient method based on the calculated advantage. Specifically, the model parameters will be adjusted along the generation direction that increases the probability of generating superior candidate generated content. During the update process, regularization terms, such as KL divergence constraints, are also considered to ensure that the magnitude of the policy update is within a reasonable range, avoiding training instability caused by excessive update magnitude. This application embodiment iteratively optimizes the large language model by repeatedly performing content generation, privacy detection, task scoring, dynamic fusion, and strategy update on the training data. During the iteration process, the model gradually learns better strategies, and the quality of the generated candidate content continuously improves. Through continuous iterative optimization, the model is optimized until it reaches the expected performance metrics on a specific task, or the number of training epochs reaches a preset upper limit, thus obtaining the policy model.
[0107] Please see Figure 7 In step S106 of some embodiments, the step of acquiring data to be processed, inputting the data to be processed into the strategy model, and outputting the target generated content through the strategy model includes:
[0108] Step S701: Obtain the data to be processed through the user interface;
[0109] Step S702: In response to the generation instruction, the data to be processed is input into the strategy model, and the strategy model is processed by summarizing the data in conjunction with the generation instruction to output the target generated content.
[0110] In this embodiment, the data to be processed can be obtained through a user interface, such as text data obtained through an input box on the user interface, or corresponding data to be processed, such as audio files, obtained through a file upload button. Furthermore, the data to be processed is input into a strategy model for content generation processing in conjunction with a generation instruction. This generation instruction can be a user-inputted prompt, thereby generating a summary of the data to be processed according to the generation instruction, resulting in target generated content that does not contain privacy information.
[0111] The following is a detailed description and explanation of the solutions in the embodiments of the present invention, using specific application examples:
[0112] This application's embodiments can be widely applied in the field of artificial intelligence technology, suitable for application scenarios such as summary generation and dialogue analysis, and can improve the privacy and security of model-generated content. For example, in customer service dialogue analysis applications, this application's embodiments automatically generate customer call summaries through a large language model, extracting key requests such as complaints and inquiries, while filtering customer privacy information such as phone numbers and addresses. This application's embodiments can also be applied to meeting recording applications, generating agenda summaries from multi-person conference calls while hiding the identities of participants. Applied to legal consultation applications, this application's embodiments can generate summaries of conversations between lawyers and clients, ensuring that case details are not leaked and protecting client privacy. This application's embodiments are also applied to medical consultation applications, extracting diagnostic suggestions from doctor-patient conversations through a large language model, masking sensitive information such as patient names and medical history, and improving the security of user privacy protection.
[0113] Please see Figure 8 This application embodiment obtains call text, which may be something like "The customer's bank card ending in 6217 transferred 50,000 yuan to Li's account on October 1, 2023...". This call text is used as input to the model to generate candidate summaries. Then, combined with the prompt word, a large language model generates corresponding candidate summaries. The prompt word may be "Please extract a summary of the input call content." The model then generates multiple candidate summary contents, for example, the first candidate content is "The customer's bank card ending in 6217 transferred 50,000 yuan on October 1st.", and the second candidate content is "The customer transferred 50,000 yuan to Li's account, bank card number 6217." Each candidate summary is then detected in real time, using rule matching, such as detecting the bank card number (regular expression \d{16,19}) and the name (preset sensitive word library). Alternatively, a privacy discrimination model can be used directly for judgment. This model is pre-trained and can be a binary classification model with small parameters trained using privacy data to determine whether privacy is included. The obtained privacy reward and task reward are dynamically fused, where the task reward can be obtained through manual annotation or automatic evaluation. This application's embodiments optimize the strategy based on fusion rewards. A relative advantage value is obtained by calculating the group's average reward, and the model parameters are updated according to this relative advantage value, increasing the probability of generating high-advantage candidate content. The trained strategy module can output compliant summary content. This application's embodiments directly suppress the generation of sensitive content through a privacy reward function, reducing information loss caused by post-processing filtering. Furthermore, a dynamic weight adjustment mechanism maintains the summary integrity score and supports industry-customized sensitive word libraries. This application's embodiments optimize the model's computational efficiency and improve the privacy security of the generated content through a lightweight privacy detection module.
[0114] Please see Figure 9 This application also provides a privacy-preserving content generation system that can implement the above-described method. The system includes:
[0115] The candidate content generation module 901 is used to process the training data through a large language model to generate multiple candidate content.
[0116] Privacy detection module 902 is used to perform privacy detection processing on the candidate generated content to obtain a privacy reward;
[0117] The task scoring module 903 is used to perform task scoring processing on the candidate generated content to obtain task rewards.
[0118] The reward fusion module 904 is used to dynamically fuse the privacy reward and the task reward to obtain a fused reward.
[0119] The strategy update module 905 is used to perform strategy update processing on the large language model according to the fusion reward to obtain a strategy model;
[0120] The target content generation module 906 is used to acquire data to be processed, input the data to be processed into the strategy model, and output the target generated content through the strategy model.
[0121] It is understood that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0122] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0123] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0124] Please see Figure 10 , Figure 10 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:
[0125] The processor 1001 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0126] The memory 1002 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1002 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1002 and is called and executed by the processor 1001 using the methods described in the embodiments of this application.
[0127] Input / output interface 1003 is used to implement information input and output;
[0128] The communication interface 1004 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0129] Bus 1005 transmits information between various components of the device (e.g., processor 1001, memory 1002, input / output interface 1003, and communication interface 1004);
[0130] The processor 1001, memory 1002, input / output interface 1003 and communication interface 1004 are connected to each other within the device via bus 1005.
[0131] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0132] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0133] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0134] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0135] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0136] This application provides a privacy-preserving content generation method, system, device, and medium. This scheme uses a large language model to process training data to obtain multiple candidate generated content, and performs privacy detection processing on the candidate generated content to obtain a privacy reward. This scheme can directly suppress the generation of sensitive content through privacy rewards, improving the privacy security of the generated content. Furthermore, this scheme performs task scoring processing on the candidate generated content to obtain a task reward, dynamically fuses the privacy reward and task reward to obtain a fusion reward, and updates the large language model based on the fusion reward to obtain a policy model. This allows for dynamic weight adjustment and optimization to balance the performance and privacy of the generated content, enhancing the stability of content generation.
[0137] This application's embodiments, by adding a binarized privacy reward function during model training, can detect in real time whether candidate outputs contain sensitive information. This allows privacy security to be explicitly optimized and directly integrated into policy gradient calculation, enabling the model to learn to avoid outputting sensitive information during training. This eliminates the need for post-processing filtering, actively suppressing privacy generation and covering the entire training process, rather than just the inference stage, thus improving end-to-end security. Furthermore, this application's embodiments dynamically adjust the fusion weights of privacy rewards and task rewards according to the training phase. This allows for dynamic adjustment of the optimization direction based on the training stage, emphasizing privacy constraints early on to prevent the model from learning sensitive patterns, and releasing task performance potential later on. This balances model performance and privacy, avoids gradient conflicts caused by fixed weights, and improves the model's adaptive training stability.
[0138] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0139] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0140] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0141] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0142] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0143] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0144] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.
[0145] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0146] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0147] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0148] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A privacy-preserving content generation method, characterized in that, The method includes the following steps: The training data is processed by a large language model to generate multiple candidate content. The candidate generated content is subjected to privacy detection processing to obtain a privacy reward; The candidate generated content is subjected to task scoring processing to obtain task rewards; The privacy reward and the task reward are dynamically merged to obtain a merged reward; The large language model is updated according to the fusion reward to obtain a policy model; The system acquires the data to be processed, inputs the data into the strategy model, and outputs the target generated content through the strategy model.
2. The method according to claim 1, characterized in that, The process of generating content from training data using a large language model yields multiple candidate generated content, including: Obtain training data; The training data is processed by text conversion to obtain the text content; The text content is input into the large language model, and combined with the generated prompt words, the text content is processed to generate multiple candidate content.
3. The method according to claim 1, characterized in that, The step of performing privacy detection processing on the candidate generated content to obtain a privacy reward includes: The candidate generated content is subjected to rule matching processing based on regular expressions to obtain the rule matching result; The candidate generated content is subjected to sensitive word matching processing based on a preset sensitive word library to obtain sensitive word matching results; The privacy reward is obtained by combining the pre-trained privacy discrimination model with the rule matching results and the sensitive word matching results to discriminate the candidate generated content.
4. The method according to claim 1, characterized in that, The step of performing task scoring on the candidate generated content to obtain task rewards includes: Initialize the reward model; Each candidate content is scored according to the reward model to obtain a group score. The task reward is obtained by performing reward trimming on the scores within the group.
5. The method according to claim 1, characterized in that, The dynamic fusion of the privacy reward and the task reward to obtain the fused reward includes: Set initial weights; The initial weights are dynamically adjusted according to the training rounds to obtain the fusion weights. The privacy reward and the task reward are merged according to the fusion weight to obtain the fused reward.
6. The method according to claim 1, characterized in that, The step of updating the policy model based on the fusion reward to obtain the policy model includes: The fusion reward is processed by calculating the average value and standard deviation to obtain the reward average value and reward standard deviation; The fusion reward is normalized based on the average reward and the standard deviation of the reward to obtain the advantage value; The parameters of the large language model are updated based on the advantage value and the regularization term to obtain the policy model.
7. The method according to any one of claims 1 to 6, characterized in that, The process of acquiring data to be processed, inputting the data to be processed into the strategy model, and outputting the target generated content through the strategy model includes: The data to be processed is obtained through the user interface. In response to the generation instruction, the data to be processed is input into the strategy model, and the strategy model is subjected to summary generation processing in conjunction with the generation instruction to output the target generated content.
8. A privacy-preserving content generation system, characterized in that, The system includes: The candidate content generation module is used to process the training data using a large language model to generate multiple candidate content. The privacy detection module is used to perform privacy detection processing on the candidate generated content to obtain a privacy reward; The task scoring module is used to score the candidate generated content to obtain task rewards. The reward fusion module is used to dynamically fuse the privacy reward and the task reward to obtain a fused reward; The strategy update module is used to perform strategy update processing on the large language model according to the fusion reward to obtain the strategy model; The target content generation module is used to acquire data to be processed, input the data to be processed into the strategy model, and output the target generated content through the strategy model.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.