Proportion determination method and device, electronic equipment and storage medium

By performing data classification and relationship training on vertical domain tasks of large language models, the appropriate data mixing ratio is determined, which solves the problem that data mixing ratio affects generalization ability in fine-tuning of large models, and improves the effectiveness and efficiency of the model.

CN119740656APending Publication Date: 2025-04-01CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411579479.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the process of fine-tuning of large language models, how to accurately determine the data mixing ratio of domain data and general data to improve the generalization ability and effect of large models.

Method used

By classifying the tasks of each target domain in the vertical field of the big model, the data sets of each sub-field are obtained; then multiple sets of relationship pairs are obtained, the initial prediction model is trained, and the target prediction model is obtained; the mixing ratio of the data to be predicted is input to the target prediction model, the corresponding model performance scores are obtained, and the mixing ratio of the target data that meets the preset performance conditions is selected.

Benefits of technology

By training and fitting the relationship between the data mixing ratio and the performance of the large model, the appropriate data mixing ratio is predicted, which improves the learning efficiency and learning effect of the large model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740656A_ABST
    Figure CN119740656A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, in particular to a proportion determination method and device, electronic equipment and a storage medium, and aims to accurately determine an optimal data mixing proportion and improve the effect of a large model. The method comprises the steps of classifying domain data sets based on task types of target domain tasks of a large model in a vertical domain to obtain sub-domain data sets; multiple groups of relation pairs are obtained, the initial prediction model is trained based on the multiple groups of relation pairs, a target prediction model is obtained, and each group of relation pair is composed of the training data mixing proportion of each sub-field data set and each general data set and the model performance score corresponding to the training data mixing proportion; and inputting the mixing proportions of the to-be-predicted data into the target prediction model to obtain model performance scores corresponding to the mixing proportions of the to-be-predicted data, and selecting a target data mixing proportion of which the model performance scores meet a preset performance condition from the mixing proportions of the to-be-predicted data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a ratio determination method, device, electronic device and storage medium. Background Art

[0002] Large language models (LLMs) can be applied to many fields due to their powerful language understanding and knowledge emergence capabilities. The training process of large models is roughly divided into two stages: pre-training and fine-tuning. In the fine-tuning stage, in order to prevent possible catastrophic forgetting problems, general data is often added for fine-tuning. The data mixing ratio of domain data and general data will affect the final generalization ability of the large model.

[0003] Therefore, how to provide a ratio determination method that can accurately determine the data mixing ratio that should be used when fine-tuning the large model, thereby improving the effect of the large model, is an urgent problem that technical personnel in this field need to solve. Summary of the invention

[0004] The embodiments of the present application provide a ratio determination method, device, electronic device and storage medium to accurately determine the optimal data mixing ratio and improve the effect of large models.

[0005] The specific technical solutions provided by the embodiments of this application are as follows:

[0006] In a first aspect, a method for determining a ratio is provided, the method comprising:

[0007] Based on the task types of each target domain task in the vertical domain of the big model, the domain data set is classified to obtain each sub-domain data set;

[0008] Acquire multiple groups of relationship pairs, and train an initial prediction model based on the multiple groups of relationship pairs to obtain a target prediction model, wherein each group of relationship pairs is composed of a mixed ratio of training data of each sub-domain data set and each general data set, and a model performance score corresponding to the mixed ratio of training data;

[0009] Each mixing ratio of the data to be predicted is input into the target prediction model to obtain the model performance score corresponding to each mixing ratio of the data to be predicted, and from each mixing ratio of the data to be predicted, a target data mixing ratio whose model performance score meets the preset performance conditions is selected.

[0010] In a possible embodiment, based on the task type of each target domain task under the vertical domain of the big model, the domain data set is classified to obtain each sub-domain data set, including:

[0011] Based on the inclusion relationship between the initial domain tasks in the vertical domain of the big model, an initial task relationship tree is constructed. Each node in the initial task relationship tree represents: the corresponding initial domain task;

[0012] The initial task relationship tree is pruned to obtain the target task relationship tree. Each node in the target task relationship tree represents: the corresponding target domain task;

[0013] Based on the task types corresponding to each node in the target task relationship tree, the domain datasets are classified to obtain sub-domain datasets.

[0014] Through the above method, each initial domain task is converted into a tree structure. The tree structure can intuitively reflect the relationship between the initial domain tasks and help design the data feeding strategy in the fine-tuning stage.

[0015] In a possible embodiment, based on the inclusion relationship between initial domain tasks in the vertical domain of the large model, before constructing the initial task relationship tree, the following steps are included:

