Method and equipment for constructing data set and computer readable storage medium

By extracting and utilizing the inference path of the data set, generating and verifying data, and building a new data set, the problems of high cost and poor quality of data set construction in the existing technology are solved, and high-quality and robust data sets are achieved Build.

CN119398161APending Publication Date: 2025-02-07SHANGHAI PROCESSOR TECH INNOVATION CENT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410562170.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The prior art faces high-time and economic costs when building high-quality data sets. At the same time, the automatically generated data set contains a large number of invalid samples, resulting in unsatisfactory training results.

Method used

By obtaining the inference paths of the original dataset, extracting the main path and the remaining paths, data generation and verification are performed based on these paths, and the enhanced data is merged to build a new dataset.

Benefits of technology

This method can automatically build data sets, reduce time and economic costs, enhance the robustness and quality of the data set, and improve the training effect of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119398161A_ABST
    Figure CN119398161A_ABST
Patent Text Reader

Abstract

The invention discloses a method and equipment for constructing a data set and a computer readable storage medium. The method comprises the following steps: acquiring a reasoning path of an original data set; extracting a main path and residual paths in the reasoning path; performing data generation according to the main path and the remaining paths to obtain enhanced data; and combining all the enhanced data as a new data set. Through the scheme of the invention, the data set can be automatically constructed, the robustness of constructing the data set is enhanced, and the quality of the data set is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application generally relates to the field of artificial intelligence technology. More specifically, the present application relates to a method, device and computer-readable storage medium for constructing a data set. Background Art

[0002] Currently, supervised fine-tuning ("SFT") is mainly used for the training and optimization of deep learning models or large models. Unlike unsupervised learning, SFT requires labeled data, which means that the dataset is usually related to the final task and contains input and corresponding output labels. In addition, for a good fine-tuned model, it not only performs well on the training data, but also has good robustness, that is, it performs well on other similar tasks and datasets.

[0003] However, how to obtain a higher quality annotated dataset for SFT is a difficult problem. On the one hand, it takes a huge amount of time and money for human experts to annotate a high-quality dataset; on the other hand, although there are a large number of automatically generated SFT datasets, they contain too many invalid samples and negative samples, which results in the training effect failing to meet expectations.

[0004] In view of this, there is an urgent need to provide a method for constructing a dataset, which can reduce the time and economic cost of making a dataset, enhance the robustness of the constructed dataset, and thus improve the quality of the dataset. Summary of the invention

[0005] In order to at least solve one or more of the technical problems mentioned above, the present application proposes a solution for constructing a data set in the following aspects.

[0006] In a first aspect, the present application provides a method for constructing a dataset, characterized in that it includes: obtaining an inference path of an original dataset; extracting a main path and a residual path in the inference path; generating data based on the main path and the residual path to obtain enhanced data; and merging all enhanced data as a new dataset.

[0007] In some embodiments, obtaining the reasoning path of the original data set includes: sampling the original data set to obtain the original reasoning path; and extracting the correct path from the original reasoning path to generate the reasoning path.

[0008] In some other embodiments, extracting the main path and the remaining path in the reasoning path includes: extracting the reasoning path with the most repetitions as the main path; performing a deduplication operation on the reasoning paths other than the main path; and extracting the reasoning path after the deduplication operation as the remaining path.

[0009] In some other embodiments, the enhanced data includes first enhanced data, second enhanced data and third enhanced data, wherein data generation based on the main path and the remaining path to obtain the enhanced data includes: performing data perturbations on the main path to generate a main path answer and the first enhanced data; verifying the remaining path to generate a standard comparison answer; comparing the main path answer with the standard comparison answer to generate the second enhanced data; and screening the standard comparison answer to generate the third enhanced data.

[0010] In some further embodiments, performing data perturbation on the main path to generate a main path answer and the first enhanced data includes: when the perturbation does not change the main path answer, retaining the answer and the path as enhanced data; and when the perturbation changes the answer, reasoning on the changed content to generate an unverified answer as the path answer.

[0011] In some other embodiments, when reasoning about the modified content fails, the data perturbation method is changed and reasoning is repeated until an unverified answer is generated.

[0012] In some other embodiments, verifying the remaining path to generate a standard comparison answer includes: perturbing the remaining path using the same perturbation method as the main path; reasoning on the perturbed path to retain the path that is successfully reasoned; and selecting multiple remaining paths with the largest edit distance and the same answer as the standard comparison answer.

[0013] In some further embodiments, comparing the main path answer with the standard comparison answer to generate the second enhanced data includes: comparing the unverified answer with the standard comparison answer; and retaining the consistent answer with the path to generate enhanced data.

