Data synthesis method and device, model pre-training method and device, medium and equipment
By splitting the target task into multiple subtasks and generating multi-style prompt words, the problem of insufficient data synthesis scale and quality in the prior art is solved, and large-scale and high-quality synthetic data generation is achieved, which meets the data needs of the pre-training process.
Patent Information
- Application Number
- CN202411821931.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-04-22
AI Technical Summary
Existing data synthesis technologies are difficult to meet the needs of large-scale data during pre-training, and the generated synthetic data is of a small order, which cannot meet the training needs of complex models.
By splitting the target task into multiple subtasks, and generating multi-style prompt words based on the large language model, obtaining the generated data corresponding to multiple subtasks, and finally integrating it into the synthetic data corresponding to the target task.
Large-scale and high-quality synthetic data generation is achieved, improving the accuracy, complexity and coherence of synthetic data, and meeting the needs of large-scale data during pre-training.
Smart Images

Figure CN119862269A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular to a data synthesis method, a model pre-training method, a data synthesis device, a computer-readable storage medium, and an electronic device. Background Art
[0002] Data synthesis is a method of creating artificially generated data that usually has similar statistical properties to real-world data. This technology is widely used in many fields, especially in artificial intelligence, such as natural language processing, computer vision, etc.
[0003] The data synthesis solutions provided by related technologies generally use machine learning models (such as generative adversarial networks, variational autoencoders, etc.) to generate synthetic data. However, the amount of synthetic data is relatively small, such as 100,000 to 1 million. It can be applied to supervised model training processes. For example, it can be applied to the supervised fine-tuning process of large language models (LLM).
[0004] Pre-training refers to training a model on a large-scale dataset to obtain a universal feature representation. Therefore, the demand for data volume (such as billions or even tens of billions) far exceeds the scale that data synthesis technology in related technologies can provide. Summary of the invention
[0005] The embodiments of the present application provide a data synthesis method, a model pre-training method, a data synthesis device, a computer-readable storage medium, and an electronic device, which can provide large-scale and high-quality synthetic data, which is conducive to meeting the demand for large-scale data volume in the pre-training process.
[0006] In a first aspect, an embodiment of the present application provides a data synthesis method, the method comprising: splitting a target task corresponding to a target pre-trained model to obtain multiple subtasks; determining a prompt word based on seed data in a seed data set, wherein the data in the seed data set is seed data about the target task collected from multiple channels, and the prompt word is a prompt word corresponding to the subtask or a prompt word corresponding to the target task, and the prompt word has multiple styles; inputting the prompt word into a large language model, wherein the large language model is a trained model, and generated data output by the large language model corresponds to the prompt word; and determining synthesized data about the target task based on the generated data.
[0007] In a second aspect, an embodiment of the present application provides a model pre-training method, the method comprising: obtaining synthetic data about a target task according to the method provided in the first aspect; and, performing the target task according to the synthetic data.
[0008] In a third aspect, an embodiment of the present application provides a data synthesis device, the device comprising: a task splitting module, a prompt word determination module, a generated data determination module, and a synthesized data determination module;
[0009] Among them, the above-mentioned task splitting module is used to split the target task corresponding to the target pre-trained model to obtain multiple sub-tasks; the above-mentioned prompt word determination module is used to determine the prompt word according to the seed data in the seed data set, wherein the data in the above-mentioned seed data set is the seed data about the above-mentioned target task collected from multiple channels, and the styles of the above-mentioned prompt word include multiple types; the above-mentioned generated data determination module is used to input the above-mentioned prompt word into the large language model, wherein the above-mentioned large language model is a trained model, and the generated data output by the above-mentioned large language model corresponds to the above-mentioned prompt word; and the above-mentioned synthetic data determination module is used to determine the synthetic data about the above-mentioned target task according to the above-mentioned generated data.
[0010] In a fourth aspect, an embodiment of the present application provides a model pre-training device, which includes: a synthetic data acquisition module and a pre-training module; wherein the synthetic data acquisition module is used to obtain synthetic data about the target task according to the method provided in the first aspect; and the pre-training module is used to perform the target task based on the synthetic data.
[0011] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the data synthesis method provided in the first aspect or the model pre-training method provided in the second aspect.
[0012] In a sixth aspect, an embodiment of the present application provides a chip for implementing the data synthesis method provided in the first aspect or the second aspect. Specifically, the chip includes: a processor for calling and running a computer program from a memory, so that a device equipped with the chip executes the data synthesis method provided in the first aspect or the model pre-training method provided in the second aspect.
[0013] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program enables a computer to execute the data synthesis method provided in the first aspect or the model pre-training method provided in the second aspect.
[0014] In an eighth aspect, an embodiment of the present application provides a computer program product, comprising computer program instructions, wherein the computer program instructions enable a computer to execute the data synthesis method provided in the first aspect or the model pre-training method provided in the second aspect.
[0015] In a ninth aspect, an embodiment of the present application provides a computer program which, when executed on a computer, enables the computer to execute the data synthesis method provided in the first aspect or the model pre-training method provided in the second aspect.
[0016] In summary, in the data synthesis scheme provided by the embodiment of the present application, the electronic device determines the model to be pre-trained and the target task for the model to be executed, and then collects the rich and varied seed data from various channels to obtain the seed data set about the above-mentioned target task. On the one hand, in the embodiment of the present application, the rich and varied seed data in the above-mentioned seed data set are spliced to obtain a variety of prompt words. Thus, the diversity of synthetic data can be promoted by improving the diversity of the input prompt words of the large language model. On the other hand, the target task can be split into multiple subtasks, so as to obtain the generated data corresponding to multiple subtasks respectively based on the trained large language model, and further integrate them into the synthetic data corresponding to the above-mentioned target task. Thus, the embodiment of the present application adopts the method of capability splitting and combination to improve the accuracy, complexity and coherence of the synthetic data, and then improves the quality of the synthetic data, which is conducive to meeting the demand for large-scale high-quality data for pre-training. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 A schematic diagram of the system architecture of the application environment of the data synthesis solution provided in the embodiment of the present application;
[0019] Figure 2 A flowchart of a data synthesis method provided in an embodiment of the present application;
[0020] Figure 3 A flowchart of a data synthesis method provided in an embodiment of the present application;
[0021] Figure 4 A flowchart of a data synthesis method based on capability decomposition and synthesis provided in an embodiment of the present application;
[0022] Figure 5 A flowchart of a data synthesis method based on capability combination and decomposition provided in an embodiment of the present application;
[0023] Figure 6 A schematic block diagram of a data synthesis device provided in an embodiment of the present application;
[0024] Figure 7 A schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here can be implemented in a sequence other than those illustrated or described here. In the present application embodiment of the present invention, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, but can also determine B according to A and / or other information. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. In the description of the present application, unless otherwise specified, "multiple" refers to two or more than two.
[0027] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0028] Existing data synthesis methods are unable to meet the huge data requirements of the pre-training process. Therefore, in most cases, pre-training relies on real data collected from the Internet or other large-scale data sources.
[0029] In view of the above-mentioned technical problems existing in the related art, the embodiment of the present application provides a scheme for providing pre-training data through data synthesis. Specifically, the electronic device determines the model to be pre-trained and the target task for the model to be executed, and then collects the rich and various seed data about it from various channels to obtain the seed data set about the above-mentioned target task. On the one hand, in the embodiment of the present application, the rich and various seed data in the above-mentioned seed data set are spliced to obtain a variety of prompt words. Thus, the large scale and diversity of synthetic data can be promoted by improving the diversity of the input prompt words of the large language model. On the other hand, the target task can be split into multiple subtasks, so as to obtain the generated data corresponding to the multiple subtasks respectively based on the trained large language model, and further integrate them into the synthetic data corresponding to the above-mentioned target task. Thus, the embodiment of the present application adopts the method of capability splitting and combination to improve the accuracy, complexity and coherence of the synthetic data, which is conducive to improving the quality of the synthetic data, and can alleviate the problem of scarcity of high-quality data during the current model pre-training.
[0030] Below through Figure 1 An exemplary system architecture of an embodiment of the present application is introduced.
[0031] For example, Figure 1 A schematic diagram of the system architecture of the application environment of the data synthesis solution provided in one embodiment of the present application. Figure 1 As shown, the system architecture of the implementation environment of the embodiment of the present application may include: a terminal 102, a server 104 for executing a data synthesis scheme or model pre-training, and a cloud server 106 for providing seed data. Among them, the connection mode 11 between the terminal 102 and the server 104 can be a wired communication link or a wireless communication link, such as through a local area network (LAN). The connection mode 11 between the server 104 and the cloud server 106 can be a wired communication link or a wireless communication link, such as a wide area network (WAN).
[0032] Exemplarily, the cloud server 106 can specifically provide basic cloud computing services such as cloud database, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and big data and artificial intelligence platforms. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. The terminal 102 is used for information input and information display, etc. Exemplarily, the terminal 102 is a computer, a smart phone, a tablet, an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, a wearable smart device, a medical device, etc. The terminal 102 is often configured with a display device, and the display device can also be a display, a display screen, a touch screen, etc. The touch screen can also be a touch screen, a touch panel, etc., but is not limited to this.
[0033] In an exemplary embodiment, reference Figure 1 , the user inputs the relevant information of the model to be pre-trained through the terminal 120, such as the model type, the task that the model is used to perform, etc. Among them, the data required for the pre-training of the above model will be provided by the embodiment of the present application. Thus, the terminal 120 inputs the relevant information of the model to be pre-trained, which can trigger the server 104 to perform the data synthesis process.
[0034] Exemplarily, in step S10, the server 104 determines the task to be performed by the pre-trained model, such as being recorded as the target task. In step S11, the server 104 obtains the original data about the above-mentioned target task from the cloud server 106 and / or the local and determines the seed data set, so as to ensure the diversity of the input of the large language model by obtaining data through multiple channels. In step S12, the server 104 splits the target task into multiple subtasks. In this embodiment, splitting a complex task into simpler tasks is conducive to obtaining more accurate generated data. In step S13, the server 104 determines a variety of prompt words for each subtask based on the seed data in the seed data set to further improve the diversity of generated data. Further, in step S14, the server 104 inputs the prompt word into a large language model, wherein the large language model outputs the generated data corresponding to the prompt word, and the above-mentioned large language model is trained; and, based on the generated data, the synthetic data about the target task is determined. In this embodiment, the generated data with higher accuracy corresponding to each subtask is integrated into the synthetic data corresponding to the target task, which can ensure the quality of the synthetic data.
[0035] It should be noted that Figure 1 The system architecture of the implementation environment of the embodiment of the present application is exemplified, but the system architecture of the implementation environment of the embodiment of the present application is not limited to Figure 1 shown.
[0036] The data synthesis method of the embodiment of the present application is described in detail below through some embodiments. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0037] Figure 2 The flowchart of a data synthesis method P200 provided in an embodiment of the present application is shown in FIG. Figure 1 Server 104 is shown.
[0038] In step S210, the target task corresponding to the target pre-training model is split into multiple subtasks.
[0039] The target pre-trained model is any model to be pre-trained. Exemplarily, the target pre-trained model can be a natural language processing model, such as a large language model to be pre-trained. With the rapid development of large language model technology, real data will not be able to meet the requirements of large language models for massive high-quality data, and data synthesis will become a key technology to promote the development of the next generation and even future large language models.
[0040] It should be noted that in addition to being applied to pre-training of large language models, the above-mentioned target pre-training model can also be a computer vision model. For example, the training of a generative adversarial network requires a large amount of image data to ensure that the generator can learn to generate high-quality images. The above-mentioned target pre-training model can also be a speech recognition model. For example, the unsupervised learning process of an autoencoder requires a large amount of audio data. The above-mentioned target pre-training model can also be a recommendation model; and so on.
[0041] In an exemplary embodiment, reference Figure 3 After determining the task (referred to as the target task) that the target pre-trained model is to perform, the server obtains seed data 32 about the target task from multiple channels. The seed data is the basis for generating synthetic data, and can be about the real examples and structures of the target task (such as the math problem solving task). These data will help the trained large language model 300 understand the information related to the math problem solving, such as the type of question, the logic of solving the problem, and the expression method. Exemplary seed data acquisition channels include web pages, books, encyclopedias, forums, social media, professional databases, etc. Multi-channel data sources provide rich information and diverse text styles.
[0042] The embodiment of the present application promotes the diversity of synthetic data by ensuring the diversity of seeds on the one hand, and can also ensure the high quality of synthetic data on the other hand. Specifically, the method of capability decomposition and synthesis is adopted in the data synthesis process provided by the embodiment of the present application to promote the synthetic data to have more accuracy, complexity and coherence, etc., so as to improve the quality of synthetic data. Specifically, the above-mentioned target task can be split. For example, the target task is a complex computing task A, which can be split into subtask a1, subtask a2 and subtask a3 with clear goals according to certain splitting basis (such as splitting by function), and the sum of the functions of the three subtasks is equivalent to the function of task A. In the embodiment of the present application, splitting the target task into multiple subtasks with clear goals is more conducive to the accuracy of data generation.
[0043] Continue to refer Figure 1 In step S120, a prompt word is determined according to seed data in the seed data set, wherein the data in the seed data set is seed data about the target task collected from multiple channels, and the prompt word includes multiple styles.
[0044] The embodiment of the present application determines the synthetic data of the target task based on the generated data of the trained large language model, and then performs a pre-training process on the target pre-training model based on the synthetic data. Figure 3 As shown, prompt words 34 of various styles are respectively input into the large language model 300, so that the large language model 300 outputs generated data 36, wherein the generated data 36 corresponds to the prompt word 34. The synthetic data 38 of the above-mentioned target task is further determined based on the above-mentioned generated data. On the one hand, since the large language model 300 has been pre-trained with a large-scale corpus and has a strong natural language understanding and generation capability, the obtained synthetic data is a grammatically correct, semantically coherent and contextual text. On the other hand, by adjusting the prompt words and control parameters of the model, the diversity of the synthetic data can be improved, and different difficulty levels, audience groups, language styles and formats can be covered, ensuring the wide applicability of the synthetic data.
[0045] The server determines the obtained seed data as the seed data set of the target task, so as to generate prompt words related to the target task, such as prompt words of subtasks after splitting the target task. Figure 3When generating prompt words related to the above-mentioned target task based on the above-mentioned seed data set, prompt words 34 of various styles can be generated, in order to promote the diversity of synthetic data by improving the diversity of prompt words input to the large language model. Exemplarily, the prompt words of the above-mentioned various styles differ in at least one of the following aspects: difficulty, audience, style and format. For example, the difficulty level includes multiple levels of difficulty from simple to complex; prompt words are customized according to different user groups, and different audiences include professionals, students, the general public, etc.; prompt words are generated using different language styles, such as formal, informal, humorous, academic, etc.; prompt words are designed in different output formats, such as question-answer pairs, dialogue forms, fill-in-the-blank questions, paragraph descriptions, etc.
[0046] In step S130, the prompt word is input into a large language model, such as Figure 3 300 is shown. The large language model is a trained model, and the generated data output by the large language model corresponds to the prompt word. And, in step S140, synthetic data about the target task is determined based on the generated data.
[0047] The embodiment of the present application promotes the diversity of synthesized data by increasing the diversity of the input prompt words of the large language model, and can also improve the quality of the synthesized data. As mentioned above, the data synthesis process provided by the embodiment of the present application adopts the method of capability decomposition and synthesis to promote the synthesized data to have higher accuracy, complexity and coherence, etc., thereby improving the quality of the synthesized data. Specifically, different target tasks have different characteristics. Next, according to the characteristics of different target tasks, a data synthesis method of targeted capability decomposition and synthesis is provided.
[0048] In an exemplary embodiment, if the complexity of the above-mentioned target task, the diversity of synthetic data is high, and / or the quality of synthetic data is high, the target task can be decomposed as a total task, that is, divided into multiple independent and interrelated subtasks, and further based on the generated data corresponding to the multiple subtasks, the synthetic data related to the target task (total task) is determined. For example, the large language model b is a model to be pre-trained, and the target task corresponding to the large language model b is to answer difficult questions. Then answering difficult questions can be split as a total task, for example, it can be split into the following subtasks: question generation, problem-solving steps, knowledge point explanation, answers, reflection, error correction, evaluation, transformation solutions and step planning. Compared with determining the prompt words of the target task (answering difficult questions) and generating corresponding data based on the trained large language model, splitting the target task into multiple subtasks with clear goals is more conducive to the accuracy of data generation.
[0049] Figure 4 The following is a flow chart of a data synthesis method P400 provided in an embodiment of the present application. Figure 4 The specific implementation of the above-mentioned data synthesis method based on capability decomposition and synthesis is introduced.
[0050] In step S410, when the target task meets the first preset condition, the target task is decomposed into M subtasks, where M is an integer greater than 1.
[0051] In an exemplary embodiment, the first preset condition may include one or more of the following: the complexity of the task is higher than the corresponding threshold, the diversity of the synthesized data is higher than the corresponding threshold, and the quality of the synthesized data is higher than the corresponding threshold. That is to say, the data synthesis method such as method P400 is suitable for scenarios with high complexity of the target task, high diversity of the synthesized data, and / or high quality of the synthesized data. Specifically, when the task corresponding to the pre-trained model involves multiple complex subtasks or capability points, decomposing them can ensure that each subtask has sufficient data support. When it is necessary to ensure that the data of each subtask is diverse, that is, in scenarios where the data diversity requirements are high, the quality of the overall data set can be improved by implementing methods such as method P400. In scenarios where it is necessary to finely control and optimize the data of each subtask to ensure the quality of the final synthesized data, it is also suitable to adopt method P400.
[0052] In addition to the above-mentioned math problem solving tasks suitable for method P400, natural language processing tasks such as text summarization, machine translation, and dialogue systems may also be used. These tasks usually involve multiple subtasks, such as sentence segmentation, keyword extraction, grammatical analysis, semantic understanding, etc. It is understandable that other tasks that may be performed by the pre-trained model are not limited in the embodiments of the present application.
[0053] In an exemplary embodiment, the target task can be split into multiple subtasks according to a preset splitting basis. The splitting basis refers to the standard or reference factor used to split the target task into multiple subtasks. Specifically, it can be determined according to the characteristics of the current target task, such as splitting a complex overall task into multiple simpler subtasks, so that each subtask is easier to manage and optimize; such as splitting the overall task into subtasks with clear goals and functions according to the different functions and requirements of the task; and ensuring that each subtask can be generated independently and the generated data can be effectively combined.
[0054] refer to Figure 4 , determine the prompt word corresponding to the subtask through steps S420-1 to S420-3.
[0055] In step S420 - 1 , the i th data generation target corresponding to the i th subtask is determined, where i is a positive integer not greater than M. In this embodiment, it is assumed that the target task is split into M subtasks.
[0056] The above-mentioned target task takes solving complex math problems as an example. Suppose that the math problem solving task is decomposed into at least two of the following subtasks: problem generation, problem solving steps, knowledge point explanation, answer, reflection, error correction, evaluation, solution transformation and step planning.
[0057] In the embodiment of the present application, based on the trained large language model (such as Figure 3 Therefore, for any subtask, it is necessary to determine the goal of data generation, and further determine the prompt word of the current subtask based on the goal. For example, in the error correction subtask, the goal is to generate error correction data, that is, to identify and correct wrong answers and provide detailed error correction instructions.
[0058] In step S420 - 2 , an i th seed data subset is determined from the seed data set according to the i th data generation target.
[0059] In some embodiments, the prompt words corresponding to the subtask can be designed directly according to the data generation target of the subtask and the total seed data set, and this method has the characteristics of high efficiency. In other embodiments, the seed data subset corresponding to the current subtask can also be determined from the total seed data set, which is conducive to ensuring that the data generated by the model is more in line with the specific requirements of the subtask. It can be understood that whether to determine an independent seed data set for each subtask should be determined according to specific needs and resource conditions; if the above-mentioned target task is more complex and the differences between the subtasks are large, an independent seed data set can be prepared for each subtask to improve the quality and pertinence of the generated data; if the task is relatively simple or resources are limited, it can be considered to use a unified seed data set or adopt a hybrid strategy; the embodiments of the present application do not limit this.
[0060] In the data generation process of the large language model, the context can provide the model with additional background information or previous interaction records to help the model better understand and generate content that meets the requirements. For example, for the error correction subtask, in addition to inputting prompt words, the wrong answers and correct answers to the questions can also be input into the model as context. Exemplarily, the above-mentioned i-th seed data subset determined can be used as context to input into the large language model together with the i-th prompt word to help the model better understand and generate data that meets the requirements of the i-th subtask.
[0061] In step S420 - 3 , a prompt word corresponding to the i th subtask is determined according to the i th seed data subset and the i th data generation target.
[0062] The i-th seed data subset can also be used to guide the generation of the i-th prompt word, which can ensure that the prompt word for the current subtask is targeted.
[0063] Exemplarily, for the error correction subtask, a large language model is sampled to answer an incorrect result and a correct result is given, and then corresponding prompt words can be designed to generate error correction information based on the incorrect answer and the correct answer.
[0064] For example, for the evaluation subtask, the answer to a question is determined from the corresponding seed data subset or the total seed data set, and the prompt word of the subtask can be designed to correct the answer to the question to determine the correct part and the wrong part of the answer.
[0065] For example, for the knowledge point explanation subtask, a math problem is determined from the corresponding seed data subset or the total seed data set, and the prompt word of the subtask can be designed to be "please answer the knowledge point tested by the math problem".
[0066] For example, for the solution change subtask, a math problem and an answer are determined from the corresponding seed data subset or the total seed data set, and the prompt word for the subtask can be designed to let the large language model change the solution.
[0067] For example, for the step planning subtask, a math problem can be determined from the corresponding seed data subset or the total seed data set, and the prompt words of the subtask can be designed to allow the large language model to give an overall idea and step planning.
[0068] For example, for the reflection subtask, that is, the data generation goal is to reflect on the math problem solution, hoping to determine whether the solution to the math problem is correct. The correct or incorrect solution to a math problem can be determined from the corresponding seed data subset or the total seed data, and it can be used as the context in the model input information. The prompt words of this subtask can be designed to let the large language model reflect on the answering process in the context.
[0069] In step S430, the prompt word corresponding to the i-th subtask is input into a large language model, wherein the large language model is a trained model, and the generated data output by the large language model corresponds to the prompt word.
[0070] refer to Figure 3 The trained large language model 300 processes the input information corresponding to each subtask and outputs the generated data corresponding to each subtask. The generated data corresponding to multiple subtasks belonging to the same target task will be used to determine the synthetic data corresponding to the target task, which will be specifically described in the steps corresponding to step S440.
[0071] In step S440 - 1 , the i th generated data corresponding to the i th subtask is post-processed, and the post-processing at least includes merging the i th generated data and the model input data of the i th subtask.
[0072] As mentioned above, in order to improve the data quality of the synthesized data, the embodiment of the present application is implemented in a manner based on capability decomposition and merging. The capability combination method can be reflected in the post-processing process of the generated data corresponding to the i-th subtask. Specifically, the generated data of the current subtask can be merged with the model input data to enhance the accuracy of the generated data corresponding to the current subtask, which is conducive to enhancing the accuracy of the synthesized data.
[0073] Exemplarily, for the error correction subtask: the wrong answers, the error correction information generated by the model, and the correct answers are merged together to form the error correction data, thereby enhancing the targetedness of the error correction and improving the expressiveness of the generated data. For the evaluation subtask: the correction results output by the model are merged with the answer information to form the evaluation data, thereby enhancing the targetedness of the evaluation and improving the expressiveness of the generated data. For the knowledge point explanation subtask: the knowledge point situation tested by the math problem output by the large language model and the math problem are merged together to form the knowledge point node data, thereby enhancing the targetedness of the explanation and improving the expressiveness of the generated data. For the transformation solution subtask: the solution output by the model and the solution input to the model are merged together to form the transformation solution data. For the step planning subtask: the step planning data output by the model and the current question are merged together to form the step planning data. For the reflection subtask: the reflection result output by the model and the answer data are merged together to form the reflection data.
[0074] In an exemplary embodiment, the post-processing may further include: performing a quality check on the generated data to remove inappropriate samples, and formatting and standardizing the generated data to ensure the consistency and availability of the data, etc.
[0075] In step S440 - 2 , the post-processed generated data corresponding to the M subtasks are integrated to obtain synthetic data about the target task.
[0076] Exemplarily, the data corresponding to all subtasks belonging to the same target task and having undergone the above post-processing are integrated to integrate the data of each capability point together to form a complete pre-training data set. In other words, the way of combining capabilities can be reflected in the integration process of the generated data corresponding to each subtask. The reflection data, error correction data, evaluation data, knowledge point analysis data, transformation solution data and step planning data are merged to form a comprehensive math problem solution data set to obtain the synthetic data of the target task (mathematical problem solution). In a further embodiment, the model that executes the target task is pre-trained based on the above synthetic data, so that the pre-trained model can learn the common feature representation of the target task.
[0077] The data synthesis method based on ability decomposition and synthesis provided by method P400 can ensure that the generated data is both rich and high-quality. Each subtask has a clear goal and function, which ensures the accuracy and completeness of the data. For example, by decomposing and combining abilities, the difficulty of answering questions with a large language model is reduced, thereby improving the accuracy of the synthesized data. This method not only improves the quality of the data, but also makes the generated data more practical, thereby better serving the pre-training process of the model.
[0078] As mentioned above, different target tasks have different characteristics. Next, according to the characteristics of different target tasks, targeted data synthesis methods for capability decomposition and synthesis are provided. In the embodiment corresponding to method P400, a data synthesis method for capability decomposition and synthesis is provided. Next, another data synthesis method for capability decomposition and synthesis is provided in the embodiment corresponding to method P500.
[0079] If the target task has the following characteristics: if the target task has high consistency requirements, high efficiency requirements for synthesized data, and / or low data post-processing requirements, then before splitting the target task, the prompt words corresponding to the target task can be determined and the model generation data can be further obtained. Then the target task is split into multiple subtasks, and the corresponding parts are obtained from the above generated data based on the goals of the subtasks, and then data generation is performed. For example, the large language model c is the model to be pre-trained, and the target task corresponding to the large language model c is the dialogue generation task of scene x, then the implementation method of method P500 can be adopted.
[0080] Figure 5 The following is a flow chart of a data synthesis method P500 provided in an embodiment of the present application. Figure 5 The specific implementation of the above-mentioned data synthesis method based on capability decomposition and synthesis is introduced.
[0081] In step S510, when the target task satisfies the second preset condition, the overall data generation target corresponding to the target task is determined.
[0082] In an exemplary embodiment, the second preset condition may include one or more of the following: task coherence is higher than a corresponding threshold, and the efficiency of synthetic data generation is higher than a corresponding threshold and lower than a corresponding threshold. That is to say, the data synthesis method such as method P500 is suitable for scenarios with high requirements for task coherence and / or high requirements for synthetic data efficiency. For example, when the task to be performed by the pre-trained model needs to generate coherent and natural data, generating the overall content first and then decomposing the overall generation based on sub-tasks can ensure that the generated data is smoother and more consistent. For example, for scenarios with high requirements for data synthesis efficiency, directly generating data for the complete task may be more efficient and reduce the complexity of data generation.
[0083] Exemplary target tasks include story generation tasks, which first generate a complete story and then break it down into different paragraphs or chapters to further optimize each part. For example, in an article writing task, a complete article is first generated and then broken down into the title, introduction, body, conclusion and other parts to further optimize each part. Another example is a dialogue generation task, which first generates a complete dialogue and then breaks it down into different turns or roles to further optimize each part. For example, if the target task corresponding to the above large language model c is the dialogue generation task for scenario x, then the above general goal is to generate a dialogue under scenario s.
[0084] In step S520, based on the seed data and the overall goal, the overall prompt word corresponding to the target task is determined.
[0085] In this embodiment, the ability combination method can be reflected in the data generation process for the overall target task. For example, the seed data contains scene s related content, and the scene s related content can be used as the context in the model input information. The prompt words corresponding to the target task can be the dialogue content between the three characters in the scene generated according to the scene s related content.
[0086] In step S530, the total prompt word and the relevant context are input into a large language model, wherein the large language model is a trained model, and the generated data output by the large language model corresponds to the total prompt word.
[0087] In step S540, the target task is decomposed into P subtasks, where P is an integer greater than 1.
[0088] In this embodiment, the capability decomposition method can be reflected in the following data processing process after the target task is split. Exemplarily, when the target task is a dialogue generation task, the target task can be split according to roles, and different roles correspond to different subtasks.
[0089] Among them, other specific implementation methods of the task splitting embodiment are the same as the embodiment corresponding to step S410 and are not repeated here.
[0090] In step S550, generated data corresponding to the P subtasks are extracted from the generated data corresponding to the total prompt word.
[0091] For example, in step S530, a complete dialogue between three characters in scene s is generated, and then the dialogue is decomposed into contents corresponding to different characters, so that the generated data corresponding to each subtask is extracted from the total generated data.
[0092] In step S560, synthetic data about the target task is determined according to the generated data corresponding to the P subtasks respectively.
[0093] Exemplarily, the generated data corresponding to the subtask can be post-processed, such as the above-mentioned post-processing implementation method in step S560 can refer to the embodiment corresponding to step S440-1, which will not be repeated here. For example, the generated data after post-processing can be recorded as: content 1, content 2... It can be understood that the generated data corresponding to the P subtasks can also be used directly for synthesized data without the above-mentioned post-processing process. For example, the generated data of each subtask can be recorded as: content 1, content 2... In other words, whether the generated data corresponding to the subtask needs to be post-processed can be determined according to the actual needs of the target task, and the embodiments of the present application do not limit this.
[0094] Taking the above dialogue generation task as an example, the synthetic data corresponding to the target task is as follows:
[0095] “Role a: Content 1;
[0096] Role b: Content 2;
[0097] Role a: Content 3;
[0098] Role c: content 4;
[0099] Role a: Content 5;
[0100] Role c: Content 6;
[0101] Role b: Content 7. ”
[0102] If the target task is an article writing task, the multiple subtasks obtained by splitting in step S540 are as follows: title, introduction, body, and conclusion. For the generated article output in step S530, the parts corresponding to each subtask can be obtained, and then further integrated, the synthetic data corresponding to the target task is as follows:
[0103] "Title: Content 11;
[0104] Introduction: Content 12;
[0105] Text: Content 13;
[0106] Conclusion: Content 14. ”
[0107] In the embodiment provided by method P500, first, a complete content (such as math problem solution data) is generated through a model generation process. This complete data set contains all necessary information such as the title, problem-solving steps, knowledge point explanation, and answers. Then, these complete data are decomposed into synthetic data corresponding to multiple subtasks. Since the complete data generated for the first time already has high quality and coherence, each subtask does not need to be regenerated from scratch in the subsequent process, which is conducive to improving data synthesis efficiency.
[0108] In order to further optimize the synthesized data, the embodiment of the present application further provides the following technical solution: after step S550, further optimization can be performed for each subtask. The following steps are exemplarily performed.
[0109] Step S21, determining the jth prompt word corresponding to the jth subtask according to the data generation target corresponding to the jth subtask, the generated data corresponding to the jth subtask and the seed data, wherein j is a positive integer not greater than P.
[0110] Step S22: input the j-th prompt word into the large language model to obtain optimized generated data corresponding to the j-th prompt word.
[0111] Step S23, determining synthetic data about the target task according to the optimized generated data respectively corresponding to the P subtasks.
[0112] The above target task is explained by taking the article writing task as an example. The generated data extracted from each subtask is as follows:
[0113] "Title: Content 11;
[0114] Introduction: Content 12;
[0115] Text: Content 13;
[0116] Conclusion: Content 14. ”
[0117] Furthermore, the above four subtasks are further optimized based on the trained large language model 300, and the generated data after optimization are as follows:
[0118] “Title: Content 21;
[0119] Introduction: Content 22;
[0120] Text: Content 23;
[0121] Conclusion: Content 24. ”
[0122] For example, for the “summarize” subtask, the prompt word is determined based on the content 14 extracted from the generated data of the overall task, the relevant seed data, and the data generation target. Further, the model generates data again based on the prompt word and possible context to obtain the optimized summary content, i.e., content 24.
[0123] In the embodiment provided by method P500 and steps S21-23, first, complete content (such as math problem solution data) is generated through a model generation process. This complete data set contains all necessary information such as questions, problem-solving steps, knowledge point explanations, answers, etc. Then, these complete data are decomposed into multiple subtasks for optimization and adjustment. Since the complete data generated for the first time already has high quality and coherence, in the subsequent optimization process, each subtask only needs to refine specific parts without regenerating from scratch, which is conducive to improving data synthesis efficiency.
[0124] In the P500 optimization scheme, based on the combination and decomposition of capabilities, it can ensure that the generated data is both natural and coherent, and has diversity and rich information. This method not only improves the quality of the data, but also makes the generated data more practical, thus better serving the pre-training process of the model.
[0125] The embodiment of the present application provides a data synthesis scheme based on the prompt word engineering. Specifically, after determining the model to be pre-trained and the target task for the model to be executed, the electronic device collects rich and diverse seed data from multiple channels to obtain a seed data set about the above-mentioned target task. On the one hand, in the embodiment of the present application, the rich and diverse seed data in the above-mentioned seed data set are spliced to obtain a variety of prompt words. Thus, the large scale and diversity of synthetic data can be promoted by improving the diversity of the prompt words input by the large language model. On the other hand, the target task can be split into multiple subtasks, so as to obtain the generated data corresponding to the multiple subtasks respectively based on the trained large language model, and further integrate them into the synthetic data corresponding to the above-mentioned target task. Thus, the embodiment of the present application adopts the method of capability splitting and combination to improve the accuracy, complexity and coherence of the synthetic data, which is conducive to improving the quality of the synthetic data.
[0126] An embodiment of the present application also provides a model pre-training method, which specifically includes: obtaining synthetic data about a target task according to the data synthesis method provided in the above embodiment; pre-training a target model based on the synthetic data, wherein the target model is used to perform the target task.
[0127] As mentioned above, the above synthetic data has the characteristics of large scale and diversity, and has high data quality, so it can be applied to the pre-training process of the model. In the embodiment provided by the present method, the above synthetic data is used as a pre-training sample to implement the model pre-training process, so that the pre-trained model can learn the general feature representation of the target person.
[0128] Combination of the above Figures 1 to 5 , describes the method embodiment of the present application, and the following is combined with Figure 6 An embodiment of the data synthesis device of the present application is described.
[0129] Figure 6 A schematic block diagram of a data synthesis device 600 provided in an embodiment of the present application.
[0130] refer to Figure 6 The data synthesis device 600 provided in the embodiment of the present application includes: a task splitting module 610, a prompt word determination module 620, a generated data determination module 630 and a synthesized data determination module 640.
[0131] Among them, the above-mentioned task splitting module 610 is used to split the target task corresponding to the target pre-trained model to obtain multiple sub-tasks; the above-mentioned prompt word determination module 620 is used to determine the prompt word according to the seed data in the seed data set, wherein the data in the above-mentioned seed data set is the seed data about the above-mentioned target task collected from multiple channels, and the styles of the above-mentioned prompt words include multiple types; the above-mentioned generated data determination module 630 is used to input the above-mentioned prompt word into the large language model, wherein the above-mentioned large language model is a trained model, and the above-mentioned large language model outputs the generated data corresponding to the above-mentioned prompt word; and the above-mentioned synthetic data determination module 640 is used to determine the synthetic data about the above-mentioned target task according to the above-mentioned generated data.
[0132] In an exemplary embodiment, based on the above scheme, the task splitting module 610 is specifically used to: when the target task meets the first preset condition, split the target task into M subtasks, where M is an integer greater than 1;
[0133] The above-mentioned prompt word determination module 620 is specifically used to: determine the i-th data generation target corresponding to the i-th subtask, where i is a positive integer not greater than M; determine the i-th seed data subset from the above-mentioned seed data set based on the above-mentioned i-th data generation target; determine the prompt word corresponding to the i-th subtask based on the above-mentioned i-th seed data subset and the above-mentioned i-th data generation target.
[0134] In an exemplary embodiment, based on the above scheme, the synthetic data determination module 640 is specifically used to: post-process the i-th generated data corresponding to the i-th subtask, wherein the post-processing at least includes merging the i-th generated data and the model input data of the i-th subtask; and, integrating the post-processed generated data corresponding to the M subtasks respectively to obtain synthetic data about the target task.
[0135] In an exemplary embodiment, based on the above scheme, the above target task is a question-solving task that satisfies the above first preset condition;
[0136] The task splitting module 610 is specifically used to: split the problem-solving task into at least two of the following subtasks: problem generation, problem-solving steps, knowledge point explanation, answer, reflection, error correction, evaluation, solution change and step planning;
[0137] The above-mentioned synthetic data determination module 640 is specifically used for: if the above-mentioned M subtasks include a reflection subtask, an error correction subtask and an evaluation subtask, then the generated data corresponding to the reflection subtask, the generated data corresponding to the error correction subtask and the generated data corresponding to the evaluation subtask are merged to obtain the synthetic data corresponding to the above-mentioned question-solving task.
[0138] In an exemplary embodiment, based on the above scheme, the above device also includes a condition judgment module, which is used to determine that the above target task meets the first preset condition when at least one of the following is met: the task complexity is higher than the corresponding threshold, the diversity of the synthetic data is higher than the corresponding threshold, and the quality of the synthetic data is higher than the corresponding threshold.
[0139] In an exemplary embodiment, based on the above scheme, the prompt word determination module 620 is specifically used to: determine the data generation overall target corresponding to the above target task when the above target task meets the second preset condition; determine a seed data subset from the above seed data set based on the above data generation overall target; determine the total prompt word corresponding to the above target task based on the above data generation overall target and the above seed data subset; wherein the above total prompt word is used to input the above large language model, and the generated data output by the above large language model corresponds to the above total prompt word.
[0140] In an exemplary embodiment, based on the above solution, the task splitting module 610 is specifically used to: split the target task into P subtasks, where P is an integer greater than 1;
[0141] The synthetic data determination module 640 is specifically used to: extract the generated data corresponding to the P subtasks from the generated data corresponding to the general prompt word; and determine the synthetic data about the target task based on the generated data corresponding to the P subtasks.
[0142] In an exemplary embodiment, based on the above solution, the task splitting module 610 is further specifically used to: split the target task into P subtasks, where P is an integer greater than 1;
[0143] The synthetic data determination module 640 is also specifically used to: extract the generated data corresponding to the P subtasks respectively from the generated data corresponding to the total prompt word; determine the j-th prompt word corresponding to the j-th subtask according to the data generation target corresponding to the j-th subtask, the generated data corresponding to the j-th subtask and the seed data, wherein j is a positive integer not greater than P; input the j-th prompt word into the large language model to obtain the optimized generated data corresponding to the j-th prompt word; and determine the synthetic data about the target task according to the optimized generated data corresponding to the P subtasks respectively.
[0144] In an exemplary embodiment, based on the above scheme, the above target task is a dialogue generation task;
[0145] The task splitting module 610 is specifically used to split the dialogue generation task into at least two of the following subtasks: dialogue initialization, dialogue continuation, dialogue termination, sentiment analysis, topic transfer, dialogue error correction, and dialogue evaluation;
[0146] The above-mentioned synthetic data determination module 640 is specifically used for: if the above-mentioned P subtasks include: a dialogue initialization subtask, a dialogue continuation subtask and a dialogue error correction subtask, then according to the optimized generated data corresponding to the dialogue initialization subtask, the optimized generated data corresponding to the dialogue continuation and the optimized generated data corresponding to the dialogue error correction subtask, determining the synthetic data about the above-mentioned dialogue generation task.
[0147] In an exemplary embodiment, based on the above scheme, the above device also includes a condition determination module, which is used to determine that the above target task meets the second preset condition when at least one of the following is met: the task consistency is higher than the corresponding threshold, and the synthetic data generation efficiency is higher than the corresponding threshold.
[0148] In an exemplary embodiment, based on the above scheme, the prompt word determination module 620 is specifically used to: clean the seed data in the seed data set; and generate prompt words of multiple styles based on the cleaned seed data, wherein the prompt words of the multiple styles differ in at least one of the following aspects: difficulty, audience, style and format.
[0149] An embodiment of the present application also provides a model pre-training device, which includes: a synthetic data acquisition module and a pre-training module.
[0150] Among them, the above-mentioned synthetic data acquisition module is used to: obtain synthetic data about the target task according to the data synthesis method provided in the above-mentioned embodiment; the above-mentioned pre-training module is used to: pre-train the target model according to the above-mentioned synthetic data, wherein the above-mentioned target model is used to perform the above-mentioned target task.
[0151] It should be understood that if Figure 6 The embodiment of the data synthesis device shown in the figure may correspond to the embodiment of the data synthesis method described above, and similar descriptions may refer to the method embodiment. To avoid repetition, they will not be described here. Specifically, by Figure 6 The information interaction between the modules in the data synthesis device shown in FIG. 1 can execute the embodiment of the above data synthesis method, by Figure 6 The information interaction between the modules in the data synthesis device shown can execute the embodiments of the above-mentioned data synthesis method, and the method embodiments corresponding to the above-mentioned and other operations and / or functions of the modules in the device are not repeated here for the sake of brevity.
[0152] The operation and maintenance related devices of the software agent of the embodiment of the present application are described above from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or a combination of hardware and software modules in the decoding processor to execute. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.
[0153] An embodiment of the present application also provides an electronic device.
[0154] Figure 7 Schematic block diagram of an electronic device 700 provided in an embodiment of the present application. As mentioned above, the operation and maintenance related devices of the software agent can be deployed in Figure 7 The electronic device shown can therefore be used to execute the above-mentioned data synthesis method.
[0155] like Figure 7As shown, the electronic device 700 may include:
[0156] The memory 710 and the processor 720, the memory 710 is used to store the computer program 730 and transmit the program code 730 to the processor 720. In other words, the processor 720 can call and run the computer program 730 from the memory 710 to implement the method in the embodiment of the present application.
[0157] For example, the processor 720 may be configured to execute the steps in the above-mentioned data synthesis method according to the instructions in the computer program 730, or to execute the steps in the above-mentioned data synthesis method.
[0158] In some embodiments of the present application, the processor 720 may include but is not limited to:
[0159] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
[0160] In some embodiments of the present application, the memory 710 includes but is not limited to:
[0161] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).
[0162] In some embodiments of the present application, the computer program 730 may be divided into one or more modules, which are stored in the memory 710 and executed by the processor 720 to complete the data synthesis method provided by the present application, or to complete the steps in the above data synthesis method. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 730 in the electronic device.
[0163] like Figure 7 As shown, the electronic device 700 may further include:
[0164] The transceiver 740 may be connected to the processor 720 or the memory 710 .
[0165] The processor 720 may control the transceiver 740 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 740 may include a transmitter and a receiver. The transceiver 740 may further include an antenna, and the number of antennas may be one or more.
[0166] It should be understood that the various components in the electronic device 700 are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.
[0167] According to one aspect of the present application, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.
[0168] According to another aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method of the above method embodiment.
[0169] In other words, when software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instruction is loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instruction can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instruction can be transmitted from a website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integration. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a digital video disc (Digital Video Disc, DVD)), or a semiconductor medium (for example, a solid-state drive (Solid State Disk, SSD)), etc.
[0170] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0171] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0172] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, 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. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0173] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A data synthesis method, characterized in that: The method comprises: Split the target task corresponding to the target pre-training model into multiple subtasks; Determine a prompt word according to seed data in a seed data set, wherein the data in the seed data set is seed data about the target task collected from multiple channels, the prompt word is a prompt word corresponding to the subtask or a prompt word corresponding to the target task, and the prompt word has multiple styles; Inputting the prompt word into a large language model, wherein the large language model is a trained model, and the generated data output by the large language model corresponds to the prompt word; Based on the generated data, synthetic data related to the target task is determined.
2. The method according to claim 1, characterized in that: The target task corresponding to the target pre-training model is split into multiple subtasks, including: When the target task satisfies the first preset condition, decomposing the target task into M subtasks, where M is an integer greater than 1; The step of determining the prompt word according to the seed data in the seed data set includes: Determine the i-th data generation target corresponding to the i-th subtask, where i is a positive integer not greater than M; According to the i-th data generation target, determining an i-th seed data subset from the seed data set; Determine a prompt word corresponding to an i-th subtask according to the i-th seed data subset and the i-th data generation target.
3. The method according to claim 2, characterized in that Determining synthetic data about the target task according to the generated data includes: Post-processing the i-th generated data corresponding to the i-th subtask, wherein the post-processing at least includes merging the i-th generated data with the model input data of the i-th subtask; The post-processed generated data corresponding to the M subtasks are respectively integrated to obtain synthetic data about the target task.
4. The method according to claim 3, characterized in that The target task is a question-solving task that meets the first preset condition; Decomposing the target task into M subtasks includes: Decomposing the problem-solving task into at least two of the following subtasks: problem generation, problem-solving steps, knowledge point explanation, answer, reflection, error correction, evaluation, solution change, and step planning; If the M subtasks include a reflection subtask, an error correction subtask, and an evaluation subtask, the post-processed generated data corresponding to the M subtasks are integrated to obtain synthetic data about the target task, including: The generated data corresponding to the reflection subtask, the generated data corresponding to the error correction subtask, and the generated data corresponding to the evaluation subtask are merged to obtain synthetic data corresponding to the question answering task.
5. The method according to claim 2, characterized in that: The method further comprises: When at least one of the following conditions is met, it is determined that the target task meets the first preset condition: The task complexity is higher than the corresponding threshold. The diversity of synthetic data is higher than the corresponding threshold, The quality of the synthetic data is higher than the corresponding threshold.
6. The method according to claim 1, characterized in that When the target task satisfies the second preset condition, determining the prompt word according to the seed data in the seed data set includes: Determine the overall data generation target corresponding to the target task; Determining a seed data subset from the seed data set according to the data generation overall goal; Generate a total target and the seed data subset according to the data, and determine a total prompt word corresponding to the target task; The total prompt word is used to input the large language model, and the generated data output by the large language model corresponds to the total prompt word.
7. The method according to claim 6, characterized in that The target task corresponding to the target pre-training model is split into multiple subtasks, including: Decomposing the target task into P subtasks, where P is an integer greater than 1; Determining synthetic data about the target task according to the generated data includes: Extracting the generated data corresponding to the P subtasks respectively from the generated data corresponding to the total prompt word; Determine synthetic data about the target task based on the generated data corresponding to the P subtasks respectively.
8. The method according to claim 6, characterized in that The target task corresponding to the target pre-training model is split into multiple subtasks, including: Decomposing the target task into P subtasks, where P is an integer greater than 1; Determining synthetic data about the target task according to the generated data includes: Extracting the generated data corresponding to the P subtasks respectively from the generated data corresponding to the total prompt word; Determine the jth prompt word corresponding to the jth subtask according to the data generation target corresponding to the jth subtask, the generated data corresponding to the jth subtask, and the seed data, where j is a positive integer not greater than P; Inputting the j-th prompt word into the large language model to obtain optimized generated data corresponding to the j-th prompt word; Determine synthetic data about the target task based on the optimized generated data respectively corresponding to the P subtasks.
9. The method according to claim 7, characterized in that: The target task is a dialogue generation task; Decomposing the target task into P subtasks includes: Splitting the dialogue generation task into at least two of the following subtasks: dialogue initialization, dialogue continuation, dialogue termination, sentiment analysis, topic transfer, dialogue error correction, and dialogue evaluation; If the P subtasks include: a dialogue initialization subtask, a dialogue continuation subtask, and a dialogue error correction subtask, then determining the synthetic data about the target task according to the optimized generated data corresponding to the P subtasks respectively includes: Determine synthetic data about the dialogue generation task based on the optimized generated data corresponding to the dialogue initialization subtask, the optimized generated data corresponding to the dialogue continuation subtask, and the optimized generated data corresponding to the dialogue error correction subtask.
10. The method according to claim 6, characterized in that The method further comprises: When at least one of the following conditions is met, it is determined that the target task meets the second preset condition: The task coherence is higher than the corresponding threshold. The synthetic data generation efficiency is higher than the corresponding threshold.
11. The method according to any one of claims 1 to 10, characterized in that The step of determining the prompt word according to the seed data in the seed data set includes: Cleaning the seed data in the seed data set; Based on the cleaned seed data, multiple styles of prompt words are generated, wherein the multiple styles of prompt words are different from each other in at least one of the following aspects: difficulty, audience, style and format.
12. A model pre-training method, characterized in that: The method comprises: According to the method of any one of claims 1 to 11, obtaining synthetic data about the target task; A target model is pre-trained based on the synthetic data, wherein the target model is used to perform the target task.
13. A data synthesis device, characterized in that: The device comprises: The task splitting module is used to split the target task corresponding to the target pre-training model into multiple subtasks; a prompt word determination module, configured to determine a prompt word according to seed data in a seed data set, wherein the data in the seed data set is seed data about the target task collected from multiple channels, the prompt word is a prompt word corresponding to the subtask or a prompt word corresponding to the target task, and the prompt word has multiple styles; a generated data determination module, configured to input the prompt word into a large language model, wherein the large language model is a trained model, and the generated data output by the large language model corresponds to the prompt word; The synthetic data determination module is used to determine the synthetic data related to the target task according to the generated data.
14. A computer-readable storage medium, characterized in that: For storing computer programs; The computer program enables a computer to execute the data synthesis method according to any one of claims 1 to 12.
15. An electronic device, wherein: including a processor and a memory; The memory is used to store computer programs; The processor is used to execute the computer program to implement the data synthesis method described in any one of claims 1 to 12.
Citation Information
Cited By
Multi-round dialogue sample data generation method, device, equipment and product
CN120541528A
A method, device, equipment and product for generating multi-turn dialogue sample data
CN120541528B
Large model data set generation method and device, electronic equipment and storage medium
CN120974180A