[0016] Based on the agent group, the vertical domain tasks of the large model are decomposed to obtain the initial domain tasks and the inclusion relationship between the initial domain tasks;

[0017] The agent group includes: a planning agent and discussion agents. The planning agent is used to specify the tasks to be decomposed in each round, and the discussion agents are used to decompose the tasks to be decomposed in each round into subtasks of the tasks to be decomposed in each round.

[0018] Through the above method, by using a large model and multiple agents, vertical field tasks can be planned and decomposed, which can generate a rich variety of initial field tasks, covering various small scenes in the vertical field, and ensuring the diversity of tasks of the large model in the vertical field.

[0019] In a possible embodiment, pruning the initial task relationship tree to obtain a target task relationship tree includes:

[0020] If the initial task relationship tree has similar nodes with similar initial domain tasks, and the similar nodes are not in the same layer, and the similar nodes have no child nodes, then only the deepest similar nodes are retained;

[0021] If the initial task relationship tree has similar nodes with similar initial domain tasks, and the similar nodes are not in the same layer, and each similar node has child nodes, only the deepest similar nodes and the child nodes of the deepest similar nodes are retained.

[0022] Through the above method, each initial domain task is converted into a tree structure and pruned, which can effectively reduce the redundancy of tasks and ensure the uniqueness of each target domain task.

[0023] In a possible embodiment, obtaining multiple groups of relationship pairs includes:

[0024] For the mixed ratio of multiple sets of training data for each sub-domain dataset and each general dataset, the following operations are performed respectively:

[0025] Fine-tune the large model based on a set of training data mixing ratios of each sub-domain dataset and each general dataset, where the sum of a set of training data mixing ratios is 1;

[0026] Verify the fine-tuned large model and obtain the model performance score of the fine-tuned large model;

[0027] A set of training data mixing ratios and the corresponding model performance scores are taken as a set of relationship pairs.

[0028] In a possible embodiment, after selecting a target data mixing ratio whose model performance score satisfies a preset performance condition from each of the mixed ratios of data to be predicted, the method further includes:

[0029] Fine-tune large models using target data mixing ratios.

[0030] Through the above method, the appropriate target data mixing ratio can be adopted to improve the efficiency and learning effect of large model learning ability.

[0031] In a second aspect, the present application provides a ratio determination device, the device comprising:

[0032] A processing module is used to classify domain data sets based on the task types of each target domain task under the vertical domain of the big model to obtain each sub-domain data set;

[0033] The first training module is used to obtain multiple groups of relationship pairs, and based on the multiple groups of relationship pairs, train the initial prediction model to obtain the target prediction model, wherein each group of relationship pairs is composed of a training data mixing ratio of each sub-domain data set and each general data set, and a model performance score corresponding to the training data mixing ratio;

[0034] The determination module is used to input each mixing ratio of the data to be predicted into the target prediction model, obtain the model performance score corresponding to each mixing ratio of the data to be predicted, and select the target data mixing ratio whose model performance score meets the preset performance conditions from each mixing ratio of the data to be predicted.

[0035] In a possible embodiment, based on the task type of each target domain task under the big model in the vertical domain, the domain data set is classified to obtain each sub-domain data set, and the processing module is further used to:

[0036] Based on the inclusion relationship between the initial domain tasks in the vertical domain of the big model, an initial task relationship tree is constructed. Each node in the initial task relationship tree represents: the corresponding initial domain task;

[0037] The initial task relationship tree is pruned to obtain the target task relationship tree. Each node in the target task relationship tree represents: the corresponding target domain task;

[0038] Based on the task types corresponding to each node in the target task relationship tree, the domain datasets are classified to obtain sub-domain datasets.

[0039] In a possible embodiment, based on the inclusion relationship between the initial domain tasks in the vertical domain of the large model, before constructing the initial task relationship tree, the processing module is further used to:

[0040] Based on the agent group, the vertical domain tasks of the large model are decomposed to obtain the initial domain tasks and the inclusion relationship between the initial domain tasks;

[0041] The agent group includes: a planning agent and discussion agents. The planning agent is used to specify the tasks to be decomposed in each round, and the discussion agents are used to decompose the tasks to be decomposed in each round into subtasks of the tasks to be decomposed in each round.

[0042] In a possible embodiment, when the initial task relationship tree is pruned to obtain the target task relationship tree, the processing module is further configured to:

[0043] If the initial task relationship tree has similar nodes with similar initial domain tasks, and the similar nodes are not in the same layer, and the similar nodes have no child nodes, then only the deepest similar nodes are retained;

