A data processing method and apparatus

By introducing prompts for sample sub-sampling and training parameter management into large-scale pre-trained models, the issues of training data compliance and legality are resolved, thereby improving model training effectiveness and data usage compliance.

CN117171567BActive Publication Date: 2026-07-14联想诺谛(北京)智能科技有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
联想诺谛(北京)智能科技有限公司
Filing Date
2023-08-31
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing large-scale pre-trained models lack constraints on training data management during the training process, leading to non-compliant and legal issues in data use, which affects the model training effect and the rights and interests of data owners.

Method used

By introducing prompts during data processing, data is categorized into positive, normal, and negative samples based on constraints. The corresponding training parameters are then determined based on these prompts, controlling the model training process to meet data usage agreements and ensuring compliance and legality.

Benefits of technology

This approach achieves improved model evaluation metrics, protects the rights of data owners, and ensures the legality and compliance of model training while meeting data usage constraints.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117171567B_ABST
    Figure CN117171567B_ABST
Patent Text Reader

Abstract

The application discloses a data processing method and device, the method comprises: obtaining to be applied data, the to be applied data includes original data and the prompt information corresponding to the original data; determining the prompt information based on the original data for target task processing, the prompt information represents the constraint condition for the target task processing through the original data; determining the initial model for the target task processing and the training parameter corresponding to the initial model according to the prompt information representing the constraint condition, the training parameter can affect the promotion rate of the model evaluation index; training the initial model using the training parameter through the original data to obtain the target task processing model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data processing method and apparatus. Background Technology

[0002] Currently, there are more and more content generation artificial intelligence (AI) applications based on large-scale pre-trained models (LLM), such as image generation, text generation, video generation, and music generation applications.

[0003] The large amount of training data used by large-scale pre-trained models during pre-training is mostly open-source corpora scraped from the Internet. Summary of the Invention

[0004] This application provides a data processing method, apparatus, electronic device, and computer-readable storage medium.

[0005] According to a first aspect of the embodiments of this application, a data processing method is provided. The method includes: obtaining data to be applied, the data to be applied including raw data and prompt information corresponding to the raw data; determining prompt information for target task processing based on the raw data, the prompt information representing the constraints for target task processing through the raw data; determining an initial model for target task processing and training parameters corresponding to the initial model based on the prompt information representing the constraints, the training parameters being able to affect the improvement rate of the model evaluation index; and training the initial model using the training parameters through the raw data to obtain a target task processing model.

[0006] According to one embodiment of this application, the data to be applied is divided into at least one of positive samples, ordinary samples, and negative samples according to the prompt information. Accordingly, the training parameters corresponding to the initial model for target task processing are determined according to the prompt information representing the constraint conditions, including at least one of the following: the training parameter determined according to the prompt information corresponding to the positive sample is a first value; the training parameter determined according to the prompt information corresponding to the ordinary sample is a second value; the training parameter determined according to the prompt information corresponding to the negative sample is a third value; the first value is greater than the second value, and the second value is greater than the third value.

[0007] According to an embodiment of this application, determining the prompt information for target task processing based on the original data includes: constraints indicating that the original data is used for training an initial model for any target task processing; for training an initial model for any target task processing, determining the prompt information of the original data as a first prompt information; and correspondingly, determining the data to be applied containing the original data as a positive sample based on the first prompt information.

[0008] According to one embodiment of this application, training an initial model using training parameters with raw data to obtain a target task processing model includes: training an initial model using training parameters with first values ​​with raw data corresponding to positive samples to obtain a target task processing model.

[0009] According to one embodiment of this application, determining the prompt information for target task processing based on the original data includes: constraints indicating that the original data cannot be used for training the initial model of any target task processing; for training the initial model of any target task processing, determining the prompt information of the original data as a second prompt information; accordingly, determining the data to be applied containing the original data as a negative sample based on the second prompt information.

[0010] According to one embodiment of this application, training an initial model using training parameters with raw data to obtain a target task processing model includes: training an initial model using training parameters with third values ​​with raw data corresponding to negative samples to obtain a target task processing model.

[0011] According to one embodiment of this application, determining the prompt information for target task processing based on the original data includes: constraints indicating that the original data is used for training an initial model for at least one specified target task processing; for training the initial model for the specified target task processing, the prompt information for the original data is determined as a third prompt information; for training the initial model for a non-specified target task processing, the prompt information for the original data is determined as a fourth prompt information; accordingly, the data to be applied containing the original data is determined as a positive sample based on the third prompt information; and the data to be applied containing the original data is determined as a negative sample based on the fourth prompt information.

