Data construction, data processing method, device, equipment, medium and program product

By generalizing and automating the evaluation of large model training datasets, a data closed loop is constructed, solving the problem of slow training iteration of large models and achieving efficient and accurate data expansion and model iteration.

CN122173856APending Publication Date: 2026-06-09SANGFOR TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SANGFOR TECH INC
Filing Date
2024-12-09
Publication Date
2026-06-09

Smart Images

  • Figure CN122173856A_ABST
    Figure CN122173856A_ABST
Patent Text Reader

Abstract

This embodiment discloses a data construction and data processing method, apparatus, device, medium, and program product. The data construction method includes: obtaining error handling results; the error handling results are determined by a first large model processing data in a test dataset; the first large model is trained using a first dataset; updating the first dataset based on the error handling results, and training the first large model based on the updated first dataset; repeating all the above steps until the error handling results meet preset conditions and then stopping execution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of artificial intelligence, and specifically relates to a data construction, data processing method, apparatus, device, medium and program product. Background Technology

[0002] Currently, large-scale model training, especially instruction fine-tuning, requires training data in the form of <instruction, answer> pairs. The labeling of this training data typically relies on manual annotation or web scraping. Since manual annotation is inconvenient and web scraping struggles to obtain reliable, targeted data, the training process for large models lacks a data feedback loop. This makes it difficult to expand the dataset based on the model's weaknesses and achieve closed-loop iteration, resulting in very slow iteration and limiting the rapid evolution of large-scale models. Summary of the Invention

[0003] This application provides a data construction, data processing method, apparatus, device, medium, and program product.

[0004] This application provides a data construction method, the method comprising:

[0005] Obtain the error handling result; the error handling result is determined by the first large model processing the data in the test dataset; the first large model is trained using the first dataset;

[0006] The first dataset is updated based on the error handling result, and the first large model is trained based on the updated first dataset. All the above steps are repeated until the error handling result meets the preset conditions and then the execution stops.

[0007] In some embodiments, the first large model is trained using a first dataset, including: the first large model is trained using generalized data; the generalized data represents data obtained by generalizing information from the first dataset.

[0008] As can be seen, generalizing to the first dataset can expand the amount of data in the first dataset. Therefore, based on the method given in this embodiment, more training data can be obtained even when the first dataset includes a small amount of data, which is beneficial for improving the training effect of large models.

[0009] In some embodiments, the generalization of information in the first dataset includes: constructing a first answer corresponding to the first instruction when the information in the first dataset includes a first instruction; and constructing a first instruction corresponding to the first answer when the information in the first dataset includes a first answer.

[0010] As can be seen, the method given in this embodiment can make full use of the individual instructions and individual answers in the first dataset to obtain training data in the form of <instruction, answer> pairs suitable for training large models. This is beneficial for expanding the amount of data used for training large models and obtaining more accurate training results.

[0011] In some embodiments, the generalization of information in the first dataset includes: when the information in the first dataset includes the first instruction and the first answer, obtaining a plurality of first instructions in the first dataset, and a first answer corresponding to each of the plurality of first instructions; obtaining a mapping relationship between each first instruction and the first answer corresponding to each first instruction; generating a second instruction, and constructing a second answer corresponding to the second instruction based on the mapping relationship.

[0012] As can be seen, the method given in this embodiment can expand the amount of data in the first dataset, which is beneficial to improving the training effect of large models.

[0013] In some embodiments, when the information in the first dataset includes a first instruction, constructing the first answer corresponding to the first instruction includes: determining a first prompt word corresponding to the first instruction based on the first instruction; and constructing a large model based on the first prompt word to obtain the first answer corresponding to the first instruction.

[0014] In some embodiments, where the information in the first dataset includes a first answer, constructing the first instruction corresponding to the first answer includes: determining a second prompt word corresponding to the first answer based on the first answer; and constructing a large model based on the second prompt word to obtain the first instruction corresponding to the first answer.

[0015] In some embodiments, the information in the first dataset includes a first instruction and / or a first answer corresponding to the first instruction; the generalization of the information in the first dataset includes: restating the first instruction to obtain a plurality of restated instructions corresponding to the first instruction; and / or restating the first answer to obtain a plurality of restated answers corresponding to the first answer.

[0016] In some embodiments, the method further includes: removing erroneous data from the generalized data; the first large model is trained using the generalized data, including: the first large model is trained using generalized data with erroneous data removed.