[0044] If the initial task relationship tree has similar nodes with similar initial domain tasks, and the similar nodes are not in the same layer, and each similar node has child nodes, only the deepest similar nodes and the child nodes of the deepest similar nodes are retained.

[0045] In a possible embodiment, when acquiring multiple groups of relationship pairs, the first training module is further used to:

[0046] For the mixed ratio of multiple sets of training data for each sub-domain dataset and each general dataset, the following operations are performed respectively:

[0047] Fine-tune the large model based on a set of training data mixing ratios of each sub-domain dataset and each general dataset, where the sum of a set of training data mixing ratios is 1;

[0048] Verify the fine-tuned large model and obtain the model performance score of the fine-tuned large model;

[0049] A set of training data mixing ratios and the corresponding model performance scores are taken as a set of relationship pairs.

[0050] In a possible embodiment, after selecting a target data mixing ratio whose model performance score satisfies a preset performance condition from each of the mixed ratios of the data to be predicted, a second training module is further included, and the second training module is used to:

[0051] Fine-tune large models using target data mixing ratios.

[0052] According to a third aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any one of the methods described in the first aspect are implemented.

[0053] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in any one of the first aspects are implemented.

[0054] In a fifth aspect, the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect.

[0055] In the embodiment of the present application, based on the task type of each target domain task of the large model in the vertical domain, the domain data set is classified to obtain each sub-domain data set, and then multiple groups of relationship pairs are obtained, and based on the multiple groups of relationship pairs, the initial prediction model is trained to obtain the target prediction model, wherein each group of relationship pairs is composed of the training data mixing ratio of each sub-domain data set and each general data set, and the model performance score corresponding to the training data mixing ratio, and finally each data mixing ratio to be predicted is input into the target prediction model to obtain the model performance score corresponding to each data mixing ratio to be predicted, and from each data mixing ratio to be predicted, the target data mixing ratio whose model performance score meets the preset performance conditions is selected. In this way, by training the prediction model to fit the relationship between the data mixing ratio and the model performance of the large model, the appropriate target data mixing ratio when performing fine-tuning tasks in the vertical domain is predicted, thereby improving the efficiency and learning effect of the large model's learning ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 This is a flow chart of an implementation method of a ratio determination method provided in an embodiment of the present application;

[0057] Figure 2 A schematic diagram of pruning a task relationship tree in an embodiment of the present application;

[0058] Figure 3 Schematic diagram of the initial prediction model structure in the embodiment of the present application;

[0059] Figure 4 Another schematic diagram of a ratio determination method in an embodiment of the present application;

[0060] Figure 5 A schematic diagram of the structure of a ratio determination device provided in an embodiment of the present application;

[0061] Figure 6 Schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0063] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0064] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0065] In the technical solution of this application, the acquisition, transmission, storage, and use of data are in compliance with the requirements of relevant national laws and regulations.

[0066] To facilitate understanding of the technical solutions provided in the embodiments of the present application, some key terms used in the embodiments of the present application are explained here:

[0067] Big Language Models: are AI models designed to understand and generate human language. They are trained on large amounts of text data and can perform a wide range of tasks, including text summarization, translation, sentiment analysis, and more. Big Language Models are characterized by their large size and contain billions of parameters, which help them learn complex patterns in language data.

[0068] Agent: An agent is an intelligent system built on technologies such as large language models that can autonomously perceive, make decisions, and take actions to achieve specific goals in a specific environment. Through training and optimization, combined with knowledge and skills in specific fields, it demonstrates better execution capabilities and broader application potential in specific tasks. They can autonomously perceive the environment, make decisions, and perform tasks in various scenarios, providing users with a richer and more personalized service experience.

[0069] Pruning: During or after the tree structure is constructed, some unnecessary branches or nodes are removed through specific rules and methods to optimize the tree structure. The main purpose of pruning is to simplify the tree structure, reduce computational complexity, and improve the generalization ability of the model.

[0070] Data mixing ratio: When fine-tuning a large model, the fine-tuning data will involve many tasks, so a large amount of composite data is required. The composition ratio and scale of the composite data will affect the final generalization ability of the large model, so when fine-tuning a large model, a suitable data mixing ratio is required.

[0071] The following is a brief introduction to the design concept of the embodiment of the present application:

[0072] With its powerful language understanding and knowledge emergence capabilities, the large language model can be applied to many fields, such as information security. The training process of the large model is roughly divided into two stages: pre-training and fine-tuning. In the fine-tuning training stage, in order to prevent possible catastrophic forgetting problems, it is often necessary to add general data for fine-tuning. The data mixing ratio of domain data and general data will affect the final generalization ability of the large model. That is, in vertical domain scenarios, it is necessary to consider the mixing ratio of domain data and general data to improve the effect of the final large model.

