Supervised data construction method and device, electronic equipment and storage medium

By expanding and generalizing instructions in supervised tasks, generating suitable task instructions, and using the question-and-answer model to construct supervised data, the problems of high threshold and poor universality of supervised data synthesis in the existing technology are solved, and efficient and general supervised data construction is achieved.

CN119830987APending Publication Date: 2025-04-15IFLYTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411882981.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the prior art, supervised data synthesis has high thresholds and poor versatility, making it difficult to quickly generate a large amount of high-quality supervised data.

Method used

By obtaining task description text, seed instructions and input data for supervised tasks, the instructions are expanded and generalized, the task instructions are generated with larger scale and richer diversity, and the question-and-answer model is used to construct supervised data.

Benefits of technology

It lowers the threshold for using model synthesis methods, improves the universality and quality of supervised data, and achieves balanced optimization of data construction efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830987A_ABST
    Figure CN119830987A_ABST
Patent Text Reader

Abstract

The invention provides a supervised data construction method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a task description text, a seed instruction and input data of a supervised task; on the basis of the task description text, instruction expansion is conducted on the seed instruction, and an expansion instruction is obtained; on the basis of the input data, performing instruction generalization on the write expansion instruction to obtain a task instruction; inputting the task instruction into a question and answer model to obtain output data of the task instruction output by the question and answer model; and constructing supervision data based on the task instruction and the output data. According to the method, the device, the electronic equipment and the storage medium provided by the invention, through automatic instruction optimization, the use threshold of a model synthesis mode is greatly reduced, and the fitness between the supervised data and the supervised task can be ensured only by inputting the task description text, so that the generality of construction of the supervised data is effectively ensured, and the construction efficiency of the supervised data is improved. Balanced optimization of construction efficiency and data quality of supervised data is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a supervised data construction method, device, electronic device and storage medium. Background Art

[0002] In the field of artificial intelligence technology, the scale and quality of supervised data have a decisive impact on the performance of trained models.

[0003] Currently, supervised data can be obtained through model synthesis. Model synthesis is to use models to synthesize data, thereby reducing the cost of manual intervention. However, model synthesis usually requires targeted optimization of prompts, which leads to a high threshold for the use of model synthesis and poor versatility, making it difficult to quickly generate a large amount of high-quality supervised data. Summary of the invention

[0004] The present invention provides a supervised data construction method, device, electronic device and storage medium, so as to solve the defects of high threshold for use and poor versatility of supervised data synthesis in related technologies.

[0005] The present invention provides a supervised data construction method, comprising: Obtain task description text, seed instructions, and input data for supervised tasks; Based on the task description text, the seed instruction is expanded to obtain an expanded instruction; Based on the input data, generalizing the expanded instruction to obtain a task instruction; Inputting the task instruction into a question-answering model to obtain output data of the task instruction output by the question-answering model; Based on the task instructions and the output data, supervised data is constructed.

[0006] According to a supervised data construction method provided by the present invention, the step of expanding the seed instruction based on the task description text to obtain the expanded instruction includes: Based on the task description text, or based on the task description text and the supplementary instruction fragment, the seed instruction is expanded to obtain a candidate instruction; The candidate instructions are deduplicated and / or quality-checked to obtain the expanded instructions, wherein the quality-check is performed based on the task description text.

[0007] According to a supervised data construction method provided by the present invention, the step of expanding the seed instruction based on the task description text or based on the task description text and the supplementary instruction fragment to obtain a candidate instruction includes: Extracting sample instructions from the seed instructions and the generated expanded instructions; Based on the task description text, or based on the task description text and the supplementary instruction fragment, the sample instruction is expanded to obtain a candidate instruction.

[0008] According to a supervised data construction method provided by the present invention, the expanded instruction is generalized based on the input data to obtain a task instruction, including: Based on a preset probability, the expansion instruction is triggered to generalize the instruction by fusing the input data according to the style provided by a preset style template to obtain the task instruction.

[0009] According to a supervised data construction method provided by the present invention, the supervised data is constructed based on the task instruction and the output data, comprising: Performing instruction quality inspection on the task instruction and performing response quality inspection on the output data; When the task instruction passes the instruction quality check and the output data passes the response quality check, supervised data is constructed based on the task instruction and the output data.

[0010] According to a supervised data construction method provided by the present invention, the acquisition of input data includes: Obtain the original data and candidate tasks; The original data is matched with each of the candidate tasks, a candidate task matching the original data is determined from each of the candidate tasks based on the matching result, and the original data is used as input data of the matching candidate task.