[0017] As can be seen, erroneous data may occur during the generalization process. The method presented in this embodiment can remove erroneous data after generalization, resulting in more accurate training data, which is beneficial for improving the accuracy of training large models.

[0018] In some embodiments, removing erroneous data from the generalized data includes: obtaining a first processing result of the generalized data; the first processing result represents the result of removing some erroneous data from the generalized data; and automatically removing erroneous data from the generalized data based on the first processing result.

[0019] As can be seen, the method given in this embodiment can automatically screen out erroneous results, which is beneficial to improving data processing efficiency. Furthermore, it is beneficial to train large models based on the processed generalized data, which is conducive to achieving iterative evolution of large models.

[0020] This application also provides a data processing method, the method comprising:

[0021] Obtain the third instruction;

[0022] The third instruction is processed by the second major model to obtain the third answer; the second major model is obtained by training the first major model with the updated first dataset, and the updated first dataset is obtained based on the above data construction method.

[0023] This application embodiment also provides a data construction apparatus, the apparatus comprising:

[0024] The first acquisition module is used to acquire error handling results; the error handling results are determined by the first large model processing the data in the test dataset; the first large model is trained using the first dataset.

[0025] The first processing module is used to update the first dataset based on the error handling result, so as to train the first large model according to the updated first dataset until the error handling result meets the preset conditions.

[0026] This application embodiment also provides a data processing apparatus, the apparatus comprising:

[0027] The second acquisition module is used to acquire the third instruction;

[0028] The second processing module is used to process the third instruction through the second large model to obtain the third answer; the second large model is obtained by training the first large model with the updated first dataset, and the updated first dataset is obtained based on the above data construction method.

[0029] This application provides an electronic device, which includes a processor and a memory for storing computer programs capable of running on the processor; wherein,

[0030] The processor is used to run the computer program to perform any of the above data construction methods or to perform the above data processing methods.

[0031] This application provides a computer storage medium storing a computer program that, when executed by a processor, implements any of the above-described data construction methods or the above-described data processing methods.

[0032] This application provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described data construction methods or the above-described data processing methods.

[0033] This application provides a data construction, data processing method, apparatus, device, medium, and program product. It processes a test dataset using a first large model to obtain error handling results for the first large model, and updates the first dataset using the error handling results. This enables more targeted large model training for error scenarios when training the first large model, achieving iterative evolution of the trained large model. Attached Figure Description

[0034] Figure 1 A flowchart of a data construction method provided in an embodiment of this application;

[0035] Figure 2 A flowchart illustrating a data construction and large model training method provided in this application embodiment;

[0036] Figure 3 A flowchart of a data processing method provided in an embodiment of this application;

[0037] Figure 4 This is a schematic diagram of the structure of a data construction apparatus provided in an embodiment of this application;

[0038] Figure 5 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0039] Figure 6 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0040] Training models, especially fine-tuning instructions, requires training data in the form of <instruction, answer> pairs, where the answer represents the output of the large model corresponding to the instruction. Currently, the processing of training data for large models typically relies on manual annotation or web crawling. Manual annotation is time-consuming and labor-intensive, resulting in slow speed and high cost. Web crawling refers to using automated scripts to scrape data from the internet as training data for large models. While web crawling can acquire large amounts of data at low cost, the acquired data often fails to meet the requirements of large model training, and even with manual screening, the data quality remains low. Furthermore, related technical solutions lack a data feedback loop, i.e., expanding the dataset based on the weaknesses of the large model to achieve closed-loop iteration. This is mainly because manual annotation is not convenient enough, and web crawling is difficult to obtain reliable data in a targeted manner. The lack of a data feedback loop makes the iteration of large models very inefficient and slow, limiting the rapid evolution of large model capabilities.

[0041] This application provides a data construction method that can improve the training effect of large models from the data level. By generalizing the training data, a large amount of training data for large models can be synthesized in a low-cost manner. Furthermore, the training dataset can be expanded in a targeted manner according to the weaknesses of the large models, thereby achieving efficient closed-loop iteration of the large models and significantly improving the training performance of large models.

[0042] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the embodiments provided herein are merely illustrative of the embodiments of this application and are not intended to limit the embodiments of this application. Furthermore, the embodiments provided below are some embodiments for implementing this application, and not all embodiments for implementing this application. Unless otherwise specified, the technical solutions described in the embodiments of this application can be implemented in any combination.