[0073] Therefore, how to provide a ratio determination method that can accurately predict the data mixing ratio that should be used when fine-tuning the large model, thereby improving the effect of the large model, is an urgent problem that technical personnel in this field need to solve.

[0074] In view of this, in the embodiments of the present application, a ratio determination method, device, electronic device and storage medium are provided. Based on the task type of each target domain task of the large model in the vertical field, the domain data set is classified to obtain each sub-domain data set, and then multiple groups of relationship pairs are obtained. Based on the multiple groups of relationship pairs, the initial prediction model is trained to obtain the target prediction model, wherein each group of relationship pairs is composed of the training data mixing ratio of each sub-domain data set and each general data set, and the model performance score corresponding to the training data mixing ratio. Finally, each data mixing ratio to be predicted is input into the target prediction model to obtain the model performance score corresponding to each data mixing ratio to be predicted, and the target data mixing ratio whose model performance score meets the preset performance condition is selected from each data mixing ratio to be predicted. In this way, by training the relationship between the data mixing ratio and the model performance of the large model, the appropriate target data mixing ratio when performing fine-tuning tasks in the vertical field is predicted, which improves the efficiency and learning effect of the large model's learning ability. In addition, based on the task types of each target domain task in the vertical field of the big model, the domain data sets are classified, and the diversity of fine-tuning tasks is taken into consideration. Each sub-domain data set can cover various small scenes in the vertical field, thereby improving the comprehensiveness of the fine-tuned big model.

[0075] See also Figure 1 As shown, it is an implementation flow chart of a ratio determination method provided in an embodiment of the present application, and the specific implementation process of the method is as follows:

[0076] Step 10: Based on the task types of each target domain task in the vertical field of the big model, classify the domain data set to obtain each sub-domain data set.

[0077] Among them, the tasks in each target area are different.

[0078] In the embodiment of the present application, based on the task type of each target domain task in the vertical domain of the big model, the domain data set is classified to obtain the sub-domain data set corresponding to each target domain task.

[0079] For example, if a big model is needed for security analysis, the target area tasks of the big model in the vertical field can be log interpretation, risk location, risk judgment, reason enumeration, response plan generation, security content summary, etc.

[0080] Optionally, in an embodiment of the present application, a possible embodiment is provided to classify domain data sets based on the task types of each target domain task in a vertical domain of a large model to obtain each sub-domain data set, and the specific steps are as follows:

[0081] Step 100: Construct an initial task relationship tree based on the inclusion relationship between the initial domain tasks in the vertical domain of the big model.

[0082] Among them, each node in the initial task relationship tree represents: the corresponding initial domain task.

[0083] In an embodiment of the present application, the vertical domain tasks of the large model are decomposed based on the agent group to obtain the initial domain tasks and the inclusion relationship between the initial domain tasks, and then the initial task relationship tree is constructed based on the inclusion relationship between the initial domain tasks.

[0084] In this way, each initial domain task is converted into a tree structure, which can intuitively reflect the relationship between the initial domain tasks and help design the data feeding strategy in the fine-tuning stage.

[0085] Among them, the agent group includes: a planning agent and discussion agents. The planning agent is used to specify the tasks to be decomposed in each round and summarize the subtasks. The discussion agents are used to decompose the tasks to be decomposed in each round into subtasks of the tasks to be decomposed in each round. The tasks to be decomposed in the first round are vertical field tasks.

[0086] In addition, in order to generate more diverse initial domain tasks, each discussion agent plays a different role.

[0087] For example, when the vertical field task is a security analysis task, each discussion agent plays different roles such as operators, security experts, emergency responders, network attackers, etc.

[0088] Exemplarily, the vertical domain task is a security analysis task. The planning agent specifies the first round of tasks to be decomposed as the security analysis task. Each discussion agent is used to decompose the security analysis task into subtasks of the security analysis task. The subtasks include log interpretation, risk location, risk judgment, enumeration of reasons for analysis and judgment, generation of response plans, security content summary, etc. The planning agent specifies the second round of tasks to be decomposed as the log interpretation task. Each discussion agent is used to decompose the log interpretation task into subtasks of the log interpretation task. Finally, after multiple rounds of discussion and decomposition, the initial domain tasks and the inclusion relationship between the initial domain tasks are obtained.