[0014] In some further embodiments, screening the standard comparison answers to generate the third enhanced data includes retaining the correct answers obtained during the verification process and the corresponding remaining paths.

[0015] In a second aspect, the present application provides a computer-readable storage medium having stored thereon computer program instructions for constructing a data set, wherein when the computer program instructions are executed by one or more processors, the method according to any one of the first aspect is implemented.

[0016] In a third aspect, the present application provides a device for constructing a data set, comprising: a processor; and a memory on which computer instructions for constructing a data set are stored, wherein when the computer instructions are executed by the processor, the method according to any one of the first aspects is implemented.

[0017] Through the method, device and computer-readable storage medium for constructing a data set provided in the above aspects and embodiments, the solution of the present application can automatically construct a data set by obtaining a reasoning path. Further, in some embodiments, the robustness of the constructed data set can be enhanced by perturbing the reasoning path. Furthermore, in some embodiments, the quality of the data set can be improved by checking and comparing between reasoning paths. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become easy to understand. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0019] Figure 1 A schematic diagram of a process for constructing a data set according to an embodiment of the present application is shown;

[0020] Figure 2 A schematic diagram of a process for obtaining a reasoning path according to an embodiment of the present application is shown;

[0021] Figure 3 A schematic diagram of a process of extracting a main path and a remaining path according to an embodiment of the present application is shown;

[0022] Figure 4 A schematic diagram of a process flow of a method for generating data according to an embodiment of the present application is shown;

[0023] Figure 5 A schematic diagram showing a flow chart of another method for constructing a data set according to an embodiment of the present application is shown;

[0024] Figure 6 A schematic block diagram of an electronic device according to an embodiment of the present application is shown. 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 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 those skilled in the art without creative work are within the scope of protection of the present application.

[0026] It should be understood that the terms "include" and "comprising" used in the specification and claims of the present application indicate the presence of described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or collections thereof.

[0027] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this application specification and claims, unless the context clearly indicates otherwise, the singular forms of "a", "an" and "the" are intended to include plural forms. It should also be further understood that the term "and / or" used in this application specification and claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.

[0028] As used in this specification and claims, the term "if" may be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" may be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0029] In the field of deep learning and machine learning, data augmentation is a common technique that aims to increase the diversity of the dataset by generating new training samples, thereby improving the generalization ability of the model and reducing the risk of overfitting. The recently proposed Rejection Sampling Fine-tuning (RFT) and Output Space Shaping methods have brought new perspectives and methods to the field of data augmentation.

[0030] Specifically, rejection sampling fine-tuning is an innovative data augmentation technique based on the "zero-sample thought chain reasoning" capability of large models. In the absence of actual input samples, large models are able to autonomously generate multiple reasoning paths. These reasoning paths represent different ways in which the model answers potential problems, thereby enriching the information content of the dataset. However, since the generated reasoning paths may contain errors or repetitions, the RFT method screens out correct and unique reasoning paths by rejection sampling and adds them to the training set as enhanced data. This method effectively utilizes the generative power of large models, improves the quality and diversity of datasets, and thus helps improve the performance of the model.

[0031] Output Space Shaping is another advanced data augmentation technique that focuses not only on increasing the number of data sets, but also on improving data quality. This method focuses on identifying and correcting incorrect reasoning paths while ensuring the correct reasoning paths. By fine-tuning the model output space, this method can guide the model to learn more accurate and reliable reasoning paths. Output Space Shaping technology optimizes the information quality in the data set, making model training more efficient and improving the model's ability to understand and solve complex problems.

[0032] The inventors found that by combining the concepts of rejection sampling fine-tuning (RFT) and output space shaping, the potential and challenges of these two methods in practical applications can be further explored. First of all, the success of the RFT method depends on the generation ability of large models and the diversity of reasoning paths. Therefore, how to design and train models with efficient generation and reasoning capabilities becomes the key. In addition, the screening criteria in the rejection sampling process have a direct impact on the quality of the final data set and need to be carefully designed to ensure a balance between correctness and diversity. At the same time, the output space shaping method requires a deep understanding and control of the output space of the model. This requires developers to have advanced model analysis and adjustment skills in order to accurately identify incorrect reasoning paths and make effective corrections. In addition, this method also requires strong algorithmic support to achieve accurate shaping of the output space.

[0033] In summary, rejection sampling fine-tuning and output space shaping provide new perspectives and methods for data augmentation techniques. By leveraging the generative power of large models and fine-tuning the output space strategy, these methods have the potential to significantly improve the quality and diversity of datasets, thereby improving model performance. However, achieving the success of these methods requires addressing a series of challenges, including model design, the formulation of screening criteria, and precise control of the output space.