[0043] It should be noted that, in the embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of other related elements in the method or apparatus that includes that element (e.g., steps in the method or units in the apparatus; for example, a unit in the apparatus may be a portion of circuitry, a portion of a processor, a portion of a program or software, etc.).

[0044] The data construction method and data processing method provided in this application include a series of steps. However, the data construction method and data processing method provided in this application are not limited to the steps described. Similarly, the data construction device and data processing device provided in this application include a series of modules. However, the device provided in this application is not limited to the modules explicitly described, but may also include modules that need to be set up for obtaining relevant information or processing based on information.

[0045] This application provides a data construction method, such as... Figure 1 As shown, Figure 1 A flowchart of a data construction method is shown. Figure 1 The data construction methods shown include:

[0046] Step 101: Obtain the error handling results; the error handling results are determined by the first large model processing the data in the test dataset; the first large model is trained using the first dataset.

[0047] The first large model in this embodiment can be a large model applicable to any scenario. It can be a local large model or a large model provided by a third party. The first large model can be trained using a first training set. The first dataset used to train the first large model can be represented as a dataset consisting of <instruction, answer> pairs. The instruction tells the large model what task it needs to perform; for example, the instruction could be "Compare the following two famous figures, using a feature list and providing the output in sentence form." The answer corresponds to the instruction, representing the output result of the large model corresponding to the instruction. The output result should meet the requirements of the instruction. For example, the output result corresponding to the instruction could be "Person A and Person B are both individuals with exceptional intelligence; both scientists have influenced the world with their profound knowledge and extraordinary contributions." Typically, in addition to the instruction and its corresponding answer, the data used for training the large model can also include input data. Input data can be text, images, numbers, etc. The input data is closely related to the instruction, enabling the large model to obtain output based on the input data and the instruction. For example, the input data could be "Person 1: XX; Person 2: XX; Features: Education, Influence, etc."

[0048] To ensure the first trained model can handle data from different domains, the richness of the instruction and answer data in the first dataset should be maximized, so that the <instruction, answer> pairs cover as many application scenarios as possible. Alternatively, the richness of the input, instruction, and answer data should be maximized to cover as many application scenarios as possible.

[0049] Step 102: Update the first dataset based on the error handling results, and train the first large model based on the updated first dataset.

[0050] Repeat all the above steps until the error handling result meets the preset conditions and then stop execution.

[0051] After training the first large model using the first dataset, to verify its processing capabilities, a test dataset can be used. The first large model processes the data in the test dataset, obtaining the processing result for each data point. An error processing result indicates that the difference between the processed result from the first large model and the corresponding labeled result in the training dataset exceeds a certain threshold. For example, in the calculation of "3-2" using the first large model, if the processed result is 2, while the labeled result in the test dataset is 1, then the first large model has obtained an error processing result for "3-2".

[0052] To test the processing capabilities of the primary model across different domains, the test dataset should also be diverse, containing data from various fields. Specifically, the test dataset can be a standard test set or various online data deployed in a real-world operational environment.

[0053] Based on the error handling results obtained from the first large model, the corresponding data in the first dataset is updated. For example, when the first large model makes an error in calculating "3-2", the data in the first dataset is updated by adding training data related to "3-2" to the first dataset, and the first large model is trained further. Alternatively, training data related to "3-2" can be added to the first dataset, such as training data related to "2-1" and "4-2", to obtain an updated first dataset, and the first large model is trained again based on the updated first dataset.

[0054] In some embodiments, error scenarios can be obtained based on error handling results, and data corresponding to the error scenarios can be found in the first dataset based on the error scenarios, and the data can be updated.

[0055] Error scenarios can be extracted from error handling results. For example, using automated testing technology, an automated testing framework or tool can load a test dataset and a primary model. The loaded primary model can then be used to predict data in the test dataset. The prediction results are compared with the labeled results to identify samples with prediction errors. Automated testing technology can also process error handling results to obtain error scenarios. For example, the error scenario corresponding to "3-2" could be a computational scenario. Automated testing technology is similar to data selection strategies or query functions in active learning. Since the selected scenarios and test data samples reflect the weaknesses of the primary model, this is crucial for improving model capabilities.