[0089] The task set corresponding to each initial domain task can be expressed as T = {t1, ..., t i ,…,t n}, the inclusion relationship between the initial domain tasks can be expressed as t i =[t father , {t kid}],t i represents the i-th initial domain task, t father represents the parent task of decomposing the i-th initial domain task, t kid Represents the set of subtasks decomposed from the i-th initial domain task.

[0090] In this way, by using a large model and multiple agents to plan and decompose vertical domain tasks, a rich variety of initial domain tasks can be generated, covering various small scenes in the vertical domain, thus ensuring the diversity of tasks of the large model in the vertical domain.

[0091] Step 101: Prune the initial task relationship tree to obtain a target task relationship tree.

[0092] Among them, each node in the target-task relationship tree represents the corresponding target domain task, the non-decomposable nodes in the target-task relationship tree represent the basic tasks (such as information extraction), and the decomposable nodes in the target-task relationship tree represent the complex tasks that require multi-step thinking chain reasoning.

[0093] In the embodiment of the present application, the initial task relationship tree is pruned according to the similar nodes with similar initial domain tasks in the initial task relationship tree to obtain the target task relationship tree, which specifically includes the following two situations:

[0094] Case 1: The initial task relationship tree has similar nodes with similar initial domain tasks, and the similar nodes are not in the same layer, and each similar node has no child nodes.

[0095] In an embodiment of the present application, if the initial task relationship tree has similar nodes that are similar to the initial domain tasks, and the similar nodes are not at the same layer, and the similar nodes have no child nodes, then only the deepest similar nodes are retained, that is, the deepest similar nodes are retained, and the similar nodes in other layers are deleted.

[0096] For example, see Figure 2 , is a schematic diagram of the task relationship tree pruning in the embodiment of the present application, t0 to t 12 are the nodes corresponding to the initial domain tasks, t8 and t 11 The corresponding initial domain tasks are similar, t8 and t 11 are similar nodes, t8 and t 11 Not on the same layer, t8 and t 11 No child nodes, t 11 The layer where t8 is located is deeper than the layer where t8 is located, then keep t 11 , delete t8.

[0097] For example, the risk location task and log interpretation task in the field of security analysis can be decomposed into information extraction tasks (the risk location task corresponds to extracting risk information, and the log interpretation task corresponds to extracting field information in the log), so one information extraction task is retained.

[0098] Case 2: The initial task relationship tree has similar nodes with similar initial domain tasks, and the similar nodes are not in the same layer, and each similar node has child nodes.

[0099] In an embodiment of the present application, if the initial task relationship tree has similar nodes that are similar to the initial domain tasks, and the similar nodes are not at the same layer, and each similar node has child nodes, then only the deepest similar nodes and the child nodes of the deepest similar nodes are retained, that is, the deepest similar nodes and the child nodes of the deepest similar nodes are retained, and the similar nodes and their child nodes of other layers are deleted.

[0100] For example, Figure 2 As shown, t4 and t 10 The corresponding initial domain tasks are similar, t4 and t 10 are similar nodes, t4 and t 10 Not in the same layer, t4's child node is t9, t 10 The child node is t 12 , t 10 The layer where t4 is located is deeper than the layer where t4 is located, then keep t 10 and t 10 The child node t 12 , delete t4 and its child node t9.

[0101] In this way, converting each initial domain task into a tree structure and pruning it can effectively reduce the redundancy of tasks and ensure the uniqueness of each target domain task.

[0102] In addition, it is worth noting that, in the embodiment of the present application, for each similar node in the same layer, one similar node may be randomly retained and other similar nodes may be deleted.

[0103] Step 102: Based on the task types corresponding to the nodes in the target task relationship tree, the domain data sets are classified to obtain sub-domain data sets.

[0104] In the embodiment of the present application, based on the task type corresponding to each node in the target task relationship tree, the domain data set is classified to obtain the sub-domain data set corresponding to each task type. If there is a task type without corresponding domain data, the domain data can be searched on the Internet or synthesized.

[0105] Step 11: Obtain multiple groups of relationship pairs, and based on the multiple groups of relationship pairs, train the initial prediction model to obtain the target prediction model.

[0106] Among them, each set of relationship pairs consists of the training data mixing ratio of each sub-domain dataset and each general dataset, and the model performance score corresponding to the training data mixing ratio.

[0107] In an embodiment of the present application, multiple sets of training data mixing ratios are randomly generated, and multiple sets of relationship pairs are formed based on the multiple sets of training data mixing ratios and the respective model performance scores corresponding to the multiple sets of training data mixing ratios.

[0108] Optionally, in the embodiment of the present application, in order to obtain multiple sets of relationship pairs, the following operations are performed respectively for the mixing ratios of multiple sets of training data of each sub-domain data set and each general data set:

[0109] Step 110: Fine-tune the large model based on a set of training data mixing ratios of each sub-domain dataset and each general dataset.

[0110] Among them, the sum of the mixing ratios of a set of training data is 1.

[0111] In an embodiment of the present application, based on a group of training data mixing ratios, a fine-tuning data set corresponding to the group of training data mixing ratios is obtained, and the large model is fine-tuned based on the fine-tuning data set.

[0112] Among them, a set of fine-tuning data sets corresponding to the mixing ratio of training data can be expressed as:

[0113]

[0114] D task_iis the sub-domain dataset corresponding to the i-th target domain task, D nor_j is the general dataset corresponding to the jth general task, α i is the proportion of the sub-domain dataset corresponding to the i-th target domain task, β j is the proportion of the general dataset corresponding to the j-th general task.

[0115] Step 111: Verify the fine-tuned large model and obtain a model performance score of the fine-tuned large model.

[0116] Among them, the model performance score can be the correct answer rate, which is not limited in the embodiments of the present application.

[0117] In the embodiment of the present application, the fine-tuned large model is verified based on the test data set to obtain a model performance score of the fine-tuned large model.

[0118] Step 112: A set of training data mixing ratios and corresponding model performance scores are taken as a set of relationship pairs.

[0119] In the embodiment of the present application, the obtained model performance score and the mixing ratio of the group of training data are taken as a set of relationship pairs.

[0120] For example, a set of relationship pairs can be expressed as: ({α1, ..., α n ,β1,…,β k} m , x m ), where x m is the model performance score corresponding to the mixing ratio of the mth group of training data.

[0121] In an embodiment of the present application, model performance parameters in multiple groups of relationship pairs are used as labels to train an initial prediction model to obtain a target prediction model.

[0122] The initial prediction model may be a multilayer perceptron (MLP) model.

[0123] For example, see Figure 3 As shown, it is a schematic diagram of the initial prediction model structure in an embodiment of the present application, including an embedding layer, multiple hidden layers and a Sigmoid layer, wherein the embedding layer is responsible for converting the input data mixing ratio into an embedding vector, and the Sigmoid layer is used to output the prediction result as a score between 0 and 1, and multiple sets of relationship pairs are used to train the initial prediction model.

[0124] Step 12: Input each data mixing ratio to be predicted into the target prediction model to obtain the model performance score corresponding to each data mixing ratio to be predicted, and select the target data mixing ratio whose model performance score meets the preset performance conditions from each data mixing ratio to be predicted.

[0125] Among them, the preset performance condition can be that the model performance score is the highest, or the model performance score is greater than the performance threshold, which is not limited in the embodiments of the present application.

[0126] For example, the preset performance condition may be the highest model performance score, and the data mixing ratios to be predicted include data mixing ratio a, data mixing ratio b, and data mixing ratio c. Each data mixing ratio to be predicted is input into the target prediction model, and the model performance score corresponding to the data mixing ratio a is 0.5, the model performance score corresponding to the data mixing ratio b is 0.2, and the model performance score corresponding to the data mixing ratio c is 0.8, then the data mixing ratio c is used as the target data mixing ratio.

[0127] Furthermore, in an embodiment of the present application, after obtaining the target data mixing ratio, the target data mixing ratio is used to fine-tune the large model. Using an appropriate target data mixing ratio can improve the efficiency and learning effect of the large model's learning ability.

[0128] Based on the above embodiments, see Figure 4 FIG. 1 is another flow chart of a method for determining a ratio in an embodiment of the present application, which specifically includes:

[0129] Step 40: Start.

[0130] Step 41: Based on the agent group, decompose the vertical domain tasks of the large model to obtain a task set.

[0131] Among them, the task set includes various initial domain tasks.

[0132] Step 42: Build a task relationship tree and perform pruning.

[0133] Step 43: Classify the domain data set to obtain each sub-domain data set.

[0134] Step 44: Randomly assign a training data mixing ratio to each sub-domain dataset and each general dataset.

[0135] Step 45: Fine-tune the large model based on the training data mixing ratio.

[0136] Step 46: Verify the fine-tuned large model and obtain a model performance score of the fine-tuned large model.

[0137] Step 47: Determine whether to stop the loop, if so, execute step 48, otherwise, execute step 44.

[0138] Step 48: Based on multiple sets of relationship pairs, train the initial prediction model to obtain the target prediction model.

[0139] Step 49: Based on the target prediction model, determine the target data mixing ratio.