[0034] It is important to understand that when exploring the content and scope of the data set in the context of this application, it is first necessary to clarify the basic concepts and uses of large language models (LLMs). Large language models are algorithmic models that use machine learning techniques, especially deep learning methods such as neural networks, to process, understand and generate human language. These models learn information such as language structure, grammar, vocabulary, and the context of language use by analyzing large amounts of text data.

[0035] The datasets include but are not limited to datasets of large language models, which means that these datasets may contain text data of various forms and types for training and optimizing large language models. Specifically, these datasets may include:

[0036] Text corpus: This is the main part of the large language model dataset, which may include text data from various sources such as the Internet, books, newspapers, scientific papers, patent documents, social media posts, etc. Text corpora usually need to be preprocessed, such as removing irrelevant content, correcting spelling errors, standardizing text formats, etc., to improve data quality.

[0037] Labeled datasets: In order to improve the performance of large language models on specific tasks, such as sentiment analysis, text classification, named entity recognition, etc., manually labeled datasets may be needed. These datasets are used to supervise the learning process by manually marking specific information in the text, such as sentiment tendency, text category, entity name, etc.

[0038] Multilingual datasets: Given the global application requirements of large language models, datasets may also include text data in multiple languages. This helps build multilingual or cross-lingual large language models that can understand and generate text in multiple languages ​​such as non-English.

[0039] Dialogue and question-answering datasets: In order to train large language models for applications in dialogue systems and question-answering systems, the datasets may contain text data in the form of dialogue records, question-answer pairs, etc. This type of data helps the model learn how humans communicate and the ability to provide accurate responses.

[0040] Professional domain datasets: For large language models that need to be applied in specific fields (such as medicine, law, finance, etc.), the dataset may need to contain professional text data in that field. This kind of data helps the model understand and generate text content with professional knowledge.

[0041] The datasets include but are not limited to datasets for large language models, ranging from extensive text corpora to specific annotated datasets, from multilingual data to dialogue and question-answering data, and even datasets in professional fields. The diversity and richness of these datasets are the key to training and optimizing large language models and improving their performance in various application scenarios.

[0042] The specific implementation of the present application is described in detail below with reference to the accompanying drawings.

[0043] Figure 1 A schematic diagram of a method 100 for constructing a data set according to an embodiment of the present application is shown below. Figure 1 The method described in this application is further explained.