[0056] After obtaining the error scenarios from the error handling results, the first dataset can be updated by adding data for the corresponding error scenarios or by labeling the data for the error scenarios. Alternatively, scenarios similar to the error scenarios can be identified, and data from these similar scenarios can be used to update the first dataset. The data used to update the first dataset can be from the test dataset or data from real-world application scenarios. The first model is then trained specifically based on the updated first dataset.

[0057] In some embodiments, the error type can be determined based on the error handling result, or the error type can be determined based on the error scenario of the error handling result, and the data in the first dataset can be updated according to the error type.

[0058] After processing the test data through the first major model and obtaining multiple test results, different error handling results can be obtained based on technologies such as automated evaluation, log analysis, and manual confirmation. Based on the error handling results, one or more scenario categories with high error rates can be obtained, and the error type of the error handling result can be obtained.

[0059] After obtaining the error handling results or error types of the first model, data corresponding to the error type can be selectively acquired. For example, when the error type is subtraction, multiple subtraction-related instructions and answers can be obtained. These different subtraction-related instructions and answers can then be used to update the first dataset, enabling the first model to be trained on the updated dataset. In practical applications, the first dataset can be updated directly using the data corresponding to the error type. Alternatively, the data corresponding to the error type can be labeled, and the labeled data can be used to update the first dataset. Or, similar types can be identified, and data from these similar types can be used to update the first dataset. The data used to update the first dataset can be from the test dataset or data from real-world application scenarios.

[0060] As can be seen, based on the above update method, the updated first dataset includes data from error-prone scenarios of the first large model. Updating the first dataset using this error-prone data creates a data loop. The first large model is then retrained based on the updated first dataset, enabling it to improve its ability to handle error-prone scenarios.

[0061] After training the first large model based on the updated first dataset, the first large model can be tested again using the test dataset to obtain the processing results, further obtaining the error processing results. Based on the method given in the above steps, the training is focused on the error-prone scenarios of the trained first large model until the error results of the trained first large model meet the preset conditions and the large model training is stopped.

[0062] For example, the first large model can output multiple processing results. If the ratio of the erroneous processing results to the multiple processing results is less than a preset ratio, the training of the first large model can be stopped; or, if the number of erroneous processing results is less than a preset threshold, the training of the first large model can be stopped; or, if the difference between the erroneous processing results and the labeled data is less than a difference threshold, the training of the first large model can be stopped.

[0063] The method presented in this embodiment provides a data construction method for training large models. By continuously training the large model using a constantly updated first dataset, the capabilities of the large model are iteratively improved. This process is repeated to gradually enhance the processing power of the large model.

[0064] In practical applications, steps 101 to 102 can be implemented based on a processor, which can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor.

[0065] In some embodiments, the first large model is trained using a first dataset, including: the first large model is trained using generalized data; the generalized data represents data obtained by generalizing information from the first dataset.

[0066] The first dataset can be the dataset used to train the first large model for the first time. This first dataset may contain a small amount of data. Because the amount of data in the first dataset is small, it can be constructed through manual annotation or data collection. The data in the initially constructed first dataset may include common instruction sets, where instructions represent instruction data that lacks a corresponding answer or result. The data in the first dataset may also include answers, which can be factual knowledge and can be used as the output of the large model that lacks instructions, or as answer data for missing instructions. The data in the first dataset may also include both instructions and answers, i.e., data in the form of <instruction, answer> pairs, where the instructions and answers in the <instruction, answer> pairs correspond one-to-one.

[0067] The initial dataset doesn't need to be very large, but it needs to be rich and high-quality. For richness, the data should cover different fields. For high quality, the data should be correct, ensuring the correspondence between instructions and answers in the <instruction, answer> pair.

[0068] Once the first dataset is obtained, it can be generalized. For example, the instruction data can be generalized by transforming it into a more abstract form, replacing keywords, or subjecting it to a degree of random perturbation, making the specific values ​​unrecognizable while maintaining the overall distribution characteristics. The same generalization methods used for instruction data can be applied to the answer data.

[0069] After generalizing the instructions and / or answers, multiple generalization results can be obtained. Based on the data in the first dataset, more instructions and / or answers can be obtained, thus expanding the data in the first dataset beyond its original size.

[0070] The first large model is trained using data from the first dataset obtained after generalization, which includes richer data samples and helps increase the accuracy of large model training.