[0012] According to one embodiment of this application, training an initial model using training parameters with raw data to obtain a target task processing model includes: training an initial model using training parameters with a first value with raw data corresponding to positive samples, and training an initial model using training parameters with a third value with raw data corresponding to negative samples to obtain a target task processing model.

[0013] According to one embodiment of this application, determining the prompt information for target task processing based on the original data includes: constraints indicating that the original data is used for training an initial model for at least one specified target task processing, and the similarity between the output of the target task and the original data is lower than a similarity threshold; for training the initial model for the specified target task processing, the prompt information for the original data is determined as the fifth prompt information; when training an initial model for a non-specified target task processing, the prompt information for the original data is determined as the fourth prompt information; correspondingly, the application data containing the original data is determined to be ordinary samples according to the fifth prompt information; the application data containing the original data is determined to be negative samples according to the fourth prompt information; correspondingly, training the initial model using training parameters with the original data to obtain the target task processing model includes: training the initial model using training parameters with a second value with the original data corresponding to ordinary samples, and training the initial model using training parameters with a third value with the original data corresponding to negative samples to obtain the target task processing model.

[0014] According to one embodiment of this application, the method further includes: determining the data to be processed; and performing target task processing on the data to be processed using a target task processing model.

[0015] According to a second aspect of the embodiments of this application, a data processing apparatus is provided, comprising: a data to be applied acquisition module, configured to acquire data to be applied, the data to be applied including raw data and prompt information corresponding to the raw data; a prompt information determination module, configured to determine prompt information for target task processing based on the raw data, the prompt information representing constraints for target task processing using the raw data; a training parameter determination module, configured to determine an initial model for target task processing and training parameters corresponding to the initial model based on the prompt information representing constraints, the training parameters being able to affect the improvement rate of model evaluation indicators; and a model training module, configured to train the initial model using the training parameters using the raw data to obtain a target task processing model.

[0016] According to a third aspect of the present application, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; and a processor configured to read executable instructions from the memory and execute the instructions to implement the data processing method described above.

[0017] According to a fourth aspect of the present application, a computer-readable storage medium is provided, the storage medium storing a computer program for performing any of the above-described data processing methods. Attached Figure Description

[0018] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of this application are illustrated in the drawings by way of example and not limitation, in which:

[0019] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.

[0020] Figure 1 This is a schematic diagram illustrating the basic process of implementing the processing method according to an embodiment of this application;

[0021] Figure 2 This is a schematic diagram illustrating the basic process of implementing the processing method according to another embodiment of this application;

[0022] Figure 3 This is a schematic diagram of the composition of the data processing device according to an embodiment of this application. Detailed Implementation

[0023] To make the objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0024] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of those different embodiments or examples.

[0025] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0026] The data processing method in this application is mainly applied to downstream task processing of large-scale pre-trained model LLM, especially in the process of training the model for downstream task processing using raw data.

[0027] Training an LLM model can yield various models for different purposes, such as sentiment classification models for sentiment classification tasks, topic recognition models for topic recognition tasks, and text generation models for text generation tasks. These sentiment classification, topic recognition, and text generation tasks are downstream tasks relative to the LLM model.

[0028] Figure 1 The basic flow of a data processing method implemented according to an embodiment of this application is shown. (Reference) Figure 1 The method includes:

[0029] Operate S110 to obtain the data to be applied, which includes the original data and the corresponding prompt information.

[0030] Raw data refers to various data or corpora collected through various means for the model training process for downstream task processing, such as: open source data or corpora scraped from the Internet; commercial data or corpora obtained from data providers; data or corpora obtained from individual users, etc.

[0031] The prompts corresponding to the raw data indicate the constraints for training the model using the raw data.

[0032] For example, the prompt message corresponding to the original data is "sentiment classification", indicating that the original data can be used to train a model for the downstream task of sentiment classification (i.e., sentiment classification model).

[0033] If the prompt message corresponding to the original data is "topic recognition", it means that the original data can be used to train the model for the downstream task of topic recognition (i.e., subject recognition model).

[0034] If the prompt message corresponding to the original data is "text generation", it indicates that the original data can be used to train a model whose downstream task is text generation (i.e., a text generation model).

[0035] Operation S120 determines the prompt information for processing the target task based on the original data. The prompt information represents the constraints for processing the target task using the original data.

[0036] The target task refers to the downstream task to be performed.

[0037] The prompt message can be determined based on the data usage agreement and authorization policy corresponding to the original data. The data usage agreement and authorization policy are used to determine the content of the prompt message. They can be agreed upon in advance by the owner and user of the original data, preset in the system configuration or data storage system, and associated with the original data.