[0011] The present invention also provides a supervised data construction device, comprising: An acquisition unit, used to acquire task description text, seed instructions and input data of a supervised task; An expansion unit, used for expanding the seed instruction based on the task description text to obtain an expanded instruction; A generalization unit, used for generalizing the expanded instruction based on the input data to obtain a task instruction; A question-answering unit, used for inputting the task instruction into a question-answering model to obtain output data of the task instruction output by the question-answering model; A construction unit is used to construct supervised data based on the task instruction and the output data.

[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the supervised data construction method described in any one of the above methods is implemented.

[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the supervised data construction method as described in any one of the above is implemented.

[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the supervised data construction method described in any one of the above is implemented.

[0015] The supervised data construction method, device, electronic device and storage medium provided by the present invention expand the seed instruction based on the task description text of the supervised task, and generalize the expanded instruction based on the input data of the supervised task, thereby obtaining a task instruction with a larger scale and richer diversity that can match the supervised task itself. Then, the model of the supervised data is synthesized based on the task instruction, and the construction of the supervised data can be realized. In this process, the use threshold of the model synthesis method is greatly reduced through automated instruction optimization, and the fit between the supervised data and the supervised task can be guaranteed by only inputting the task description text, which effectively guarantees the versatility of the supervised data construction and realizes the balanced optimization of the construction efficiency and data quality of the supervised data.

[0016] In addition, the setting of task description text can cover different practical application scenarios, so that supervised data construction can be migrated to various tasks in a fast and low-cost manner, which can significantly improve the ease of use and scenario coverage of supervised data construction methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is one of the flow charts of the supervised data construction method provided by the present invention.

[0019] Figure 2 It is a flowchart of the instruction expansion provided by the present invention.

[0020] Figure 3 It is a flow chart of the quality inspection provided by the present invention.

[0021] Figure 4 This is the second flowchart of the supervised data construction method provided by the present invention.

[0022] Figure 5 This is the third flow chart of the supervised data construction method provided by the present invention.

[0023] Figure 6 It is a structural schematic diagram of the supervised data construction device provided by the present invention.

[0024] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] In recent years, language model (LM) technology based on deep learning has experienced rapid development and has become a highly anticipated research direction in the field of artificial intelligence. Language models are continuously improving their ability to understand and process natural languages ​​through large-scale data training. With the significant increase in the computing power of graphics processing units (GPUs) and the gradual overcoming of technical difficulties in large-scale training, larger-scale training has become possible, which in turn has promoted a double leap in the parameter scale and data scale of large language models (LLMs).

[0027] However, the increase in scale has also brought about a surge in demand for data. Large-scale data means huge construction costs, including investment in manpower construction and annotation. Therefore, how to reduce such costs has become an urgent problem to be solved. At the same time, data quality also plays a vital role in the performance of the trained model, and ensuring data quality has become a primary consideration.

[0028] In the training process of large language models, pre-training and post-training are two important links. Among them, the most common technology in the post-training stage is supervised fine-tuning (SFT). In this stage, the model can learn to understand and execute instructions described in natural language, so as to perform specific tasks. Many independent studies and experiments have shown that the quality of data is crucial in this stage.

[0029] Therefore, how to ensure the quantity and quality of supervised data used in the supervised fine-tuning stage has become an urgent problem to be solved.

[0030] At present, in order to meet the demand for supervised data, supervised data is usually synthesized through three methods: artificial synthesis, template synthesis and model synthesis.

[0031] Among them, manual synthesis is a supervised data synthesis method that relies on a large amount of manpower to write relevant basic instructions and corresponding answers. This method requires special Prompt engineering training for instruction writers to ensure that the instructions and answers written meet the requirements of model training. However, for complex tasks, domain knowledge tasks, and long text tasks, the difficulty of manual synthesis increases significantly, resulting in a significant decrease in efficiency. Especially when it comes to professional fields, it is necessary to invite additional experts in related fields to construct and annotate, which undoubtedly further increases costs.

[0032] Template synthesis is a relatively fast supervised data synthesis method. Template synthesis constructs a unified instruction template for a class of tasks, and then fills the instruction template with structured parsing of the relevant context data, thereby achieving the construction of supervised data. This method has significantly improved efficiency, but due to the singleness of the template, the generated data lacks diversity. Although the diversity problem can be alleviated to a certain extent by constructing multiple templates, the construction of multiple templates will create new pressures on efficiency and cost. At the same time, template synthesis also requires that the original data must be uniformly matched to the format required by the template, which limits the flexibility and application scope of the data.

[0033] Model synthesis attempts to find a balance between cost and effect. Model synthesis uses models to automatically generate data, thereby reducing the cost of manual intervention. However, this solution also introduces many new problems. For example, the data generated by the model may be abnormal, or new dirty data may be introduced, which requires optimizing the instructions and using multi-process processing to ensure the quality of the data. This leads to a high threshold for the use of model synthesis solutions, a lack of versatility, and difficulty in quickly producing a large amount of high-quality data. In addition, although there have been some attempts to automatically construct specific types of data, which can construct a large amount of data for specific tasks, the proportion of high-quality data still needs to be optimized.

[0034] In summary, the current synthesis methods for supervised data all have obvious shortcomings. Among them, the manual synthesis method is costly, inefficient, and requires professional training; although the template synthesis method is efficient, the instruction diversity is poor, and there are strict requirements on the format of the original data; although the model synthesis method attempts to find a balance between cost and effect, it has a high threshold for use, lacks versatility, and the proportion of high-quality data needs to be improved. Therefore, there is an urgent need for a new, efficient, universal, and high-quality data construction solution for supervised data.

[0035] Figure 1 It is one of the flowcharts of the supervised data construction method provided by the present invention, such as Figure 1 As shown, the method includes: Step 110, obtaining the task description text, seed instructions and input data of the supervised task.

[0036] Here, a supervised task is a learning task that needs to be implemented using labeled data, such as a text classification task, a machine translation task, a text summarization task, etc. In the embodiment of the present invention, a supervised task is a task that needs to construct corresponding supervised data.

[0037] The task description text is a natural language text of the requirements for constructing supervised data under a supervised task. The task description text can specifically describe the functions that the supervised data needs to have, and can also be specifically described for the supervised task. In addition, the requirements and conditions for constructing the supervised data can also be described, and the embodiments of the present invention do not limit this. It is clear that the task description text can simply and clearly describe the requirements for constructing the supervised data.

[0038] A seed instruction is an instruction template in the supervised data under a supervised task, and can also be understood as a template of sample data in the supervised data. By filling the data into the template, the sample data in the supervised data can be obtained. Here, there can be one or more seed instructions, that is, one or more instruction templates can be obtained. Different seed instructions are used to implement the same supervised task from different description methods. Seed instructions are template examples of instructions for implementing supervised tasks. Seed instructions can represent specific context content and related parameters in the form of placeholders, for example, it can be "read the following text\n{{text}}\nextract field {{field_list}}", and for example, it can be "read the text\n{{text}}\nand answer the question {{question}}".

[0039] The input data refers to the data collected for the supervised task, which reflects the contextual content and related parameters of the supervised task. For example, for the seed instruction "Read the following text\n{{text}}\nExtract fields {{field_list}}", the data structure of the input data is {"text":"...","field_list": "..."}, that is, the input data may include the content of the text and the content of the extracted fields. The input data may be in the form of structured data, and the input data corresponds to the seed instruction. When unstructured data is obtained, the unstructured data may be converted into structured input data through structured rules or models.

[0040] Step 120: Expand the seed instruction based on the task description text to obtain an expanded instruction.

[0041] Specifically, after obtaining the task description text and seed instructions for supervised tasks, considering that the number of seed instructions is limited, the scale is small, and the diversity is poor, larger-scale and more diverse expanded instructions can be obtained based on the existing seed instructions through instruction expansion, as instruction templates for supervised tasks.

[0042] In order to ensure the reliability of the expanded instructions and prevent the expanded instructions from deviating from the supervised tasks, the task description text can be used as a reference when expanding the instructions for the seed instructions. That is, the task description text can be used as a reference for instruction expansion, and the seed instructions can be used as an example for instruction expansion to generate expanded instructions that meet the requirements described in the task description text and are similar to the seed instructions. Instruction expansion can be specifically implemented through a large language model. For example, the task description text and the seed instructions can be input into the large language model, and the instruction expansion can be performed by the large language model, or the task description text and the seed instructions can be input into an instruction expansion model that has been pre-trained on the basis of the large language model to implement instruction expansion. The embodiments of the present invention do not specifically limit this.

[0043] Step 130: generalize the expanded instruction based on the input data to obtain a task instruction.

[0044] Specifically, instruction expansion is carried out around the task description text of the supervised task, and the expanded instruction obtained is also an instruction template that is separated from the context content. Therefore, after obtaining the expanded instruction, it is necessary to generalize the expanded instruction based on the input data. Through instruction generalization, the context content and related parameters of the supervised task reflected by the input data are integrated into the expanded instruction, thereby generating instructions that are more in line with the context of the supervised task, that is, obtaining task instructions. Task instructions can not only meet the needs of the task description text, but also carry the information of the input data. For example, when performing the task of extracting names from a text, the context content reflected by the input data is about the personnel information of a company. By combining the input data for instruction generalization, task instructions such as "extracting the name of a person in a certain position in a certain company in the text" that are more in line with the context content can be obtained, thereby improving the diversity and clarity of the instructions.

[0045] It can be understood that the task instructions here can be used as instructions for sample data in supervised data, or the task instructions here can be used to determine the instructions required for the labels corresponding to the sample data in the supervised data.

[0046] Instruction generalization can be specifically achieved through a large language model. For example, the input data and expanded instructions can be input into the large language model, and the large language model can generalize the instructions. Alternatively, the input data and expanded instructions can be input into an instruction generalization model that has been pre-trained based on the large language model to achieve instruction generalization. The embodiments of the present invention do not specifically limit this.

[0047] Step 140: input the task instruction into the question-answering model to obtain output data of the task instruction output by the question-answering model.

[0048] Step 150: construct supervised data based on the task instructions and the output data.

[0049] Specifically, after obtaining the task instruction, the task instruction can be input into the question-answering model as a question to obtain the answer output by the question-answering model for the task instruction, that is, the output data of the task instruction.

[0050] Here, the question-answering model can be a large language model, or can be a large language model that is adaptively trained for the field to which the supervised task belongs. The output data of the task instructions obtained based on the question-answering model, that is, the labels in the supervised data under the supervised task.

[0051] Thus, after obtaining the output data, the supervised data is constructed by combining the task instruction and its output data. For example, the task instruction can be used as sample data in the supervised data, and the output data of the task instruction can be used as the label of the sample data in the supervised data; for another example, the input data corresponding to the task instruction can be used as sample data in the supervised data, and the output data of the task instruction can be used as the label of the sample data in the supervised data, which is not specifically limited in the embodiment of the present invention.

[0052] In the method provided in the embodiment of the present invention, the seed instruction is expanded based on the task description text of the supervised task, and the expanded instruction is generalized based on the input data of the supervised task, thereby obtaining a task instruction with a larger scale, richer diversity, and capable of matching the supervised task itself. Then, the model of the supervised data is synthesized based on the task instruction, and the construction of the supervised data can be achieved. In this process, the use threshold of the model synthesis method is greatly reduced through automated instruction optimization, and the fit between the supervised data and the supervised task can be guaranteed by only inputting the task description text, which effectively guarantees the versatility of the construction of the supervised data and achieves a balanced optimization of the construction efficiency and data quality of the supervised data.

[0053] In addition, the setting of task description text can cover different practical application scenarios, so that supervised data construction can be migrated to various tasks in a fast and low-cost manner, which can significantly improve the ease of use and scenario coverage of supervised data construction methods.

[0054] Based on the above embodiment, in step 120, the step of expanding the seed instruction based on the task description text to obtain the expanded instruction includes: Based on the task description text, or based on the task description text and the supplementary instruction fragment, the seed instruction is expanded to obtain a candidate instruction; The candidate instructions are deduplicated and / or quality-checked to obtain the expanded instructions, wherein the quality-check is performed based on the task description text.

[0055] Specifically, in order to ensure the reliability of instruction expansion, on the basis of using the task description text as a reference for instruction expansion and the seed instruction as an example for instruction expansion, supplementary instruction fragments for supervised tasks can also be added to help improve the complexity and quality of instruction expansion. The supplementary instruction fragments here, that is, the supplementary fragments for the existing content in the seed instruction, can be requirements for output results, supplementary instructions for supervised tasks, role positioning for the question-answering model when outputting answers to task instructions, etc. The supplementary instruction fragments can be for supervised tasks or for all types of tasks. For example, it can be "give 3 different answers", "answer in the style of Shakespeare", "answer in markdown format", etc. The embodiment of the present invention does not make specific restrictions on this. In the instructions obtained by expanding the instructions based on the supplementary instruction fragments, the content of the supplementary instruction fragments can be included.

[0056] In addition, considering that duplicate data or dirty data may be introduced during the instruction expansion process, deduplication processing and / or instruction quality inspection may be performed on the result of the instruction expansion. In an embodiment of the present invention, the result of the instruction expansion may be recorded as a candidate instruction.

[0057] Deduplication is performed on the candidate instructions, that is, it is determined whether there are duplicate instructions among the generated candidate instructions, and the duplicate instructions are removed. For example, MinHash fuzzy deduplication can be used to deduplicate the candidate instructions. Here, MinHash is a technology for estimating the Jaccard similarity between two sets, and the Jaccard similarity here measures the ratio of the intersection to the union of the two sets. In the MinHash fuzzy deduplication process, the deduplication process can be accelerated by using Locality-Sensitive Hashing (LSH).

[0058] Performing instruction quality inspection on candidate instructions may specifically include detecting whether the candidate instructions deviate from the task description of the supervised task, and such detection may be performed with reference to the task description text. In addition, instruction quality inspection may also be used to detect whether the candidate instructions have other defects. Instruction quality inspection may be implemented by pre-set rules, or the task description text and the candidate instructions may be input into a large language model together, and the large language model may detect whether the candidate instructions meet the requirements set forth in the task description text, which is not specifically limited in the embodiments of the present invention.

[0059] In the embodiment of the present invention, the candidate instructions that have undergone deduplication processing and / or instruction quality inspection are recorded as expanded instructions. It can be understood that by performing deduplication processing and / or instruction quality inspection after instruction expansion, the instruction quality of the expanded instructions can be guaranteed, thereby providing conditions for ensuring the data quality of the supervised data.

[0060] Based on any of the above embodiments, in step 120, the step of expanding the seed instruction based on the task description text, or based on the task description text and the supplementary instruction fragment, to obtain a candidate instruction includes: Extracting sample instructions from the seed instructions and the generated expanded instructions; Based on the task description text, or based on the task description text and the supplementary instruction fragment, the sample instruction is expanded to obtain a candidate instruction.

[0061] Specifically, instruction expansion can be executed in multiple cycles, and in each cycle execution process, the expanded instructions generated by instruction expansion before can be applied as examples for this round of instruction expansion, so that in this round of instruction expansion process, the previously generated expanded instructions can be referenced, thereby further improving the complexity and quality of the expanded instructions.

[0062] Here, for any round of instruction expansion, the seed instruction and the expanded instructions generated in the previous rounds can be mixed together for sampling, and the instructions thus extracted are used as sample instructions. After obtaining the sample instructions, the task description text, or the task description text and the supplementary instruction fragment can be used as a reference for instruction expansion, and the sample instructions are used as examples of instruction expansion to perform instruction expansion in this round. As a result, the examples used for each round of execution expansion are different, which can further ensure the complexity and diversity of the expanded instructions obtained.

[0063] For example, Figure 2 Schematic diagram of the flow of instruction expansion provided by the present invention. Figure 2 As shown, during the process of instruction expansion, instruction expansion can be performed based on the task description text, seed instructions, and supplementary instruction fragments, thereby obtaining candidate instructions. Subsequently, the candidate instructions that have passed the deduplication process and instruction quality inspection are recorded as expanded instructions, and it is determined whether the number of expanded instructions reaches the target. If it reaches the target, the instruction expansion process can be terminated. If not, a new round of instruction expansion is returned. In addition, when a new round of instruction expansion is performed, sample instructions can be sampled from the seed instructions and the expanded instructions as examples for a new round of instruction expansion.

[0064] Based on any of the above embodiments, in step 130, generalizing the expanded instruction based on the input data to obtain a task instruction includes: Based on a preset probability, the expansion instruction is triggered to generalize the instruction by fusing the input data according to the style provided by a preset style template to obtain the task instruction.

[0065] Specifically, in the process of instruction generalization, in order to further improve the expression diversity of instructions, a preset style template may be introduced to achieve style conversion of instructions through the style represented by the preset style template.

[0066] Here, there may be multiple preset style templates, and different preset style templates may correspond to different instruction expression styles. The preset style template may be an example of an instruction expression style or a description of an instruction expression style, and the embodiment of the present invention does not specifically limit this.

[0067] In order to achieve the diversity of instruction expressions, the trigger probability of style conversion can be set, that is, the preset probability. Therefore, in the process of instruction generalization, when there is a preset probability, the style conversion is triggered, so that the expanded instruction is integrated with the input data to achieve instruction generalization, and the expression style is converted to the style provided by the preset style template. The task instruction obtained in this way not only realizes the integration of the context content reflected by the instruction and the input data, but also realizes the conversion of the expression style, effectively improving the expression diversity of the task instruction.

[0068] Based on any of the above embodiments, in step 150, constructing supervised data based on the task instruction and the output data includes: Performing instruction quality inspection on the task instruction and performing response quality inspection on the output data; When the task instruction passes the instruction quality check and the output data passes the response quality check, supervised data is constructed based on the task instruction and the output data.

[0069] Specifically, after obtaining the output data of the task instructions, in order to construct reliable and effective high-quality supervised data, quality inspection of the task instructions and output data is also required.

[0070] Here, the instruction quality inspection is performed on the task instructions, which can specifically include detecting whether the candidate instructions deviate from the task description of the supervised task. For such detection, the task description text can be referred to for execution. In addition, the instruction quality inspection can also be used to detect whether the candidate instructions have other defects. For example, a large language model can be used to determine whether the task instructions meet the requirements in the task description text. In addition, a large language model can also be used to determine whether the task instructions meet the general quality requirements, and whether the task instructions meet the optional user-added requirements.

[0071] Usually, after it is determined that the task instruction has passed the instruction quality inspection, the response quality inspection can be performed on the output data.

[0072] Here, the response quality inspection for the output data may specifically include detecting whether the output data correctly answers the task instruction and whether the output data meets the quality requirements. Here, detecting whether the output data correctly answers the instruction can be achieved through a large language model; the algorithms for detecting whether the output data meets the quality requirements include but are not limited to: perplexity (PPL) detection, sorry answer recognition, leakage detection algorithm, etc.

[0073] If the task instruction passes the instruction quality inspection and the output data of the task instruction also passes the response quality inspection, the task instruction and its output data can be used together to construct the supervised data. For example, the task instruction can be used as the sample data in the supervised data, and the output data can be used as the label of the sample data in the supervised data. Alternatively, it is also possible to add a format conversion layer based on the specific needs of the supervised task, convert the output data into the target format, and then construct the supervised data, so that users can directly obtain the supervised data that meets the expected format.

[0074] For example, Figure 3 Schematic diagram of the quality inspection process provided by the present invention. Figure 3 As shown, for task instructions, we can first check whether the task instructions meet the requirements in the task description text. On the basis of determining that they meet the requirements in the task description text, we can then check whether the task instructions meet the general quality requirements. On the basis of determining that they meet the quality requirements, we can then check whether the task instructions meet the additional requirements.

[0075] If the task instruction meets the above three requirements, the output data corresponding to the task instruction can be tested for response. Specifically, the output data can be tested first to see if it meets the requirements of the task instruction, and then tested to see if it meets the quality requirements on the basis of determining that it meets the requirements of the task instruction.

[0076] In the method provided in the embodiment of the present invention, by performing quality inspection on the task instructions and the output data respectively, the data quality of the supervised data constructed thereby can be effectively guaranteed.

[0077] Based on any of the above embodiments, Figure 4 This is the second flow chart of the supervised data construction method provided by the present invention. Figure 4 As shown, a supervised data construction method includes the following steps: First, the task description text and seed instructions of the supervised task can be obtained; in addition, the data under the supervised task is structured to obtain structured data matching the seed instructions, namely, input data.

[0078] Secondly, based on the task description text, the seed instructions are expanded to obtain large-scale expanded instructions.

[0079] Next, based on the input data, the expanded instruction is generalized, thereby obtaining a task instruction that combines the context content in the input data.

[0080] Then, the task instruction is used as a question to obtain the corresponding response reply, that is, the output data of the task instruction is obtained.

[0081] After obtaining the task instructions and their output data, quality inspection and filtering can be performed on the task instructions and their output data.

[0082] After completing the quality inspection and filtering, the output data can be converted into a format and the result can be output after the format conversion is completed. The output structure here is supervised data.

[0083] In the above steps, data structuring, instruction expansion, instruction generalization, response acquisition, and quality inspection and filtering can all be achieved through a large language model.

[0084] In the method provided in the embodiment of the present invention, a combination of processes including instruction expansion, instruction generalization, response reply, etc. is performed through a large language model, thereby realizing the construction of supervised data, which can solve the engineering problems in the construction of supervised data and effectively improve the diversity and complexity of supervised data. In addition, through quality inspection and filtering through a large language model, common defects in model synthesis can be repaired and filtered, thereby ensuring the quality of supervised data.

[0085] Moreover, users only need to convert requirements into task description text and seed instructions to achieve high-quality supervised data construction, and a series of processes such as instruction expansion, instruction generalization, response reply, and quality inspection filtering can be integrated into the software and are invisible to users. In this process, users do not need to modify codes and instructions, which greatly reduces the threshold for users to use models for supervised data construction and improves the portability and ease of use of supervised data construction methods.

[0086] In the method provided in the embodiment of the present invention, instruction optimization is achieved through instruction expansion and instruction generalization, and combined with quality inspection and filtering, the quality of supervised data is improved and defective data is filtered, so that the construction quality of supervised data is higher and the diversity is richer. In addition, supervised data construction is achieved in an automated form, which greatly improves the efficiency of data construction. As a result, higher quality supervised data can be obtained at a lower cost, which can play a positive role in model training.

[0087] Based on any of the above embodiments, in step 110, the acquisition of input data includes: Obtain the original data and candidate tasks; The original data is matched with each of the candidate tasks, a candidate task matching the original data is determined from each of the candidate tasks based on the matching result, and the original data is used as input data of the matching candidate task.

[0088] Specifically, in each of the above embodiments, a clear task description text is set as a task definition for the supervised task, and there is matching input data for the supervised task. However, in actual applications, not all supervised tasks have highly matching input data, which limits the quality improvement of supervised data construction. In addition, there are some high-quality data that cannot be matched to the corresponding supervised tasks, which makes it difficult to use this part of the data.

[0089] In the embodiment of the present invention, the above problems are improved. In the embodiment of the present invention, the original data is the data that has not been matched with the supervised task, the candidate task is the task that can be used as the supervised task, and the number of the candidate tasks is multiple. It can be understood that the setting of multiple candidate tasks greatly increases the probability that the original data hits one of the candidate tasks as the supervised task that matches it, which helps to help the original data achieve task matching.

[0090] After obtaining the original data and multiple candidate tasks, the original data can be matched with each candidate task respectively, thereby obtaining the matching results of the original data and each candidate task respectively. The matching result here can be the matching degree or whether it is matched. After obtaining the matching results of the original data and each candidate task respectively, the candidate task that matches the original data can be determined from each candidate task, thereby, the original data can be used as the input data of the candidate task, which facilitates the application of the original data.

[0091] Furthermore, in this process, the matching between the original data and each candidate task can be achieved through the large language model, that is, the large language model can match each candidate task with the context reflected by the original data, thereby selecting the candidate task that best fits the original data from each candidate task. In addition, in this process, the large language model can also appropriately rewrite and intercept the original data so that the original data can better match the candidate task.

[0092] For example, Figure 5 This is the third flow chart of the supervised data construction method provided by the present invention. Figure 5 As shown, a candidate task list, supplementary requirements and original data can be obtained in advance. The candidate task list includes multiple candidate tasks, and the supplementary requirements can be supplementary descriptions of the task requirements of the candidate tasks, or can be descriptions of the requirements for constructing the entire supervised data, which is not specifically limited in the embodiment of the present invention.

[0093] Secondly, the candidate task list and supplementary requirements can be combined into a configuration file, and data pre-filtering can be performed on the original data.

[0094] Subsequently, task matching can be performed based on the configuration file and the original data after pre-filtering. The task matching here can be achieved through a large language model, and in the task matching process based on the large language model, adaptive adjustments can be made to the original data.

[0095] After obtaining the task matching result, that is, obtaining the best matching task for the original data, the best matching task can be used as a supervised task to generate a task description text for the task, and generate task instructions based on the task description text and the original data. In this process, the generation of the task description text and the generation of the task instructions can both be achieved through the large language model.

[0096] After obtaining the task instruction, the task instruction can be used as a question to obtain the corresponding response reply, that is, to obtain the output data of the task instruction. Here, the acquisition of the response reply can also be implemented based on the large language model.

[0097] After obtaining the task instructions and their output data, quality inspection and filtering can be performed on the task instructions and their output data. The quality inspection and filtering here can also be achieved through a large language model.

[0098] After completing the quality inspection and filtering, the output data can be converted into a format and the result can be output after the format conversion is completed. The output structure here is supervised data.

[0099] The supervised data construction device provided by the present invention is described below. The supervised data construction device described below and the supervised data construction method described above can be referenced to each other.

[0100] Figure 6 is a schematic diagram of the structure of the supervised data construction device provided by the present invention, such as Figure 6 As shown, the supervised data construction device includes: An acquisition unit 610 is used to acquire a task description text, a seed instruction, and input data of a supervised task; An expansion unit 620, configured to expand the seed instruction based on the task description text to obtain an expanded instruction; A generalization unit 630, configured to generalize the expanded instruction based on the input data to obtain a task instruction; A question-answering unit 640, configured to input the task instruction into a question-answering model to obtain output data of the task instruction output by the question-answering model; The construction unit 650 is used to construct supervised data based on the task instruction and the output data.

[0101] In the device provided by the embodiment of the present invention, the seed instruction is expanded based on the task description text of the supervised task, and the expanded instruction is generalized based on the input data of the supervised task, thereby obtaining a task instruction with a larger scale and richer diversity that can match the supervised task itself. Then, the model of the supervised data is synthesized based on the task instruction, and the construction of the supervised data can be achieved. In this process, the use threshold of the model synthesis method is greatly reduced through automated instruction optimization, and the fit between the supervised data and the supervised task can be guaranteed by only inputting the task description text, which effectively guarantees the versatility of the construction of the supervised data and achieves a balanced optimization of the construction efficiency and data quality of the supervised data.

[0102] In addition, the setting of task description text can cover different practical application scenarios, so that supervised data construction can be migrated to various tasks in a fast and low-cost manner, which can significantly improve the ease of use and scenario coverage of supervised data construction.

[0103] Based on any of the above embodiments, the expansion unit is specifically used for: Based on the task description text, or based on the task description text and the supplementary instruction fragment, the seed instruction is expanded to obtain a candidate instruction; The candidate instructions are deduplicated and / or quality-checked to obtain the expanded instructions, wherein the quality-check is performed based on the task description text.

[0104] Based on any of the above embodiments, the expansion unit is specifically used for: Extracting sample instructions from the seed instructions and the generated expanded instructions; Based on the task description text, or based on the task description text and the supplementary instruction fragment, the sample instruction is expanded to obtain a candidate instruction.

[0105] Based on any of the above embodiments, the generalization unit is specifically used for: Based on a preset probability, the expansion instruction is triggered to generalize the instruction by fusing the input data according to the style provided by a preset style template to obtain the task instruction.

[0106] Based on any of the above embodiments, the construction unit is specifically used for: Performing instruction quality inspection on the task instruction and performing response quality inspection on the output data; When the task instruction passes the instruction quality check and the output data passes the response quality check, supervised data is constructed based on the task instruction and the output data.

[0107] Based on any of the above embodiments, the acquiring unit is specifically used for: Obtain the original data and candidate tasks; The original data is matched with each of the candidate tasks, a candidate task matching the original data is determined from each of the candidate tasks based on the matching result, and the original data is used as input data of the matching candidate task.

[0108] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the supervised data construction method, which includes: Obtain task description text, seed instructions, and input data for supervised tasks; Based on the task description text, the seed instruction is expanded to obtain an expanded instruction; Based on the input data, generalizing the expanded instruction to obtain a task instruction; Inputting the task instruction into a question-answering model to obtain output data of the task instruction output by the question-answering model; Based on the task instructions and the output data, supervised data is constructed.

[0109] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0110] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the supervised data construction method provided by the above methods, the method comprising: Obtain task description text, seed instructions, and input data for supervised tasks; Based on the task description text, the seed instruction is expanded to obtain an expanded instruction; Based on the input data, generalizing the expanded instruction to obtain a task instruction; Inputting the task instruction into a question-answering model to obtain output data of the task instruction output by the question-answering model; Based on the task instructions and the output data, supervised data is constructed.

[0111] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the supervised data construction method provided by the above methods, the method comprising: Obtain task description text, seed instructions, and input data for supervised tasks; Based on the task description text, the seed instruction is expanded to obtain an expanded instruction; Based on the input data, generalizing the expanded instruction to obtain a task instruction; Inputting the task instruction into a question-answering model to obtain output data of the task instruction output by the question-answering model; Based on the task instructions and the output data, supervised data is constructed.

[0112] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0113] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.