[0071] In some embodiments, the above generalization of information in the first dataset includes: constructing a first answer corresponding to the first instruction when the information in the first dataset includes a first instruction; and constructing a first instruction corresponding to the first answer when the information in the first dataset includes a first answer.

[0072] Since the data used for training large models is typically in the form of <instruction, answer> pairs, meaning that the data used for training large models usually includes the instructions input to the model and the corresponding output results of the model, after obtaining the first dataset, we can configure the first answer corresponding to the first instruction for the data in the first dataset that only contains the first instruction, thus obtaining data in the form of <instruction, answer> pairs; or we can configure the first instruction corresponding to the first answer for the data in the first dataset that only contains the first answer, thus obtaining data in the form of <instruction, answer> pairs.

[0073] In some embodiments, the above generalization of information in the first dataset includes: when the information in the first dataset includes a first instruction and a first answer, obtaining multiple first instructions in the first dataset and a first answer corresponding to each of the multiple first instructions; obtaining a mapping relationship between each first instruction and the first answer corresponding to each first instruction; generating a second instruction, and constructing a second answer corresponding to the second instruction based on the mapping relationship.

[0074] This embodiment presents another data augmentation method. Multiple <instruction, answer> pairs can be selected from the first dataset, and the mapping relationship between the first instruction and the first answer in each <instruction, answer> pair can be mined to obtain the mapping relationship between each first instruction and its corresponding first answer. A second instruction is then generated, and a second answer corresponding to the second instruction is constructed based on the mapping relationship. Specifically, the mapping relationship can be obtained directly by constructing a large model from the data, and the second instruction and its corresponding first answer can be obtained based on the mapping relationship.

[0075] For example, data in the form of <instruction, answer> pairs could be: Instruction 1: What does one plus one equal? ​​Answer 1: One plus one equals two; Instruction 2: What does one plus two equal? ​​Answer 2: One plus two equals three; Based on the data, a large model is constructed to analyze the data in the <instruction, answer> pairs, and new instructions and corresponding new answers are obtained through mapping relationships. For example, the new instruction: What does two plus two equal? ​​The corresponding new answer: Two plus two equals four.

[0076] In some embodiments, when the information in the first dataset includes a first instruction, the above-described construction of the first answer corresponding to the first instruction includes: determining a first prompt word corresponding to the first instruction based on the first instruction; and constructing a large model based on the first prompt word to obtain the first answer corresponding to the first instruction.

[0077] In some embodiments, where the information in the first dataset includes the first answer, the above-described construction of the first instruction corresponding to the first answer includes: determining the second prompt word corresponding to the first answer based on the first answer; and constructing a large model based on the second prompt word to obtain the first instruction corresponding to the first answer.

[0078] In practical applications, a large model can be constructed using pre-set data to supplement the corresponding answer to the instruction, and vice versa. This large model can be a locally trained model used to construct training data, or a pre-trained model provided by a third party.

[0079] When a first answer is needed based on a first instruction, one can first understand the content and requirements of the first instruction, determine its core intent, extract key words and phrases, and construct one or more possible first prompt words based on the extracted words and phrases and the structure of natural language. By inputting the constructed first prompt words into a pre-defined data construction model, the model generates one or more possible first answers based on the input first prompt words. For example, suppose the first instruction is "Please describe an outdoor game suitable for a family gathering." Based on the above implementation, the first prompt word could be "Describe an outdoor game suitable for a family gathering." The answer obtained through the data construction model could be "An outdoor game suitable for a family gathering is a 'treasure hunt.' You can hide some small gifts or clues in the yard beforehand."

[0080] When a first instruction is needed based on a first answer, the content and requirements of the first answer can be understood first, the core intent of the first answer can be determined, and key words and phrases can be extracted from the first answer. Based on the extracted words and phrases, combined with the structure of natural language, one or more possible second prompt words can be constructed. By inputting the constructed second prompt words into a large data construction model, the large data construction model can generate one or more possible first instructions based on the input second prompt words. For example, assuming the first answer is "Please provide a report on the application of artificial intelligence in the medical field," based on the above implementation method, the second prompt word can be constructed as "requirement for a report on the application of artificial intelligence in the medical field." The first instruction obtained by the large data construction model could be "Write a report on the latest applications, challenges, and prospects of artificial intelligence in the medical field."

