Evaluation data set generation method and device
The construction of large model evaluation data sets through automated methods solves the problem of high manpower consumption and the reliance of data sets on manual experience, achieves semantic consistency and adaptability, and ensures the comprehensiveness and effectiveness of the evaluation data set.
Patent Information
- Application Number
- CN202410805015.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-27
AI Technical Summary
The existing technology has problems such as high labor consumption, lack of objectivity, dependence on manual experience, and inability to adapt to the development level and semantic consistency of large models when constructing large model evaluation data sets.
Through an automated method based on large models, the evaluation data is collected and rewritten, the target data is screened using the similarity threshold, the validity score of the target data is calculated, and the model is trained to generate a semantically consistent evaluation data set to ensure the comprehensiveness and adaptability of the data set. sex.
It reduces labor costs, improves the objectivity and semantic consistency of the data set, ensures that the data set can adapt to the development level of large models, and avoids the problem of data set failure after model repair.
Smart Images

Figure CN118709758A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of deep learning, and in particular to the field of model processing technology, and can be applied to training and fine-tuning models. Background Art
[0002] A generative big model is a generative model based on a large-scale corpus. It can generate, understand and reason about natural language in an end-to-end manner. It has been widely used in text creation, chatbots, machine translation, text summarization and other fields. As the application scope of big models becomes wider, its development has also brought some challenges, such as whether the output data of big models has privacy security, ethical and other security issues. Among them, in order to solve the security problems of big models, it is usually necessary to evaluate the big models to test the security of the model output. Optionally, when evaluating big models, it is usually necessary to build an evaluation dataset for the big model. At present, how to build an evaluation dataset for big models is a technical problem that needs to be solved urgently. Summary of the invention
[0003] The present disclosure provides a method, device, electronic device and storage medium for generating an evaluation data set.
[0004] According to a first aspect of the present disclosure, there is provided a device for generating an evaluation data set, comprising:
[0005] Determine at least one target data corresponding to the first evaluation data based on a first model and at least one first evaluation data collected; wherein the first model is used to generate an evaluation data set, the evaluation data set is used to perform model evaluation, the target data is rewritten data of the first evaluation data, and the similarity between the target data and the first evaluation data is greater than a first threshold;
[0006] Determine the validity score of the target data, where the validity score is proportional to the model evaluation effect of the target data;
[0007] The first model is trained based on at least one first evaluation data, at least one target data, and an effectiveness score, so that the trained first model rewrites the first evaluation data to obtain: target data with an effectiveness score greater than a second threshold;
[0008] An evaluation data set is determined based on the trained first model.
[0009] According to a second aspect of the present disclosure, there is provided a device for generating an evaluation data set, comprising:
[0010] A first determination module is used to determine at least one target data corresponding to the first evaluation data based on a first model and at least one first evaluation data collected; wherein the first model is used to generate an evaluation data set, the evaluation data set is used to perform model evaluation, the target data is rewritten data of the first evaluation data, and the similarity between the target data and the first evaluation data is greater than a first threshold;
[0011] A second determination module is used to determine the validity score of the target data, where the validity score is proportional to the model evaluation effect of the target data;
[0012] A training module, configured to train the first model based on at least one first evaluation data, at least one target data, and an effectiveness score, so that the trained first model rewrites the first evaluation data to obtain: target data with an effectiveness score greater than a second threshold;
[0013] The third determination module is used to determine the evaluation data set based on the trained first model.
[0014] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.
[0018] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.
[0019] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the method described in the first aspect when executed by a processor.
[0020] The technology disclosed in the present invention solves the problem of poor slot value information extraction effect in the related art.
[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0023] Figure 1 A flowchart of a method for generating an evaluation data set provided in an embodiment of the present disclosure;
[0024] Figure 2 A flowchart of a method for generating an evaluation data set provided in an embodiment of the present disclosure;
[0025] Figure 3 A block diagram of an evaluation data set generation device provided in an embodiment of the present disclosure;
[0026] Figure 4 It is a block diagram of an electronic device used to implement the evaluation data set generation method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0028] It should be noted that in the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0029] Optionally, methods for constructing evaluation datasets for large models mainly include the following:
[0030] The first method is to manually construct an evaluation data set. For example, manually collect the problems that appear in the evaluation of the large model, and based on the problems, construct basic evaluation data that can evaluate the problems, and then perform simple data enhancement (such as rewriting) on the basic evaluation data, or use the large model to expand the basic evaluation data to obtain the evaluation data set of the large model.
[0031] The second method is to automatically construct an evaluation data set. For example, the large model can be fine-tuned using the labeled data so that the large model can label data with better evaluation results based on the input data, and the evaluation data set of the large model can be constructed based on the data with better evaluation results.
[0032] The third method is to iteratively construct the evaluation data set. For example, collect some data, automatically iterate the data to obtain the iterated data, and then construct the evaluation data set of the large model based on the iterated data.
[0033] However, the above three methods all have some technical problems.
[0034] The first method requires a lot of manpower, and the evaluation data set constructed in the first method is highly correlated with artificial prior knowledge. The quality of the data set depends on artificial experience and lacks objectivity, which will affect the evaluation effect.
[0035] The second method requires data collection in the early stage, and the standards are relatively fixed, which may not match the current security level of the large model, and cannot be iterated according to the development level of the large model. For example, if the large model evaluation finds a problem and fixes it, at this time, the data with good evaluation results marked in the second method may not be used to evaluate new problems caused by the repaired large model.
[0036] The third method may not be able to guarantee semantic consistency during the iteration process, which may cause some semantic data to disappear from the evaluation dataset, affecting the comprehensiveness of the evaluation dataset.
[0037] Optionally, the evaluation data set generation method disclosed in the present invention can solve the above problems.
[0038] Figure 1 The flowchart of a method for generating an evaluation data set provided by an embodiment of the present disclosure is executed by an evaluation data set generating device. Figure 1 As shown, the evaluation data set generation method may include but is not limited to the following steps.
[0039] In step 101, at least one first evaluation data is collected and at least one second rewriting data corresponding to the first evaluation data is determined.
[0040] Optionally, the method of collecting at least one first evaluation data may include: first determining the model to be evaluated, which may be a large model, and then determining the evaluation target of the model to be evaluated. The evaluation target may be understood as: the type of problem that the model to be evaluated needs to evaluate. For example, the evaluation target may include: privacy and security issues, ethical and moral issues, etc., wherein, when the evaluation target is "privacy and security issues", it indicates that it is necessary to evaluate whether the output data of the model to be evaluated involves privacy and security, and when the evaluation target is "ethical and moral issues", it indicates that it is necessary to evaluate whether the output data of the model to be evaluated involves ethics and morality. And, after determining the evaluation target of the model to be evaluated, at least one first evaluation data is collected for the evaluation target. The first evaluation data may be: data that can reflect the evaluation target. For example, if the evaluation target is "privacy and security issues", the first evaluation data may be privacy data, and if the evaluation target is "ethical and moral issues", the first evaluation data may be data involving ethics and morality. Optionally, the first evaluation data may be directly obtained from historical business.
[0041] Optionally, the above content is only an introduction to an exemplary method of "collecting at least one first evaluation data". In other embodiments, other methods may also be used to collect at least one first evaluation data, and the present disclosure does not make any specific limitations on this.
[0042] In some embodiments, after collecting at least one first evaluation data, the first evaluation data can be rewritten, for example, the first evaluation data can be rewritten by synonym replacement, traditional Chinese conversion, etc., to determine at least one second rewritten data corresponding to the first evaluation data. Optionally, the first evaluation data can be rewritten using a mature rewriting model, or the first evaluation data can be rewritten in other ways, which is not specifically limited in the present disclosure.
[0043] In step 102, the first model is enabled to learn the rewriting ability based on the first evaluation data and the second rewriting data.
[0044] Optionally, the first model can be used to generate an evaluation data set, and the evaluation data set can be used to perform model evaluation on the model to be evaluated. Optionally, the model to be evaluated can be different from the first model, or can be the same, which is not specifically limited in the present disclosure.
[0045] Optionally, the first evaluation data and the second rewriting data can be used to fine-tune the first model using the full amount or lora method, so that the first model can fully learn different data rewriting methods and improve the rewriting ability of the large model.
[0046] In some embodiments, other fine-tuning methods may also be used to enable the first model to fully learn different data rewriting methods, and the present disclosure does not specifically limit this.
[0047] In step 103, the first evaluation data is input into the learned first model to output at least one third rewritten data corresponding to different first evaluation data.
[0048] Optionally, the first evaluation data can be input into the learned first model, and the sampling method and / or penalty coefficient of the first model can be adjusted so that the first model can use different rewriting methods to rewrite the first evaluation data to obtain at least one third rewritten data of the first evaluation data.
[0049] In some embodiments, all collected first evaluation data may be input into the first model to obtain at least one third rewritten data corresponding to each first evaluation data.
[0050] In step 104, at least one target data corresponding to the first evaluation data is determined from at least one third rewritten data corresponding to the first evaluation data.
[0051] Optionally, third rewritten data having a similarity with the first evaluation data greater than a first threshold value may be determined as target data.
[0052] For example, the cosine similarity between the first evaluation data and at least one corresponding third rewritten data in the embedding can be calculated, wherein, for the third rewritten data with too small cosine similarity, it is considered that its subject and semantics have changed significantly from the first evaluation data, and the third rewritten data needs to be deleted, and for the third rewritten data with high cosine similarity (for example, the cosine similarity is greater than the first threshold), it is considered that its subject and semantics have not changed significantly from the first evaluation data, and the third rewritten data with high cosine similarity can be retained as the target data, thereby ensuring the semantic consistency between the target data and the first evaluation data.
[0053] It should be noted that the present disclosure may also adopt other methods to calculate the similarity between the first evaluation data and the third rewritten data, and the present disclosure does not make any specific limitation on this.
[0054] In step 105, a validity score of the target data is determined.
[0055] Optionally, the method for determining the validity score of the target data may include:
[0056] First, at least one second model is determined. The second model has the same type of evaluation problem (or the above-mentioned evaluation target) as the model to be evaluated. For example, if the evaluation problem (or evaluation target) of the model to be evaluated is a privacy and security issue, then the second model should be a model that also has privacy and security issues. In some embodiments, the second model can be a large model. The second model can be a currently representative large model, for example, it can be a large model newly produced by a well-known brand.
[0057] Optionally, after determining at least one second model, at least one target data can be used to evaluate each second model to determine the model evaluation effect of the target data. Among them, the more second models evaluated by a certain target data, the better the model evaluation effect of the target data. For example, assuming that target data #1 and target data #2 evaluate the same 4 second models, wherein target data #1 evaluates 3 first models with evaluation problems (such as privacy and security issues), and target data #2 evaluates 1 first model with evaluation problems (such as privacy and security issues), then the model evaluation effect of target data #1 is greater than the model evaluation effect of target data #2.
[0058] Optionally, after determining the model evaluation effect of the target data, the effectiveness score of the target data can be determined based on the model evaluation effect of the target data, wherein the effectiveness score is proportional to the model evaluation effect of the target data, that is, the better the model evaluation effect of the target data, the higher its effectiveness score.
[0059] In step 106, a first model is trained based on at least one first evaluation data, at least one target data, and an effectiveness score.
[0060] Optionally, the trained first model should satisfy the following requirement: after rewriting the first evaluation data, the trained first model can obtain target data having a validity score greater than a second threshold.
[0061] In some embodiments, the training method of the first model may include: first constructing a reinforcement learning data set based on at least one first evaluation data, at least one target data, and an effectiveness score, and determining the first data set and the second data based on the at least one target data, wherein the first data set includes one or more target data, and the effectiveness score of the target data in the first data set is greater than a second threshold; the second data set includes one or more target data, and the effectiveness score of the target data in the second data set is less than a third threshold; the second threshold is greater than or equal to the third threshold; thereafter, training the first model based on the reinforcement learning data set, the first data set, the second data set, and the DPOP algorithm until the loss function of the first model converges.
[0062] Optionally, the loss function may include:
[0063]
[0064] Wherein, D represents a reinforcement learning data set, x is a validity rewriting prompt input to the first model, and the validity rewriting prompt may include at least one of the following: first evaluation data, a rewriting command, and a rewriting requirement (for example, a rewriting requirement learned by the first model); y w Represents the first data set, y l represents the second data set, π ref (y w |x) represents the output probability of the first model before training for the data in the first data set, π ref (y l |x) represents the output probability of the first model before training for the data in the second data set, π θ (y w |x) represents the output probability of the first model in training for the data in the first dataset, π θ (y l|x) represents the output probability of the first model in training for the data in the second data set, β is the regularization term corresponding to the KL regularization strength, and λ is a hyperparameter that can be adjusted.
[0065] It should be noted that the above DPOP algorithm is only an example introduction of the present disclosure, and other methods can also be used to train the first model to achieve the purpose of the present disclosure, and the present disclosure does not make specific limitations on this.
[0066] In step 107, an evaluation data set is determined based on the trained first model.
[0067] Optionally, at least one first evaluation data may be input into the trained first model for rewriting to output at least one first rewritten data, and the at least one first rewritten data may be determined as an evaluation data set so that the model to be evaluated may be subsequently evaluated based on the evaluation data set.
[0068] Optionally, data can be collected again based on the evaluation target of the model to be evaluated, and the re-collected data can be input into the trained first model for rewriting to output at least one first rewritten data, and the at least one first rewritten data can be determined as an evaluation data set, so as to subsequently evaluate the model to be evaluated based on the evaluation data set.
[0069] In summary, the evaluation data set generation method disclosed in the present invention does not require a large amount of manual operation, and the labor cost is low. In addition, the evaluation data set generated in the present invention does not need to rely on manual experience, and has sufficient objectivity. At the same time, the method disclosed in the present invention is based on rewriting data with a similarity greater than a first threshold to construct an evaluation data set, which ensures the semantic consistency between the evaluation data set and the first evaluation data, avoids the disappearance of a semantic dimension of the first evaluation data, ensures the sample distribution of different evaluation dimensions, and maintains the comprehensiveness of the evaluation data set. In addition, in the method disclosed in the present invention, each time the evaluation data set of the model to be evaluated is determined, data with better evaluation effects will be first determined based on a second model that has the same type of evaluation problems as the model to be evaluated, and then the evaluation data set of the model to be evaluated will be constructed based on the data with better evaluation effects. That is, even when the model to be evaluated is evaluated again after some problems of the model to be evaluated are fixed, data with better evaluation effects will be first determined based on the second model that has the same type of evaluation problems as the model to be evaluated, and then the evaluation data set of the model to be evaluated will be constructed based on the data with better evaluation effects. Among them, since the second model and the model to be evaluated have the same type of evaluation problems, even if some problems of the model to be evaluated are fixed and then the model to be evaluated is evaluated again, it can be ensured that the data with good evaluation effect determined based on the second model will also have good evaluation effect on the repaired model to be evaluated. When constructing an evaluation data set for the model to be evaluated based on this data, it can be ensured that the data in the evaluation data set always has good model evaluation effect on the model to be evaluated, thereby ensuring the evaluation effect of the repaired model to be evaluated and ensuring that the evaluation data set can be iterated according to the model development level.
[0070] Figure 2 The flowchart of a method for generating an evaluation data set provided by an embodiment of the present disclosure is executed by an evaluation data set generating device. Figure 2 As shown, the evaluation data set generation method may include but is not limited to the following steps.
[0071] In step 201, at least one target data corresponding to the first evaluation data is determined based on the first model and at least one first evaluation data collected.
[0072] In step 202, a validity score of the target data is determined.
[0073] In step 203, a first model is trained based on at least one first evaluation data, at least one target data, and an effectiveness score, so that the trained first model rewrites the first evaluation data to obtain: target data with an effectiveness score greater than a second threshold.
[0074] In step 204, an evaluation data set is determined based on the trained first model.
[0075] For a detailed description of steps 210-204, please refer to the above Figure 1 Embodiment Description Content.
[0076] In summary, the evaluation data set generation method disclosed in the present invention does not require a large amount of manual operation, and the labor cost is low. In addition, the evaluation data set generated in the present invention does not need to rely on manual experience, and has sufficient objectivity. At the same time, the method disclosed in the present invention is based on rewriting data with a similarity greater than a first threshold to construct an evaluation data set, which ensures the semantic consistency between the evaluation data set and the first evaluation data, avoids the disappearance of a semantic dimension of the first evaluation data, ensures the sample distribution of different evaluation dimensions, and maintains the comprehensiveness of the evaluation data set. In addition, in the method disclosed in the present invention, each time the evaluation data set of the model to be evaluated is determined, data with better evaluation effects will be first determined based on a second model that has the same type of evaluation problems as the model to be evaluated, and then the evaluation data set of the model to be evaluated will be constructed based on the data with better evaluation effects. That is, even when the model to be evaluated is evaluated again after some problems of the model to be evaluated are fixed, data with better evaluation effects will be first determined based on the second model that has the same type of evaluation problems as the model to be evaluated, and then the evaluation data set of the model to be evaluated will be constructed based on the data with better evaluation effects. Among them, since the second model and the model to be evaluated have the same type of evaluation problems, even if some problems of the model to be evaluated are fixed and then the model to be evaluated is evaluated again, it can be ensured that the data with good evaluation effect determined based on the second model will also have good evaluation effect on the repaired model to be evaluated. When constructing an evaluation data set for the model to be evaluated based on this data, it can be ensured that the data in the evaluation data set always has good model evaluation effect on the model to be evaluated, thereby ensuring the evaluation effect of the repaired model to be evaluated and ensuring that the evaluation data set can be iterated according to the model development level.
[0077] The following is an exemplary introduction to the method disclosed in the present invention:
[0078] The present disclosure aims to propose a targeted large-model evaluation data set generation technology. This technology can address the problem of evaluation data set failure, that is, automatically optimize the evaluation data set according to the average development level of the existing large models in the industry. Even if the large model is constantly repairing the problems that have been measured, this solution can continue to ensure the validity of the evaluation data set. At the same time, the original type distribution of the evaluation data set is taken into account, and the subject proportion and comprehensiveness of the evaluation data set are not changed.
[0079] To achieve the above objectives, the solution disclosed in this disclosure is:
[0080] Module 1: Collection and rewriting of original evaluation data sets
[0081] According to the evaluation objectives, the original evaluation data set is collected, and the basic data can be directly obtained from the business. Using different rewriting requirements, such as synonym replacement, traditional Chinese conversion and other schemes, the evaluation text pairs before and after rewriting are generated, hereinafter referred to as evaluation text pairs, and then enter module 2.
[0082] Module 2: Improving large model rewriting capabilities
[0083] Using the evaluation text pairs, fine-tune the big model using the full amount or lora method, so that the big model can fully learn different data rewriting methods and improve the big model's rewriting ability. The fine-tuned model is called the rewritten big model. Enter module 3.
[0084] Module 3: Large-scale rewritten text generation based on the rewriting model
[0085] Use the rewriting big model to rewrite a large amount of data in the original evaluation data set. During the generation of the big model, adjust the sampling method and penalty coefficient of the big model to ensure that the same text can be rewritten into different texts. Enter module 4.
[0086] Module 4: Rewrite text similarity screening
[0087] Calculate the cosine similarity between the rewritten text and the original text on the embedding. For texts with too small a cosine similarity, it is considered that the topic and semantics of the text have changed significantly. Based on the cosine similarity, delete the texts with obvious changes in the topic, and only keep the texts with no obvious changes in the topic. Such texts are called similar rewritten texts. Go to module 5.
[0088] Module 5: Similar rewritten text validity test
[0089] Select multiple representative large models and test the effectiveness of similar rewritten texts. Definition of effectiveness: The effectiveness score is obtained by successfully testing the evaluation text that has the vulnerabilities of the large model. The more large models with vulnerabilities are tested using this text, the higher the effectiveness score of the text.
[0090] Module 6: Training to improve the effectiveness of large model generation results
[0091] The original text, similar rewritten text, and validity scores of similar rewritten texts are used to construct a reinforcement learning dataset. Similar rewritten texts with high validity are accepted texts, and similar rewritten texts with low validity are rejected texts. The DPOP algorithm is used to further train the rewritten large model, which is called the effective rewritten large model. The DPOP algorithm optimizes the loss function for paired preference datasets:
[0092]
[0093] Wherein, D is a reinforcement learning data set, x is a validity rewriting prompt input to the first model, and the validity rewriting prompt includes at least one of the following: first evaluation data, rewriting command, and rewriting requirement; y w Represents the first data set, y l represents the second data set, π ref (y w |x) represents the output probability of the first model before training for the data in the first data set, π ref (y l |x) represents the output probability of the first model before training for the data in the second data set, π θ (y w |x) represents the output probability of the first model in training for the data in the first dataset, π θ (y l |x) represents the output probability of the first model in training for the data in the second data set, β is the regularization term corresponding to the KL regularization strength, and λ is a hyperparameter that can be adjusted.
[0094] Module 7. Regenerate the evaluation data set:
[0095] By effectively rewriting the large model, we rewrite the evaluation data set to obtain an effective data set that is close to the development level of the current mainstream model.
[0096] Based on the big model technology, this solution proposes a targeted big model evaluation dataset generation technology that maintains semantic consistency. Compared with manually constructed evaluation sets, the labor cost is lower, and the quality of the dataset does not depend on expert experience. Compared with the automated construction solution, this solution is iterative based on the current level of big model development. Even if the big model R&D team repairs the big model based on the problems found, the dataset will not become invalid. Compared with the current iterative automated solution, it maintains semantic consistency, maintains the sample distribution of different evaluation dimensions, and maintains the comprehensiveness of the evaluation dataset.
[0097] Figure 3 A block diagram of an evaluation data set generation device provided by an embodiment of the present disclosure. Figure 3 As shown, the evaluation data set generating device may include:
[0098] A first determination module is used to determine at least one target data corresponding to the first evaluation data based on a first model and at least one first evaluation data collected; wherein the first model is used to generate an evaluation data set, the evaluation data set is used to perform model evaluation, the target data is rewritten data of the first evaluation data, and the similarity between the target data and the first evaluation data is greater than a first threshold;
[0099] A second determination module is used to determine the validity score of the target data, where the validity score is proportional to the model evaluation effect of the target data;
[0100] A training module, configured to train the first model based on at least one first evaluation data, at least one target data, and an effectiveness score, so that the trained first model rewrites the first evaluation data to obtain: target data with an effectiveness score greater than a second threshold;
[0101] The third determination module is used to determine the evaluation data set based on the trained first model.
[0102] Optionally, in some embodiments, the first determining module is further configured to:
[0103] Collect at least one first evaluation data and determine at least one second rewritten data corresponding to the first evaluation data;
[0104] enabling the first model to learn rewriting capability based on the first evaluation data and the second rewriting data;
[0105] Inputting the first evaluation data into the learned first model to output at least one third rewritten data corresponding to different first evaluation data;
[0106] At least one target data corresponding to the first evaluation data is determined from at least one third rewritten data corresponding to the first evaluation data.
[0107] Optionally, in some embodiments, the second determining module is further configured to:
[0108] determining at least one second model;
[0109] Using at least one target data to evaluate at least one second model to determine the model evaluation effect of the target data;
[0110] The validity score of the target data is determined based on the model evaluation effect of the target data.
[0111] Optionally, in some embodiments, the training module is further used to:
[0112] Constructing a reinforcement learning data set based on at least one first evaluation data, at least one target data, and an effectiveness score;
[0113] Determine a first data set and a second data set based on at least one target data; wherein the first data set includes one or more target data, and the validity score of the target data in the first data set is greater than a second threshold; the second data set includes one or more target data, and the validity score of the target data in the second data set is less than a third threshold; the second threshold is greater than or equal to the third threshold;
[0114] The first model is trained based on the reinforcement learning data set, the first data set, the second data set, and the DPOP algorithm until the loss function of the first model converges.
[0115] Optionally, in some embodiments, the loss function includes:
[0116]
[0117] Wherein, D represents a reinforcement learning data set, x is a validity rewriting prompt input to the first model, and the validity rewriting prompt includes at least one of the following: first evaluation data, rewriting command, and rewriting requirement; y w Represents the first data set, y l represents the second data set, π ref (y w |x) represents the output probability of the first model before training for the data in the first data set, π ref (y l |x) represents the output probability of the first model before training for the data in the second data set, π θ (y w |x) represents the output probability of the first model in training for the data in the first dataset, π θ (y l |x) represents the output probability of the first model in training for the data in the second data set, β is the regularization term corresponding to the KL regularization strength, and λ is a hyperparameter that can be adjusted.
[0118] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0119] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0120] like Figure 4, is a block diagram of an electronic device according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0121] like Figure 4 As shown, the electronic device includes: one or more processors 401, a memory 402, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to an interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 401 is taken as an example.
[0122] The memory 402 is a non-transitory computer-readable storage medium provided by the present disclosure. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the evaluation data set generation method provided by the present disclosure. The non-transitory computer-readable storage medium of the present disclosure stores computer instructions, which are used to enable a computer to perform the evaluation data set generation method provided by the present disclosure.
[0123] The memory 402, as a non-transient computer-readable storage medium, can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the evaluation data set generation method in the embodiment of the present disclosure. The processor 401 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 402, that is, implements the evaluation data set generation method in the above method embodiment.
[0124] The memory 402 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device extracted from the key information, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 402 may optionally include a memory remotely arranged relative to the processor 401, and these remote memories may be connected to the electronic device for extracting key information via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0125] The electronic device for extracting key information may further include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.
[0126] The input device 403 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device for key information extraction, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 404 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
[0127] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0128] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0129] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0130] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0131] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0132] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in this disclosure can be achieved, and this document is not limited here.
[0133] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for generating an evaluation dataset. include: Determine at least one target data corresponding to the first evaluation data based on a first model and at least one first evaluation data collected; wherein the first model is used to generate an evaluation data set, the evaluation data set is used to perform model evaluation, the target data is rewritten data of the first evaluation data, and the similarity between the target data and the first evaluation data is greater than a first threshold; Determine the validity score of the target data, where the validity score is proportional to the model evaluation effect of the target data; The first model is trained based on at least one first evaluation data, at least one target data, and an effectiveness score, so that the trained first model rewrites the first evaluation data to obtain: target data with an effectiveness score greater than a second threshold; An evaluation data set is determined based on the trained first model.
2. The method according to claim 1, in, The determining, based on the first model and the at least one first evaluation data collected, at least one target data corresponding to the first evaluation data includes: Collect at least one first evaluation data and determine at least one second rewritten data corresponding to the first evaluation data; enabling the first model to learn rewriting capability based on the first evaluation data and the second rewriting data; Inputting the first evaluation data into the learned first model to output at least one third rewritten data corresponding to different first evaluation data; At least one target data corresponding to the first evaluation data is determined from at least one third rewritten data corresponding to the first evaluation data.
3. The method according to claim 1, in, Determining the validity score of the target data includes: determining at least one second model; Using at least one target data to evaluate at least one second model to determine the model evaluation effect of the target data; The validity score of the target data is determined based on the model evaluation effect of the target data.
4. The method according to claim 1, in, The step of training the first model based on at least one first evaluation data, at least one target data, and the effectiveness score includes: Constructing a reinforcement learning data set based on at least one first evaluation data, at least one target data, and an effectiveness score; Determine a first data set and a second data set based on at least one target data; wherein the first data set includes one or more target data, and the validity score of the target data in the first data set is greater than a second threshold; the second data set includes one or more target data, and the validity score of the target data in the second data set is less than a third threshold; the second threshold is greater than or equal to the third threshold; The first model is trained based on the reinforcement learning data set, the first data set, the second data set, and the DPOP algorithm until the loss function of the first model converges.
5. The method according to claim 4, in, The loss function includes: Wherein, D represents a reinforcement learning data set, x is a validity rewriting prompt input to the first model, and the validity rewriting prompt includes at least one of the following: first evaluation data, rewriting command, and rewriting requirement; y w Represents the first data set, y l represents the second data set, π ref (y w |x) represents the output probability of the first model before training for the data in the first data set, π ref (y l |x) represents the output probability of the first model before training for the data in the second data set, π θ (y w |x) represents the output probability of the first model in training for the data in the first dataset, π θ (y l |x) represents the output probability of the first model in training for the data in the second data set, β is the regularization term corresponding to the KL regularization strength, and λ is a hyperparameter that can be adjusted.
6. A device for generating an evaluation data set, include: A first determination module is used to determine at least one target data corresponding to the first evaluation data based on a first model and at least one first evaluation data collected; wherein the first model is used to generate an evaluation data set, the evaluation data set is used to perform model evaluation, the target data is rewritten data of the first evaluation data, and the similarity between the target data and the first evaluation data is greater than a first threshold; A second determination module is used to determine the validity score of the target data, where the validity score is proportional to the model evaluation effect of the target data; A training module, configured to train the first model based on at least one first evaluation data, at least one target data, and an effectiveness score, so that the trained first model rewrites the first evaluation data to obtain: target data with an effectiveness score greater than a second threshold; The third determination module is used to determine the evaluation data set based on the trained first model.
7. The device according to claim 6, in, The first determining module is further used for: Collect at least one first evaluation data and determine at least one second rewritten data corresponding to the first evaluation data; enabling the first model to learn rewriting capability based on the first evaluation data and the second rewriting data; Inputting the first evaluation data into the learned first model to output at least one third rewritten data corresponding to different first evaluation data; At least one target data corresponding to the first evaluation data is determined from at least one third rewritten data corresponding to the first evaluation data.
8. The method according to claim 6, in, The second determining module is further used for: determining at least one second model; Using at least one target data to evaluate at least one second model to determine the model evaluation effect of the target data; The validity score of the target data is determined based on the model evaluation effect of the target data.
9. The method according to claim 6, in, The training module is also used for: Constructing a reinforcement learning data set based on at least one first evaluation data, at least one target data, and an effectiveness score; Determine a first data set and a second data set based on at least one target data; wherein the first data set includes one or more target data, and the validity score of the target data in the first data set is greater than a second threshold; the second data set includes one or more target data, and the validity score of the target data in the second data set is less than a third threshold; the second threshold is greater than or equal to the third threshold; The first model is trained based on the reinforcement learning data set, the first data set, the second data set, and the DPOP algorithm until the loss function of the first model converges.
10. The method according to claim 4, in, The loss function includes: Wherein, D represents a reinforcement learning data set, x is a validity rewriting prompt input to the first model, and the validity rewriting prompt includes at least one of the following: first evaluation data, rewriting command, and rewriting requirement; y w Represents the first data set, y l represents the second data set, π ref (y w |x) represents the output probability of the first model before training for the data in the first data set, π ref (y l |x) represents the output probability of the first model before training for the data in the second data set, π θ (y w |x) represents the output probability of the first model in training for the data in the first dataset, π θ (y l |x) represents the output probability of the first model in training for the data in the second data set, β is the regularization term corresponding to the KL regularization strength, and λ is a hyperparameter that can be adjusted.
11. An electronic device, include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.
13. A computer program product comprising a computer program, in, When the computer program is executed by a processor, the computer program implements the steps of the method according to any one of claims 1 to 5.