[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A supervised data construction method, characterized in that: include: Obtain task description text, seed instructions, and input data for supervised tasks; Based on the task description text, the seed instruction is expanded to obtain an expanded instruction; Based on the input data, generalizing the expanded instruction to obtain a task instruction; Inputting the task instruction into a question-answering model to obtain output data of the task instruction output by the question-answering model; Based on the task instructions and the output data, supervised data is constructed.

2. The supervised data construction method according to claim 1, characterized in that: The step of expanding the seed instruction based on the task description text to obtain the expanded instruction includes: Based on the task description text, or based on the task description text and the supplementary instruction fragment, the seed instruction is expanded to obtain a candidate instruction; The candidate instructions are deduplicated and / or quality-checked to obtain the expanded instructions, wherein the quality-check is performed based on the task description text.

3. The supervised data construction method according to claim 2, characterized in that: The step of expanding the seed instruction based on the task description text or based on the task description text and the supplementary instruction fragment to obtain a candidate instruction includes: Extracting sample instructions from the seed instructions and the generated expanded instructions; Based on the task description text, or based on the task description text and the supplementary instruction fragment, the sample instruction is expanded to obtain a candidate instruction.

4. The supervised data construction method according to claim 1, characterized in that: The step of generalizing the expanded instruction based on the input data to obtain a task instruction includes: Based on a preset probability, the expansion instruction is triggered to generalize the instruction by fusing the input data according to the style provided by a preset style template to obtain the task instruction.

5. The supervised data construction method according to claim 1, characterized in that: The constructing supervised data based on the task instruction and the output data comprises: Performing instruction quality inspection on the task instruction and performing response quality inspection on the output data; When the task instruction passes the instruction quality check and the output data passes the response quality check, supervised data is constructed based on the task instruction and the output data.

6. The supervised data construction method according to any one of claims 1 to 5, characterized in that: The acquisition of the input data includes: Obtain the original data and candidate tasks; The original data is matched with each of the candidate tasks, a candidate task matching the original data is determined from each of the candidate tasks based on the matching result, and the original data is used as input data of the matching candidate task.

7. A supervised data construction device, characterized in that: include: An acquisition unit, used to acquire task description text, seed instructions and input data of a supervised task; An expansion unit, used for expanding the seed instruction based on the task description text to obtain an expanded instruction; A generalization unit, used for generalizing the expanded instruction based on the input data to obtain a task instruction; A question-answering unit, used for inputting the task instruction into a question-answering model to obtain output data of the task instruction output by the question-answering model; A construction unit is used to construct supervised data based on the task instruction and the output data.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the supervised data construction method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the supervised data construction method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the supervised data construction method according to any one of claims 1 to 6 is implemented.