[0081] In some embodiments, the information in the first dataset includes a first instruction and / or a first answer corresponding to the first instruction; the generalization of the information in the first dataset includes: restating the first instruction to obtain multiple restated instructions corresponding to the first instruction; and / or restating the first answer to obtain multiple restated answers corresponding to the first answer.

[0082] This embodiment presents a method for generalizing data from a first dataset. It allows for the language restatement of a first instruction in the first dataset, resulting in multiple restated instructions. Here, language restatement of the first instruction refers to restating the description of the first instruction in language. Language restatement refers to expressing a concept or description using different methods and different words. Based on the language restatement method, the first instruction in the first dataset is restated, resulting in multiple restatement results.

[0083] When only the first instruction is restated, multiple restated instructions can be obtained if the first instruction does not include the corresponding first answer. Based on the multiple restated instructions, the corresponding answer can be supplemented for each restated instruction using the method given in the above embodiments.

[0084] When only the first answer is restated, multiple restated answers can be obtained if the first answer does not include the corresponding first instruction. Based on the multiple restated answers, the corresponding first instruction can be added to each restated answer using the method given in the above embodiments.

[0085] When restating data in the form of <instruction, answer> pairs, the instructions in the <instruction, answer> pair can be restated to obtain multiple sets of data corresponding to multiple restated instructions and answers. Similarly, the answers in the <instruction, answer> pair can be restated to obtain multiple sets of data consisting of instructions and multiple restated answers. Furthermore, based on data in the same <instruction, answer> pair form, the instructions and answers can be restated to obtain multiple sets of data consisting of multiple restated instructions and multiple restated answers.

[0086] It can be seen that by restating the instructions and / or answers in language, the data in the first dataset can be expanded to obtain the first dataset for training large models.

[0087] In some embodiments, the method further includes: removing erroneous data from the generalized data; the first large model is trained on the generalized data, including: the first large model is trained on the generalized data with erroneous data removed.

[0088] Based on the method given in the above embodiments, after generalizing the first dataset, since the data obtained after generalization may contain erroneous data, the erroneous data in the generalized data is removed, and the first large model is trained based on the generalized data with erroneous data removed.

[0089] As can be seen, the method given in this embodiment can ensure the accuracy of the data used for training the first large model, which is beneficial to improving the training effect of the large model.

[0090] In some embodiments, the above-mentioned removal of erroneous data from generalized data includes: obtaining a first processing result of the generalized data; the first processing result represents the result of removing some erroneous data from the generalized data; and automatically removing erroneous data from the generalized data based on the first processing result.

[0091] Because the generalized data contains a large amount of corpus synthesized through a large data construction model, the data in the generalized data may have low reliability. Quality checks on the generalized data can include both manual and automated screening. First, manual screening removes erroneous data, yielding the initial processing result. Then, during the manual screening process, rules for judging the "good" or "bad" quality of data samples are gradually summarized, and these rules are implemented in code to screen for erroneous data; alternatively, prompt words can be constructed based on these rules, and then a large data construction model is used to screen the data in the generalized data, resulting in generalized data with erroneous data removed.

[0092] Based on the data construction method given in the above embodiments, Figure 2 The flowchart illustrates the data construction and large model training methods. Figure 2 The data construction method shown corresponds to the method given in the above embodiments, including:

[0093] Step 201: Manually label the data.

[0094] By manually labeling a small amount of instruction and / or answer data in the seed dataset, which can be the original first dataset, the initial dataset can be the dataset used for the initial training of the first large model in the above embodiments.

[0095] Step 202: LLM generalization.

[0096] Based on the method described in the above embodiments, a large model is constructed using preset data to generalize the instruction and / or answer data in the seed dataset, resulting in generalized data. Here, the generalized dataset corresponds to the dataset constructed from the generalized data in the above embodiments.

[0097] Step 203: Quality inspection.

[0098] Based on the method described in the above embodiments, a quality check is performed on the generalized dataset to remove unqualified data samples, resulting in a training dataset. Here, the training dataset refers to the dataset constructed from the generalized data after removing erroneous data in the above embodiments. The quality check combines manual and automatic screening to perform high-quality screening, removing unqualified data from the generalized dataset, and obtaining the processed generalized dataset as the training dataset.

[0099] Step 204: Fine-tune the instructions.

[0100] By fine-tuning the first large model before training in the above embodiment using the training dataset, an instruction-tuned model is obtained, which is the first large model in the above embodiment.

[0101] Step 205: Large model validation.

