Method and device for generating training data of large model
Through vertical classification and iterative adjustment of training data, high-quality training data sets are generated for different business scenarios, and these data sets are integrated according to the complexity of task learning, which solves the problem of large models performing poorly in different scenarios and achieves better performance and training results.
Patent Information
- Application Number
- CN202411587517.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-14
AI Technical Summary
The existing large-model training methods are trained after merging data sets from different business scenarios, resulting in poor performance of the model in certain specific scenarios, and the existing evaluation methods cannot reflect the specific performance of the large-model in various business scenarios, and lack scenario targeting and effectiveness.
Multiple business scenarios are determined by vertical classification, the initial training set is constructed for each scenario, and the initial training set for fine-tuning sub-capability model is iteratively adjusted until the preset performance conditions are met, and the scene training set is obtained. Then, each scene training set is integrated according to the task learning complexity, and the target training data is generated for fine-tuning of the big model.
It ensures the quality and accuracy of training data in each business scenario, realizes accurate capture of data distribution, key features and requirements, improves the performance of large models in various business scenarios, and optimizes the training effect of large models.
Smart Images

Figure CN119622330A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method and device for generating training data for a large model. Background Art
[0002] As user needs become more diverse and complex, a single large model usually needs to cope with a variety of different interaction needs, which requires the large model to have a high degree of flexibility and adaptability and to be able to perform well in multiple business scenarios.
[0003] At present, the commonly used large model training method is to merge the data sets of different business scenarios to form a large data set, and then use the data set to train the model. However, due to the differences in data distribution, key features and requirements of different business scenarios, simply merging the data sets together for training will lead to poor performance of the model in certain specific scenarios. When evaluating the performance of large models, the existing technology provides evaluation results based on the large data set and the overall fine-tuning effect of the large model. The numerical evaluation results cannot reflect the specific performance of the large model in various business scenarios, making the fine-tuning process of the large model lack of scenario-specificity and effectiveness, and cannot meet the training requirements for the large model to show good performance in various business scenarios. Summary of the invention
[0004] In view of this, in order to solve the above-mentioned technical problems, the present application provides a method, device, equipment and readable storage medium for generating training data for a large model.
[0005] Specifically, the present application is implemented through the following technical solutions:
[0006] According to a first aspect of an embodiment of the present application, a method for generating training data for a large model is provided, the method comprising:
[0007] For the interaction scenarios between users and big models, vertical classification is carried out according to the hierarchical depth of the big model's application field to determine the corresponding multiple business scenarios;
[0008] Construct an initial training set for each business scenario;
[0009] For each business scenario, iteratively adjust the initial training set used to fine-tune the sub-capability model until the performance result of the sub-capability model after fine-tuning meets the preset performance conditions of the business scenario, thereby obtaining the scenario training set of the business scenario; the sub-capability model includes any lightweight model having the same function as the large model;
[0010] According to the task learning complexity of each of the multiple business scenarios, the scenario training sets of each business scenario are integrated to generate target training data; the target training data is used to fine-tune the pre-trained large model.
[0011] Optionally, integrating scenario training sets of various business scenarios to generate target training data includes:
[0012] Arrange and splice the scenario training set of each business scenario in order from low to high learning complexity of the task to obtain first training data;
[0013] Selecting a preset number of sub-data sets from the scenario training set of each business scenario, and integrating the sub-data sets from different business scenarios into a common training data set as second training data;
[0014] The second training data is spliced at the end of the first training data to generate the target training data.
[0015] Optionally, selecting a preset number of sub-data sets from the scenario training set of each business scenario includes:
[0016] Determine the data proportion of the scenario training set of each business scenario in the total data set; the total data set refers to the data set obtained by merging the scenario training sets of each business scenario;
[0017] Determine the preset number corresponding to the business scenario according to the total amount of data in the scenario training set of the business scenario and the corresponding data proportion;
[0018] A preset amount of data corresponding to the business scenario is extracted from the scenario training set of the business scenario to form the sub-data set.
[0019] Optionally, the method further includes a step of predetermining the task learning complexity of the multiple business scenarios, including:
[0020] Acquire multiple judgment conditions set for each evaluation dimension; wherein each judgment condition is assigned a score value; the score value is positively correlated with the complexity of the content represented by the judgment condition in the evaluation dimension to which it belongs; the evaluation dimension at least includes content information complexity, grammatical complexity, and reasoning complexity;
[0021] For the multiple business scenarios, determine all determination conditions satisfied by the sample data of the business scenarios, and calculate the total score of the business scenarios in all evaluation dimensions according to the score values of the determination conditions satisfied by the business scenarios;
[0022] The total scores of each business scenario are sorted in ascending order to determine the order of task learning complexity of the multiple business scenarios from low to high.
[0023] Optionally, for each business scenario, iteratively adjusting the initial training set used to fine-tune the sub-capability model until the performance result after the sub-capability model is fine-tuned meets the preset performance condition of the business scenario, thereby obtaining the scenario training set of the business scenario, includes:
[0024] Fine-tune the sub-capability model using the constructed initial training set of the business scenario to obtain a fine-tuned sub-model;
[0025] Obtaining a performance result of the fine-tuning sub-model on a test set; the test set is constructed for the business scenario;
[0026] In the case where the performance result does not meet the preset performance condition, iteratively adjusting the initial training set, and using the adjusted initial training set to fine-tune the sub-capability model until the performance result of the fine-tuned sub-model on the test set meets the preset performance condition;
[0027] The training set used for fine-tuning when the performance result meets the preset performance condition is used as the scenario training set of the business.
[0028] Optionally, when the performance result does not meet the preset performance condition, iteratively adjusting the initial training set includes:
[0029] Before performing the Nth round of iterative adjustment on the initial training set, obtain the performance results of each round of fine-tuning in the first N-1 rounds, and determine the target round with the best performance result; the value of N is a positive integer greater than 2;
[0030] When the initial training set is adjusted for the Nth round of iteration, the initial training set used when fine-tuning the target round is adjusted.
[0031] Optionally, the iteratively adjusting the initial training set of the business scenario includes:
[0032] The initial training set is changed by data augmentation processing;
[0033] Alternatively, when the performance results of the fine-tuned sub-model do not meet the preset performance conditions, the initial training set is adjusted according to the performance results and the received user feedback, and the sub-capability model is fine-tuned using the adjusted initial training set; the user feedback is used to describe the way in which the initial training set is changed.
[0034] Optionally, after fine-tuning the sub-capability model using the adjusted initial training set, the method further includes:
[0035] In response to receiving the model test instruction, receiving test input data from the graphical user interface;
[0036] The fine-tuned sub-model obtained by fine-tuning is used to generate corresponding test outputs and return them to the graphical user interface, so that the user generates the user feedback according to the test outputs; the user feedback includes at least one of data-adjusted a posteriori knowledge based on the model test output and manually annotated data of the business scenario.
[0037] Optionally, after generating the target training data, the method further includes:
[0038] In response to adding at least one new business scenario, constructing an initial training set of the new business scenario, and continuously iteratively adjusting the initial training set of the new business scenario to obtain a scenario training set of the business scenario;
[0039] Obtaining a ranking position of the task learning complexity of the newly added business scenario in the task learning complexities of the multiple existing business scenarios;
[0040] Insert the scenario training set of the newly added business scenario into the target training data corresponding to the sorting position to generate an updated target training set.
[0041] According to a second aspect of an embodiment of the present application, a device for generating training data for a large model is provided, the device comprising:
[0042] The business scenario classification module is used to classify the interaction scenarios between users and the big model vertically according to the hierarchical depth of the big model's application field, and determine the corresponding multiple business scenarios;
[0043] The training set construction module is used to construct the initial training set for each business scenario;
[0044] A training set adjustment module, for iteratively adjusting the initial training set used to fine-tune the sub-capability model for each business scenario, until the performance result of the sub-capability model after fine-tuning meets the preset performance condition of the business scenario, thereby obtaining a scenario training set for the business scenario; the sub-capability model includes any lightweight model having the same function as the large model;
[0045] The target training data generation module is used to integrate the scenario training sets of each business scenario according to the task learning complexity of each of the multiple business scenarios to generate target training data; the target training data is used to fine-tune the pre-trained large model.
[0046] Optionally, the target training data generating module is specifically used for:
[0047] Arrange and splice the scenario training set of each business scenario in order from low to high learning complexity of the task to obtain first training data;
[0048] Selecting a preset number of sub-data sets from the scenario training set of each business scenario, and integrating the sub-data sets from different business scenarios into a common training data set as second training data;
[0049] The second training data is spliced at the end of the first training data to generate the target training data.
[0050] Optionally, when the target training data generation module is used to select a preset number of sub-data sets from the scenario training set of each business scenario, it includes:
[0051] Determine the data proportion of the scenario training set of each business scenario in the total data set; the total data set refers to the data set obtained by merging the scenario training sets of each business scenario;
[0052] Determine the preset number corresponding to the business scenario according to the total amount of data in the scenario training set of the business scenario and the corresponding data proportion;
[0053] A preset amount of data corresponding to the business scenario is extracted from the scenario training set of the business scenario to form the sub-data set.
[0054] Optionally, the device further includes a module for predetermining the task learning complexity of the multiple business scenarios, which is specifically used to:
[0055] Acquire multiple judgment conditions set for each evaluation dimension; wherein each judgment condition is assigned a score value; the score value is positively correlated with the complexity of the content represented by the judgment condition in the evaluation dimension to which it belongs; the evaluation dimension at least includes content information complexity, grammatical complexity, and reasoning complexity;
[0056] For the multiple business scenarios, determine all determination conditions satisfied by the sample data of the business scenarios, and calculate the total score of the business scenarios in all evaluation dimensions according to the score values of the determination conditions satisfied by the business scenarios;
[0057] The total scores of each business scenario are sorted in ascending order to determine the order of task learning complexity of the multiple business scenarios from low to high.
[0058] Optionally, the training set adjustment module is specifically used to:
[0059] Fine-tune the sub-capability model using the constructed initial training set of the business scenario to obtain a fine-tuned sub-model;
[0060] Obtaining a performance result of the fine-tuning sub-model on a test set; the test set is constructed for the business scenario;
[0061] In the case where the performance result does not meet the preset performance condition, iteratively adjusting the initial training set, and using the adjusted initial training set to fine-tune the sub-capability model until the performance result of the fine-tuned sub-model on the test set meets the preset performance condition;
[0062] The training set used for fine-tuning when the performance result meets the preset performance condition is used as the scenario training set of the business.
[0063] Optionally, the training set adjustment module is specifically used to:
[0064] Before performing the Nth round of iterative adjustment on the initial training set, obtain the performance results of each round of fine-tuning in the first N-1 rounds, and determine the target round with the best performance result; the value of N is a positive integer greater than 2;
[0065] When the initial training set is adjusted for the Nth round of iteration, the initial training set used when fine-tuning the target round is adjusted.
[0066] Optionally, the training set adjustment module is specifically used to:
[0067] The initial training set is changed by data augmentation processing;
[0068] Alternatively, when the performance results of the fine-tuned sub-model do not meet the preset performance conditions, the initial training set is adjusted according to the performance results and the received user feedback, and the sub-capability model is fine-tuned using the adjusted initial training set; the user feedback is used to describe the way in which the initial training set is changed.
[0069] Optionally, after fine-tuning the sub-capability model using the adjusted initial training set, the device further includes:
[0070] In response to receiving the model test instruction, receiving test input data from the graphical user interface;
[0071] The fine-tuned sub-model obtained by fine-tuning is used to generate corresponding test outputs and return them to the graphical user interface, so that the user generates the user feedback according to the test outputs; the user feedback includes at least one of data-adjusted a posteriori knowledge based on the model test output and manually annotated data of the business scenario.
[0072] Optionally, after generating the target training data, the device further includes:
[0073] In response to adding at least one new business scenario, constructing an initial training set of the new business scenario, and continuously iteratively adjusting the initial training set of the new business scenario to obtain a scenario training set of the business scenario;
[0074] Obtaining a ranking position of the task learning complexity of the newly added business scenario in the task learning complexities of the multiple existing business scenarios;
[0075] Insert the scenario training set of the newly added business scenario into the target training data corresponding to the sorting position to generate an updated target training set.
[0076] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising: a memory and a processor; the memory is used to store a computer program; the processor is used to execute the above-mentioned method for generating training data for the large model by calling the computer program.
[0077] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the training data generation method of the above-mentioned large model is implemented.
[0078] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0079] In the technical solution provided by the present application, by dividing the specific business scenarios of the big model, and optimizing the initial training set for each business scenario through the pre-built sub-capability model, the scenario training set under the business scenario is obtained, thereby ensuring the quality and accuracy of the training data under a single business scenario, and achieving accurate capture of the data distribution, key features and requirements under each business scenario. Then, according to the task learning complexity of each business scenario, the scenario training set of each business scenario is orderly integrated in order from simple to complex, and the target training data for fine-tuning the big model is generated, so that the big model can follow a step-by-step learning path, first Learn relatively basic and simple tasks, and gradually transition to more complex and challenging tasks; based on the performance of the scenario training sets of various business scenarios on the sub-capability model, it is possible to predict the performance of the large model in the business scenario when the scenario training sets are used to fine-tune the large model. The accurate and targeted evaluation results on the sub-capability model provide strong data support for the fine-tuning of the large model. The fine-tuned large model can inherit the training effects of each scenario training set on the sub-capability model. While ensuring the generalization ability of the large model, the large model fully absorbs the advantages of each business scenario, thereby optimizing the training effect of the large model and improving the performance of the large model in various business scenarios.
[0080] It should be understood that the above general description and the following detailed description are only exemplary and explanatory and cannot limit the present application. In addition, any embodiment in the present application does not need to achieve all the above effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] Figure 1A It is a flowchart of a method for generating training data for a large model shown in an exemplary embodiment of the present application;
[0082] Figure 1B It is a schematic diagram of classification results of vertical classification according to the hierarchical depth of the medical field shown in an exemplary embodiment of the present application;
[0083] Figure 2 It is a flowchart of a process of changing the initial training set of a business scenario and fine-tuning the model training shown in an exemplary embodiment of the present application;
[0084] Figure 3A It is a flowchart of a step of combining the scenario training sets of each business scenario to generate target training data, as shown in an exemplary embodiment of the present application;
[0085] Figure 3B is a schematic diagram of target training data generated by combining multiple scene training sets according to an exemplary embodiment of the present application;
[0086] Figure 3C is a flowchart of steps for determining a preset quantity and extracting part of the training data, shown in an exemplary embodiment of the present application;
[0087] Figure 4 It is a flowchart of steps for quantifying the task learning complexity of a business scenario shown in an exemplary embodiment of the present application;
[0088] Figure 5A This is an overall flow chart showing an exemplary embodiment of the present application, taking the specific business scenario division and training data construction in an education scenario as an example;
[0089] Figure 5B This is an example of a business scenario vertically classified according to the hierarchical depth of the education field, as shown in an exemplary embodiment of the present application;
[0090] Figure 6 It is a structural schematic diagram of a large model training data generation device shown in an exemplary embodiment of the present application;
[0091] Figure 7 It is a hardware schematic diagram of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0092] As user needs become more diverse and complex, a single large model usually needs to cope with a variety of different interaction needs, which requires the large model to have a high degree of flexibility and adaptability and to be able to perform well in multiple business scenarios.
[0093] At present, the commonly used large model training method is to simply mix the data sets of different business scenarios to form a large data set, and then use the data set to uniformly train the model. However, due to the differences in data distribution, key features and requirements of different business scenarios, simply merging the data sets together for training will lead to poor performance of the model in certain specific scenarios. When evaluating the performance of large models, the evaluation results provided by the existing technology are mainly based on the large data set and the overall fine-tuning effect of the large model. That is, the evaluation results reflect the average performance of the large model on the entire mixed data set, and cannot reflect the specific performance of the large model in various business scenarios. It is difficult to provide targeted guidance at the business scenario level for the fine-tuning process of the model, and it is unable to meet the training requirements for the large model to show good performance in various business scenarios.
[0094] In view of this, in order to solve the above problems, the present application provides a method for generating training data for a large model. The training data generated by this method is used for fine-tuning training of the large model, which can improve the performance of the large model in various specific business scenarios. The method divides the interaction scenarios between users and the large model into specific business scenarios, and separately adjusts the initial training set of each business scenario through the sub-capability model to obtain the adjusted scenario training set for each business scenario. The scenario training set can accurately capture the data distribution, key features and requirements of the corresponding business scenario, and orderly integrate the scenario training sets of each business scenario according to the complex learning procedures of the task of the business scenario to obtain the target training data of the large model, so that the large model follows a step-by-step learning path when fine-tuning using the target training data. The fine-tuned large model can inherit the training effect of each scenario training set on the sub-capability model, while ensuring the generalization ability of the large model, and improve the performance of the large model in various specific business scenarios.
[0095] Next, combine Figure 1A-Figure 7The training data generation method of the large model provided in this application is introduced. The method can be applied to a terminal or a server, or to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal may include but is not limited to various personal computers, laptops, smart phones and tablet computers, and the server may include an independent server or a server cluster composed of multiple servers. It is understandable that the large model described in this application may include a class of machine learning models with a large number of parameters and complex structures. This type of model has a strong data processing capability, can process a large amount of data and learn from it the complex patterns and laws hidden in the data. The specific structure, specific type and implementation details of the large model are not limited in this application.
[0096] See also Figure 1A As shown in the flowchart of the method steps, the method for generating training data for the large model may at least include the following steps:
[0097] S101, for the interaction scenarios between the user and the big model, vertical classification is performed according to the hierarchical depth of the application field of the big model to determine the corresponding multiple business scenarios;
[0098] The application field of the large model refers to the specific industry or field where the large model is applied, such as education, medical care, finance, etc. The hierarchical depth of the application field is used to represent the classification process from broad to narrow, from general to specific, and the hierarchical depth is positively correlated with the level of detail of the field classification, that is, the deeper the hierarchical depth, the more specific and detailed the corresponding scene classification.
[0099] Vertical classification refers to the process of dividing things or concepts into detailed categories according to set standards or features. In this embodiment, the interaction scenarios between users and big models are carefully classified according to the hierarchical depth of the big model's application field to accurately describe the specific application of the big model in the application field. For example, taking the big model in the medical field as an example, see Figure 1B An exemplary diagram of classification results of vertical classification according to the hierarchical depth of the medical field is shown, where the corresponding spy scene classification becomes more specific as the hierarchy goes down.
[0100] In the field of machine learning and artificial intelligence, different business scenarios are used to meet different needs or purposes. Business scenarios are used to define the boundaries, constraints and goals of the problem in order to provide a clear direction for model training. In this embodiment, the interaction scenario between the user and the big model is used to represent various interactive situations when the user uses the big model, covering different information input by the user and the specific query purpose. The input information and the query purpose point to different business scenarios served by the big model. For example, when the purpose of the user's interaction with the big model is to have daily chats, the user input includes relaxed and casual text content, such as greetings, sharing daily news or chatting, etc.; in this type of interactive scenario, the big model needs to be able to understand and respond to the user's daily conversation needs, maintain the fluency and naturalness of the conversation, which can be regarded as the application of the big model in the business scenario of "daily chat". For another example, the user's query purpose is to request the big model to help analyze and interpret the data in the report. The user input includes specific report content, data indicators or related questions. In this interactive scenario, the big model needs to use its powerful data processing and pattern recognition capabilities to conduct in-depth analysis of the input data and give accurate and valuable interpretations or suggestions, which can be regarded as the service content of the big model "data analysis report interpretation" in the business scenario.
[0101] Therefore, the interaction scenarios between users and big models can be divided into different business scenarios served by big models. Different business scenarios have different capability requirements and knowledge requirements for big models. For example, the chat business scenario requires the big model to have fluent conversation ability, sense of humor, and extensive topic knowledge so that it can communicate with users naturally and interestingly. In the data analysis report interpretation business scenario, the big model is required to have an in-depth understanding and analysis of the user's learning report data, accurately extract key information, and provide valuable insights or suggestions.
[0102] Based on this, in this embodiment, vertical classification is performed according to the hierarchical depth of the big model application field, and based on the underlying classification results, the interaction scenarios between the user and the big model can be clearly divided into multiple specific business scenarios. The multiple business scenarios belong to the same hierarchical depth and are parallel to multiple scenario classifications, each of which has different functional requirements for the big model. Regarding the hierarchical depth of the application field, the user can set the hierarchical depth of the vertical classification according to actual needs and application scenarios. For example, if the hierarchical depth is set to 1, Figure 1BFor example, the interaction scenarios between users and the big model can be divided into three business scenarios: basic medical knowledge Q&A, auxiliary diagnosis and treatment recommendations, and medical image analysis. Alternatively, without the need for users to set the hierarchical depth, users can flexibly select vertical classification results of any hierarchical depth according to actual needs, and determine multiple corresponding business scenarios based on the vertical classification results of this level. For the most detailed and specific business scenarios, multiple business scenarios can be determined based on the deepest vertical classification results, which is suitable for application scenarios that require high specialization and refinement, such as specific lesion analysis of medical images. For example, continuing with Figure 1B For example, according to the deepest vertical classification results, the interaction scenarios between users and the big model can be divided into multiple business scenarios such as drug description, disease description, ..., disease consultation, ..., mental health consultation, text report analysis, ..., ultrasound analysis, etc.
[0103] Regarding vertical classification according to the hierarchical depth of the application field, the key feature information that can describe the interaction scene, such as the subject or keyword of the input information involved in the historical interaction scene between the user and the large model, the purpose of the interaction, etc., can be first obtained, and then the vertical classification is performed based on the key feature information to determine the specific vertical classification result. Among them, the key feature information can be realized by analyzing the historical interaction information between the user and the large model, such as historical dialogue tasks. The historical interaction information can include custom collected historical interaction task data, which includes queries, questions or instructions input by the user and the response or answer returned by the model, or can also include open source datasets about the interaction between the user and the large model in the same application field, such as interaction data from other research institutions, academic teams or open source communities, containing rich user query and model response samples.
[0104] When multiple business scenarios are determined based on the vertical classification results, the business scenarios can be merged and summarized by using data mining or machine learning techniques on multiple classification results at the same level of depth to remove redundant or similar business scenarios and optimize the division of business scenarios so that the division of business scenarios is more in line with actual needs. The multiple business scenarios obtained in this step can cover the main needs and scenarios in the process of user interaction with the large model.
[0105] S102, constructing an initial training set for each business scenario;
[0106] The initial training set refers to the sample data set used to train the machine learning model. The sample data set contains input data related to the business scenario and the corresponding output data or labels, which are used to reflect the user's behavior, needs or problems in the business scenario. The input data is the information that the model needs to process, and the output data or labels are the targets that the model needs to predict. During the training process, the model will learn how to extract features from the input data and predict the output data based on the extracted features. By continuously adjusting the model's internal parameters such as weights and biases to minimize the difference between the model's predicted output data and the corresponding output data or labels in the sample data set, the model is trained to learn the inherent laws and patterns of the business scenario.
[0107] The initial training set for each business scenario should include sufficiently diverse samples to cover all possible situations of the business scenario. The construction of the initial training set can be achieved by obtaining open source data and building on the open source data set, or through a language model, and through prompt engineering to achieve targeted generation of sample data for the business scenario, or through manual annotation to construct the data, providing high-quality sample data that is more in line with user reality.
[0108] S103, for each business scenario, iteratively adjusting the initial training set used to fine-tune the sub-capability model until the performance result of the sub-capability model after fine-tuning meets the preset performance condition of the business scenario, thereby obtaining a scenario training set of the business scenario; the sub-capability model includes any lightweight model having the same function as the large model;
[0109] In this step, for each business scenario, the initial training set of the business scenario is changed, and the pre-trained sub-capability model is fine-tuned using the changed initial training set until the performance results of the fine-tuned sub-capability model on the test set of the business scenario meet the preset performance conditions; wherein, each fine-tuning after the scenario training set is changed uses the pre-trained sub-capability model used in the first fine-tuning under the business scenario as the training starting point.
[0110] That is, for a business scenario, during the iterative adjustment process of the initial training set for the business scenario, the initial training set after each adjustment will be fine-tuned based on the adjusted initial training set on the sub-capability model that has not undergone any fine-tuning, rather than continuing to fine-tune the sub-capability model after the previous round of fine-tuning, thereby ensuring that the initial training set after each iterative adjustment is compared at the same starting point, so that the effect of the training set adjustment can be fairly evaluated.
[0111] The sub-capability model is a model that is pre-trained based on a large amount of general data. The model obtains general feature representations through the pre-training process, so that it has generalization capabilities. The sub-capability model can use the same data as the training data used in the pre-training process of the large model for the pre-training process. In this embodiment, the sub-capability model serves as the starting point for fine-tuning the training for each business scenario.
[0112] The sub-capability model can be any lightweight model with the same function as the large model, which has a simpler network structure, fewer parameters and lower computing requirements. The lightweight model can be obtained by simplifying the network structure of the pre-trained large model, such as reducing the number of layers or the number of neurons, or applying model compression technology. It can be understood that the network structure of the sub-capability model can also include a subset of the network structure of the large model, that is, the sub-capability model can have the same network structure and parameters as the large model; or, the network structure of the sub-capability model is a part of the network structure of the large model, and its parameters can be obtained by mapping the parameters of the large model according to specific rules, that is, the sub-capability model can also be a model similar to or simpler than the network structure and parameters of the large model, so as to ensure that it can adapt to different business scenarios while maintaining universality, and at the same time, it is beneficial for the large model to inherit the training effect of the scenario training set of each business scenario on the sub-capability model after fine-tuning the training data generated according to the method provided in this application.
[0113] The fine-tuning is used to adjust or optimize the general model trained on a large-scale data set to adapt to the needs of a specific business scenario. It uses the knowledge learned in the pre-training process to perform adaptive adjustments based on the initial data set of the business scenario. The fine-tuning process may include the following steps: (1) Training: Use the initial training set to train the pre-trained sub-capability model, including adjusting the parameters of the model to minimize the loss function on the initial training set; (2) Evaluation: Evaluate the performance of the fine-tuned model on the test set to determine whether the trained model has achieved the expected performance. In this embodiment, the pre-trained second model is fine-tuned by adjusting part of the model parameters, such as the last few layers or some intermediate layers, on the initial training set of the business scenario. Among them, the fine-tuning can be a supervised fine-tuning processing method.
[0114] The preset performance condition is a pre-set model performance standard or threshold, which is used to determine whether the model meets the needs of the business scenario. When the performance results of the fine-tuned sub-capability model on the test set meet the model performance standard or threshold, it is determined that the initial training set used for this round of fine-tuning of the sub-capability model meets the requirements. The initial training set used in this round of fine-tuning will be used as the scenario training set for the business scenario to be finally obtained.
[0115] There are many ways to iteratively adjust the initial training set of the business scenario or change the scenario training set of the business scenario, including but not limited to the following strategies: (1) Data cleaning: clean the initial training set to remove noise data, duplicate data, erroneous data and irrelevant data; (2) Data enhancement: use data enhancement technology to increase the diversity and number of training samples; (3) Add new data samples: collect new data samples to expand the scale and coverage of the training set; (4) Random changes: use random changes such as random noise injection and random data transformation to simulate the uncertainty in the real world; (5) Adjust according to model performance: guide the adjustment and optimization of the initial training set based on the performance of the model on the test set and the difference analysis between the output predicted by the model for the input in the test set and the actual output of the test set; (6) User feedback: collect user feedback and adjust the initial training set based on the actual feedback of users. These strategies do not exist in isolation and can be used in combination with each other. You can choose a suitable method to change the initial training set according to the specific situation.
[0116] The iterative process of this step can be understood as the following process: (1) First round of iteration: Use the initial training set constructed in step S102 to fine-tune the sub-capability model; After fine-tuning, evaluate the performance of the sub-capability model: If the performance result meets the preset performance condition, the initial training set is determined as the scenario training set of the business scenario; If the performance result does not meet the preset performance condition, enter (2) the subsequent iteration process; (2) Subsequent iteration: If the preset performance condition is not met, adjust the training set, and use the adjusted new training set again to fine-tune the sub-capability model that has not been fine-tuned. Each fine-tuning in the subsequent iteration process starts from the sub-capability model that has not been fine-tuned, rather than continuing to fine-tune from the model after the previous round of fine-tuning. By continuously iteratively adjusting the training set and re-fine-tuning the model, a specific training set is found that enables the sub-capability model to meet the preset performance condition after one round of fine-tuning. In actual operation, each fine-tuned model version, the performance result of the model, and the initial training set used for the fine-tuning can be saved for use in subsequent analysis and comparison.
[0117] S104, integrating the scenario training sets of the various business scenarios according to the task learning complexity of the multiple business scenarios to generate target training data; the target training data is used to fine-tune the pre-trained large model.
[0118] The task learning complexity of this business scenario is used to indicate the difficulty of the large model to learn the hidden behavior patterns and rules of the data in this business scenario. Different business scenarios have different learning complexities due to their different data characteristics, objective functions, constraints and other factors. It can be evaluated from multiple dimensions such as the amount of information, complexity of logic and rules, complexity of data sources and processing, personalized needs, and context understanding and reasoning capabilities. Complex business scenarios usually include complex process business logic and multi-layer reasoning processes to achieve their implementation.
[0119] For example, taking the daily chat business scenario and the data report interpretation business scenario as examples, daily chats involve topics in daily life, such as weather, diet, entertainment, etc. The information is relatively simple and easy to understand, the logic and rules of the chat dialogue are relatively simple, and data processing mainly involves text understanding and generation, which can be achieved through simple semantic understanding and sentiment analysis. The task learning complexity of this daily chat scenario is relatively low, while data report interpretation contains a large amount of data and information, such as financial statements, market analysis reports, etc. The amount of information is large and usually has complex structures and relationships. In the interpretation process, it is necessary to understand complex logical relationships, correlations and causal relationships between data, as well as professional terms and rules in the report, and have strong context understanding and reasoning capabilities, and be able to accurately understand the intentions, purposes and conclusions of the report, as well as the hidden information and trends behind the data. Complex preprocessing and feature engineering are required for processing, such as data cleaning, format conversion, feature extraction, etc. Therefore, the task learning complexity of the data report interpretation business scenario is relatively high.
[0120] For each of the multiple business scenarios determined, after the processing flow of the aforementioned steps S102 and S103, a scenario training set of the business scenario can be obtained, and the aforementioned pre-trained sub-capability model that has not been fine-tuned can be fine-tuned using the scenario training set, so that the performance result of the fine-tuned model meets the preset performance conditions of the business scenario. Based on the scenario training set of each business scenario, it can be orderly combined and integrated with other processing according to the task learning complexity of each business scenario, so as to generate target training data for fine-tuning the large model.
[0121] When combining scenario training sets of different business scenarios, the combination of scenario training sets of different business scenarios can be achieved by mixed sampling, importance-based sampling, etc. based on the balance, diversity and quality requirements of the data. In this embodiment, the scenario training sets of each business scenario are based on the task learning complexity of each business scenario, and the scenario training sets of each business scenario are integrated in order from low to high according to the task learning complexity, so as to generate the target training data, which includes the ordered data set sequence obtained by integration. Based on the integration of the scenario training sets of each business scenario in order from low to high according to the task learning complexity, when the target training data is used to fine-tune the large model, the large model can follow a step-by-step learning path, first learn relatively simple business scenarios, and gradually transition to complex business scenarios, so that the large model can learn the characteristics and data laws of each business scenario based on the scenario training sets with good training effects in each business scenario in the target training data while maintaining the original generalization ability, so that the trained large model can perform well in different business scenarios.
[0122] In the disclosed embodiment, the interaction between the user and the big model is divided into specific business scenarios of the big model, and the initial training set of each business scenario is optimized through the pre-built sub-capability model to obtain a high-quality scenario training set for each business scenario, thereby ensuring the quality and accuracy of the training data in each business scenario, and achieving accurate capture of the data distribution, key features and requirements in each business scenario. Then, according to the task learning complexity of each business scenario, the scenario training sets of each business scenario are orderly integrated in the order of the task learning complexity from simple to complex, and the target training data for fine-tuning the big model is generated, so that The big model can follow a step-by-step learning path, first learning relatively basic and simple tasks, and gradually transitioning to more complex and challenging tasks. The sub-capability model includes a lightweight model with the same functions as the big model. The accurate and targeted evaluation results on the sub-capability model provide strong data support for the fine-tuning of the big model. The big model fine-tuned with the target training data can inherit the training effects of each scenario training set on the sub-capability model. While ensuring the generalization ability of the big model, it enables the big model to fully absorb the advantages of each business scenario, thereby optimizing the training effect of the big model and improving the performance of the big model in various business scenarios.
[0123] In the above embodiments, the training data generation method of the large model provided by this application is described in the process, and the implementation details in the process are supplemented. In some embodiments, different business scenarios have specific business needs and characteristics. In order to more accurately construct the initial training set of each business scenario, the scene feature information such as themes and keywords involved in each business scenario can be used as the basis to construct a set of discrimination criteria for the business scenario. The set of discrimination criteria may include identification conditions and rules for business scenarios, which are used to describe the scene interaction requirements and scene key features under different business scenarios.
[0124] For example, taking three of the business scenarios divided when the big model is applied to the field of education - the chatting scenario, the data interpretation and analysis scenario, and the model's own function description scenario as examples, based on the model's own function description scenario, the big model is required to be able to provide an accurate description of the model's own information and functions. From the user input and the model's response output content, the set of judgment criteria for the model's own function description scenario can exemplarily include the following: ① Question type: questions such as "Who are you?", "What can you do?", "What is your function?" that mention the model's own capabilities; ② Keywords: self-related words such as "name", "identity", "ability", "function", "responsibility", "role", "limitation", etc., indicating that the user wants to know the basic information or function of the model; ③ Answer requirements: directly and accurately explain its own information and functions to meet the actual needs of users.
[0125] Exemplarily, the set of criteria for data interpretation and analysis scenarios may include at least the following: ① Subject: data analysis or report interpretation; ② Keywords: the presence of related words such as "analysis", "report", "data", "reasoning", "formula", etc., indicating that users need data analysis or report interpretation services; ③ Content: Contains specific data, indicators, charts and other content; ④ Model response output: requires detailed explanation and analysis, and the output word count is more than 50 words. The set of criteria for casual chat scenarios may include at least the following: ① Subject: not limited to a specific field, covering a wide range of topics such as life, study, and interests; ② Input or output word count: between 5-30 words, suitable for relaxed and brief conversations; ③ Keywords: Contains words such as "chat" and "chat" that indicate the intention of casual chat; ④ Tone: Contains a relaxed tone such as humor and wit to create a pleasant conversation atmosphere.
[0126] Based on this, for each business scenario, an initial training set of the business scenario can be constructed according to the set of discrimination criteria of the business scenario. The initial training set of the business scenario can be constructed through an open source data set, which usually includes noisy data samples. Therefore, the aforementioned step S102 can be implemented through the following steps, namely: according to the set of discrimination criteria of the business scenario, by matching the data samples in the open source data set with the set of discrimination criteria, a first data set that meets the business scenario is obtained from the acquired open source data set, and the initial training set of the business scenario is constructed using the first data set.
[0127] Among them, the open source data set can be obtained from a public data set warehouse, an open source data market, or can also automatically capture relevant data from a specific website or social media through a web crawler, or can include user-defined or collected data about the business scenario. When constructing the initial training set based on the first data set, the first data set can be first subjected to a data preprocessing step, which may include a data cleaning and data format standardization process. The data cleaning may include removing duplicate data and processing missing values, and data format standardization is used to convert data into a unified format. Based on the fact that open source data sets usually contain data from different sources and backgrounds, by matching the data samples in the open source data set with the set of discrimination criteria for the business scenario, the data that meets the business scenario is selected from the open source data set to construct the initial training set, thereby ensuring that the initial training set is highly relevant to the business scenario and increasing the diversity and richness of the initial training set.
[0128] The initial training set of the business scenario can also be constructed through a language model. A prompt text can be set according to the set of discrimination criteria and / or the user's prior knowledge about the business scenario, and the prompt text can be used to guide the language model to generate sample data that conforms to the business scenario, thereby constructing the initial training set. The user's prior knowledge about the business scenario refers to the user's existing knowledge and experience about the business scenario, which can include requirements for the generation format, number of words, coverage scenarios, etc. of the training data of the business scenario; the prompt text includes text input set to guide the language model to generate specific content, which can include some keywords, descriptions or instructions, and can be constructed through the description of the interaction requirements of the business scenario in the set of discrimination criteria and the user's prior knowledge, and input into the trained language model. The language model can generate sample data that conforms to the language specification and the business scenario according to the requirements of the prompt text, forming the initial training set of the business scenario; the language model can include a deep learning model based on architectures such as a recurrent neural network, a long short-term memory network, a transformer, or a language model of the GPT (Generative Pre-trained Transformer) series.
[0129] After obtaining sample data that meets the business scenario, the data category balance processing under the business scenario can be performed by identifying the subject of each sample data to avoid model deviation caused by too much or too little training data in certain subject categories. In addition, supervised data enhancement methods can be used to further process the sample data to increase the diversity of the data and the generalization ability of the model. By using the language model combined with the user's prior knowledge and the set of discrimination criteria to generate a scenario training set, the efficiency and accuracy of scenario training data generation are improved. At the same time, since the generated data is generated based on the natural language model, the initial training set has better readability and interpretability.
[0130] In some embodiments, regarding the method of iteratively adjusting the initial training set used to fine-tune the sub-capability model described in step S103, see Figure 2 The exemplary step flow chart may include at least the following processing steps:
[0131] S201, fine-tuning the sub-capability model using the constructed initial training set of the business scenario to obtain a fine-tuned sub-model;
[0132] For the initial training set of each business scenario, first load the pre-trained sub-capability model, and use the scenario training set to fine-tune the sub-capability model to minimize the difference loss between the predicted output of the sub-capability model and the true output of the sample, and stop fine-tuning the sub-capability model when the training of the sub-capability model reaches the preset convergence condition.
[0133] S202, obtaining a performance result of the fine-tuning sub-model on a test set; the test set is constructed for the business scenario;
[0134] The test set of the business scenario refers to a data set containing known answers or expected outputs, which is used to evaluate the performance of the trained model on data that has not been exposed during the training process. The purpose of the test set is to provide an independent and objective evaluation standard to measure the generalization ability of the model to new data. In order to obtain accurate and reliable performance results, the test set meets the requirements of data independence and is as close to real-world data as possible. The test set can be constructed by manual annotation, or a public data set related to the business scenario can be used as a test set, or test data can be constructed through a language model, combined with manual correction of test data to obtain a high-quality test set.
[0135] When using the test set of the business scenario to evaluate the model performance of the fine-tuned sub-capability model, that is, the fine-tuned sub-model, appropriate performance indicators can be selected for evaluation based on business needs and goals. Performance indicators such as accuracy, recall rate, F1 score, AUC-ROC curve and other parameters are calculated based on the real labels in the test set and the prediction results of the model to obtain the performance results of the fine-tuned sub-model.
[0136] Next, determine whether the performance result of the fine-tuning sub-model is greater than or equal to the preset performance condition (execute step S2031):
[0137] If yes, that is, if the performance result meets the preset performance condition, then step S2032 is executed, that is, the initial training set used in the current fine-tuning is determined as a scene training set that meets the requirements, so as to provide a data basis for the subsequent step S104 to combine and generate the target training data of the next large model;
[0138] If not, that is, the performance result does not meet the preset performance condition, then execute step S2033, i.e., iteratively adjust the initial training set used for the current fine-tuning, and use the adjusted initial training set to fine-tune the sub-capability model until the performance result of the fine-tuned sub-model on the test set meets the preset performance condition;
[0139] That is, when the performance result does not meet the preset performance condition, the initial training set used in the current fine-tuning is adjusted to change the initial training set, and the process returns to continue executing step S201 and its subsequent steps until the performance result of the fine-tuning sub-model on the test set meets the preset performance condition, thereby using the training set used for fine-tuning when the performance result meets the preset performance condition as the scenario training set for the business.
[0140] For example, taking business scenario 1 as an example, after constructing the initial training set M11 and test set of business scenario 1, the pre-trained sub-capability model Model_R is loaded as the training starting point:
[0141] (1) First fine-tuning: Use the initial training set M11 of business scenario 1 to fine-tune Model_R to obtain the fine-tuned sub-model Model_R1, and evaluate the performance of Model_R1 on the test set of business scenario 1;
[0142] (2) Second and subsequent fine-tuning (fine-tuning after changes in the initial training set):
[0143] When the performance result of the fine-tuned sub-model Model_R1 after the first fine-tuning does not meet the preset performance conditions, the initial training set M11 of business scenario 1 is adjusted to change the initial training set to obtain the transformed initial training set M12, and the sub-capability model Model_R (rather than the model Model_R1 obtained in the previous round of training) is continued to be trained using the changed scenario training set M12 to obtain the fine-tuned sub-model Model_R2, and the performance of Model_R2 on the test set of business scenario 1 is evaluated;
[0144] Repeat the above process of adjusting the initial training set and training the model until the performance result of Model_RN (N is the number of fine-tuning times) on the test set meets the preset performance conditions, and determine the initial training set used in the Nth fine-tuning as the scenario training set that meets the requirements, and use it to execute step S104. For other business scenarios, the change and fine-tuning process of the scenario training set are the same as those of business scenario 1, and the processing process of each business scenario is independent of each other.
[0145] In some embodiments, in order to improve the iterative adjustment efficiency of the initial training set, for the iterative adjustment of the initial training set when the performance result does not meet the preset performance condition as described in the aforementioned step S203, this embodiment proposes an iterative method based on historical fine-tuning experience, namely: before performing the Nth round of iterative adjustment of the initial training set, obtain the performance results of each round of fine-tuning in the first N-1 rounds, and determine the target round with the best performance result; the value of N is a positive integer greater than 2; when the Nth round of iterative adjustment of the initial training set is performed, the initial training set used when fine-tuning the target round is adjusted.
[0146] That is, first obtain the performance results after each round of fine-tuning in the first N-1 rounds, and determine the round with the best performance results from these rounds as the target round. The determination of the target round can be based on the optimal value of a single evaluation indicator or on a comprehensive consideration of multiple evaluation indicators. When the initial training set is adjusted for the Nth round of iterative adjustments, instead of blindly making major modifications to the current training set, the initial training set used for fine-tuning is adjusted with reference to the round (target round) with the best performance of the model after fine-tuning in the first N-1 rounds. This can include retaining valid data features in the target round training set, removing or correcting data parts that may cause performance degradation, or introducing new data samples that are complementary to the target round training set. In this way, blind adjustment of the training set can be avoided, and the initial training set in the business scenario can be optimized more quickly to better meet the needs of the business scenario.
[0147] For example, taking N as 4, when performing the fourth round of adjustments, the best performance result of the fine-tuning sub-model in the historical fine-tuning corresponding to the first three rounds of iterative adjustments will be referred to to guide the adjustment of the initial data set of the current round: when performing the fourth round of fine-tuning, the performance of the fine-tuning sub-model after fine-tuning the initial training set in the first three rounds will be compared, and the target round, such as the second round, will be determined. The initial training set used in the second round of fine-tuning will be used as the data starting point for the fourth round of adjustments, that is, the adjustment of the initial data set in the fourth round is for the initial training set used in the second round of fine-tuning. In this way, the historical fine-tuning experience can be fully utilized to improve the iterative efficiency of the initial training set, thereby accelerating the optimization process of model performance.
[0148] In some embodiments, regarding the iterative adjustment of the initial training set of the business scenario described in the aforementioned step S103, not only can the initial training set be changed through data enhancement processing to achieve the purpose of adjustment, but the initial data set can also be iteratively adjusted by combining the performance results of the fine-tuned sub-model and the user feedback information given by the user based on the manual test results of the fine-tuned sub-model. That is, for any round of fine-tuning of the sub-capability model, if the performance results of the fine-tuned sub-model do not meet the preset performance conditions, the initial training set is adjusted according to the performance results and the received user feedback, and the sub-capability model is fine-tuned using the adjusted initial training set; the user feedback is used to describe the way in which the initial training set is changed.
[0149] The performance results may include the performance evaluation value of the fine-tuned sub-capability model on the test set, and the predicted output given by the sub-capability model for the input response of the test set. Based on the performance results, a trained machine learning model or data mining technology can be used to analyze the difference between the model's predicted output and the actual output in the test set and the data distribution of obvious output errors to provide a predicted change pattern for the scenario training set.
[0150] The user feedback includes the change mode of the scenario training set given by the user based on the performance evaluation of the fine-tuned sub-capability model on the test set, or the change mode of the training set given by the user through manual testing of the fine-tuned sub-capability model. The user can provide user feedback to adjust the scenario training set in any of the following ways: directly provide the direction and suggestions for the adjustment of the scenario training set as the posterior knowledge input for data adjustment; or directly upload the manually annotated data for the business scenario to correct the scenario training set.
[0151] Regarding the user feedback, the user can analyze the sample problems of the scenario training set currently used for fine-tuning by manually testing the fine-tuned sub-capability model, so as to provide user feedback to guide the changes in the scenario training set based on the model test results. That is, after the sub-capability model is fine-tuned using the adjusted initial training set, a user test interface can also be provided for the user to manually test the fine-tuned sub-model obtained by fine-tuning, and in response to receiving the model test instruction from the user test interface, receive the test input data from the graphical user interface; generate the corresponding test output using the fine-tuned sub-model and return it to the user test interface, so that the user generates the user feedback according to the test output; the user feedback includes at least one of the following information: data adjustment posterior knowledge based on the model test output and artificial annotation data of the business scenario.
[0152] For example, for the initial training set in the data report interpretation business scenario, the user finds through manual testing that the fine-tuning sub-model has many errors when outputting mathematical formulas, such as mismatched brackets, missing symbols, etc., then the user can provide data adjustment posterior knowledge related to "the training set contains many incorrectly labeled formulas or data noise, and the mathematical formulas in the training set need to be verified and corrected and / or labeled data about the formulas should be increased." Alternatively, the user can directly upload multiple training sets of manually labeled formulas.
[0153] In the disclosed embodiment, by analyzing the performance results and user feedback of the fine-tuned model, problems existing in the initial training set used in the current fine-tuning can be determined, thereby achieving targeted adjustments to the initial training set and speeding up the processing process of causing changes to the initial training set.
[0154] In some embodiments, in order to more effectively integrate and optimize the training data of different business scenarios, thereby improving the learning efficiency and generalization ability of the model, this embodiment focuses on how to intelligently combine scenario training sets according to the task learning complexity of the business scenarios. Regarding the aforementioned step S104 of integrating the scenario training sets of each business scenario according to the task learning complexity of each of the multiple business scenarios to generate target training data, this embodiment proposes a hierarchical training set combination strategy, which gradually increases the learning difficulty of the model by orderly arranging and splicing training data of different complexities, ensuring that it can robustly master various tasks from simple to complex. See Figure 3A As shown in the flowchart, the target training data generation process recorded in this embodiment can be implemented by the following steps:
[0155] S301, arranging and splicing the scenario training set of each business scenario in order of the task learning complexity from low to high to obtain first training data;
[0156] According to the pre-set sorting results of the task learning complexity of different business scenarios, the scenario training sets of each business scenario are sorted so that the scenario training sets with simple task learning complexity are sorted first and the complex scenario training sets are sorted last. Figure 3B The schematic diagram shown shows that multiple scenario training sets are arranged and spliced in order from simple to complex. It is known that the task learning complexity of business scenario 1, business scenario 2 and business scenario 3 is arranged from simple to complex as follows: business scenario 2, business scenario 1, business scenario 3. Therefore, when arranging and splicing the scenario training sets of these three business scenarios, the corresponding scenario training sets are placed in the corresponding sorting positions in the order of business scenario 2, business scenario 1, and business scenario 3, and the sorted scenario training sets are spliced head to tail to obtain the first training data.
[0157] S302, selecting a preset number of sub-data sets from the scenario training set of each business scenario, and integrating the sub-data sets from different business scenarios into a common training data set as second training data;
[0158] The second training data is obtained by extracting a certain amount of training data from the scenario training set of each business scenario, and then mixing a certain amount of training data randomly extracted from different business scenarios. When determining a preset amount of training data from the scenario training set of each business scenario, the preset amount can be determined based on the proportion of the scenario training set of the business scenario in all business scenarios, so that the relative proportion of each business scenario in the mixed second training data is consistent with the proportion of the scenario training set of the business scenario, thereby avoiding data skew.
[0159] like Figure 3B The second training data schematic diagram shown on the right extracts a certain amount of training data from the scenario training sets of business scenario 1, business scenario 2, and business scenario 3, respectively, and mixes the three parts of the extracted training data together to construct the second training data.
[0160] S303: splicing the second training data at the end of the first training data to generate the target training data.
[0161] That is, by sequentially adding all samples of the second training data set to the end of the data of the first training data, the first training data and the second training data are concatenated. Figure 3B The first training data and the second training data shown are spliced after the scenario training set of business scenario 3 in the first training data, and the two parts of data constitute the target training data as a whole in the order shown in the figure.
[0162] Through the splicing operation, the generated target training data includes samples from the first training data set as well as samples from the second training data set from different business scenarios, providing more diverse training samples for the training process of large models that support multiple business scenarios, which helps to improve the generalization ability and performance of the model.
[0163] In the disclosed embodiment, the scenario training sets of each business scenario are arranged and spliced in order from low to high according to the task learning complexity of each business scenario, and the mixed training data extracted from each business scenario is combined to generate target training data to fine-tune the large model. The large model can learn in a step-by-step manner from shallow to deep, gradually transitioning from relatively simple basic tasks to more complex business scenario learning. At the same time, the training data based on the mixture of different business scenarios covers a wide range of business scenario characteristics and data distribution. Integrating the mixed data into the target training data can effectively avoid the learning forgetting phenomenon that may occur in the training process of the large model, that is, the model may forget the previously learned knowledge when learning new tasks, thereby helping the large model to better understand and master the laws and characteristics in the data, enhance its adaptability and generalization ability in multiple business scenarios, and improve training efficiency.
[0164] In some embodiments, for the aforementioned steps, a preset number of sub-data sets are selected from the scenario training set for each business scenario, see Figure 3C The flowchart of the preset number determination and training data extraction steps shown can be implemented through the following steps:
[0165] S3021, determining the data proportion of each scenario training set of each business scenario in the total data set; the total data set refers to a data set obtained by merging the scenario training sets of each business scenario;
[0166] By adding up the total amount of data in the scenario training sets of each business scenario, we can get the total amount of training data included in the total data set. Based on the total amount of training data and the total amount of data in the scenario training sets for each business scenario, we can calculate the data proportion corresponding to the business scenario. The data proportion reflects the importance or weight of the business scenario in the total data set.
[0167] Assume there are n business scenarios, and the total amount of data in the scenario training set of the i-th business scenario is Scene i The total number of training data in the total dataset is Scene total , then the total number of training data can be expressed as:
[0168]
[0169] Then the proportion of the scenario training set of the i-th business scenario in the total data set is P iIt can be expressed as:
[0170]
[0171] S3022, determining a preset number corresponding to the business scenario according to the total amount of data in the scenario training set of the business scenario and the corresponding data proportion;
[0172] When the total amount of data in the scenario training set and the corresponding data percentage are known, the product of the total amount of data in the scenario training set of the business scenario and the data percentage can be directly determined as the preset number corresponding to the business scenario. Alternatively, the calculated preset number can be adjusted according to the business scenario requirements or data distribution characteristics. For example, for some particularly important business scenarios with a small amount of data, the preset number can be appropriately increased; for business scenarios with a particularly large amount of data but relatively low importance, the preset number can be appropriately reduced.
[0173] S3023, extracting a preset amount of data corresponding to the business scenario from the scenario training set of the business scenario to form a sub-data set corresponding to the business scenario.
[0174] In the embodiment of the present disclosure, by determining the preset number for each business scenario based on a method based on data proportion, it can be ensured that the importance and data volume of different business scenarios can be fully considered when combining training data, thereby obtaining more reasonable and effective target training data.
[0175] In some embodiments, for the task learning complexity of the business scenario described in the aforementioned step S104, this embodiment provides an implementation method for quantifying the task learning complexity of the business scenario, by considering the dimensions of content domain, grammatical complexity, reasoning complexity, etc., setting different judgment conditions and scores for the corresponding judgment conditions for each dimension, and finally calculating the scores comprehensively to determine the complexity ranking of the business scenario. The comprehensive calculation score is the quantitative value of the task learning complexity of the business scenario. Based on this, see Figure 4 The flowchart of the steps for quantifying the task learning complexity of a business scenario is shown as an example. The task learning complexity of the business scenario can be achieved by the following steps:
[0176] S401, obtaining a plurality of determination conditions set for each evaluation dimension; wherein each determination condition is assigned a score value; the score value is positively correlated with the complexity of the content represented by the determination condition in the evaluation dimension to which it belongs; the evaluation dimension at least includes content information complexity, grammatical complexity, and reasoning complexity;
[0177] Evaluation dimensions are different aspects or angles used to measure or evaluate an object or task. In this embodiment, the evaluation dimensions include at least content information complexity, grammatical complexity, and reasoning complexity. Among them, content information complexity is used to indicate the depth and breadth of information contained in the text or task, as well as the cognitive requirements of the information for the understander. For example, academic papers containing multiple professional terms, complex concepts and deep meanings usually have higher content information complexity, while simple explanatory texts for the general public have relatively lower content information complexity. Grammatical complexity is used to indicate the complexity of the grammatical structure of a text or task, including sentence length, clause structure, types and number of grammatical phenomena, etc. For example, a sentence containing multiple clauses, complex sentences and complex grammatical phenomena has a higher grammatical complexity, while a text consisting only of simple sentences has a relatively low grammatical complexity. Reasoning complexity is used to indicate the complexity of logical reasoning required to understand a text or task, including the number of reasoning steps, the level and depth of reasoning, etc. For example, a task that requires comprehensive analysis and reasoning based on multiple information in the text to draw a conclusion has a higher reasoning complexity, while a task that only requires simple judgment or memory has a relatively low reasoning complexity.
[0178] The judgment condition includes specific standards or requirements set according to the evaluation dimension, which are used to determine whether an object or task meets a specific level. In this embodiment, a plurality of different judgment conditions can be set for the same evaluation dimension, which may include a plurality of parallel judgment conditions, and different judgment conditions are used to quantify the complexity represented by the evaluation dimension from different directions. For example, for the evaluation dimension of content information complexity, the judgment condition set can be set from aspects such as whether professional knowledge is involved and the proportion of professional knowledge. For grammatical complexity, the judgment condition can be set from aspects such as the average length of sentences, the number of nested clauses, the number of pronouns, and whether there are complex grammatical phenomena. For the judgment condition of reasoning complexity, it can be set from aspects such as the number of derivation steps and whether examples are used for demonstration.
[0179] The score value is a value assigned to each judgment condition, which is used to quantify the performance of the evaluation object or task in a specific dimension. The high or low score value usually reflects the complexity or difficulty of the evaluation object or task in this dimension. For example, if the judgment condition indicates that "the text contains a large number of professional terms", then the judgment condition is assigned a higher score value, reflecting the high level of complexity of the text content information. On the contrary, if the judgment condition indicates that "the text only contains simple sentences and common words", then a lower score value can be assigned to the judgment condition.
[0180] To explain the determination conditions set for each evaluation dimension more clearly, an exemplary determination condition example is given below. For example, for content information complexity, the determination conditions set and the corresponding score values may include:
[0181] a1. Content involving daily conversation, spoken language, weather, and hobbies (1 point);
[0182] a2. The proportion of text describing areas other than these four aspects does not exceed 10% (1 point);
[0183] a3. Involving professional knowledge or academic knowledge in a certain field (e.g. professional knowledge in the financial field), and professional / academic terms appearing 2 or more times (3 points);
[0184] a4. The content of domain expertise or academic knowledge accounts for more than 60% (3 points);
[0185] a5. a1 and a3 are not satisfied, or a2 and a4 are not satisfied (2 points).
[0186] For the complexity of content information, the set judgment conditions and corresponding score values may include:
[0187] b1. The average length of the sentences of questions and answers does not exceed 10 words (1 point);
[0188] b2. There is no more than one nested clause in the sentence (1 point);
[0189] b3. The frequency of pronouns (such as "he", "she", "it") does not exceed 1 time per sentence (1 point);
[0190] b4. The average length of the sentences exceeds 15 words (3 points);
[0191] b5. There are more than 3 nested clauses in the sentence (3 points);
[0192] b6. The frequency of pronouns appearing is 3 times or more per sentence (3 points);
[0193] b7. Does not satisfy b1 and b3, or does not satisfy b2 and b4, or does not satisfy b3 and b6 (2 points).
[0194] Among them, information about the number of nested clauses, subject-verb-object structure, frequency of occurrence of pronouns, etc. can be determined through dependency grammar analysis.
[0195] For the reasoning complexity, the judgment conditions and corresponding score values set may include:
[0196] c1. Complete the information statement in one sentence (1 point);
[0197] c2. The number of examples and derivations requiring more than two steps is 0 (1 point);
[0198] c3. Multi-step reasoning process, at least 3 steps of logical deduction are required to reach a conclusion (3 points);
[0199] c4. Provide at least 2 examples to illustrate your point (3 points);
[0200] c5. The use of complex grammatical phenomena such as beginning-end correspondence, contrastive argumentation, and other writing and argumentation techniques (3 points);
[0201] c6. Both c2 and c3 are not satisfied (2 points).
[0202] S402, for the multiple business scenarios, determining all determination conditions satisfied by the sample data of the business scenarios, and calculating the total score of the business scenarios in all evaluation dimensions according to the score values of the determination conditions satisfied by the business scenarios;
[0203] The sample data based on the business scenario is used to quantitatively evaluate the task learning complexity of the business scenario in combination with the aforementioned judgment conditions. Therefore, the sample data of the business scenario can be data manually labeled for each business scenario, or, the sample data of the business scenario can also be the test set used to evaluate the performance results of the fine-tuning sub-model in the aforementioned steps, which can more accurately reflect the actual complexity of the business scenario.
[0204] For multiple judgment conditions on each evaluation dimension, to determine whether the sample data of the business scenario meets the judgment conditions, the language model can be combined with the prompt engineering, or a logical judgment program or other technical methods can be written to achieve the matching judgment of the sample data to the judgment conditions one by one. For a business scenario, the sample data of the business scenario can be matched with each judgment condition on each evaluation dimension to determine the various judgment conditions satisfied by the business scenario, and the score values corresponding to each of the judgment conditions are summed to obtain the total score of the business scenario in all evaluation dimensions. The score value reflects the performance of the task learning complexity of the sample data in each evaluation dimension. Therefore, the total score can represent the quantitative value of the task learning complexity of the business scenario.
[0205] S403 , sorting in ascending order according to the total score of each business scenario, and determining the order of task learning complexity of the multiple business scenarios from low to high.
[0206] Based on the total score being used to represent the quantitative value of the task learning complexity of the business scenario, and the score value assigned by the aforementioned judgment condition is positively correlated with the complexity of the content represented by the judgment condition in the evaluation dimension to which it belongs, therefore, the total score of the business scenario will be positively correlated with the task learning complexity. The sorting result of ascending order based on the total scores of each business scenario can represent the sorting result from low to high between the corresponding task learning complexities of each business scenario, and the sorting from low to high between the task learning complexities can be used for the combination of the scenario training sets of the business scenarios described in the aforementioned step S104.
[0207] In the case where there are at least two business scenarios with the same total score, random sorting can be performed in a non-sequential manner, or further distinction can be made based on the same judgment conditions satisfied by the two. For example, the same first judgment condition with a numerical value can be used in the judgment conditions satisfied by the at least two business scenarios, and the actual numerical value of the sample data when each of the at least two business scenarios meets the first judgment condition can be further sorted. For example, assuming that business scenario A and business scenario B have the same total score and meet the judgment condition of "a4. The proportion of domain expertise or academic knowledge content exceeds 60%" in the complexity of information content at the same time, the proportion of domain expertise or academic knowledge content in the sample data of business scenario A and business scenario B can be further sorted. For example, if the proportion of business scenario A is 65% and the proportion of business scenario B is 75%, then when the total scores of business scenarios A and B are the same, the task learning complexity of business scenario A is lower than the task learning complexity of business scenario B.
[0208] In the disclosed embodiment, multiple evaluation dimensions and scoring rules are pre-set, and the evaluation dimensions cover multiple aspects such as subject content, grammatical structure, and reasoning, so as to quantify and standardize the task learning complexity of the business scenario, reduce the influence of subjective factors on the performance results, and realize the multi-dimensional evaluation of the task learning complexity of the business scenario. Based on this method, as the business scenario and needs change, the evaluation dimensions and scoring rules can be adjusted according to the actual situation. The adjustability and adaptability of this method enable it to adapt to different scenarios and needs, and it has wide applicability.
[0209] When the related technology uses the data set of business scenarios and adjusts the data distribution to optimize the large model, when a new business scenario appears, it is necessary to collect data again and adjust the data distribution. Since adjusting the data distribution is a resource-intensive process, it consumes a lot of computing resources and time costs, resulting in a longer iteration cycle of the large model, affecting the rapid response to different business scenarios in interactive scenarios. In this embodiment, after generating the target training data of the large model, for the case of adding other new business scenarios other than the multiple business scenarios divided in the aforementioned step S101, the following steps can be used to achieve a rapid update of the target training data set:
[0210] In response to adding at least one new business scenario, construct an initial training set for the new business scenario, and continuously iteratively adjust the initial training set of the new business scenario to obtain a scenario training set for the business scenario; obtain the ranking position of the task learning complexity of the new business scenario in the task learning complexity of the existing multiple business scenarios; insert the scenario training set of the new business scenario into the target training data corresponding to the ranking position to generate an updated target training set.
[0211] That is, for at least one other newly added business scenario other than the multiple business scenarios included in the generated target training data, the same idea as the aforementioned steps S102-S103 can be used to obtain a scenario training set when the performance results of the fine-tuned sub-capability model of each newly added business scenario meet the preset performance conditions. When merging the scenario training set of the newly added business scenario into the target training data, the merging method of the scenario training sets of the multiple business scenarios already in the target training data can be adopted. Based on the fact that the present application combines the scenario training sets from low to high according to the task learning complexity of the business scenario, the scenario training set of the newly added business scenario can be inserted into the scenario training sets of the multiple business scenarios of the first training data in the target training data according to the task learning complexity of the business scenario. After the insertion, each scenario training set of the first training data still satisfies the task learning complexity of the business scenario and is arranged in order from low to high; and a preset number of training data are extracted from the scenario training set of the newly added business scenario and mixed into the second training data of the target training data, thereby realizing the update of the target training data in the case of a newly added business scenario.
[0212] In the disclosed embodiments, by quickly constructing training sets and test sets for new business scenarios, and using the same scenario training set to generate changes, a scenario training set that meets the requirements is obtained and incorporated into the generated target training data, thereby avoiding the need to re-collect and adjust the distribution of all data each time a new business scenario is added, reducing the consumption of computing resources and time costs, reducing the maintenance cost of large models, achieving rapid updates of target training data, and improving the iteration efficiency of large models.
[0213] In order to enable those skilled in the art to better understand the method provided by the present application, this embodiment takes a specific business scenario division and training data construction in an education scenario as an example, combined with Figure 5A The overall flow chart shown is an exemplary illustration of the method for generating training data for the large model of the present application.
[0214] like Figure 5A As shown, the process of generating training data for a large model under an educational scenario in this embodiment includes a business scenario division step S501, a scenario training set construction and update step for a single business scenario S502, and a target training data generation step based on a scenario training set for a business scenario S503.
[0215] S501, business scenario division steps:
[0216] a. Based on the topic, keywords, input and output data types and other task-related information of the dialogue task in the interaction scenario between the user and the education model in the education scenario, vertical classification is carried out according to the hierarchical depth of the education field, and the interaction scenario is divided into more specific business scenarios. For example, Figure 5B An example of a business scenario that is vertically classified according to the hierarchical depth of the education field is shown. In this embodiment, the education scenario can be preliminarily divided into three business scenarios: knowledge question and answer scenario, data interpretation and analysis scenario, and chat scenario. The knowledge question and answer scenario can be further divided into general knowledge question and answer scenario and domain professional knowledge question and answer scenario. The general knowledge question and answer scenario can be further divided into learning and life question and answer scenario, encyclopedia knowledge question and answer scenario, and so on.
[0217] b. Conduct in-depth analysis of each business scenario and extract key features of the scenario. The key features of the scenario are used to accurately describe the scenario requirements and goals of different business scenarios, and can be used as information in the set of discriminant criteria as the basis for constructing scenario training sets and test sets for the business scenario. For example, in a casual chat scenario, the key features of the scenario may include relevant features indicating fluent conversational skills, sense of humor, and extensive topic knowledge.
[0218] S502, steps for constructing and updating a scenario training set for a single business scenario:
[0219] a. Design a dedicated initial training set and test set for each business scenario. For example, collect and organize a large amount of chat conversation data for the chat scenario.
[0220] b. For each business scenario, see Figure 5BThe scenario training set update process shown in the figure first uses the initial training set of the business scenario to fine-tune the pre-trained sub-capability model for the business scenario using the SFT (Supervised Fine-Tuning) technology, and evaluates the model performance of the fine-tuned sub-capability model through the test set. If the performance result does not meet the preset performance conditions, the initial training set is updated according to the performance results and user feedback, and the pre-trained sub-capability model used in the first round of fine-tuning is continued to be fine-tuned using the updated initial training set. The above process is repeated until the performance result of the fine-tuned model meets the preset performance conditions, confirming that the initial training set currently used for fine-tuning meets the requirements and is used as the scenario training set for the business scenario.
[0221] The pre-trained sub-capability model can be a lightweight model with the same function as the large model, and the sub-capability model can have a simpler network structure and parameters with the same or similar structure as the large model. The updating method of the initial training set can be achieved through data cleaning and preprocessing, data enhancement, and the introduction of domain experts for data annotation.
[0222] Repeat the processing of step b for each business scenario to obtain scenario training sets that meet the requirements for all the divided business scenarios. In the process of obtaining scenario training sets that meet the requirements for multiple business scenarios, in order to improve processing efficiency, after constructing scenario training sets and test sets for multiple business scenarios, multiple business scenarios can be processed in parallel in the manner of step b above.
[0223] S503, step of generating target training data of scenario training set based on business scenario:
[0224] a. Integrate all scenario training sets that meet the requirements of all business scenarios to generate target training data. The target training data consists of two parts:
[0225] i. The scenario training sets that meet the requirements of each business scenario are arranged from simple to difficult according to the method of task learning complexity of the business scenario. In this implementation, it is assumed that the task learning complexity of the business scenario is from simple to difficult in the order of: chatting scenario, knowledge question and answer scenario, data interpretation and analysis scenario, and the data splicing of the scenario training set is performed in this order. For the specific judgment of the difficulty of the task learning complexity of the business scenario, it can be quantitatively judged according to the judgment conditions set in advance for different evaluation dimensions and the score values assigned to each judgment condition recorded in the aforementioned embodiment. Based on the aforementioned judgment conditions, the total score of each business is initialized to 0, and the total score of each business scenario is calculated respectively. The lower the total score, the simpler the business scenario, and vice versa. The task learning complexity of the business scenario can be sorted from low to high by sorting in ascending order according to the total score of the business scenario.
[0226] ii. According to the proportion of the scenario training set of each business scenario to the total data set after all scenario training sets are merged, extract a portion of the corresponding proportion of data from each scenario training set, and mix and shuffle the corresponding proportion of data;
[0227] b. Splice the two parts of data obtained in step a above, and determine the merged data as the target training data of the education model. For the pre-trained education model, using the target training data, through end-to-end SFT fine-tuning, the fine-tuned large model can maintain the model performance learned in the original pre-training stage while accurately learning the characteristics and patterns in various business scenarios, thereby enhancing the generalization ability of the large model while improving its performance in multiple business scenarios.
[0228] In the disclosed embodiment, the interaction scenario between the educational big model and the user is identified and divided into multiple business scenarios, and key features and requirements are extracted for each scenario to construct a corresponding scenario training set and sub-model. The scenario training set is adjusted based on the sub-model training. The independent training and evaluation method enables the sub-model under each business scenario to be optimized for a specific business scenario. After training, it can demonstrate adaptability and optimization effects for a specific scenario, and feedback is given to the adjustment of the scenario training set to obtain a scenario training set with good model training effects in a single business scenario. After obtaining the scenario training set, the scenario training sets of multiple business scenarios are merged into one data according to the set strategy, and given to the pre-trained educational big model for training, so that the trained educational big model can not only maintain the original generalization performance, but also inherit the model performance of the sub-model of the business scenario on the test set, thereby improving the performance of the big model in various business scenarios.
[0229] Corresponding to the embodiment of the method for generating training data of the aforementioned large model, see Figure 6 As shown, the present application also provides an embodiment of a training data generating device for a large model, the device comprising:
[0230] The business scenario classification module 601 is used to vertically classify the interaction scenarios between the user and the big model according to the hierarchical depth of the application field of the big model, and determine the corresponding multiple business scenarios;
[0231] A training set construction module 602 is used to construct an initial training set for each business scenario;
[0232] The training set adjustment module 603 is used to iteratively adjust the initial training set used to fine-tune the sub-capability model for each business scenario, until the performance result of the sub-capability model after fine-tuning meets the preset performance condition of the business scenario, thereby obtaining the scenario training set of the business scenario; the sub-capability model includes any lightweight model having the same function as the large model;
[0233] The target training data generation module 604 is used to integrate the scenario training sets of each business scenario according to the task learning complexity of each of the multiple business scenarios to generate target training data; the target training data is used to fine-tune the pre-trained large model.
[0234] In some embodiments, the target training data generation module is specifically used to:
[0235] Arrange and splice the scenario training set of each business scenario in order from low to high learning complexity of the task to obtain first training data;
[0236] Selecting a preset number of sub-data sets from the scenario training set of each business scenario, and integrating the sub-data sets from different business scenarios into a common training data set as second training data;
[0237] The second training data is spliced at the end of the first training data to generate the target training data.
[0238] In some embodiments, the target training data generation module, when used to select a preset number of sub-data sets from the scenario training set of each business scenario, includes:
[0239] Determine the data proportion of the scenario training set of each business scenario in the total data set; the total data set refers to the data set obtained by merging the scenario training sets of each business scenario;
[0240] Determine the preset number corresponding to the business scenario according to the total amount of data in the scenario training set of the business scenario and the corresponding data proportion;
[0241] A preset amount of data corresponding to the business scenario is extracted from the scenario training set of the business scenario to form the sub-data set.
[0242] In some embodiments, the apparatus further includes a module for predetermining the task learning complexity of the plurality of business scenarios, specifically for:
[0243] Acquire multiple judgment conditions set for each evaluation dimension; wherein each judgment condition is assigned a score value; the score value is positively correlated with the complexity of the content represented by the judgment condition in the evaluation dimension to which it belongs; the evaluation dimension at least includes content information complexity, grammatical complexity, and reasoning complexity;
[0244] For the multiple business scenarios, determine all determination conditions satisfied by the sample data of the business scenarios, and calculate the total score of the business scenarios in all evaluation dimensions according to the score values of the determination conditions satisfied by the business scenarios;
[0245] The total scores of each business scenario are sorted in ascending order to determine the order of task learning complexity of the multiple business scenarios from low to high.
[0246] In some embodiments, the training set adjustment module is specifically used to:
[0247] Fine-tune the sub-capability model using the constructed initial training set of the business scenario to obtain a fine-tuned sub-model;
[0248] Obtaining a performance result of the fine-tuning sub-model on a test set; the test set is constructed for the business scenario;
[0249] In the case where the performance result does not meet the preset performance condition, iteratively adjusting the initial training set, and using the adjusted initial training set to fine-tune the sub-capability model until the performance result of the fine-tuned sub-model on the test set meets the preset performance condition;
[0250] The training set used for fine-tuning when the performance result meets the preset performance condition is used as the scenario training set of the business.
[0251] In some embodiments, the training set adjustment module is specifically used to:
[0252] Before performing the Nth round of iterative adjustment on the initial training set, obtain the performance results of each round of fine-tuning in the first N-1 rounds, and determine the target round with the best performance result; the value of N is a positive integer greater than 2;
[0253] When the initial training set is adjusted for the Nth round of iteration, the initial training set used when fine-tuning the target round is adjusted.
[0254] In some embodiments, the training set adjustment module is specifically used to:
[0255] The initial training set is changed by data augmentation processing;
[0256] Alternatively, when the performance results of the fine-tuned sub-model do not meet the preset performance conditions, the initial training set is adjusted according to the performance results and the received user feedback, and the sub-capability model is fine-tuned using the adjusted initial training set; the user feedback is used to describe the way in which the initial training set is changed.
[0257] In some embodiments, after fine-tuning the sub-capability model using the adjusted initial training set, the apparatus further comprises:
[0258] In response to receiving the model test instruction, receiving test input data from the graphical user interface;
[0259] The fine-tuned sub-model obtained by fine-tuning is used to generate corresponding test outputs and return them to the graphical user interface, so that the user generates the user feedback according to the test outputs; the user feedback includes at least one of data-adjusted a posteriori knowledge based on the model test output and manually annotated data of the business scenario.
[0260] In some embodiments, after generating the target training data, the apparatus further includes:
[0261] In response to adding at least one new business scenario, constructing an initial training set of the new business scenario, and continuously iteratively adjusting the initial training set of the new business scenario to obtain a scenario training set of the business scenario;
[0262] Obtaining a ranking position of the task learning complexity of the newly added business scenario in the task learning complexities of the multiple existing business scenarios;
[0263] Insert the scenario training set of the newly added business scenario into the target training data corresponding to the sorting position to generate an updated target training set.
[0264] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0265] The present application also provides an electronic device. The structural diagram of the electronic device is as follows: Figure 7 As shown, the electronic device 700 includes at least one processor 701, a memory 702 and a bus 703, and the at least one processor 701 is electrically connected to the memory 702; the memory 702 is configured to store at least one computer-executable instruction, and the processor 701 is configured to execute the at least one computer-executable instruction, thereby executing the steps of any large model training data generation method provided in any embodiment or any optional implementation method of the present application.
[0266] Furthermore, the processor 701 may be a Field-Programmable Gate Array (FPGA) or other devices with logic processing capabilities, such as a Microcontroller Unit (MCU) or a Central Process Unit (CPU).
[0267] An embodiment of the present application also provides another readable storage medium storing a computer program, which, when executed by a processor, is used to implement the steps of any method for generating training data for a large model provided in any embodiment or any optional implementation manner in the present application.
[0268] The readable storage medium provided in the embodiments of the present application includes, but is not limited to, any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the readable storage medium includes any medium that can store or transmit information in a readable form by a device (e.g., a computer).
[0269] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for generating training data for a large model, characterized in that: The method comprises: For the interaction scenarios between users and big models, vertical classification is carried out according to the hierarchical depth of the big model's application field to determine the corresponding multiple business scenarios; Construct an initial training set for each business scenario; For each business scenario, iteratively adjust the initial training set used to fine-tune the sub-capability model until the performance result of the sub-capability model after fine-tuning meets the preset performance conditions of the business scenario, thereby obtaining the scenario training set of the business scenario; the sub-capability model includes any lightweight model having the same function as the large model; According to the task learning complexity of each of the multiple business scenarios, the scenario training sets of each business scenario are integrated to generate target training data; the target training data is used to fine-tune the pre-trained large model.
2. The method according to claim 1, characterized in that The scenario training sets of various business scenarios are integrated to generate target training data, including: Arrange and splice the scenario training set of each business scenario in order from low to high learning complexity of the task to obtain first training data; Selecting a preset number of sub-data sets from the scenario training set of each business scenario, and integrating the sub-data sets from different business scenarios into a common training data set as second training data; The second training data is spliced at the end of the first training data to generate the target training data.
3. The method according to claim 2, characterized in that The selecting a preset number of sub-data sets from the scenario training set of each business scenario includes: Determine the data proportion of the scenario training set of each business scenario in the total data set; the total data set refers to the data set obtained by merging the scenario training sets of each business scenario; Determine the preset number corresponding to the business scenario according to the total amount of data in the scenario training set of the business scenario and the corresponding data proportion; A preset amount of data corresponding to the business scenario is extracted from the scenario training set of the business scenario to form the sub-data set.
4. The method according to claim 1, characterized in that: The method further includes a step of predetermining the task learning complexity of the plurality of business scenarios, including: Acquire multiple judgment conditions set for each evaluation dimension; wherein each judgment condition is assigned a score value; the score value is positively correlated with the complexity of the content represented by the judgment condition in the evaluation dimension to which it belongs; the evaluation dimension at least includes content information complexity, grammatical complexity, and reasoning complexity; For the multiple business scenarios, determine all determination conditions satisfied by the sample data of the business scenarios, and calculate the total score of the business scenarios in all evaluation dimensions according to the score values of the determination conditions satisfied by the business scenarios; The total scores of each business scenario are sorted in ascending order to determine the order of task learning complexity of the multiple business scenarios from low to high.
5. The method according to claim 1, characterized in that The iterative adjustment is used to fine-tune the initial training set of the sub-capability model until the performance result of the sub-capability model after fine-tuning meets the preset performance condition of the business scenario, and the scenario training set of the business scenario is obtained, including: Fine-tuning the sub-capability model using the constructed initial training set to obtain a fine-tuned sub-model; Obtaining a performance result of the fine-tuning sub-model on a test set; the test set is constructed for the business scenario; In the case where the performance result does not meet the preset performance condition, iteratively adjusting the initial training set, and using the adjusted initial training set to fine-tune the sub-capability model until the performance result of the fine-tuned sub-model on the test set meets the preset performance condition; The training set used for fine-tuning when the performance result meets the preset performance condition is used as the scenario training set of the business.
6. The method according to claim 5, characterized in that When the performance result does not meet the preset performance condition, iteratively adjusting the initial training set includes: Before performing the Nth round of iterative adjustment on the initial training set, obtain the performance results of each round of fine-tuning in the first N-1 rounds, and determine the target round with the best performance result; the value of N is a positive integer greater than 2; When the initial training set is adjusted for the Nth round of iteration, the initial training set used when fine-tuning the target round is adjusted.
7. The method according to claim 5, characterized in that The iterative adjustment of the initial training set of the business scenario includes: The initial training set is changed by data augmentation processing; Alternatively, when the performance results of the fine-tuned sub-model do not meet the preset performance conditions, the initial training set is adjusted according to the performance results and the received user feedback, and the sub-capability model is fine-tuned using the adjusted initial training set; the user feedback is used to describe the way in which the initial training set is changed.
8. The method according to claim 7, characterized in that After fine-tuning the sub-capability model using the adjusted initial training set, the method further includes: In response to receiving the model test instruction, receiving test input data from the graphical user interface; The fine-tuned sub-model obtained by fine-tuning is used to generate corresponding test outputs and return them to the graphical user interface, so that the user generates the user feedback according to the test outputs; the user feedback includes at least one of data-adjusted a posteriori knowledge based on the model test output and manually annotated data of the business scenario.
9. The method according to claim 1, characterized in that: After generating the target training data, the method further includes: In response to adding at least one new business scenario, constructing an initial training set of the new business scenario, and continuously iteratively adjusting the initial training set of the new business scenario to obtain a scenario training set of the business scenario; Obtaining a ranking position of the task learning complexity of the newly added business scenario in the task learning complexities of the multiple existing business scenarios; Insert the scenario training set of the newly added business scenario into the target training data corresponding to the sorting position to generate an updated target training set.
10. A training data generating device for a large model, characterized in that: The device comprises: The business scenario classification module is used to classify the interaction scenarios between users and the big model vertically according to the hierarchical depth of the big model's application field, and determine the corresponding multiple business scenarios; The training set construction module is used to construct the initial training set for each business scenario; A training set adjustment module, for iteratively adjusting the initial training set used to fine-tune the sub-capability model for each business scenario, until the performance result of the sub-capability model after fine-tuning meets the preset performance condition of the business scenario, thereby obtaining a scenario training set for the business scenario; the sub-capability model includes any lightweight model having the same function as the large model; The target training data generation module is used to integrate the scenario training sets of each business scenario according to the task learning complexity of each of the multiple business scenarios to generate target training data; the target training data is used to fine-tune the pre-trained large model.
Citation Information
Cited By
Automatic iteration method and system of medical identification and diagnosis model and storage medium
CN119851965A
Automatic Iteration Method, System and Storage Medium of Medical Diagnosis Model
CN119851965B