Data generation methods, devices, and computer program products
A dual neural network system identifies and suppresses predetermined information in large-scale model outputs, ensuring high-quality results by maintaining probability distributions.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- NTT DOCOMO INC
- Filing Date
- 2025-10-09
- Publication Date
- 2026-04-22
AI Technical Summary
Large-scale models generate outputs containing privacy, bias, or copyright infringing content, and conventional suppression methods like retraining and pre/post-processing are costly and inefficient, while fine-tuning degrades output quality.
A dual neural network approach where a first model identifies predetermined information units and a second model generates output data, using weighted loss functions to suppress these units while maintaining output quality.
Effectively suppresses predetermined information in large-scale model outputs while preserving output quality by minimizing the impact on probability distributions.
Smart Images

Figure 2026068720000001_ABST
Abstract
Description
[Technical Field]
[0001] This disclosure relates to a data generation method, apparatus, and computer program product, which can be used to suppress large-scale models from generating data containing predetermined information. [Background technology]
[0002] In recent years, large-scale model technology has developed rapidly. Based on technologies such as deep learning, large-scale models can generate realistic text, images, audio, and other content. However, training large-scale models requires the use of vast amounts of data, and this training data may contain content that infringes on privacy, bias, or copyright. As a result, the output of large-scale models trained on such data may also contain this content. If it is found that the output of a large-scale model contains this content, the model needs to quickly suppress its output.
[0003] Conventional techniques for suppressing the output of specific content by large-scale models include, for example, model retraining and pre-processing / post-processing. Model retraining requires deleting or obfuscating specific data in the training dataset and then retraining the model. Such methods incur extremely high training costs. On the other hand, model pre-processing / post-processing suppresses the output of specific content by the model by suppressing the model's prompts (i.e., pre-processing) or filtering the model's output (i.e., post-processing). However, both depend on complex rule design, making it difficult to completely solve the problem of suppressing the output of specific content by the model.
[0004] To address these challenges, there is a technique that suppresses the output of a model based on fine-tuning of large-scale models. This technique can reduce the training cost of the model and eliminate the need for manual rule design. However, fine-tuning a large-scale model can degrade the quality of the results it generates. For example, a fine-tuned large-scale language model may generate text containing problems such as grammatical errors and word redundancies. [Overview of the Initiative]
[0005] This disclosure has been made in view of the above-mentioned issues. The purpose of this disclosure is to provide a data generation method, apparatus, and computer program product that suppress the generation of results containing predetermined information by large-scale models and improve the quality of the generated results of large-scale models.
[0006] According to one aspect of the present disclosure, a data generation method is provided which includes: using a first neural network model to generate an indicator for each input base unit that indicates whether the input base unit is a predetermined base unit containing predetermined information; and using a second neural network model to generate output data based on input data and the indicator, wherein the output data includes one or more output base units, and each output base unit is different from the predetermined base unit.
[0007] According to one embodiment of the present disclosure, the first neural network model includes a first submodel that generates the indicator for each of the input base units, and a second submodel that generates output data for the second submodel based on one or more of the input base units and the indicator for each of the input base units.
[0008] According to an embodiment of the present disclosure, the loss function used for training the first neural network model is a weighted sum of a first loss function and a second loss function. The first loss function indicates the number of the predetermined basic units, and the second loss function indicates the difference between the output data of the second submodel and the input data.
[0009] According to an embodiment of the present disclosure, for each input basic unit, when the value of the indicator is 1, it indicates that the input basic unit is the predetermined basic unit; when the value of the indicator is 0, it indicates that the input basic unit is not the predetermined basic unit. The first loss function is the sum of the indicators of each input basic unit.
[0010] The second loss function is the vector distance between the output data of the second submodel and the input data.
[0011] According to an embodiment of the present disclosure, the second neural network model is a pre-trained generative neural network model.
[0012] According to an embodiment of the present disclosure, by fine-tuning the second neural network model, at each key time step, in the probability distribution for selecting an output basic unit, the probability of the predetermined basic unit is minimized, and the change in the probability in the probability distribution of other candidate output basic units different from the predetermined basic unit before and after the fine-tuning is minimized. The key time step is the time step for generating an output basic unit corresponding to the position of the predetermined basic unit indicated by the indicator.
[0013] According to an embodiment of the present disclosure, in the fine-tuning, a loss function composed of a weighted sum of a third loss function and a fourth loss function is calculated at the key time step, the third loss function indicates the probability that the output basic unit generated at the key time step is the predetermined basic unit, and the fourth loss function indicates the difference between the probability distribution before fine-tuning and the probability distribution after fine-tuning of the other candidate output basic units at the key time step.
[0014] According to an embodiment of the present disclosure, the third loss function is the logarithmic likelihood of the probability of generating the predetermined basic unit at each key time step.
[0015] According to an embodiment of the present disclosure, the fourth loss function is the KL divergence between the probability distribution of the other candidate output basic units before fine-tuning and the probability distribution of the other candidate output basic units after fine-tuning at the key time step.
[0016] According to an embodiment of the present disclosure, the input data is text and the input basic unit is a token.
[0017] According to an embodiment of the present disclosure, the input data is an image and the input basic unit is a patch of the image.
[0018] According to an embodiment of the present disclosure, the input data is audio and the input basic unit is a frame of the audio.
[0019] According to another aspect of the present disclosure, there is provided a data generation device including a processor and a memory storing one or more computer programs, wherein when the one or more computer programs are executed by the processor, the data generation method described in each of the above items is executed by the processor.
[0020] According to another aspect of this disclosure, a computer program product is provided which includes a computer program, and when the computer program is executed by a processor, the data generation methods described in the above sections are executed.
[0021] The methods, apparatus, and computer program products provided in this disclosure can suppress the generation of results containing predetermined information by large-scale models and improve the quality of the results generated by large-scale models. [Brief explanation of the drawing]
[0022] [Figure 1] Figure 1 shows a flowchart of the data generation method according to an embodiment of the present disclosure. [Figure 2] Figure 2 schematically shows the configuration of the first neural network model according to an embodiment of the present disclosure. [Figure 3] Figure 3 shows a schematic diagram of a data generation method according to an embodiment of the present disclosure. [Figure 4] Figure 4 shows a schematic diagram of the configuration of a data generation device according to an embodiment of the present disclosure. [Modes for carrying out the invention]
[0023] The embodiments of this disclosure will be described in more detail below with reference to the drawings. Although the drawings show several embodiments of this disclosure, this disclosure is achievable in various ways and should not be construed as being limited to the embodiments described below. Rather, these embodiments should be understood as being provided for a more thorough and complete understanding of this disclosure. The drawings and embodiments of this disclosure should be understood as merely illustrative and not as limiting the scope of protection of this disclosure.
[0024] It should be understood that each step described in the embodiments of the method of this disclosure may be performed in a different order and / or in parallel. Furthermore, embodiments of the method may include other steps and / or some steps may be omitted.
[0025] As used herein, the term "includes" and its variations are open inclusions, meaning "including, but not limited to, ...". The term "based on" means "at least partially based on...". The term "one embodiment" means "at least one embodiment". The term "another embodiment" means "at least one other embodiment". The term "several embodiments" means "at least several embodiments". Definitions of other terms are provided below.
[0026] The concepts of “first,” “second,” etc., as used in this disclosure should be understood to be merely for distinguishing different devices, modules, units, models, data, etc., and not to limit the order of functions performed by these devices, modules, units, models, data, etc., the order of generation, or interdependencies.
[0027] Furthermore, the modifiers “one” and “multiple” as used in this disclosure are illustrative rather than restrictive, and should be understood as “one or more” unless otherwise specified in the surrounding text, as would be understood by those skilled in the art.
[0028] The results generated by large-scale models may include content related to privacy, bias, and copyright infringement, and it is necessary to suppress the output of such content. Conventional techniques to suppress the output of specific content by large-scale models involve fine-tuning the large-scale model to maximize the loss function when the specific content is output, thereby preventing that content from being output. However, large-scale models are generative models and generate results based on conditional probability distributions. Therefore, while operations such as fine-tuning suppress the generation of specific content, this results in the destruction of the probability distributions in the hidden layers of other content, and the quality of the results generated by the large-scale model deteriorates.
[0029] This disclosure was made in response to the above-mentioned problems. The concept of this disclosure is as follows: For data containing information that is undesirable to be included in the output results of a second neural network model (e.g., a pre-trained model), such as privacy information, bias information, or infringement information (hereinafter referred to as "predetermined information"), the first neural network model processes the input data containing the predetermined information and identifies predetermined basic units within the input data. Then, based on the identification results by the first neural network model, the second neural network model is fine-tuned. This ensures that the output data generated by the second neural network model based on its input data does not contain such predetermined basic units. Furthermore, the quality of the results generated by the large-scale model is ensured by maintaining the probability distribution of the second neural network model generating other basic units before and after fine-tuning. Here, a basic unit is the smallest unit of data processed by the neural network model. Both the input data and output data of the neural network model are composed of basic units. For example, in the case of text data, the basic unit may be a token. Furthermore, the specified basic unit may be a basic unit that contains the specified information, and since the input data contains the specified basic unit, it is considered to contain the specified information.
[0030] The following explanation uses examples where the data processed by the first and second neural network models is text data. However, it is clear that the data processed by these models is not limited to text, but may also be other types of data such as images or audio. Furthermore, any appropriate conventional method may be used to convert the data into base units. It should be noted that the base units processed by the neural network models are actually in vector form, which is a common understanding in this field. Here, a detailed explanation of how to convert base units into vector form will be omitted.
[0031] The data generation method according to the embodiment of this disclosure will be described in detail below. Figure 1 shows a flowchart of the data generation method 100 according to the embodiment of this disclosure. The data generation method 100 may include steps S110 and S120. In step S110, for input data including one or more input basic units, an indicator is generated for each input basic unit using a first neural network model to indicate whether that input basic unit is a predetermined basic unit containing predetermined information.
[0032] As an example, consider the case where the input data is the sentence "His phone number is 717-823-8477" as text data. This input data is pre-divided into four basic input units (i.e., four tokens): "his", "phone number", "is", and "717-823-8477", and input into the first neural network model. Assuming that "717-823-8477" is the actual phone number of a person, if "717-823-8477" is included in the output of the large-scale model, there is a possibility of leakage of the person's privacy. On the other hand, "his", "phone number", and "is" do not cause leakage of certain information such as privacy. The first neural network model automatically identifies that "717-823-8477" contains the predetermined information, that is, it automatically identifies "717-823-8477" as the predetermined basic unit, and generates an indicator that it is that predetermined basic unit. Furthermore, for base units that do not contain the specified information, such as "his," "telephone number," and "is," an indicator will be generated to show that the base unit is not the specified base unit.
[0033] Here, the input data "His phone number is 717-823-8477" is merely an example, and the four divided input base units are also simplified examples for the sake of explanation. Actual input base units may differ from the example above.
[0034] In step S120, a second neural network model is used to generate output data based on the input data and indicators. The output data includes one or more output base units, each output base unit being different from a predetermined base unit.
[0035] In other words, the second neural network model, when generating results based on an indicator that shows a predetermined base unit and the input data, suppresses the inclusion of the predetermined base unit in the results. Here again, let's take the aforementioned "His phone number is 717-823-8477" as an example of input data. Based on the indicator generated by the first neural network model, the second neural network model recognizes "717-823-8477" as the predetermined base unit. In that case, it does not output a result that includes the predetermined base unit, such as "His phone number is 717-823-8477. Please contact him at this phone number..." Instead, it outputs a result that does not include the predetermined base unit, such as "His phone number is 617-923-5437. Please contact him at this phone number...", while maintaining the same output quality as before. Here, let's assume that 617-923-5437 is not an actual phone number, but a random fake number.
[0036] As a result, certain information is not included in the results generated by the second neural network model, but the second neural network model is still capable of generating realistic results.
[0037] Here, we will explain using an example where the input data contains multiple input base units, one of which is a predetermined base unit. However, naturally, the input data may contain only one input base unit. Furthermore, the multiple input base units may include multiple predetermined base units.
[0038] The first neural network model 200 and the second neural network model 300 used in the data generation method 100 will be described below.
[0039] Figure 2 schematically shows the configuration of a first neural network model 200 according to an embodiment of the present disclosure. As shown in Figure 2, the first neural network model 200 is a neural network model trained on a self-supervised basis. It includes a first submodel 210 that generates an indicator for each input base unit indicating whether or not it is a predetermined base unit, and a second submodel 220 that generates output data for the second submodel 220 based on one or more input base units and the indicator for each input base unit.
[0040] Here, the first submodel 210 and the second submodel 220 may be neural network models that implement self-supervised learning. In one embodiment, the first submodel 210 and the second submodel 220 may each be Transformer models, but their implementation is clearly not limited to these, and other suitable autoregressive models may be employed.
[0041] Specifically, one or more input base units of the input data are input to the first submodel 210. The first submodel 210 determines whether each input base unit is a predetermined base unit, generates an indicator to show that the input base unit is a predetermined base unit for input base units that are predetermined base units, and generates a different indicator for input base units that are not predetermined base units. The second submodel 220 may reconstruct the input data based on the predetermined base units determined by the first submodel 210.
[0042] In one embodiment, the indicator indicating a predetermined base unit may be "1", and the indicator indicating that it is not a predetermined base unit may be "0". In this case, the indicator may be treated as a mask of the input base units, and the input data may be reconstructed in the second submodel 220. More specifically, each input base unit (in vector form) may be multiplied by its corresponding indicator using scalar multiplication, and each resulting input base unit may be input to the second submodel 220.
[0043] Indicators corresponding to each basic input unit of the input data may be used in the subsequent processing of a second neural network model. Details will be described later.
[0044] As an example, consider the case in Figure 2 where the input data is "His phone number is 717-823-8477". The first submodel 210 determines that "717-823-8477" is the predetermined base unit among the four base units of this input data: "his", "phone number", "is", and "717-823-8477", and generates a corresponding indicator ("1" in Figure 2). On the other hand, for "his", "phone number", and "is", which are not predetermined base units, it generates an indicator ("0" in Figure 2) that is different from the indicator for the predetermined base unit. In this case, "his", "phone number", and "is", which are not predetermined base units, are each multiplied by "0" scalar multiplier, resulting in a vector composed of zeros. This is represented as "--" in Figure 2. The second submodel 220 does not reconstruct the input data based on these, but rather reconstructs (or reconstructs) "His phone number is 717-823-8477" based on "717-823-8477".
[0045] Here, if the first submodel 210 determines too many predetermined base units, those excess units are suppressed so as not to be included in the output of the second neural network model 300. This affects the quality of the output of the second neural network model 300. On the other hand, if the first submodel 210 determines too few predetermined base units, it may miss some predetermined base units in the input data. As a result, the second submodel 220 may not be able to accurately reconstruct the input data. Furthermore, the output of the second neural network model 300 will still contain predetermined information that is considered privacy violations, biases, or infringements.
[0046] In contrast, in one embodiment, the loss function used to train the first neural network model 200 may be a weighted sum of the first loss function and the second loss function. Here, the first loss function represents the number of predetermined base units, and the second loss function represents the difference between the output data and input data of the second submodel 220.
[0047] Specifically, for each input base unit, an indicator value of "1" may indicate that the input base unit is a predetermined base unit, and an indicator value of "0" may indicate that the input base unit is not a predetermined base unit. The first loss function described above may also be the sum of the indicator values for each input base unit.
[0048] More specifically, the first loss function may be expressed by the following equation (1).
number
[0049] Here, L1 is the first loss function, i is the number of the current input base unit, j is the total number of input base units in the input data, and M i,j This indicates the indicator value for the i-th input base unit.
[0050] As a result, the value of the loss function L1 increases if the number of predetermined base units determined by the first submodel 210 is large. By using this first loss function L1 to monitor the number of predetermined base units, the accuracy of the determined predetermined base units is improved.
[0051] The second loss function described above may also be the vector distance between the output data and input data of the second submodel 220. Here, the data output by the second submodel 220 based on predetermined base units is, of course, also composed of base units. Therefore, the magnitude of the difference between the data output by the second submodel 220 and the original input data can be determined by the vector distance. Here, the vector distance may be the Euclidean distance, Manhattan distance, Hamming distance, etc., but is not limited to these.
[0052] In one embodiment, the second loss function may be expressed by the following equation (2).
number
[0053] Here, L2 represents the second loss function, and X represents the input data.
number
[0054] By using such a loss function L2, it is possible to manage the completeness of the predetermined base units determined by the first submodel 210. In other words, if the first submodel 210 misses a predetermined base unit, it becomes difficult for the second submodel 220 to reconstruct the input data. As a result, the vector distance between the output result and the input data increases, that is, the value of L2 increases.
[0055] Based on this, the overall loss function used to train the first neural network model 200 may be expressed by equation (3) below. L M1 =w1*L1+w2*L2(3)
[0056] Here, L M1The following shows the overall loss function used to train the first neural network model 200. w1 and w2 are the weights of the first loss function L1 and the second loss function L2, respectively. These weights are used to adjust the ratio relationship between the first loss function L1 and the second loss function L2 and may be set manually before training.
[0057] Such a loss function L M1 By constructing and optimizing the first neural network model 200 during training, the trained first neural network model 200 can achieve both accuracy and comprehensiveness in identifying predetermined basic units. Furthermore, the first neural network model 200 can determine whether or not predetermined information is contained at a finer granularity than the input data, such as the input basic unit. Therefore, compared to conventional methods that suppress the output of predetermined information by large-scale models, the impact on the quality of the output of the second neural network model 300 is smaller.
[0058] Of course, the first loss function L1, the second loss function L2, and the loss function L mentioned above are also relevant. M1 This is merely an example, and any appropriate loss function may be used as long as the first neural network model 200 can achieve both accuracy and comprehensiveness of a given basic unit. For example, the second loss function L2 described above is not limited to the vector distance between the data output by the second submodel 220, represented by equation (2), and the input data. The second loss function may also be based on other metrics that can measure the difference between the data output by the second submodel 220 and the input data, such as log-likelihood, mean square error (MSE), root mean square error (RMSE), correlation coefficient, etc. Furthermore, the loss function L of the first neural network model 200 M1 The equation is not limited to equation (3) described above; for example, a regularization term to control the complexity of the first neural network model 200 may be added to equation (3).
[0059] Furthermore, the indicators generated by the first neural network model 200 for each input base unit are not limited to 1 and 0, nor are they limited to numerical values. Various appropriate indicators may be used as long as they can clearly distinguish the predetermined base unit. For example, the first neural network model 200 may generate an indicator in the form of a character or string if the input base unit is a predetermined base unit, and generate an indicator in the form of a different character or string if it is not a predetermined base unit. In this case, the second submodel 220 only needs to accept input base units that have an indicator indicating that they are a predetermined base unit as input. The first loss function L1 described above should then count the indicators that indicate that they are a predetermined base unit.
[0060] Figure 3 shows a schematic diagram of a data generation method according to an embodiment of the present disclosure. As shown in Figure 3, the first neural network model 200 generates indicators for each input basic unit in the input data based on the input data. The second neural network model 300 is fine-tuned based on the input data and the indicators generated by the first neural network model 200 so that predetermined basic units are not included in the output data. The second neural network model 300 will be described below.
[0061] In one embodiment, the second neural network model 300 may be a pre-trained generative neural network model. For example, the second neural network 300 may be a large-scale language model, a large-scale multimodal model, etc. Such large-scale models may be pre-trained. Fine-tuning allows them to adapt to new tasks with relatively little training. The second neural network model 300 may also be a generative model. A generative model captures the probability distribution in the hidden space of the training data and can specify the output by conditional probability when generating data. When generating sequential data such as text, images, or audio, the second neural network model 300 may generate one basic output unit for each time step. The basic output unit generated at each time step may be specified by a conditional probability that is conditional on the basic output unit generated in the previous time step. For example, suppose a large-scale model can generate 5000 different output base units at timestep t (i.e., there are 5000 candidate output base units at timestep t). t-1 Under the conditions under which the output units are generated, these 5000 different candidate output units each correspond to one conditional probability, forming a probability distribution for time step t. In one embodiment, the second neural network model 300 selects the candidate output unit with the highest probability in this probability distribution as the output unit for time step t. The method by which the second neural network model 300 generates the output unit for time step t described above is known and is merely an example. The second neural network model 300 may employ any suitable method to identify the output unit for time step t.
[0062] In one embodiment, the second neural network model 300 is fine-tuned so that at each key time step, the probability of a predetermined base unit is minimized within the probability distribution for selecting the output base unit. Furthermore, the change in the probability distribution of other candidate output base units different from the predetermined base unit is minimized before and after fine-tuning.
[0063] Here, the key time step may be a time step that generates an output base unit corresponding to the position of a predetermined base unit indicated by an indicator. Specifically, it may be identified by an indicator generated by the first neural network model 200 described above for each input base unit. In each time step in which the second neural network model 300 generates an output base unit based on each input base unit of the input data, the order (position) of the key time step in all time steps corresponds to the position of the indicator that indicates a predetermined base unit among the indicators generated by the first neural network model 200 for each input base unit of the input data. As mentioned above, the input data may contain one or more predetermined base units, and accordingly, there may also be one or more key time steps.
[0064] As an example, the first neural network model 200 uses an indicator M for input data containing four basic input units: "his", "phone number", "is", and "717-823-8477". i,4 Assume that the result is [0,0,0,1]. Here, "717-823-8477" is a predetermined base unit. In this case, the second neural network model 300 can identify the fourth input base unit as the predetermined base unit based on this indicator. Then, among the multiple time steps that generate the output base unit based on this input data, the fourth time step is designated as the key time step, and fine tuning is performed in this fourth time step to minimize the probability of the predetermined base unit mentioned above.
[0065] At each key time step, the output of a predetermined base unit by the second neural network model 300 can be suppressed by minimizing the probability of that base unit in the probability distribution for selecting the output base unit. However, simultaneously changing the probability of the predetermined base unit may also change the probabilities of other candidate output base units in the probability distribution, which can affect the subsequent generation procedure of the large-scale model and cause quality degradation problems in the output of the large-scale model, such as grammatical errors and disordered word order. Therefore, by minimizing the change in the probability distribution of other candidate output base units different from the predetermined base unit before and after fine-tuning, the quality of the generation results of the second neural network model 300 can be ensured.
[0066] Therefore, in the fine tuning of the second neural network model 300 according to the embodiment of this disclosure, consideration is given to minimizing the probability of a predetermined base unit in the probability distribution at key time steps. Furthermore, consideration is also given to minimizing the change in the probability distribution of the probabilities of other candidate output base units before and after the fine tuning of minimizing the probability of that predetermined base unit.
[0067] In other words, in one embodiment, during fine tuning, a loss function is calculated at a key time step, consisting of a weighted sum of a third loss function and a fourth loss function. The third loss function represents the probability that the output base unit generated at the key time step is a predetermined base unit, and the fourth loss function represents the difference between the probability distribution of other candidate output base units before fine tuning and the probability distribution after fine tuning at the key time step.
[0068] This makes it possible to ensure the quality of the results generated by large-scale models while suppressing the output of predetermined basic units at key time steps.
[0069] Specifically, in one embodiment, the third loss function may be the log-likelihood of the probability of generating a predetermined basic unit at the key time step. For example, the third loss function may be represented by the following equation (4).
Number
[0070] Here, L3 is the third loss function, θ is the parameter of the second neural network model, t is the key time step, S is the set of key time steps, and x indicates the output basic unit. P θ (x t |x1,…,x t-1 ) represents the probability that the output basic unit x generated by the second neural network model at time step t is a predetermined basic unit. t
[0071] Therefore, by optimizing the third loss function in the training procedure, the probability that the generated output basic unit is a predetermined basic unit can be minimized. As a result, it is possible to suppress the output of the predetermined basic unit by the second neural network model 300.
[0072] In one embodiment, the fourth loss function is the Kullback-Leibler Divergence (KL divergence) between the probability distribution of other candidate output basic units before fine-tuning and the probability distribution of other candidate output basic units after fine-tuning at the key time step. The KL divergence is a measure indicating the difference between two probability distributions. Generally, the fourth loss function may be represented by the following equation (5).
Number
[0073] Here, L4 is the fourth loss function, θ is the parameter of the second neural network model, t is the key time step, and D KL () indicates the calculation of the KL divergence. xt 1 ,…,x t n This is a predetermined base unit x that can be output at key time step t. t * Shows other candidate output base units different from the one shown. n indicates the number of other candidate output base units at time step t. Mask(x t * ) is a given base unit x in a probability distribution. t * This demonstrates masking the probability of [something].
number
number
[0074] This allows the fourth loss function L4 to be optimized during the training procedure, minimizing the change in the probability distribution formed by the probabilities of other candidate output base units in the corresponding time step before and after the probability of a given base unit is minimized. This minimizes the influence on the second neural network model 300 when it selects the output base unit in the current time step and the output base units in subsequent time steps based on the probability distribution, thereby ensuring the quality of the output generated by the second neural network model 300.
[0075] Based on this, the overall loss function used in training (fine-tuning) the second neural network model 300 may be expressed by the following equation (6). L M2 =w 3* L3+ w 4* L4(6)
[0076] Here, L M2 This shows the entire loss function used to train the second neural network model 300. w3 and w4 are the weights of the third loss function L3 and the fourth loss function L4, respectively. These weights are used to adjust the ratio relationship between the third loss function L3 and the fourth loss function L4 and may be set manually before training.
[0077] This results in such a loss function L M2 By constructing and optimizing this during training, it is possible to ensure the quality of the generated results while suppressing the output of predetermined basic units by the second neural network model 300.
[0078] Of course, the third loss function L3, the fourth loss function L4, and the loss function L mentioned above are also relevant. M2This is merely an example, and any appropriate loss function may be used as long as the second neural network model 300 can achieve both the suppression of the output of a predetermined base unit and the assurance of the quality of the generated result. The third loss function L3 does not have to adopt the log-likelihood of the probability of generating a predetermined base unit. For example, 1 minus the probability of generating a predetermined base unit may be simply adopted as the third loss function L3. Also, the fourth loss function L4 is not limited to adopting KL divergence, but may be based on, for example, cross-entropy or JS divergence. Loss function L used in fine tuning of the second neural network model 300 M2 The equation is not limited to equation (6) described above; for example, a regularization term to control the complexity of the second neural network model 300 may be added to equation (6).
[0079] Using the specific examples from the above explanation, we will now explain in detail the fine-tuning of the second neural network model. For the four basic input units included in the input data, "his", "telephone number", "is", and "717-823-8477", the second neural network model 300 uses an indicator M from the first neural network model 200 to indicate that "717-823-8477" is a predetermined basic unit. i,4The result is [0,0,0,1]. Since time steps t1 to t3 are not key time steps, the second neural network model 300 does not perform fine tuning and generates the output base units "his", "phone number", and "is" at t1 to t3, respectively. Since time step t4 is a key time step, the second neural network model 300 fine-tunes the probability of a given base unit "717-823-8477" in the probability distribution of time step t4. That is, it is assumed that the candidate output base units for time step t4 are "717-823-8477", "617-923-5437", "Zhang San", and "A City", and that the corresponding probability distributions are {0.4, 0.3, 0.25, 0.05}. In this case, during fine tuning, the probability of the predetermined base unit "717-823-8477" (0.4) is minimized, and the changes in the probabilities {0.3, 0.25, 0.05} of "617-923-5437", "Zhang San", and "City A" in the probability distribution before and after fine tuning are minimized. For example, the probability distribution after fine tuning may be {0.5, 0.3, 0.19, 0.01}, where each probability is the probability of "617-923-5437", "Zhang San", "City A", and "717-823-8477", respectively. At this time, if the second neural network model 300 selects the candidate output base unit with the highest probability in the probability distribution, it may generate "617-923-5437" instead of the predetermined base unit "717-823-8477" at key time step t4. Subsequently, the second neural network model 300 may continue to generate output base units in subsequent time steps t5 and beyond, based on the output base unit "617-923-5437" generated after fine-tuning in key time step t4. This suppresses the second neural network model 300 from generating results containing a predetermined base unit, thereby avoiding the leakage of the actual telephone number "717-823-8477".
[0080] In the above explanation, we used an example where both the data processed by the first neural network model 200 and the second neural network model 300 were text. However, as mentioned above, the data processed by the first neural network model 200 and the second neural network model 300 are not limited to text, but may be other types of data such as images or audio.
[0081] For example, consider the following case. The second neural network model 300 is a model that can receive a prompt and output an image. If it is found that the image generated by the second neural network model 300 contains infringing content, the image is divided into patches. The first neural network model 200 then generates an indicator that shows which patch in the image contains the predetermined infringing information. Subsequently, when the second neural network model 300 receives the same prompt again, it ensures that no patch containing the predetermined infringing information appears in the generated image. In this case, both the input data for the first neural network model 200 and the second neural network model 300 may be images (the second neural network model 300 also needs to receive prompts). The basic unit in the above embodiment may be the smallest unit of image data processed by the neural network model, i.e., a patch.
[0082] For example, consider the following case: The second neural network model 300 is a model that can receive prompts and generate audio. If it is found that the audio generated by the second neural network model 300 contains discriminatory content, the audio is divided into frames. The first neural network model 200 then generates an indicator that shows which frame in the audio contains discriminatory content. Subsequently, when the second neural network model 300 receives the same prompt again, it ensures that no frames containing discriminatory content appear in the output audio. In this case, both the input data for the first neural network model 200 and the second neural network model 300 may be audio (the second neural network model 300 also needs to receive prompts). The basic unit in the above embodiment may be the smallest unit of audio data processed by the neural network model, i.e., a frame.
[0083] The processing of multimodal data as described above may be achieved by conventional techniques. Such techniques ensure that the model is not limited by the type of input data by converting the basic units of the input data into latent features. That is, the first neural network model 200 and the second neural network model 300 may be supplemented with modules that perform type conversion processing for input data of different data types. For example, image patches or audio frames may be converted into text tokens.
[0084] The data generation method relating to the embodiments of this disclosure has been described in detail above.
[0085] According to one aspect of this disclosure, a data generation device 400 is further provided. Figure 4 shows a schematic diagram of the configuration of the data generation device 400 according to an embodiment of this disclosure.
[0086] As shown in Figure 4, the data generation device 400 of this embodiment includes a processor 410 and a memory 420. One or more computer programs are stored in the memory 420.
[0087] The processor 410 is a program-controlled device such as a microprocessor, and operates according to a program stored in, for example, the memory 420. The memory 420 is a memory element such as ROM or RAM. The memory 420 stores a program that the processor 410 and the like execute. The data generation device 400 shown in Figure 4 can be used to implement the data generation method according to the embodiment of this disclosure.
[0088] According to one aspect of this disclosure, a computer program product including a computer program is further provided. When the computer program is executed by a processor, the data generation method according to the embodiment of this disclosure can be realized.
[0089] The hardware computing devices described in this disclosure, either as a whole or as components thereof, may be implemented by a variety of suitable hardware means, including but not limited to FPGAs, ASICs, SoCs, discrete gates or transistor logic, discrete hardware components, or any combination thereof. The devices, equipment, methods, and systems relating to this disclosure are not limited to any particular hardware architecture or configuration. The components of the disclosed devices, equipment, and systems may be separate or integrated, combined in different ways, and / or replaced or supplemented by other components. It should be understood that the teachings in this disclosure can be implemented in various forms, such as hardware, software, firmware, dedicated processors, or combinations thereof.
[0090] The block diagrams of the apparatus, equipment, methods, and systems relating to this disclosure are merely illustrative and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will understand, these circuits, devices, apparatus, equipment, and systems may be connected, arranged, and configured in any manner that achieves the desired purpose.
[0091] In the above description, the present invention has been explained based on examples. These examples are for illustrative purposes only, and it should be understood by those skilled in the art that the combinations of components and processes of these examples can be modified in various ways, and that such modifications are also within the scope of the present invention.
Claims
1. For input data containing one or more input base units, a first neural network model is used to generate an indicator for each input base unit indicating whether that input base unit is a predetermined base unit containing predetermined information. This includes generating output data based on the input data and the indicator using a second neural network model, The output data includes one or more basic output units, and each basic output unit is different from the predetermined basic unit. Data generation method.
2. The first neural network model described above is For each of the aforementioned input base units, a first submodel that generates the indicator, A second submodel that generates output data for a second submodel based on one or more input base units and the indicators of each input base unit, A data generation method according to claim 1, including the following:
3. The loss function used to train the first neural network model is a weighted sum of the first loss function and the second loss function. The first loss function indicates the number of predetermined base units, The second loss function represents the difference between the output data and the input data of the second submodel. The data generation method according to claim 2.
4. For each of the aforementioned input base units, if the value of the indicator is 1, it indicates that the input base unit is the predetermined base unit; if the value of the indicator is 0, it indicates that the input base unit is not the predetermined base unit. The first loss function is the sum of the indicators for each of the input base units. The data generation method according to claim 3.
5. The second loss function is the vector distance between the output data and the input data of the second submodel. The data generation method according to claim 3.
6. The second neural network model is a pre-trained generative neural network model. The data generation method according to claim 1.
7. The second neural network model, through fine-tuning, minimizes the probability of the predetermined base unit in the probability distribution for selecting the output base unit at each key time step, and minimizes the change in the probability of other candidate output base units different from the predetermined base unit in the probability distribution before and after the fine-tuning. The key time step is a time step that generates an output base unit corresponding to the position of the predetermined base unit indicated by the indicator. The data generation method according to claim 6.
8. In the fine tuning described above, a loss function is calculated at the key time step, which is composed of a weighted sum of the third loss function and the fourth loss function. The third loss function represents the probability that the output base unit generated in the key time step is the predetermined base unit. The fourth loss function represents the difference between the probability distribution of the other candidate output base units before fine-tuning and the probability distribution after fine-tuning at the key time step. The data generation method according to claim 7.
9. The third loss function is the log-likelihood of the probability of generating the predetermined base unit at each key time step. The data generation method according to claim 8.
10. The fourth loss function is the KL divergence between the probability distribution of the other candidate output base units before fine-tuning and the probability distribution of the other candidate output base units after fine-tuning, at the key time step. The data generation method according to claim 8.
11. The aforementioned input data is text, The aforementioned input base unit is a token. A data generation method according to any one of claims 1 to 10.
12. The aforementioned input data is an image, The aforementioned input base unit is a patch of the aforementioned image. A data generation method according to any one of claims 1 to 10.
13. The aforementioned input data is audio. The aforementioned input basic unit is the audio frame. A data generation method according to any one of claims 1 to 10.
14. Processor and A memory for storing one or more computer programs, including When one or more of the aforementioned computer programs are executed by the processor, the data generation method according to any one of claims 1 to 10 is executed by the processor. Data generation device.
15. Including computer programs, When the computer program is executed by the processor, the data generation method according to any one of claims 1 to 10 is executed. Computer program products.