[0102] By inputting a test dataset into the instruction fine-tuning model, a large-scale model validation is performed on the instruction fine-tuning model. Here, the test dataset can be a standard test dataset, online operational data, etc. This step corresponds to the method described in the above embodiment where the first large model processes the data in the test dataset.

[0103] Step 206: Automated evaluation and data selection.

[0104] Step 205 yields multiple processing results of the instruction fine-tuning model. Through automated evaluation, error processing results are selected from these results to identify scenarios with high error rates and examples where the instruction fine-tuning model makes prediction errors.

[0105] Step 207: Targeted data annotation.

[0106] By manually labeling some data based on the selected scenarios with high model error rates, and combining the selected examples of incorrect predictions, the seed dataset is updated based on the erroneous examples. Then, the model is fine-tuned again using the updated seed dataset.

[0107] Repeat the above steps to gradually improve the ability of the instruction to fine-tune the model until execution stops when the error sample meets the preset conditions.

[0108] This application's embodiments utilize a large language model, enabling generalization based on a small, manually labeled first dataset. Compared to traditional manual labeling methods, the method presented in this application's embodiments can rapidly and cost-effectively expand the amount of data in the first dataset. Training a large model using the expanded dataset helps reduce the iteration cycle of the large model, allowing its processing capabilities to evolve rapidly.

[0109] Furthermore, this application's embodiments introduce the concept of active learning, automatically selecting the most valuable data from the dataset for large-scale model training through automated machine learning algorithms. It automatically identifies scenarios with high error rates in the large-scale model and erroneous data samples, then performs targeted data updates. This strategy achieves iterative evolution of large-scale model training through a "collection-generalization-training-evaluation-feedback closed loop," thereby enabling the large-scale model to acquire higher-performance instruction compliance capabilities.

[0110] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0111] Based on the data construction method proposed in the foregoing embodiments, this application also provides a data processing method, such as... Figure 3 As shown, the data processing method includes:

[0112] Step 301: Obtain the third instruction.

[0113] Step 302: Process the third instruction using the second major model to obtain the third answer.

[0114] The second major model was obtained by training the first major model using the updated first dataset, which was obtained based on the data construction method given in the above embodiments.

[0115] In practical applications, steps 301 to 302 can be implemented based on a processor, which can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.

[0116] Based on the data construction method proposed in the foregoing embodiments, this application also provides a data construction apparatus, such as... Figure 4 As shown, the data construction apparatus includes:

[0117] The first acquisition module 401 is used to acquire error handling results; the error handling results are determined by the first large model processing the data in the test dataset; the first large model is trained using the first dataset.

[0118] The first processing module 402 is used to update the first dataset based on the error handling results, so as to train the first large model according to the updated first dataset until the error handling results meet the preset conditions.

[0119] In practical applications, the first acquisition module 401 and the first processing module 402 can be implemented based on a processor and a communication device.

[0120] In some embodiments, the first processing module 402 is further configured to construct a first answer corresponding to the first instruction when the information in the first dataset includes the first instruction; and to construct a first instruction corresponding to the first answer when the information in the first dataset includes the first answer.

[0121] In some embodiments, the first processing module 402 is further configured to, when the information in the first dataset includes a first instruction and a first answer, obtain a plurality of first instructions in the first dataset and a first answer corresponding to each of the plurality of first instructions; obtain a mapping relationship between each first instruction and the first answer corresponding to each first instruction; generate a second instruction, and construct a second answer corresponding to the second instruction based on the mapping relationship.

[0122] In some embodiments, when the information in the first dataset includes a first instruction, the first processing module 402 is specifically used to determine the first prompt word corresponding to the first instruction based on the first instruction; and to obtain the first answer corresponding to the first instruction by constructing a large model based on the first prompt word.

[0123] In some embodiments, when the information in the first dataset includes the first answer, the first processing module 402 is specifically used to determine the second prompt word corresponding to the first answer based on the first answer; and to obtain the first instruction corresponding to the first answer by constructing a large model based on the second prompt word.

[0124] In some embodiments, the information in the first dataset includes a first instruction and / or a first answer corresponding to the first instruction; the first processing module 402 is specifically used to restate the first instruction to obtain multiple restated instructions corresponding to the first instruction; and / or to restate the first answer to obtain multiple restated answers corresponding to the first answer.

[0125] In some embodiments, the first processing module 402 is further configured to remove erroneous data from the generalized data.