[0140] Based on the same inventive concept, the present application embodiment provides a ratio determination device, please refer to Figure 5 , the device comprises:

[0141] Processing module 501, for classifying domain data sets based on the task types of each target domain task under the vertical domain of the big model to obtain each sub-domain data set;

[0142] The first training module 502 is used to obtain multiple groups of relationship pairs, and train the initial prediction model based on the multiple groups of relationship pairs to obtain the target prediction model, wherein each group of relationship pairs is composed of a training data mixing ratio of each sub-domain data set and each general data set, and a model performance score corresponding to the training data mixing ratio;

[0143] Determination module 503 is used to input each data mixing ratio to be predicted into the target prediction model, obtain the model performance score corresponding to each data mixing ratio to be predicted, and select the target data mixing ratio whose model performance score meets the preset performance conditions from each data mixing ratio to be predicted.

[0144] In a possible embodiment, based on the task type of each target domain task under the big model in the vertical domain, the domain data set is classified to obtain each sub-domain data set, and the processing module 501 is further used to:

[0145] Based on the inclusion relationship between the initial domain tasks in the vertical domain of the big model, an initial task relationship tree is constructed. Each node in the initial task relationship tree represents: the corresponding initial domain task;

[0146] The initial task relationship tree is pruned to obtain the target task relationship tree. Each node in the target task relationship tree represents: the corresponding target domain task;

[0147] Based on the task types corresponding to each node in the target task relationship tree, the domain datasets are classified to obtain sub-domain datasets.

[0148] In a possible embodiment, based on the inclusion relationship between the initial domain tasks in the vertical domain of the large model, before constructing the initial task relationship tree, the processing module 501 is further used to:

[0149] Based on the agent group, the vertical domain tasks of the large model are decomposed to obtain the initial domain tasks and the inclusion relationship between the initial domain tasks;

[0150] The agent group includes: a planning agent and discussion agents. The planning agent is used to specify the tasks to be decomposed in each round, and the discussion agents are used to decompose the tasks to be decomposed in each round into subtasks of the tasks to be decomposed in each round.

[0151] In a possible embodiment, when the initial task relationship tree is pruned to obtain the target task relationship tree, the processing module 501 is further used to:

[0152] If the initial task relationship tree has similar nodes with similar initial domain tasks, and the similar nodes are not in the same layer, and the similar nodes have no child nodes, then only the deepest similar nodes are retained;

[0153] If the initial task relationship tree has similar nodes with similar initial domain tasks, and the similar nodes are not in the same layer, and each similar node has child nodes, only the deepest similar nodes and the child nodes of the deepest similar nodes are retained.

[0154] In a possible embodiment, when acquiring multiple groups of relationship pairs, the first training module 502 is further configured to:

[0155] For the mixed ratio of multiple sets of training data for each sub-domain dataset and each general dataset, the following operations are performed respectively:

[0156] Fine-tune the large model based on a set of training data mixing ratios of each sub-domain dataset and each general dataset, where the sum of a set of training data mixing ratios is 1;

[0157] Verify the fine-tuned large model and obtain the model performance score of the fine-tuned large model;

[0158] A set of training data mixing ratios and the corresponding model performance scores are taken as a set of relationship pairs.

[0159] In a possible embodiment, after selecting a target data mixing ratio whose model performance score satisfies a preset performance condition from each of the data mixing ratios to be predicted, a second training module 504 is further included. The second training module 504 is used to:

[0160] Fine-tune large models using target data mixing ratios.

[0161] Based on the above embodiments, see Figure 6 Shown is a schematic diagram of the structure of an electronic device in an embodiment of the present application.

[0162] An embodiment of the present application provides an electronic device, which may include a processor 610 (Center Processing Unit, CPU), a memory 620, an input device 630 and an output device 640, etc. The input device 630 may include a keyboard, a mouse, a touch screen, etc., and the output device 640 may include a display device, such as a liquid crystal display (Liquid Crystal Display, LCD), a cathode ray tube (Cathode Ray Tube, CRT), etc.

[0163] The memory 620 may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor 610 with program instructions and data stored in the memory 620. In the embodiment of the present application, the memory 620 may be used to store the program of any ratio determination method in the embodiment of the present application.

[0164] The processor 610 calls the program instructions stored in the memory 620, and the processor 610 is used to execute any ratio determination method in the embodiments of the present application according to the obtained program instructions.

[0165] Based on the above embodiments, in an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the ratio determination method in any of the above method embodiments is implemented.