[0044] like Figure 1 As shown, at step S101, the reasoning path of the original data set is obtained. In one embodiment, the original data set can be sampled multiple times using a large model (the specific sampling method will be described in Figure 2to obtain the reasoning path.

[0045] Specifically, obtaining the reasoning path of the original data set is a process involving complex data processing and analysis, which aims to reveal the underlying logic and relationships behind the data through in-depth exploration and analysis of the original data set. This process usually involves using large machine learning models, especially those with strong natural language processing capabilities, to sample the original data set multiple times to obtain the reasoning path between the data.

[0046] First, raw datasets refer to the collected data without any preprocessing, which can be in the form of text, images, audio or other forms. In many cases, raw datasets are large and complex, containing rich information, but may also contain noise and irrelevant information. Therefore, it is a challenge to extract useful information and knowledge directly from these data.

[0047] To overcome this challenge, we can use large models, that is, large machine learning models, especially those large language models that are specifically designed to understand and generate human language, such as models based on the Transformer architecture. These models have learned to capture the complex structure and rich semantic information of language by training on large-scale datasets.

[0048] Secondly, the process of multiple sampling refers to the repeated analysis and processing of the original data set using a large model. In each sampling, the model will try to extract information from the data, understand the meaning of the data, and infer the possible logical relationships and reasoning paths between the data. This process includes not only extracting explicit information directly from the data, but also using the model's reasoning ability to mine implicit and less obvious information and relationships.

[0049] In this way, inference paths, which are representations of logical and causal relationships between data elements, can be obtained. Inference paths help understand the intrinsic structure of the data, for example, how to deduce from one data point to another, or how certain features in the data interact and affect the final result. These inference paths are not only important for a deep understanding of the data itself, but also for improving the training and performance of machine learning models.

[0050] return Figure 1 In the process shown in step S102, the main path and the remaining path in the reasoning path are extracted. In this application, a method is introduced for extracting reasoning paths from complex data sets. This process focuses on identifying and distinguishing the main path from the remaining path (such as Figure 3 The specific extraction method will be shown in Figure 3 (see the instructions for more information).

[0051] Main paths represent those paths that show the strongest logical coherence and causal relationships in the data set. They represent the most significant reasoning flow between data and are key to understanding the overall structure and dynamics of the data set. These paths usually contain the most important nodes and connections, revealing the main patterns and trends in the data set.

[0052] In the context of this application, the remaining paths may include all paths other than the main path. Although these paths may not contain the main logical flow in the data set, they provide a more comprehensive perspective on the data set and reveal possible secondary patterns, marginal relationships or anomalies, etc. Further, these remaining paths are equally important for a complete understanding of the complexity of the data set and help identify and explain the subtle differences and diversity in the data.

[0053] In step S103, data is generated according to the main path and the remaining path to obtain enhanced data. Specifically, by perturbing the reasoning path, checking and comparing the data, the correct answer and path in the process are retained as enhanced data (such as Figure 4 As shown in the Figure 4 (see the instructions for more information).

[0054] It should be noted that this method first generates data based on the previously identified main path and residual path as the basic framework. The main path, as the most important logical flow in the dataset, provides the core structure and main causal relationships for the enhanced data; while the residual path contributes auxiliary logical flows and secondary causal relationships, increasing the diversity and complexity of the data. By combining these two paths, enhanced data that reflects the deep structure and dynamics of the original dataset can be generated.

[0055] Furthermore, the generated data is perturbed, that is, each element in the path (such as nodes and connections) is slightly modified to simulate the natural variation of the data. This perturbation can include changing node attributes, adjusting connection weights, adding or deleting certain connections, etc. Then, the perturbed data is verified and compared through a set of predetermined algorithms to ensure that the generated data still maintains logical correctness and consistency.

[0056] Keep the enhanced data that has been verified and determined to be logically correct. This includes keeping the correct answers and paths, ensuring that they can effectively reflect the real patterns and relationships behind the data, ensuring the quality of the enhanced data, and ensuring that the data can provide effective support and assistance in subsequent applications, such as training machine learning models. Through the above methods, not only can the data set be expanded, but also the diversity and complexity of the data can be enhanced.

[0057] At step S104, all enhanced data are merged as a new data set. The system collects all data generated by the data enhancement techniques described previously. These data include data generated based on the main path and the remaining path, as well as enhanced data after data perturbation, verification and correctness retention operations. Then, these data will be integrated into a unified framework to form a comprehensive data set. This process involves not only the physical merging of data, but also the standardization of data formats and structures to ensure the consistency and interoperability of data sets.

[0058] Next, a series of quality control and optimization operations are performed on the newly generated dataset. This includes but is not limited to removing duplicate data, correcting erroneous or inconsistent data entries, balancing data distribution, etc. Through these operations, the quality of the dataset can be further improved to ensure its effectiveness and reliability in model training. In addition, it may also include feature engineering of the dataset, such as feature selection and feature transformation, to improve the efficiency and performance of model training.

[0059] The newly generated enhanced dataset will be used to train the machine learning model. At this stage, the diversity and complexity of the dataset can provide rich learning resources for model training, helping the model to capture more subtle and complex data patterns. This is crucial to improving the generalization ability and predictive performance of the model, especially when facing complex problems in the real world. By using this optimized dataset, the learning efficiency of the model and the final application effect can be significantly improved.

[0060] Figure 2 A flow chart of a method 200 for obtaining a reasoning path according to an embodiment of the present application is shown. Specifically, Figure 2 The flow of the reasoning path for obtaining the original data set is further shown. It can be understood that Figure 2 The method steps shown are Figure 1 In view of this, the above text combines Figure 1 The description of step S101 is also applicable to the following description.

[0061] like Figure 2As shown, at step S201, the original data set is sampled to obtain the original reasoning path. In this process, the original data set is processed and analyzed. It should be understood that the original data set may contain a large number of data points, involving different types of data, such as text, images, or numerical values. Sampling here refers to selecting a representative subset from a large original data set for more in-depth analysis. The purpose of sampling is to reduce the consumption of computing resources while retaining enough information to reveal the basic structure and pattern of the data. The original reasoning path can be obtained by applying a specific analysis method or machine learning model to the selected data subset. These reasoning paths represent the inherent logical relationships and causal chains of the data, which may include but are not limited to the order of occurrence of specific events, the dependencies between data points, or the way variables interact with each other.

[0062] In one embodiment, a ToRA (Tool Integrated Reasoning Model) model is used, which is specially designed to discover and build reasoning paths from large-scale data sets. A reasoning path refers to a collection of logical relationships and causal chains between data points, which can reveal the underlying structure and dynamic process behind the data.

[0063] Specifically, the ToRA model is used to sample the original dataset hundreds of times. This process involves multiple explorations and analyses of the dataset, with each sampling designed to capture different aspects and features of the data. The original dataset may be very large, containing complex structures and diverse information types. Through repeated sampling, the ToRA model can understand the dataset from different angles and depths, and gradually build a comprehensive network of reasoning paths.

[0064] At step S202, the correct path is extracted from the original reasoning path to generate a reasoning path. Next, the task turns to further analysis and screening of the original reasoning path obtained in the previous step. The original reasoning path may contain wrong paths, noise, or irrelevant information, which need to be identified and eliminated. Extracting the correct path involves evaluating and verifying the original reasoning path, using various criteria and methods to determine which paths most accurately reflect the true structure and relationships of the data set. This may include comparing the consistency, reliability, and predictive power of different paths, or verifying the paths using known external information. Ultimately, through this step, a set of refined and verified reasoning paths can be generated, which provide a reliable basis for subsequent data analysis, model training, or decision support.

[0065] Furthermore, the correct reasoning paths are extracted from the sampling results and duplicates are removed. This process requires screening and verification of a large number of reasoning paths obtained by sampling. Since multiple sampling may produce duplicate paths or contain erroneous paths due to data noise, judgment is required to identify the most accurate and valuable reasoning paths. The extraction process may include comparing the consistency between paths, verifying the consistency of the paths with known facts, and evaluating the reliability and practicality of the paths. Deduplication ensures that the final set of reasoning paths does not contain redundant items and that each path is unique and contributing.

[0066] Through the above two steps, we can obtain a set of carefully selected and optimized reasoning paths, which not only reflect the complex logical relationships and causal chains between data, but also ensure that the knowledge extracted from the data is as close to the actual situation as possible, thus supporting high-quality data-driven decision-making. At the same time, it also provides a solid foundation for subsequent data analysis, model training or decision support.

[0067] Figure 3 A schematic flow chart of a method 300 for extracting a main path and a remaining path according to an embodiment of the present application is shown. Specifically, Figure 3 The process of extracting the main path and the remaining path in the reasoning path is further shown. It can be understood that Figure 3 The method steps shown are Figure 1 In view of this, the above combined with Figure 1 The description of step S102 is also applicable to the following description.

[0068] During the extraction process, the entire data set is first comprehensively analyzed, and then a series of precise calculations and comparisons are performed to determine which paths have the highest logical coherence and causal strength, thereby identifying the main paths. Next, these main paths are compared with other paths in the data set to distinguish the remaining paths, ultimately effectively revealing the deep structure and relationships behind the data.

[0069] like Figure 3 As shown, at step S301, the reasoning path with the most repetitions is extracted as the main path. The present application adopts a method to identify the main reasoning path in the data set.

[0070] Specifically, this step involves an in-depth analysis of the original data set to identify and record various possible reasoning paths and their frequencies of occurrence. Among all the identified reasoning paths, the one that appears most frequently is identified as the primary path. This frequency-based selection method is based on an important assumption: reasoning paths that appear repeatedly in a data set are more likely to represent the strongest logical relationships and causal chains between data. Therefore, by extracting the most repeated reasoning paths, the application can effectively determine the core structure and dynamics in the data set.

[0071] At step S302, a deduplication operation is performed on the reasoning paths other than the main path. The purpose of this process is to eliminate redundant information that may appear during the data analysis process and to ensure the uniqueness and value of each reasoning path. The deduplication operation involves a detailed comparison of each reasoning path to identify and remove those paths that are exactly the same or extremely similar. In this way, the present application can ensure that the reasoning paths retained in the data set are diverse and representative, providing a richer and more sophisticated perspective for subsequent analysis.

[0072] At step S303, the reasoning path after the deduplication operation is extracted as the remaining path. The present application extracts the remaining path from the set of reasoning paths after the deduplication operation is performed. These remaining paths, i.e., other paths other than the main path, represent all other valid logical relationships and causal chains in the data set except the most important logical flow after deduplication processing. The process of extracting the remaining path not only increases the present application's understanding of the overall picture of the data set, but also reveals possible secondary patterns, marginal relationships or abnormal situations.

[0073] Through the description of the above three steps, this application demonstrates a systematic approach to analyzing and processing reasoning paths in a data set, from determining the main logical flow of the data set to managing the remaining reasoning paths to improve the efficiency and accuracy of data analysis.

[0074] To ensure the accuracy and reliability of the extraction process, this application also includes a set of validation mechanisms to evaluate the effectiveness of the identified main and residual paths. This includes but is not limited to cross-validation using independent data sets and applying statistical tests to confirm the significance and stability of the paths.

[0075] Figure 4 A schematic diagram of a data generation method 400 according to an embodiment of the present application is shown. Specifically, Figure 4 The process of generating data according to the main path and the remaining path to obtain enhanced data is further shown. The enhanced data includes first enhanced data, second enhanced data and third enhanced data. It can be understood that Figure 4 The method steps shown are Figure 1In view of this, the above combined with Figure 1 The description of step S103 is also applicable to the following description.

[0076] like Figure 4 As shown, at step S401, data perturbation is performed on the main path to generate a main path answer and the first enhanced data.

[0077] In this application, the main path is defined as the most critical and representative logical flow or causal chain in the data set. It usually contains the most significant features and relationships in the data set and is the basis for the core structure of the data set. Determine the specific plan for data perturbation on the main path, which may include but is not limited to modifying the node values ​​on the path, changing the connection weights between nodes, adding or deleting certain nodes or connections, etc. The design of the perturbation plan needs to ensure that the variation of the data is both meaningful and maintains the logical consistency of the data as a whole.

[0078] After the data perturbation is completed, the newly generated data is evaluated to ensure that the perturbation has achieved the intended purpose, that is, increasing the diversity and robustness of the dataset without destroying the basic structure and logic of the data.

[0079] Further, when the disturbance does not change the main path answer, the answer and the path are retained as the first enhanced data; and when the disturbance changes the answer, the changed content is inferred to generate an unverified answer as the path answer.

[0080] Specifically, this application modifies the main path in the data set by including but not limited to eight different data perturbation methods, aiming to enhance the diversity of the data set and the effect of model training. These perturbation methods include but are not limited to changes in number types, adjustments in numerical values, changes in semantics, and rearrangements of data order. Depending on whether these perturbations affect the correct answer to the question, they are divided into the following two major processing flows:

[0081] Data perturbations that do not change the answer: Although this type of data perturbation changes the expression form or some conditions of the question, it does not affect the final answer to the question. For example, a slight adjustment of non-critical values ​​in a math question, or adjustment of the order of information presentation without affecting the calculation logic. Since the answer to the original question remains unchanged, the new data instances generated by this type of data perturbation can be used as part of the correct reasoning path and included in the effective and high-quality augmented dataset.

[0082] It should be noted that when the perturbation does not change the answer of the main path, the answer and the main path are retained as the first enhanced data. At the same time, when the reasoning of the changed content fails, the data perturbation method is changed and the reasoning is repeated until an unverified answer is generated.

[0083] Data perturbations that require changing the answer: This type of data perturbation will affect the answer to the question. Therefore, for this type of data perturbation, not only the conditions of the question need to be changed, but also the reasoning path and problem-solving code need to be adjusted accordingly to ensure that a new correct answer can be obtained. Specifically, adjustments can include changing the type of numbers (such as from integers to decimals), the size of the numbers, the semantics of the questions (changing the basic conditions or logic of the questions), and the order of information. After this type of perturbation, the reasoning path and code must be adjusted accordingly, and the code must be executed to verify whether the new solution is reasonable. If the code execution fails, it means that the perturbation is unreasonable and needs to be re-perturbed until a feasible solution is found.

[0084] It should be noted that in data perturbations that require changing the answer, the answer that is changed is an unverified answer.

[0085] After executing the above two types of data perturbations, this application uses a systematic verification process to ensure the validity and correctness of the data perturbations. For data perturbations that require changing the answers, special attention is paid to the process of executing the code, and the code execution results are used to determine whether the perturbed questions are reasonable. Only when all perturbed main paths can successfully execute the code and generate reasonable answers, this round of data perturbation is considered successful.

[0086] In addition, for new answers obtained through code execution, this application also includes a mechanism for handling unverified answers. That is, all newly generated answers are considered unverified when they are first generated, and their correctness needs to be confirmed through subsequent expert review or automated verification processes.

[0087] At step S402, the remaining path is verified to generate a standard comparison answer. In one embodiment, the standard comparison answer here can be a correct answer based on the original path, an answer that has been strictly verified or confirmed by expert review.

[0088] Furthermore, the aforementioned verification and generation process includes: perturbing the remaining paths using the same perturbation method as the main path; reasoning on the perturbed paths to retain the paths that have been successfully reasoned; and selecting multiple remaining paths with the largest edit distance and the same answer as standard comparison answers.

[0089] Specifically, mapping the modification method of the main path to the remaining path means applying the method and logic used to modify the main path to the remaining path, and making appropriate adjustments according to the corresponding data perturbation method. This ensures that the modification method of the remaining path is consistent with the main path, thereby improving the effect and accuracy of data enhancement.

[0090] When executing the altered code, if an error occurs, that path is not taken. This means that only paths that produce the correct answer are included in the augmented dataset.

[0091] In one embodiment, for each question, three paths with the largest edit distance and the same answer can be selected from the remaining paths as standard comparison answers. It should be noted that the edit distance refers to the minimum number of edit operations required to convert one string into another, including insertion, deletion, and substitution. Therefore, selecting the path with the largest edit distance and the same answer can maximize the difference between the remaining path and the main path, while avoiding unnecessary data duplication and redundancy caused by small differences.

[0092] In the process of executing the code and comparing the answers, it is necessary to generate corresponding chains of thought and code changes according to the location and method of modification. This can record the process of data enhancement and provide a basis for reference and inspection.

[0093] In step S403, the main path answer is compared with the standard comparison answer to generate the second enhanced data.

[0094] It should be understood that the purpose of comparing the unverified answers to the main path with the standard comparison answers is to test the accuracy and stability of the main path. The comparison process includes comparing and checking the answers to the main path with the standard comparison answers in terms of numerical value, form, logic, etc. to ensure their consistency.

[0095] If the main path answer matches the standard comparison answer, that is, the two are consistent, then the new data and answers generated by the path after data perturbation are valid and reasonable. Such new data instances can be included in the enhanced dataset and used as part of the effective reasoning path for training models or other related analysis and applications.

[0096] However, if the main path answer is inconsistent with the standard comparison answer, that is, there is a difference, then further inspection of possible reasons is required. This may include but is not limited to code execution errors, irrationality of data perturbation methods, data input problems, etc. When inconsistencies are found, corrections and adjustments need to be made in a timely manner to ensure that the main path answer can match the standard comparison answer. This can avoid data perturbation and misleading caused by incorrect main paths, and improve the effect and reliability of data enhancement.

[0097] Specifically, the unverified answer is compared with the standard comparison answer; and the consistent answer and the path are retained to generate the second enhanced data.

[0098] After re-changing the question, the above operation needs to be repeated, that is, the modification of the main path is mapped to the remaining paths, the same modification is made, and the modified code is executed. For the wrong path, no modification is made and it is not part of the enhanced data. This ensures that only the path that can produce the correct answer is adopted and avoids data inaccuracy and redundancy.

[0099] If the answers to the compared questions are the same, then the question will be used as part of the augmented data. It should be noted that when choosing the questions to compare, you should give priority to questions with greater difficulty and greater answer variation to obtain more effective information and data augmentation effects.

[0100] In step S404, the standard comparison answers are screened to generate the third enhanced data.

[0101] It should be understood that the purpose of screening the standard comparison answers is to determine the correct answers obtained during the verification process and the corresponding remaining paths to generate the third enhanced data. When screening, the correct answers that are completely consistent with the standard comparison answers should be retained because these answers are correct and reliable.

[0102] Further, the correct answer and the corresponding remaining path obtained in the verification process are retained. Regarding the processing method of the remaining paths, it is first necessary to ensure that these paths match the correct answers, that is, they can produce correct results. Secondly, these paths need to be classified and screened to generate the third enhanced data. Specifically, the remaining paths should be divided into different groups or categories, such as difficulty, question type, theme, etc., and each group or category should be screened and sorted to select the optimal path as the third enhanced data.

[0103] It should be noted that when screening and selecting paths, priority should be given to paths that can produce high-quality data, that is, those with greater difficulty and greater answer variation, while ensuring data diversity and coverage. This can maximize the effect and value of data augmentation.

[0104] Figure 5 A flow chart of another method 500 for constructing a data set according to an embodiment of the present application is shown. Next, a training set of the most common GSM8K data set in Math Word Problem (MWP) is taken as an example. Figure 5 The overall process of constructing the dataset is further explained.

[0105] Below is the original GSM8K dataset:

[0106]

[0107] The ToRA model is used to sample the original dataset hundreds of times to obtain the reasoning path. The correct reasoning path is then extracted from the sampling results and deduplicated. At the same time, the path with the most repetitions is determined as the main path, and the rest are residual paths.

[0108] The data format of the inference path is as follows:

[0109]

[0110]

[0111] Perform data perturbation and apply eight different data perturbation methods to the main path to change the question. Depending on whether the perturbation changes the answer, it is handled in two cases: No change to the answer: The generated data set is used as valid augmented data. Change the answer: Change the reasoning path and code at the same time, and execute the code to verify the rationality of the change. If the code execution fails, re-perturb until it is successfully executed and the answer is generated. The data format after data perturbation and the final augmented data set is consistent, and the data format is as follows:

[0112]

[0113] Keep the correct answer and path as part of the augmented data set. For the verification of the remaining paths, use the modification method of the main path to map to the remaining paths and make the same modification. Execute the modified code, and the wrong path is not adopted. Select the three remaining paths with the largest edit distance and the same answer as the standard comparison answer. Then compare the unverified answer with the standard comparison answer, and the consistent answer is part of the augmented data. All the remaining paths of the correct answer are selected as part of the augmented data. Finally, merge all the augmented data as a new high-quality dataset.

[0114] Figure 6 FIG. 1 is a schematic block diagram of an electronic device according to an embodiment of the present application. Figure 6 As shown, the electronic device 600 may include a processor 601 and a memory 602. The memory 602 stores computer instructions for constructing a data set. When the computer instructions are executed by the processor 601, the electronic device 600 executes the above-mentioned Figure 1 to Figure 5 The method described.

[0115] In some embodiments, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program code is executed by a processor, the program code is used to cause the processor to perform the method described above. The program product may adopt any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0116] Although multiple embodiments of the present application have been shown and described herein, it is obvious to those skilled in the art that such embodiments are provided only by way of example. Those skilled in the art can think of many changes, modifications and alternatives without departing from the thought and spirit of the present application. It should be understood that in the process of practicing the present application, various alternatives to the embodiments of the present application described herein can be adopted. The attached claims are intended to limit the scope of protection of the present application, and therefore cover equivalents or alternatives within the scope of these claims.

[0117] The collection and acquisition of various data in this application complies with relevant laws and regulations and is authorized by the data provider. Any organization or individual that needs to obtain external data must obtain authorization in accordance with the law and ensure data security. It is not allowed to illegally collect, use, process, or transmit unauthorized or unprotected data, or to illegally buy, sell, provide, or disclose unauthorized or unprotected data.

Claims

1. A method for constructing a data set, characterized in that: include: Get the inference path of the original dataset; Extracting a main path and a remaining path from the reasoning path; Generate data according to the main path and the remaining path to obtain enhanced data; as well as Combine all augmented data as a new dataset.

2. The method according to claim 1, characterized in that The reasoning path for obtaining the original data set includes: Sampling the original data set to obtain the original reasoning path; and The correct path is extracted from the original reasoning path to generate the reasoning path.

3. The method according to claim 1, characterized in that The extracting of the main path and the remaining path in the reasoning path comprises: Extracting the reasoning path with the most repetitions as the main path; performing a deduplication operation on the reasoning paths other than the main path; and The reasoning path after the deduplication operation is extracted as the remaining path.

4. The method according to claim 1, characterized in that: The enhanced data includes first enhanced data, second enhanced data and third enhanced data, wherein generating data according to the main path and the remaining path to obtain the enhanced data includes: Performing data perturbation on the main path to generate a main path answer and the first enhanced data; Verifying the remaining path to generate a standard comparison answer; comparing the main path answer with the standard comparison answer to generate the second enhanced data; and The standard comparison answers are screened to generate the third enhanced data.

5. The method according to claim 4, characterized in that The step of performing data perturbation on the main path to generate the main path answer and the first enhanced data includes: When the disturbance does not change the main path answer, retain the answer and the path as the first enhanced data; and When the perturbation changes the answer, reasoning is performed on the changed content to generate an unverified answer as the answer for that path.

6. The method according to claim 5, characterized in that When reasoning about the changed content fails, the data perturbation method is changed and reasoning is repeated until an unverified answer is generated.

7. The method according to claim 4, characterized in that The checking of the remaining path to generate a standard comparison answer includes: Perturb the remaining paths using the same perturbation method as the main path; Perform reasoning on the perturbed paths to retain the paths that are successfully reasoned; and Select multiple remaining paths with the largest edit distance and the same answer as the standard comparison answer.

8. The method according to claim 5, characterized in that The step of comparing the main path answer with the standard comparison answer to generate the second enhanced data includes: Comparing the unverified answer with the standard comparison answer; and The consistent answer is retained with the path to generate the second enhanced data.

9. The method according to claim 7, characterized in that: The screening of the standard comparison answers to generate the third enhanced data includes retaining the correct answers obtained during the verification process and the corresponding remaining paths.

10. A computer-readable storage medium having stored thereon computer program instructions for constructing a data set, wherein when the computer program instructions are executed by one or more processors, the method according to any one of claims 1 to 9 is implemented.

11. A device for constructing a data set, comprising: processor; A memory having computer instructions for constructing a data set stored thereon, wherein when the computer instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.