[0126] In some embodiments, the first processing module 402 is specifically used to obtain a first processing result of the generalized data; the first processing result represents the result of removing some erroneous data in the generalized data; based on the first processing result, the erroneous data in the generalized data is automatically removed.

[0127] Based on the data processing method proposed in the foregoing embodiments, this application also provides a data processing apparatus, such as... Figure 5 As shown, the data processing device includes:

[0128] The second acquisition module 501 is used to acquire the third instruction.

[0129] The second processing module 502 is used to process the third instruction through the second large model to obtain the third answer; the second large model is obtained by training the first large model with the updated first dataset, and the updated first dataset is obtained based on the above data construction method.

[0130] In practical applications, the second acquisition module 501 and the second processing module 502 can be implemented based on a processor and a communication device.

[0131] It should be noted that the descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0132] It should be noted that, in the embodiments of this application, if the above methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a terminal, server, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.

[0133] This application also provides an electronic device. Figure 6 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application, as shown below. Figure 6 As shown, the electronic device 60 may include:

[0134] Memory 601 is used to store executable instructions.

[0135] The processor 602 is used to implement any of the above-described data construction methods or data processing methods when executing executable instructions stored in the memory 601.

[0136] The processor 602 mentioned above can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.

[0137] The aforementioned computer-readable storage medium or memory 601 may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.; it may also be various terminals that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0138] This application embodiment further provides a computer storage medium storing computer-executable instructions, which are used to implement any of the data construction methods or data processing methods provided in the above embodiments.

[0139] Correspondingly, this application embodiment further provides a computer program product, the computer program product including computer executable instructions, which are used to implement any of the data construction methods or data processing methods provided in the above embodiments.

[0140] In some embodiments, the functions or modules of the apparatus provided in this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0141] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.

[0142] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict.

[0143] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0144] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0145] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0146] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims. All of these forms are within the protection scope of this application.

Claims

1. A data construction method, characterized in that, The method includes: Obtain the error handling result; the error handling result is determined by the first large model processing the data in the test dataset; the first large model is trained using the first dataset; The first dataset is updated based on the error handling result, and the first large model is trained based on the updated first dataset. All the above steps are repeated until the error handling result meets the preset conditions and then the execution stops.

2. The method according to claim 1, characterized in that, The first large model is trained using a first dataset, including: the first large model is trained using generalized data; the generalized data refers to data obtained by generalizing information from the first dataset.

3. The method according to claim 2, characterized in that, The generalization of information in the first dataset includes: If the information in the first dataset includes the first instruction, construct the first answer corresponding to the first instruction; If the information in the first dataset includes the first answer, construct the first instruction corresponding to the first answer.

4. The method according to claim 2, characterized in that, The generalization of information in the first dataset includes: If the information in the first dataset includes the first instruction and the first answer, obtain multiple first instructions in the first dataset, and the first answer corresponding to each of the multiple first instructions; Obtain the mapping relationship between each first instruction and the first answer corresponding to each first instruction; Generate a second instruction, and construct a second answer corresponding to the second instruction based on the mapping relationship.

5. A data processing method, characterized in that, The method includes: Obtain the third instruction; The third instruction is processed by the second major model to obtain the third answer; the second major model is obtained by training the first major model with the updated first dataset, and the updated first dataset is obtained based on the method described in any one of claims 1 to 4.

6. A data construction apparatus, characterized in that, The device includes: The first acquisition module is used to acquire error handling results; the error handling results are determined by the first large model processing the data in the test dataset; the first large model is trained using the first dataset. The first processing module is used to update the first dataset based on the error handling result, so as to train the first large model according to the updated first dataset until the error handling result meets the preset conditions.

7. A data processing apparatus, characterized in that, The device includes: The second acquisition module is used to acquire the third instruction; The second processing module is used to process the third instruction through the second large model to obtain the third answer; the second large model is obtained by training the first large model with the updated first dataset, and the updated first dataset is obtained based on the method described in any one of claims 1 to 4.

8. An electronic device, characterized in that, The electronic device includes a processor and a memory for storing computer programs that can run on the processor; wherein, The processor is used to run the computer program to perform the method according to any one of claims 1 to 4, or claim 5.

9. A computer storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements any one of claims 1 to 4, or the method of claim 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements any one of claims 1 to 4, or the method of claim 5.