[0166] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0167] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0168] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0169] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0170] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for determining a ratio, characterized in that: include: Based on the task types of each target domain task in the vertical domain of the big model, the domain data set is classified to obtain each sub-domain data set; Acquire multiple groups of relationship pairs, and train an initial prediction model based on the multiple groups of relationship pairs to obtain a target prediction model, wherein each group of relationship pairs is composed of a training data mixing ratio of each sub-domain data set and each general data set, and a model performance score corresponding to the training data mixing ratio; Each data mixing ratio to be predicted is input into the target prediction model to obtain the model performance score corresponding to each data mixing ratio to be predicted, and from the data mixing ratios to be predicted, the target data mixing ratio whose model performance score meets the preset performance conditions is selected.

2. The method according to claim 1, characterized in that The task types of each target domain task under the vertical domain based on the big model are used to classify the domain data sets to obtain each sub-domain data set, including: Based on the inclusion relationship between each initial domain task in the vertical domain of the big model, an initial task relationship tree is constructed, wherein each node in the initial task relationship tree represents: a corresponding initial domain task; Pruning the initial task relationship tree to obtain a target task relationship tree, wherein each node in the target task relationship tree represents: a corresponding target domain task; Based on the task types corresponding to the nodes in the target task relationship tree, the domain data sets are classified to obtain sub-domain data sets.

3. The method according to claim 2, characterized in that Before constructing the initial task relationship tree based on the inclusion relationship between the initial domain tasks in the vertical domain of the big model, the following steps are included: Based on the agent group, the vertical domain tasks of the large model are decomposed to obtain initial domain tasks and the inclusion relationship between the initial domain tasks; The agent group includes: a planning agent and discussion agents, wherein the planning agent is used to specify the tasks to be decomposed in each round, and the discussion agents are used to decompose the tasks to be decomposed in each round into subtasks of the tasks to be decomposed in each round.

4. The method according to claim 1, characterized in that The pruning of the initial task relationship tree to obtain a target task relationship tree includes: If the initial task relationship tree has similar nodes with similar initial domain tasks, and the similar nodes are not in the same layer, and the similar nodes have no child nodes, then only the deepest similar nodes are retained; If the initial task relationship tree has similar nodes with similar initial domain tasks, and the similar nodes are not in the same layer, and the similar nodes have child nodes, only the deepest similar nodes and the child nodes of the deepest similar nodes are retained.

5. The method according to claim 1, characterized in that The obtaining of multiple sets of relationship pairs includes: For the mixed ratio of multiple sets of training data of each sub-field dataset and each general dataset, the following operations are performed respectively: Fine-tuning the large model based on a set of training data mixing ratios of the sub-field data sets and the general data sets, wherein the sum of the set of training data mixing ratios is 1; Verifying the fine-tuned large model to obtain a model performance score of the fine-tuned large model; The set of training data mixing ratios and the corresponding model performance scores are taken as a set of relationship pairs.

6. The method according to claim 1, characterized in that After selecting the target data mixing ratio whose model performance score satisfies the preset performance condition from the various data mixing ratios to be predicted, the method further includes: The large model is fine-tuned using the target data mixing ratio.

7. A ratio determination device, characterized in that: include: A processing module is used to classify domain data sets based on the task types of each target domain task under the vertical domain of the big model to obtain each sub-domain data set; A first training module is used to obtain multiple groups of relationship pairs, and based on the multiple groups of relationship pairs, train an initial prediction model to obtain a target prediction model, wherein each group of relationship pairs is composed of a training data mixing ratio of each sub-domain data set and each general data set, and a model performance score corresponding to the training data mixing ratio; A determination module is used to input each mixing ratio of the data to be predicted into the target prediction model, obtain the model performance score corresponding to each mixing ratio of the data to be predicted, and select the target data mixing ratio whose model performance score meets the preset performance conditions from the mixing ratios of the data to be predicted.

8. The device according to claim 7, characterized in that When classifying the domain data sets based on the task types of each target domain task in the vertical domain of the large model to obtain each sub-domain data set, the processing module is also used to: Based on the inclusion relationship between each initial domain task in the vertical domain of the big model, an initial task relationship tree is constructed, wherein each node in the initial task relationship tree represents: a corresponding initial domain task; Pruning the initial task relationship tree to obtain a target task relationship tree, wherein each node in the target task relationship tree represents: a corresponding target domain task; Based on the task types corresponding to the nodes in the target task relationship tree, the domain data sets are classified to obtain sub-domain data sets.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Large model fine adjustment method and device for medical college education scene

    CN120067276A

  • A large model fine-tuning method and device for medical school education scenarios

    CN120067276B

  • Method and device for determining ratio of pre-training data and electronic equipment

    CN120562532A