[0038] The prompts can be natural language describing the constraints, such as "sentiment classification," "topic recognition," or "text generation"; or they can be specific symbols representing the constraints, such as "C1," "C2," or "C3." Once the computer recognizes these natural language or specific symbols representing the constraints, it can map them to the constraints used for processing the target task with the raw data, as well as a series of variables and their values ​​corresponding to those constraints. This disclosure does not limit the form of the prompts.

[0039] For the target task, this embodiment can further classify the data to be applied into at least one of positive samples, ordinary samples, and negative samples based on the prompt information. Specifically, when the prompt information determines that the original data is unconditionally allowed to be used for model training in the target task, the data to be applied containing the original data and the prompt information is a positive sample; when the prompt information determines that the original data is conditionally allowed to be used for model training in the target task, the data to be applied containing the original data and the prompt information is an ordinary sample; and when the prompt information determines that the original data is not allowed to be used for model training in the target task, the data to be applied containing the original data and the prompt information is a negative sample.

[0040] Operation S130 determines the initial model for the target task processing and the corresponding training parameters based on the prompts for the representation constraints. The training parameters can affect the improvement rate of the model evaluation index.

[0041] LLM has a very large set of model parameters. Different model parameters correspond to different neurons in the neural network. The model parameters (neurons) corresponding to each downstream task will also be different, but they are all a subset of the very large set of model parameters.

[0042] Determine the initial model for the target task processing, which means activating the model parameters (neurons) corresponding to the target task so that LLM can perform the corresponding model training.

[0043] It should be noted that the above-mentioned model evaluation metrics are used to evaluate model quality and performance, such as accuracy (ACC), precision per unit volume (PPV), sensitivity (TPR), specificity (TNR), F1 score, log loss (LogLoss), and the area under the ROC and AUC curves. The improvement rate of model evaluation metrics characterizes the degree of improvement of each evaluation metric after initial model training compared to before model training. It can be calculated using the following formula: Improvement rate of model evaluation metrics = (Evaluation metric value after model training - Evaluation metric value before model training) / Evaluation metric value before model training.

[0044] Training parameters differ from model parameters. They are not part of the model itself and do not affect its behavior or output. They are only used to control the model training process and the trend of model evaluation metrics. Here, training parameters specifically refer to those training parameters that can affect the improvement rate of model evaluation metrics, such as the learning rate or loss function. The initial training parameters for the model can be flexibly set as needed to control the impact of the raw data on the model evaluation metrics.

[0045] Based on the above division of positive samples, normal samples, and negative samples, and according to the hints from the representation constraints, the training parameters corresponding to the initial model are determined, including at least one of the following:

[0046] The training parameters determined based on the prompt information corresponding to the positive samples are the first values;

[0047] The training parameters determined based on the prompts corresponding to ordinary samples are the second values;

[0048] The training parameters determined based on the prompts corresponding to the negative samples are the third values;

[0049] The first value is greater than the second value, and the second value is greater than the third value.

[0050] The correspondence between the prompts representing different constraints and the training parameter values ​​is usually pre-set and stored in a configuration file or data storage system. Thus, when it is necessary to determine the training parameters corresponding to the initial model based on the prompts representing the constraints, these parameters can be directly retrieved from the configuration file or data storage system.

[0051] As can be seen, classifying the data to be applied into positive samples, ordinary samples, and negative samples according to the prompt information helps in determining the training parameters used for model training. Positive samples correspond to the first value, negative samples to the second value, and ordinary samples to the third value. However, this differs from the method of determining the training parameters corresponding to the original data. Currently, when training a model using original data, the original data has no constraints, and the training parameters can be determined according to other needs of model training. The example disclosed in this publication, however, essentially determines the training parameters for model training using the original data based on the prompt information representing the constraints of the application of the original data, namely the limitations of positive samples, ordinary samples, and negative samples. It should be noted that the limitation of classifying the data to be applied into positive samples, ordinary samples, and negative samples here is not directly related to the attribute of the original data as positive or negative samples.

[0052] Operation S140 trains the initial model using the training parameters with the raw data to obtain the target task processing model.

[0053] In this embodiment, since the training parameters used to train the initial model using raw data are determined based on the prompts of the representation constraints, the learning speed of the model and the improvement rate of the model evaluation metrics can be controlled according to the constraints negotiated with the owner of the raw data during the model training process. This ensures that the use of the raw data meets the corresponding constraints. Thus, the rights and interests of the owner of the raw data can be better protected, ensuring the compliance and legality of the use of the raw data.

[0054] In the above example, the prompt message represents the constraint condition, which is determined based on the data usage agreement or authorization policy, meaning that the constraint condition is contained within the data usage agreement or authorization policy information. This disclosure provides the following types of constraint conditions (data usage agreements or authorization policies) and corresponding prompt messages:

[0055] 1. If the constraint condition indicates that the original data is used for training the initial model for any target task, then the prompt information of the original data is the first prompt information for training the initial model for any target task.

[0056] If the original data can be used for model training of all tasks, then the data to be applied, which includes the original data and the first prompt information, is a positive sample for model training of any target task. Therefore, the data to be applied is determined to be a positive sample based on the first prompt information.

[0057] Accordingly, when training the model: the initial training parameters of the target task model can be determined as the first value based on the first prompt information of the data to be applied, and the target task processing model is obtained after training using the original data in the data to be applied.

[0058] 2. The constraint condition indicates that the original data cannot be used for training the initial model for any target task. For training the initial model for any target task, the prompt information for the original data is the second prompt information.

[0059] If the original data cannot be used for training any model, then the data to be applied, which contains the original data and the second prompt information, is a negative sample for training any target task model. Therefore, the data to be applied is determined to be a negative sample based on the second prompt information.

[0060] Accordingly, when training the model: based on the second hint information of the data to be applied, the training parameters of the initial model for the target task can be determined as the third value, and the target task processing model is obtained after training using the original data in the data to be applied.

[0061] 3. The constraints indicate that the raw data is used for training an initial model for at least one specified target task. For training the initial model for the specified target task, the prompt information of the raw data is the third prompt information; for training the initial model for a non-specified target task, the prompt information of the raw data is the fourth prompt information.

[0062] This means that the original data can be used unconditionally for model training of a specified target task, but cannot be used for model training of a non-specified target task. In this case, the prompt information corresponding to the original data can change with the target task. For example, if the target task specified for the original data S1 that can be used for model training is topic recognition and text generation, and the target task is text generation, then text generation is the specified target task of the original data S1. For model training of the text generation task, the prompt information of the original data S1 is the third prompt information, and the data to be applied containing the original data S1 and the third prompt information is a positive sample. If the target task is sentiment classification, then sentiment classification is not the specified target task of the original data S1. For model training of the sentiment classification task, the prompt information of the original data S1 is the fourth prompt information, and the data to be applied containing the original data S1 and the fourth prompt information is a negative sample.

[0063] When training the model: If the target task is specified, the training parameters of the initial model for the target task can be determined as the first value based on the third prompt information of the data to be applied. The target task processing model is obtained after training using the original data in the data to be applied. If the target task is not specified, the training parameters of the initial model for the target task can be determined as the third value based on the fourth prompt information of the data to be applied. The target task processing model is obtained after training using the original data in the data to be applied.

[0064] 4. The constraint condition indicates that the original data is used for training an initial model for at least one specified target task, and the similarity between the output of the target task and the original data is lower than the similarity threshold. For training the initial model for the specified target task, the prompt information of the original data is the fifth prompt information; when training an initial model for a non-specified target task, the prompt information of the original data is determined to be the fourth prompt information.

[0065] This means that the original data is conditionally restricted to model training for a specified target task and cannot be used for model training for tasks other than the specified target task. In this case, the prompt information corresponding to the original data can change with the target task. For example, the original data S2 is conditionally restricted to model training for the target tasks of topic recognition and sentiment classification. If the target task is topic recognition, then topic recognition is the specified target task of the original data S1, but with conditions. Therefore, for model training of the topic recognition task, the prompt information of the original data S1 is the fifth prompt information, and the data to be applied containing the original data S1 and the fifth prompt information is a normal sample. If the target task is text generation, then text generation is not the specified target task of the original data S1. For model training of the text generation task, the prompt information of the original data S1 is the fourth prompt information, and the data to be applied containing the original data S1 and the fourth prompt information is a negative sample.

[0066] Accordingly, when training the model: if the target task is specified, the training parameters of the initial model for the target task can be determined as the second value according to the fifth prompt information of the data to be applied, and the target task processing model is obtained after training using the original data in the data to be applied; if the target task is not specified, the training parameters of the initial model for the target task can be determined as the third value according to the fourth prompt information of the data to be applied, and the target task processing model is obtained after training using the original data in the data to be applied.

[0067] It should be noted that, Figure 1 The embodiments shown are merely a basic embodiment of this application, and implementers can further refine and expand upon them.

[0068] This application provides a data processing method. The method adds constraints to the prompt information to characterize the processing of the target task using the original data (e.g., open source corpus), and determines the initial model for processing the target task and the corresponding training parameters of the initial model based on the prompt information characterizing the constraints, so that the application of the original data conforms to the constraints.

[0069] The above scheme will be illustrated with a specific example below.

[0070] In this embodiment, the raw data includes multiple datasets obtained from different data sources: a first dataset obtained from data provider A, a second dataset obtained from data provider B, a third dataset contributed by individual user A, a fourth dataset contributed by individual user B, and a fifth dataset crawled from a contracted website. Each dataset may contain multiple pieces of raw data.

[0071] In this embodiment, the learning rate is used as a training parameter to influence the improvement rate of the model evaluation metric. The learning rate is a hyperparameter that controls the speed of model parameter updates. During gradient descent optimization, the learning rate determines the step size of each parameter update. Specifically, during training, after comparing the output of a downstream task with the expected result to obtain the loss function value, the model parameters are adjusted based on the magnitude of the loss function value, often using the following formula: New model parameter value = Original model parameter value - Learning rate * Gradient.

[0072] The gradient is the partial derivative of the loss function with respect to the model parameters, representing the trend of the loss function under the current parameter values. The learning rate controls the speed or step size of descent in the gradient direction. When the learning rate is set to a larger value, the step size is larger, and the degree of model optimization, i.e., the improvement rate of the model evaluation metric, will be larger; conversely, when the learning rate is set to a smaller value, the step size is smaller, and the degree of model optimization, i.e., the improvement rate of the model evaluation metric, will be smaller; when the learning rate is set to a value close to zero or even negative, the optimization process will be very slow, and may even remain in a state of no change or improvement.

[0073] Setting the learning rate to the first value can improve the model's learning speed, allowing the model's evaluation metric to improve as quickly as possible and the model to converge faster. Setting the learning rate to the second value means setting the learning rate within a reasonable range and using an appropriate learning speed to ensure that the improvement of the model's evaluation metric is carried out under the premise of meeting the constraints. Setting the learning rate to the third value (close to zero or even negative) can stop the model's learning, thereby minimizing the improvement of the model's evaluation metric. In this way, useful information can be minimized from the original data, so that the original data has no impact on the model or plays no role in improving the model.

[0074] Before training the model for downstream task processing using each dataset, the authorization policy for each piece of raw data in each dataset is first obtained to determine the prompts, i.e., the constraints.

[0075] In this embodiment, it is assumed that the original data has the following authorization policies:

[0076] 1) The model cannot be used for training in any downstream task.

[0077] 2) It can be used for model training in discriminative tasks, but not for model training in non-discriminative tasks.

[0078] 3) It can be used for model training in both discriminative and generative tasks;

[0079] When used for generative tasks, the similarity between the output of the generative task and the original data is lower than the similarity threshold.

[0080] 4) It can be used for model training in both discriminative and generative tasks;

[0081] When used for generation tasks, if the similarity between the output of the generation task and the original data is lower than the similarity threshold, and if the similarity between the output of the generation task and the original data is higher than the similarity threshold, then the fee will be charged according to the percentage of contribution of the original data to the output.

[0082] 5) The model can be used unconditionally for training any downstream task.

[0083] Due to the different authorization strategies mentioned above, the learning rate used for the same downstream task processing will be different when using different raw data; similarly, the learning rate used for the same raw data will also be different when used for different downstream task processing.

[0084] Assuming the original data in this embodiment includes:

[0085] If the original data in the first dataset all use the above authorization policy 1), then the prompt message will be the second prompt message, such as "disabled".

[0086] The original data in the second dataset all use the authorization strategy 2) described above. The specified target task that can be used is a discriminative task, such as text classification, information extraction, information retrieval, etc. All other downstream tasks are non-specified target tasks. For discriminative tasks, the prompt message is the third prompt message, such as "specified available", and for non-specified tasks, it is the fourth prompt message, such as "non-specified unavailable". Alternatively, the third prompt message can also be "discriminative tasks available" and the fourth prompt message can be "non-discriminative tasks unavailable". Or, the category of the specified target task can be used directly as the prompt message, such as "text classification". In this case, "text classification" is the third prompt message for the specified target task and the fourth prompt message for non-specified target tasks.

[0087] The original data in the third dataset all use the authorization strategy 3) mentioned above. The specified target tasks that can be used are generation tasks, such as article generation, text rewriting, and text translation, with a similarity threshold of 20%. For discriminative tasks, the prompt message is the third prompt message, such as "Specified Available"; for generation tasks, the prompt message is the fifth prompt message, such as "Specified Available, Similarity Below 20%"; for non-specified tasks (i.e., neither discriminative nor generation tasks), the prompt message is the fourth prompt message, such as "Unavailable unless specified".

[0088] The original data in the fourth dataset all use the aforementioned authorization strategy 4). The designated target task for use is a generative task, with a similarity threshold of 20%. The contribution percentage of the original data represents the change in model parameters before and after training the model using this dataset. For discriminative tasks, the prompt is the third prompt, such as "Designated Available"; for generative tasks, the prompt is the fifth prompt, such as "Designated Available, Similarity Below 20%, Fee Paid Based on Data Contribution Rate"; for non-designated tasks (i.e., neither discriminative nor generative tasks), the prompt is the fourth prompt, such as "Unavailable Unless Designated".

[0089] If all the original data in the fifth dataset uses the above authorization strategy 5), then the prompt message will be the first prompt message, such as "Unconditional use".

[0090] The content and form of the first to fifth prompts mentioned above are just examples. This disclosure does not impose any restrictions on the content and form of the prompts, as long as the constraints represented by the prompts can be parsed according to the preset prompt parsing rules.

[0091] Based on the above authorization strategy, the prompt information corresponding to the first to fifth datasets can be determined.

[0092] For the target task, determine the prompts for the original data to form the application data (including the original data and corresponding prompts). Based on the prompts, the application data is determined as positive samples, ordinary samples, or negative samples. For each type of sample, set the corresponding learning rate for the initial model of the target task.

[0093] In this embodiment, the discriminative task includes sentiment classification; the generative task includes story continuation. The following table (Table 1) shows the correspondence between the dataset, the cue information representing the constraints, the target task, the sample type, and the learning rate:

[0094]

[0095]

[0096] Table 1

[0097] If the target task is sentiment classification:

[0098] The model parameter set for the sentiment classification task is X, which contains model parameters x1, x2, ..., xn. Activating each parameter in the model parameter set X yields the initial model for the sentiment classification task. The initial model is trained using the first to fifth datasets to obtain the sentiment classification model, specifically: 1% learning rate determined by the prompts when training on the first dataset; 100% learning rate when training on the second dataset; 100% learning rate when training on the third dataset; 100% learning rate when training on the fourth dataset; and 100% learning rate when training on the fifth dataset.

[0099] If the objective task is a story continuation task:

[0100] The model parameter set corresponding to the story continuation task is Y, which contains model parameters y1, y2, ..., yn. Activating each parameter in the model parameter set Y yields the initial model for processing the story continuation task. The initial model is trained using datasets one through five to obtain the story continuation model. Specifically: when training with the first dataset, the learning rate of the initial model, determined by the prompts, is 1%; when training with the second dataset, the learning rate is 1%; when training with the third dataset, the learning rate is 10%, ensuring that the similarity between the story continuation content and the corpus does not exceed 20%. If it does, the parameter values ​​in parameter set Y are adjusted to ensure the similarity does not exceed 20%; when training with the fourth dataset, the learning rate is 10%, and for corpora with similarity exceeding 20%, the contribution of that corpus to the story continuation and the amount to be paid are calculated. After training, the payment process is initiated; when training with the fifth dataset, the learning rate of the initial model is 100%.

[0101] Through the above process, a model for performing various downstream tasks can be obtained.

[0102] After the training of the models used for various downstream task processing is completed, the trained models can be applied to perform the corresponding downstream task processing. For example... Figure 2 As shown, it includes:

[0103] Operation S201: Confirm the prompt message for the data to be processed;

[0104] In step S202, determine the corresponding target task processing model based on the prompt information, and then process the data to be processed using the target task processing model.

[0105] Once the models for various downstream tasks of the LLM are trained, users can use the LLM model to perform a variety of downstream tasks.

[0106] For example, a user inputs, "Please continue the story: On a crisp autumn morning, Xiaoming saw an old man on his way to school." Parsing the user input reveals the prompt "story continuation," thus identifying the target task as story continuation. This activates the corresponding model parameters, specifically the story continuation model (target task model). The story continuation model then processes the data to be processed, namely "On a crisp autumn morning, Xiaoming saw an old man on his way to school," generating the continued story, which is then output to the user.

[0107] Furthermore, embodiments of this application also provide a data processing apparatus. For example... Figure 3 As shown, the device 30 includes:

[0108] The application data acquisition module 301 is used to acquire the application data, which includes the original data and the corresponding prompt information of the original data.

[0109] The prompt information determination module 302 is used to determine the prompt information for processing the target task based on the raw data. The prompt information represents the constraints for processing the target task through the raw data.

[0110] The training parameter determination module 303 is used to determine the initial model for processing the target task and the corresponding training parameters of the initial model based on the prompt information of the representation constraints. The training parameters can affect the improvement rate of the model evaluation index.

[0111] The model training module 304 is used to train the initial model using training parameters with raw data to obtain the target task processing model.

[0112] According to one embodiment of this application, the data to be applied is divided into at least one of positive samples, normal samples, and negative samples according to the prompt information. Accordingly, the training parameter determination module 303 is used for at least one of the following: the training parameter determined according to the prompt information corresponding to the positive sample is a first value; the training parameter determined according to the prompt information corresponding to the normal sample is a second value; the training parameter determined according to the prompt information corresponding to the negative sample is a third value; the first value is greater than the second value, and the second value is greater than the third value.

[0113] According to an embodiment of this application, the prompt information determination module 302 is specifically used for: constraining conditions to indicate that the original data is used for training an initial model for processing any target task; for training an initial model for processing any target task, determining the prompt information of the original data as a first prompt information; and correspondingly, determining the data to be applied containing the original data as a positive sample based on the first prompt information.

[0114] According to one embodiment of this application, the model training module 304 is specifically used to: train an initial model using training parameters with first values ​​through the original data corresponding to positive samples to obtain a target task processing model.

[0115] According to an embodiment of this application, the prompt information determination module 302 is specifically used for: constrained conditions indicating that the original data cannot be used for training the initial model of any target task processing; for training the initial model of any target task processing, determining the prompt information of the original data as the second prompt information; and correspondingly, determining the data to be applied containing the original data as a negative sample based on the second prompt information.

[0116] According to one embodiment of this application, the model training module 304 is specifically used to: train an initial model using training parameters with a third value using the original data corresponding to the negative samples, thereby obtaining a target task processing model.

[0117] According to an embodiment of this application, the prompt information determination module 302 is specifically used for: constraining conditions to indicate that the original data is used for training an initial model for at least one specified target task processing; for training the initial model for the specified target task processing, determining the prompt information of the original data as a third prompt information; for training the initial model for a non-specified target task processing, determining the prompt information of the original data as a fourth prompt information; accordingly, determining the data to be applied containing the original data as a positive sample based on the third prompt information; and determining the data to be applied containing the original data as a negative sample based on the fourth prompt information.

[0118] According to one embodiment of this application, the model training module 304 is specifically used to: train an initial model using training parameters with a first value using the original data corresponding to positive samples, and train an initial model using training parameters with a third value using the original data corresponding to negative samples, to obtain a target task processing model.

[0119] According to an embodiment of this application, the prompt information determination module 302 is specifically used for: when the constraint condition indicates that the original data is used for training an initial model for at least one specified target task processing, and the similarity between the output of the target task and the original data is lower than a similarity threshold, for training the initial model of the specified target task processing, determining the prompt information of the original data as the fifth prompt information; when training an initial model for a non-specified target task processing, determining the prompt information of the original data as the fourth prompt information; correspondingly, determining the application data containing the original data as ordinary samples according to the fifth prompt information; determining the application data containing the original data as negative samples according to the fourth prompt information; correspondingly, the model training module 304 is specifically used for: training an initial model using training parameters with a second value using the original data corresponding to ordinary samples, and training an initial model using training parameters with a third value using the original data corresponding to negative samples, to obtain a target task processing model.

[0120] According to a third aspect of the present application, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; and a processor configured to read executable instructions from the memory and execute the instructions to implement the data processing method described above.

[0121] According to a fourth aspect of the present application, a computer-readable storage medium is provided, the storage medium storing a computer program for performing any of the above-described data processing methods.

[0122] It should be noted that the above descriptions of the data processing apparatus embodiments, the electronic device embodiments, and the computer-readable storage medium embodiments are similar to the descriptions of the foregoing method embodiments and have similar beneficial effects, therefore they will not be repeated. For technical details not disclosed in the descriptions of the data processing apparatus embodiments, the electronic device embodiments, and the computer-readable storage medium embodiments of this application, please refer to the descriptions of the foregoing method embodiments of this application for understanding; to save space, they will not be repeated here.

[0123] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0124] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in implementation. For example, multiple units or components may be combined, integrated into another device, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces. The indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0125] 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. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected as needed to achieve the purpose of this embodiment.

[0126] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0127] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage media, read-only memory (ROM), magnetic disks, or optical disks.

[0128] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage media, ROM, magnetic disks, or optical disks.

[0129] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data processing method, the method comprising: Obtain the data to be applied, which includes the original data and the corresponding prompt information; The original data is a corpus; The prompt information is determined based on the data usage agreement or authorization policy of the original data and is used to characterize the constraints for processing the target task through the original data. The constraints include at least one of the target task types in which the original data can be used and the target task types in which it cannot be used. Determine the prompt information for target task processing based on the original data; Based on the prompts from the representation constraints, determine the initial model for processing the target task and the corresponding training parameters of the initial model; Based on the constraints provided by the original data, determine the training parameters for model training using the original data. The training parameters include the learning rate, the value of which is related to the constraints and is used to control the impact of the original data on the improvement rate of the model evaluation index. The initial model using the training parameters is trained using the raw data to obtain the target task processing model.

2. The method according to claim 1, wherein the data to be applied is divided into at least one of positive samples, ordinary samples, and negative samples according to the prompt information, and correspondingly, the training parameters corresponding to the initial model for processing the target task are determined according to the prompt information of the representation constraints, including at least one of the following: The training parameters determined based on the prompt information corresponding to the positive sample are the first values; The training parameters determined based on the prompt information corresponding to the ordinary sample are the second values; The training parameters determined based on the prompt information corresponding to the negative sample are the third value; The first value is greater than the second value, and the second value is greater than the third value.

3. The method according to claim 2, The prompt information for determining the target task processing based on the original data includes: The constraints indicate that the original data is used for training an initial model for any target task processing. For training an initial model for any target task processing, the prompt information of the original data is determined as the first prompt information. Accordingly, based on the first prompt information, the data to be applied containing the original data is determined to be a positive sample.

4. The method according to claim 3, The step of training the initial model using the training parameters with the original data to obtain the target task processing model includes: The initial model, using the training parameters with the first value, is trained using the original data corresponding to the positive samples to obtain the target task processing model.

5. The method according to claim 2, The prompt information for determining the target task processing based on the original data includes: The constraint condition indicates that the original data cannot be used for training the initial model for any target task processing. For training the initial model for any target task processing, the prompt information of the original data is determined as the second prompt information. Accordingly, based on the second prompt information, the data to be applied containing the original data is determined to be a negative sample.

6. The method according to claim 5, The step of training the initial model using the training parameters with the original data to obtain the target task processing model includes: The initial model, using the training parameters with the third value, is trained using the original data corresponding to the negative samples to obtain the target task processing model.

7. The method according to claim 2, The prompt information for determining the target task processing based on the original data includes: The constraint condition indicates that the original data is used for training an initial model for at least one specified target task processing. For training the initial model for the specified target task processing, the prompt information of the original data is determined as a third prompt information; for training the initial model for a non-specified target task processing, the prompt information of the original data is determined as a fourth prompt information. Accordingly, the data to be applied containing the original data is determined to be a positive sample based on the third prompt information; and the data to be applied containing the original data is determined to be a negative sample based on the fourth prompt information.

8. The method according to claim 7, The step of training the initial model using the training parameters with the original data to obtain the target task processing model includes: The initial model using training parameters with the first value is trained using the original data corresponding to the positive samples, and the initial model using training parameters with the third value is trained using the original data corresponding to the negative samples, to obtain the target task processing model.

9. The method according to claim 2, The prompt information for determining the target task processing based on the original data includes: The constraint condition indicates that the original data is used for training an initial model for at least one specified target task, and the similarity between the output of the target task and the original data is lower than a similarity threshold. For training the initial model for the specified target task, the prompt information of the original data is determined as the fifth prompt information; when training an initial model for a non-specified target task, the prompt information of the original data is determined as the fourth prompt information. Accordingly, based on the fifth prompt, the data to be applied containing the original data is determined to be a normal sample; based on the fourth prompt, the data to be applied containing the original data is determined to be a negative sample. Accordingly, training the initial model using the training parameters with the original data to obtain the target task processing model includes: The initial model using training parameters with the second value is trained using the original data corresponding to the ordinary samples, and the initial model using training parameters with the third value is trained using the original data corresponding to the negative samples, to obtain the target task processing model.

10. A data processing apparatus, the apparatus comprising: The application data acquisition module is used to acquire application data, which includes raw data and corresponding prompt information. The original data is a corpus; The prompt information is determined based on the data usage agreement or authorization policy of the original data and is used to characterize the constraints for processing the target task through the original data. The constraints include at least one of the target task types in which the original data can be used and the target task types in which it cannot be used. The prompt information determination module is used to determine the prompt information for target task processing based on the original data; The training parameter determination module is used to determine the initial model for processing the target task and the corresponding training parameters of the initial model based on the prompt information of the representation constraints. Based on the constraints indicating the application of the original data, the training parameters for model training using the original data are determined; the training parameters include the learning rate, the value of which is related to the constraints and is used to control the impact of the original data on the improvement rate of the model evaluation index. The model training module is used to train the initial model using the training parameters with the original data to obtain the target task processing model.