Training sample acquisition and large scale model optimization training method, and device
A data-driven method for large-scale model optimization through query mining and training sample construction enhances the reasoning ability of large-scale models, addressing their deficiencies in complex tasks and improving accuracy.
Patent Information
- Application Number
- JP2024114396
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-20
- Filing Date
- 2024-07-18
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-07-18
AI Technical Summary
Current large-scale models face deficiencies in handling complex reasoning tasks, necessitating improved training methods to enhance their reasoning abilities.
A data-driven approach involving query mining, problem discovery, training sample construction, and model training to identify and address weaknesses in large-scale models, utilizing training samples of different classes to perform pre-training and supervised fine-tuning (SFT) for optimization.
Enhances the reasoning ability of large-scale models, improving their accuracy and efficiency in handling various query types, thereby supporting real-world applications.
Smart Images

Figure 2024138520000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a method and apparatus for obtaining training samples and optimizing large-scale model training in the fields of large-scale models, deep learning, natural language processing, and the like. [Background technology]
[0002] A large-scale model is a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of natural language text, etc. The emergence of large-scale models can fundamentally change the way humans and machines interact with each other and reconstruct the entire computing ecosystem. Summary of the Invention [Problem to be solved by the invention]
[0003] The present disclosure provides a method and apparatus for obtaining training samples and optimizing large-scale model training. [Means for solving the problem]
[0004] The method for obtaining training samples is as follows: in response to determining that an optimization trigger condition is met, querying as candidate queries queries collected from a given data source that may serve as input to the large-scale model; filtering a target query from the candidate queries, the target query being a query that the large-scale model cannot process correctly; The method includes constructing a corresponding training sample based on each target query, respectively, where the training sample is used to perform optimization training on the large-scale model.
[0005] Large-scale model optimization training methods include obtaining training samples, the training samples being corresponding training samples constructed based on each target query, the target queries being queries that the large-scale model selected from candidate queries cannot process correctly, and the candidate queries being queries collected from a given data source that can be used as input for the large-scale model; and performing optimization training on the large-scale model using the training samples.
[0006] The training sample acquisition device includes a query mining module, a problem discovery module, and a sample construction module; the query mining module is adapted to, in response to determining that an optimization trigger condition is met, generate candidate queries from queries collected from a given data source that may serve as an input for a large-scale model; the problem discovery module is used to filter a target query from the candidate queries, the target query being a query that the large-scale model cannot process correctly; The sample construction module is used to construct corresponding training samples respectively based on each target query, and the training samples are used to perform optimization training on the large-scale model.
[0007] The large-scale model optimization training device includes a sample acquisition module and a model training module; The sample acquisition module is used to acquire training samples, and the training samples are corresponding training samples respectively constructed based on each target query, the target queries are queries that the large-scale model cannot correctly process and are selected from candidate queries, and the candidate queries are queries collected from a predetermined data source that can be used as inputs for the large-scale model; The model training module is used to perform optimal training on the large-scale model using the training samples.
[0008] Electronic devices include: At least one processor; a memory in communication with the at least one processor; The memory stores instructions executable by the at least one processor that, when executed by the at least one processor, cause the at least one processor to perform the method.
[0009] A non-transitory computer readable storage medium having computer instructions stored thereon that cause a computer to perform the method.
[0010] The computer program product comprises computer programs / instructions which, when executed by a processor, implement the method.
[0011] It should be understood that the contents described herein are not intended to identify key or important features of the embodiments of the present disclosure, nor should they be used to limit the scope of the present disclosure. Other features of the present disclosure can be readily understood through the following specification. [Brief description of the drawings]
[0012] The drawings are for a better understanding of the present application and are not intended to limit the present application. [Figure 1] 4 is a flowchart of an embodiment of the training sample acquisition method of the present disclosure. [Diagram 2] 1 is a flowchart of an embodiment of the large-scale model optimization training method of the present disclosure. [Diagram 3] FIG. 1 is a schematic diagram of the overall realization process of the large-scale model optimization training method of the present disclosure. [Figure 4]FIG. 4 is a structural schematic diagram of the training sample obtaining device embodiment 400 of the present disclosure. [Diagram 5] FIG. 5 is a structural schematic diagram of the configuration of the embodiment 500 of the large-scale model optimization training apparatus of the present disclosure. [Figure 6] 6 shows a schematic block diagram of an electronic device 600 in which embodiments of the present disclosure can be implemented. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Hereinafter, exemplary embodiments of the present application will be described based on the drawings. For ease of understanding, various details of the embodiments of the present application are included, and they should be regarded as merely examples. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of simplicity, the following description omits the description of well-known functions and structures.
[0014] Additionally, the term "and / or" in this specification describes only the relation between related objects and indicates that three types of relations can exist, for example, A and / or B can indicate three cases: only A exists, A and B exist simultaneously, or only B exists. It should be understood that the sign " / " generally indicates that the related objects before and after it are in an "or" relationship.
[0015] 1 is a flow chart of the embodiment of the training sample acquisition method of the present disclosure. As shown in FIG. 1, the specific implementation includes:
[0016] In step 101, in response to determining that an optimization trigger condition has been met, queries collected from a given data source that may serve as input to a large-scale model are identified as candidate queries.
[0017] In step 102, a target query is selected from the candidate queries, the target query being a query that the large-scale model cannot process correctly.
[0018] In step 103, based on each target query, a corresponding training sample is constructed respectively, and the training sample is used to perform optimization training for a large-scale model.
[0019] Using the solution described in the embodiment of the above method, candidate queries can be collected, from which target queries that the large-scale model cannot process correctly can be mined; and based on each target query, corresponding training samples can be accurately constructed, thereby improving the quality of the constructed training samples; and when the subsequently constructed training samples are used to perform optimization training on the large-scale model, accurate optimization can be performed on the weaknesses in the large-scale model's reasoning ability, and the optimization effect, etc. can be improved.
[0020] The specific condition of the optimization trigger condition can be determined according to actual needs, and can, for example, refer to periodically executing the method of the embodiment shown in FIG. 1 after a predetermined period of time, or can refer to receiving a trigger command sent by a user, etc.
[0021] In step 101, if it is determined that an optimization trigger condition is met, a query collected from a predetermined data source that can be an input of a large-scale model can be set as a candidate query. The candidate query can be obtained by query mining (also called inference demand mining, etc.). The specific data source to be included in the predetermined data source can be determined according to actual needs, and can include, for example, product logs, public evaluation sets, open data sets, the Internet, etc.
[0022] In step 102, a target query can be selected from the obtained candidate queries, the target query being a query that the large-scale model cannot process correctly, and the large-scale model refers to a large-scale model that needs to be optimized and trained according to the method of the present disclosure. The large-scale model can also refer to an original large-scale model obtained by pre-training+supervised fine-tuning (SFT) training, or a large-scale model after one or more optimization trainings are performed on the original large-scale model.
[0023] Preferably, when filtering a target query from a candidate query, the following process can be performed for any candidate query, in which the candidate query is used as an input to a large-scale model, a response corresponding to the candidate query generated by the large-scale model is obtained, and in response to determining that the response is an error response that does not match the candidate query, the candidate query is used as a filtered target query.
[0024] That is, for each candidate query, a corresponding answer can be generated using the large-scale model, and if the generated answer is determined to be an error answer, the candidate query can be determined as the target query. That is, the large-scale model's own capabilities can be used to assist in the effectiveness evaluation and to discover weaknesses in the current reasoning capabilities.
[0025] Preferably, for any candidate query, the candidate query and the corresponding reply can be input into a pre-trained evaluation model, and an evaluation result can be obtained as to whether the reply output by the evaluation model matches the candidate query.
[0026] For example, for a candidate query a, a response a corresponding to the candidate query a is generated using a large-scale model, and then the candidate query a and the response a are input into an evaluation model to obtain an evaluation result of whether the response a output by the evaluation model matches the candidate query a. If the evaluation result shows that the response a does not match the candidate query a, the candidate query a can be selected as the target query.
[0027] The evaluation model may be obtained by training using a large number of training samples that have been constructed in advance. Accordingly, the evaluation model can quickly obtain the evaluation results outputted by the evaluation model, and the evaluation model is obtained by training using a large number of training samples, thereby ensuring the accuracy of the evaluation results outputted.
[0028] In practical applications, for example, assuming that the number of candidate queries is 1000, the number of target queries may be 300, and so on, each target query can be used to construct an error question set.
[0029] Furthermore, in step 103, for each target query in the error question set, a corresponding training sample can be constructed respectively.
[0030] Wherein, preferably, for any target query, the following processing can be performed, which includes determining a problem type corresponding to the target query, determining a sample type corresponding to the problem type, and constructing training samples of the sample type based on the target query.
[0031] Through the above process, corresponding training samples can be accurately constructed for different target queries, and the optimization training effect of subsequent models can be improved.
[0032] Wherein, preferably, the problem types may include data overwrite problems, model capability problems, and data quality problems. Accordingly, for any target query, a manner of determining a problem type corresponding to the target query may include: searching a training sample set, the training sample set including training samples used when performing SFT training on a large-scale model (which may include training samples for SFT training every time); in response to a training sample matching the target query not being detected, determining that the problem type corresponding to the target query is a data overwrite problem; and in response to a training sample matching the target query being searched, determining whether the problem type corresponding to the target query is a model capability problem or a data quality problem through a context learning (ICL) manner.
[0033] For any target query, a training sample set can be first searched to determine whether there is a training sample matching the target query in the training sample set, where the training sample matching the target query can refer to a training sample that is completely identical to the target query, or can also refer to a training sample whose similarity to the target query is greater than a predetermined threshold, and the specific value of the predetermined threshold can be determined according to actual needs. If it is determined that there is no training sample matching the target query in the training sample set, it can be determined that the problem type corresponding to the target query is a data overwrite problem; conversely, the ICL method can further determine whether the problem type corresponding to the target query is a model capability problem, and if it is not a model capability problem, it can be determined that the problem type corresponding to the target query is a data quality problem.
[0034] Preferably, the sample types include a first type of training samples and a second type of training samples, in which the first type of training samples are training samples for performing pre-training, and the second type of training samples are training samples for performing SFT training. Accordingly, for any target query, the manner of determining a sample type corresponding to a problem type of the target query can include: determining that the sample type is a first type of training sample in response to determining that the problem type is a model capability problem; and determining that the sample type is a second type of training sample in response to determining that the problem type is a data overwrite problem or a data quality problem.
[0035] That is, for model capability issues, a first type of training sample can be constructed and used to perform pre-training on a large-scale model; for data quality issues or data overwrite issues, a second type of training sample can be constructed and used to perform SFT training on a large-scale model.
[0036] Through the above process, it is possible to realize the discovery of multi-dimensional problems such as data overwriting problems, data quality problems, and model capability problems, and for different types of problems, it is possible to accurately construct corresponding types of training samples respectively, and further to improve the optimization training effect of subsequent models, etc.
[0037] There is no limitation on how to construct the training sample corresponding to each target query. For example, for any target query, the following possible implementation can be used to construct the corresponding training sample: search for the answer corresponding to the target query from the Internet, and further obtain queries similar to the target query from the Internet, obtain the corresponding answer, and then construct the training sample according to the obtained content.
[0038] Based on the training samples constructed in step 103, optimization training can be performed on the large-scale model.
[0039] Preferably, a first type of training sample can be used to perform pre-training on a large-scale model to obtain a first model, and then a second type of training sample can be used to perform SFT training on the first model to obtain a second model, and the second model can be used to perform actual reasoning applications; or the first type of training sample can be used to perform pre-training on a large-scale model, and the second type of training sample can be used to perform SFT training on the large-scale model, respectively; after the SFT training is completed to obtain a third model, in response to the pre-training not being completed, the third model is used to perform actual reasoning applications; in response to the pre-training being completed, a first model is obtained, and a second type of training sample can be used to perform SFT training on the first model to obtain a second model, and the second model is used to replace the third model to perform actual reasoning applications.
[0040] That is, for the large-scale model to be optimized, first, the first type of training sample can be used to perform pre-training on it, and after the pre-training is completed, the second type of training sample can be used to perform SFT training on the large-scale model, and then the actual reasoning application can be performed on the large-scale model after SFT training. However, in actual applications, the pre-training time is usually long. If the pre-training and SFT training are completed before performing the actual reasoning application on the large-scale model, the large-scale model will be completely unusable for a long time, which will affect the normal processing of business, etc. In order to overcome this problem, the first type of training sample can be used to perform pre-training on the large-scale model, and the second type of training sample can be used to perform SFT training on the large-scale model. Since the time of SFT training is relatively short, the large-scale model after SFT training can be used first to perform the actual reasoning application, so as to avoid affecting the normal processing of business for a long time. Then, after the pre-training is completed, the second type of training sample can be used to perform SFT training on the large-scale model after pre-training to obtain the large-scale model required for this optimization training, and the large-scale model after SFT training can be replaced for the actual reasoning application.
[0041] In practical applications, when the first type of training sample or the second type of training sample is used to train a large-scale model, other training samples can be further combined. For example, take pre-training as an example, and further combine the training samples used in previous pre-training to perform this pre-training, thereby improving the training effect, etc.
[0042] In addition, preferably, before selecting a target query from the candidate queries in step 102, the query type of each candidate query can be determined, i.e., demand classification can be performed; and after selecting a target query from the candidate queries accordingly, the number of target queries belonging to different query types can be calculated, and the processing capabilities of the large-scale model for different query types can be determined based on the statistical results.
[0043] The specific types of query types may be determined according to actual needs, and may include, for example, common sense reasoning, mathematical calculation, question and answer, and code generation.
[0044] How to determine the query type of each candidate query is not limited, and can be determined, for example, by using a pre-trained classification model. Accordingly, by collecting statistics on the number of target queries belonging to different query types, the processing capabilities of the large-scale model for different query types can be determined, i.e., for which / what query types the large-scale model has low processing capabilities, and weaknesses in the reasoning capabilities of the large-scale model can be found.
[0045] Preferably, after performing optimization training on the large-scale model using the training sample described in step 103, the large-scale model after optimization training can be further tested using test queries respectively corresponding to different query types, and the processing capabilities of the large-scale model after optimization training for different query types can be determined based on the test results.
[0046] For example, a test query can be used as input to the large-scale model after optimization training, and a corresponding response output by the large-scale model can be obtained. Furthermore, the test query and the corresponding response can be input to an evaluation model, and an evaluation result of whether the test query output by the evaluation model matches the corresponding response can be obtained. Furthermore, the evaluation result can be used as a test result. The test results can be combined to determine the processing capability of the large-scale model for different query types after optimization training. Furthermore, it can be determined in what aspects the large-scale model has improved after optimization training, thereby realizing verification of the optimization training effect, etc.
[0047] 2 is a flow chart of an embodiment of the large-scale model optimization training method of the present disclosure. As shown in FIG. 2, the specific implementation manner includes:
[0048] In step 201, training samples are obtained, the training samples being corresponding training samples respectively constructed based on each target query, the target queries being queries that the large-scale model cannot process correctly selected from candidate queries, and the candidate queries being queries collected from a given data source that can be used as input for the large-scale model.
[0049] In step 202, the training samples are used to perform optimization training on a large scale model.
[0050] Current large-scale models still have certain shortcomings when processing reasoning tasks, so how to improve the reasoning ability of large-scale models, especially their complex reasoning ability, is an urgent problem that needs to be solved.
[0051] The solution described in the embodiment of the above method provides a data-driven large-scale model self-evolution method, which can realize the optimized training of the large-scale model through operations such as query mining, problem discovery, training sample construction, and model training, thereby improving the reasoning ability of the large-scale model, and accordingly, using the large-scale model to carry out actual reasoning applications can improve the accuracy of the reasoning results, etc.
[0052] The training samples obtained in step 201 may be training samples constructed by the embodiment method shown in FIG.
[0053] Preferably, the training samples may include a first type of training samples and a second type of training samples. Accordingly, in step 202, the manner of using the training samples to perform optimization training on the large-scale model may include: using the first type of training samples to perform pre-training on the large-scale model to obtain a first model; using the second type of training samples to perform SFT training on the first model to obtain a second model; and using the second model to perform actual reasoning application; or respectively using the first type of training samples to perform pre-training on the large-scale model and the second type of training samples to perform SFT training on the large-scale model; after the SFT training is completed to obtain a third model, in response to the pre-training not being completed, in response to the pre-training being completed, obtaining a first model, using the second type of training samples to perform SFT training on the first model to obtain a second model, and using the second model to replace the third model to perform actual reasoning application.
[0054] That is, for the large-scale model to be optimized, first, the first type of training sample can be used to perform pre-training on it, and after the pre-training is completed, the second type of training sample can be used to perform SFT training on the large-scale model, and then the actual reasoning application can be performed on the large-scale model after SFT training. However, in actual applications, the pre-training time is usually long. If the pre-training and SFT training are completed before performing the actual reasoning application on the large-scale model, the large-scale model will be completely unusable for a long time, which will affect the normal processing of business, etc. In order to overcome this problem, the first type of training sample can be used to perform pre-training on the large-scale model, and the second type of training sample can be used to perform SFT training on the large-scale model. Since the time of SFT training is relatively short, the large-scale model after SFT training can be used first to perform the actual reasoning application, so as to avoid affecting the normal processing of business for a long time. Then, after the pre-training is completed, the second type of training sample can be used to perform SFT training on the large-scale model after pre-training to obtain the large-scale model required for this optimization training, and the large-scale model after SFT training can be replaced for the actual reasoning application.
[0055] In addition, preferably, after performing optimization training on the large-scale model using the training sample described in step 202, the large-scale model after optimization training can be further tested using test queries respectively corresponding to different query types, and the processing capabilities of the large-scale model after optimization training for different query types can be determined based on the test results.
[0056] For example, a test query can be used as input to the large-scale model after optimization training, and a corresponding response output by the large-scale model can be obtained. Furthermore, the test query and the corresponding response can be input to an evaluation model, and an evaluation result of whether the test query output by the evaluation model matches the corresponding response can be obtained. Furthermore, the evaluation result can be used as a test result. The test results can be combined to determine the processing capability of the large-scale model for different query types after optimization training. Furthermore, it can be determined in what aspects the large-scale model has improved after optimization training, thereby realizing verification of the optimization training effect, etc.
[0057] Combining the above description, Figure 3 is a schematic diagram of the overall implementation process of the large-scale model optimization training method of the present disclosure. As shown in Figure 3, demand classification therein refers to respectively determining the query type of each candidate query, and command search refers to respectively searching the training sample set for each target query to determine the problem type of each target query, and the large-scale model after optimization training can be used to generate new product logs in the data source, and can be used for target query selection for the next optimization training, etc. For the specific implementation of each step shown in Figure 3, please refer to the above related description, and the description will be omitted here.
[0058] It should also be noted that the query in the solution described in the present disclosure is usually in text format, and the query may be a problem, i.e., a problem in text format for inputting into the large-scale model. In the solution described in the present disclosure, queries that can be input into the large-scale model in text format from a given data source can be collected as candidate queries, and preferably, the candidate queries should include queries of different query types as much as possible, such as queries of common sense reasoning, mathematical calculation, question and answer, and code generation, etc., and then, target queries that the large-scale model cannot process correctly can be selected from the candidate queries in text format, and further, corresponding training samples can be respectively constructed based on each target query in text format, and further, the constructed training samples can be used to perform optimization training on the large-scale model, and accordingly, for the inputted text format query, the large-scale model after optimization training can provide a more accurate answer.
[0059] For the sake of simplicity, the embodiments of the above methods are described as a combination of a series of operations, but those skilled in the art should recognize that the present disclosure is not limited by the described operation sequence, since some steps may use other sequences or may be performed simultaneously according to the present disclosure. Next, all of the embodiments described herein belong to preferred embodiments, and the related operations and modules are not necessarily essential to the present disclosure. In addition, some embodiments may not have detailed parts, and the relevant descriptions in other embodiments may be referred to.
[0060] The above is a description of a method embodiment, and the following will further illustrate the solution described in this disclosure through an apparatus embodiment.
[0061] 4 is a structural schematic diagram of the configuration of the embodiment 400 of the training sample obtaining device of the present disclosure. As shown in FIG. 4, it includes a query mining module 401, a problem finding module 402, and a sample building module 403.
[0062] The query mining module 401 is used to generate candidate queries, collected from predetermined data sources, that can serve as inputs for a large-scale model, in response to determining that an optimization trigger condition is met.
[0063] The problem discovery module 402 is used to filter target queries from the candidate queries, where the target queries are queries that the large-scale model cannot handle correctly.
[0064] The sample construction module 403 is used to construct corresponding training samples respectively based on each target query, and the training samples are used to perform optimization training for the large-scale model.
[0065] Using the solution described in the above-mentioned device embodiment, candidate queries can be collected, from which target queries that the large-scale model cannot process correctly can be mined; and based on each target query, corresponding training samples can be accurately constructed, thereby improving the quality of the constructed training samples; and when the subsequently constructed training samples are used to perform optimization training on the large-scale model, accurate optimization can be performed on the weaknesses in the large-scale model's reasoning ability, thereby improving the optimization effect, etc.
[0066] If it is determined that the optimization trigger condition is met, the query mining module 401 may obtain candidate queries from queries collected from a predetermined data source that may be an input for a large-scale model. The candidate queries may be obtained through query mining (or inference demand mining, etc.).
[0067] For the obtained candidate queries, the problem discovery module 402 can filter out target queries therefrom, which are queries that the large-scale model cannot process correctly.
[0068] Preferably, when filtering a target query from candidate queries, the problem discovery module 402 can perform the following process for any candidate query, respectively, by taking the candidate query as an input to a large-scale model, obtaining a response corresponding to the candidate query generated by the large-scale model, and, in response to determining that the response is an error response that does not match the candidate query, taking the candidate query as a filtered target query.
[0069] Preferably, for any candidate query, the problem discovery module 402 can input the candidate query and the corresponding answer into a pre-trained evaluation model, and obtain an evaluation result whether the answer output by the evaluation model matches the candidate query.
[0070] Furthermore, the sample construction module 403 constructs corresponding training samples respectively based on each target query.
[0071] Preferably, for any target query, the sample construction module 403 can perform the following processes, respectively: determine a problem type corresponding to the target query, determine a sample type corresponding to the problem type, and construct training samples of the sample type based on the target query.
[0072] Wherein, preferably, the problem types may include data overwrite problem, model capability problem, and data quality problem. Accordingly, for any target query, the manner in which the sample construction module 403 determines the problem type corresponding to the target query may include: searching a training sample set, the training sample set including training samples used when performing SFT training on a large-scale model; in response to no training sample matching the target query being found, determining that the problem type corresponding to the target query is a data overwrite problem; and in response to a training sample matching the target query being found, determining through an ICL manner whether the problem type corresponding to the target query is a model capability problem or a data quality problem.
[0073] Preferably, the sample types include a first type of training samples and a second type of training samples, in which the first type of training samples are training samples for performing pre-training, and the second type of training samples are training samples for performing SFT training. Accordingly, for any target query, the manner in which the sample construction module 403 determines a sample type corresponding to the problem type of the target query can include: determining that the sample type is a first type of training sample in response to determining that the problem type is a model capability problem; and determining that the sample type is a second type of training sample in response to determining that the problem type is a data overwrite problem or a data quality problem.
[0074] That is, for model capability problems, a first type of training sample can be constructed, and for data quality problems or data overwriting problems, a second type of training sample can be constructed.
[0075] In addition, preferably, before filtering out target queries from the candidate queries, the query mining module 401 can further determine the query type of each candidate query, and accordingly, after filtering out target queries from the candidate queries, the problem discovery module 402 can further calculate statistics on the number of target queries belonging to different query types, and can further determine the processing capabilities of large-scale models for different query types based on the statistical results.
[0076] 5 is a structural schematic diagram of the configuration of the embodiment 500 of the large-scale model optimization training apparatus of the present disclosure. As shown in FIG. 5, it includes a sample acquisition module 501 and a model training module 502.
[0077] The sample acquisition module 501 is used to acquire training samples, which are corresponding training samples respectively constructed based on each target query, the target queries are queries that the large-scale model cannot process correctly selected from the candidate queries, and the candidate queries are queries collected from a certain data source that can be used as input for the large-scale model.
[0078] The model training module 502 is used to perform optimal training on a large-scale model using the training samples.
[0079] The solution described in the above-mentioned device embodiment provides a data-driven large-scale model self-evolution method, which can realize the optimized training of the large-scale model through operations such as query mining, problem discovery, training sample construction, and model training, thereby improving the reasoning ability of the large-scale model, and accordingly, using the large-scale model to carry out actual reasoning applications can improve the accuracy of the reasoning results, etc.
[0080] Preferably, the training samples include a first type of training samples and a second type of training samples. Accordingly, the model training module 502 can use the first type of training samples to pre-train a large-scale model to obtain a first model, use the second type of training samples to perform SFT training on the first model to obtain a second model, and use the second model to perform actual reasoning application; or can use the first type of training samples to pre-train a large-scale model and use the second type of training samples to perform SFT training on the large-scale model respectively; after the SFT training is completed to obtain a third model, in response to the pre-training not being completed, use the third model to perform actual reasoning application; in response to the pre-training being completed, obtain a first model, use the second type of training samples to perform SFT training on the first model to obtain a second model, and use the second model to replace the third model to perform actual reasoning application.
[0081] In addition, preferably, after performing optimization training on the large-scale model using the training samples, the model training module 502 can further test the large-scale model after optimization training using test queries corresponding to different query types, and determine the processing capabilities of the large-scale model after optimization training for different query types based on the test results.
[0082] For the specific workflow of the device embodiment shown in FIG. 4 and FIG. 5, reference may be made to the relevant description of the method embodiment described above, and the description will be omitted here.
[0083] In other words, the solution described in the present disclosure can realize the self-evolution of large-scale model reasoning capabilities based on data-driven and model closed-loop iteration, improve the reasoning capabilities of large-scale models, and further improve the accuracy of reasoning results, etc.
[0084] The solutions described in this disclosure relate to the field of artificial intelligence technology, and can be particularly applied to fields such as large-scale models, deep learning, and natural language processing. Artificial intelligence is a discipline that studies the simulation of certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.) by computers, and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing, while artificial intelligence software technologies mainly include several directions such as computer vision technology, speech recognition technology, natural language processing technology, and machine learning / deep learning, big data processing technology, and knowledge graph technology.
[0085] The data in the above embodiments of the present disclosure is not for a specific user, and does not reflect the personal information of a specific user. In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and other processing of relevant user personal information all comply with relevant laws and regulations and do not violate public order and morals.
[0086] According to an embodiment of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium, and a computer program product.
[0087] 6 shows a schematic block diagram of an electronic device 600 for implementing an embodiment of the present disclosure. The electronic device is intended to represent various types of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various types of mobile devices, such as personal digital assistants, mobile phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the practice of the present disclosure as described herein and / or claimed herein.
[0088] 6, the device 600 includes a computing unit 601, which can perform various appropriate operations and processes based on a computer program stored in a read-only memory (ROM) 602 or loaded from a storage unit 608 into a random access memory (RAM) 603. The RAM 603 can also store various programs and data required for the device 600 to operate. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0089] Several components in device 600 are connected to an I / O interface 605, including input units 606 such as a keyboard, mouse, etc., output units 607 such as various types of displays, speakers, etc., storage units 608 such as a disk, optical disk, etc., and communication units 609 such as a network card, modem, wireless communication transceiver, etc. The communication units 609 enable device 600 to exchange information / data with other devices via a computer network, such as the Internet, and / or various telecommunication networks.
[0090] The computing unit 601 is a general-purpose and / or dedicated processing component with various processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, computing units that execute various machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 executes various methods and processes described above, such as the methods described in this disclosure. For example, in some embodiments, the methods described in this disclosure can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, some or all of the computer program is loaded and / or installed in the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, it can perform one or more steps of the methods described in this disclosure above. Alternatively, in other embodiments, the computing unit 601 can be configured to execute the methods described in this disclosure via any other suitable manner (e.g., by firmware).
[0091] Various implementations of the systems and techniques described herein may be realized in digital electronic circuitry systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on a chip systems (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include being implemented in one or more computer programs that may be executed and / or interpreted by a programmable system that includes at least one programmable processor, which may be a special purpose or general purpose programmable processor, and that may receive data and instructions from and transmit data and instructions to a storage system, at least one input device, and at least one output device.
[0092] The program codes for implementing the methods of the present disclosure can be written using any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general purpose computer, a special purpose computer, or other programmable data processing apparatus such that the functions / operations specified in the flowcharts and / or block diagrams are implemented when the program codes are executed by the processor or controller. The program codes can be executed entirely on the machine, partially on the machine, partially on the machine as a separate software package and partially on a remote machine, or entirely on a remote machine or server.
[0093] In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use with or in combination with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium includes, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the above. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
[0094] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user, and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other types of devices can also be used to provide interaction with a user, for example, feedback provided to the user can be any form of sensing feedback (e.g., visual feedback, auditory feedback, or haptic feedback) and can receive input from the user in any form (including acoustic input, speech input, and haptic input).
[0095] The systems and techniques described herein may be implemented in a computing system including a back-end component (e.g., a data server), or a computing system including a middleware component (e.g., an application server), or a computing system including a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user interacts with an implementation of the systems and techniques described herein), or in a computing system including any combination of such back-end, middleware, and front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0096] The computer system may include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship between the client and the server is created by computer programs running on corresponding computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server for combining blockchains.
[0097] It should be understood that steps can be rearranged, added, or deleted using various types of flows shown above. For example, each step described in the present disclosure can be performed in parallel, sequentially, or in a different order, but is not limited herein as long as the technical solution disclosed in the present disclosure can achieve the desired results.
[0098] The above specific implementation methods do not constitute a limitation of the protection scope of the present disclosure. Those skilled in the art can make various modifications, combinations, subcombinations, and substitutions based on design requirements and other factors. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present disclosure should be included in the protection scope of the present disclosure.
Claims
1. A method for obtaining training samples, comprising the steps of: in response to determining that an optimization trigger condition is met, query candidates are queries collected from predefined data sources that may serve as inputs to the large-scale model; filtering a target query from the candidate queries, the target query being a query that the large-scale model cannot process correctly; constructing corresponding training samples based on each target query, respectively, the training samples being used to perform optimization training on the large-scale model; How to obtain training samples.
2. The step of selecting a target query from the candidate queries includes: For each of the candidate queries, The process includes: serving the candidate query as an input to the large-scale model; obtaining a response generated by the large-scale model corresponding to the candidate query; and, in response to determining that the response is an error response that does not match the candidate query, serving the candidate query as a filtered target query. The method for obtaining training samples according to claim 1 .
3. Responding to determining that the response is an error response that does not match the candidate query includes: inputting the candidate query and the answer into a pre-trained evaluation model, and obtaining an evaluation result of whether the answer output by the evaluation model matches the candidate query; The method for obtaining training samples according to claim 2 .
4. Constructing a corresponding training sample based on each target query, respectively, comprises: For any target query, performing the following steps: The process includes determining a problem type corresponding to the target query, determining a sample type corresponding to the problem type, and constructing training samples of the sample type based on the target query. The method for obtaining training samples according to any one of claims 1 to 3.
5. the problem types include data overwrite problems, model capability problems, and data quality problems; Determining a problem type corresponding to the target query includes: retrieving a training sample set, the training sample set including training samples used in supervised fine-tuning training of the large-scale model; determining, in response to no training samples being found that match the target query, that a problem type corresponding to the target query is the data overwrite problem; in response to retrieving training samples matching the target query, determining whether a problem type corresponding to the target query is the model capability problem or the data quality problem through a context learning manner. The method for obtaining training samples according to claim 4.
6. The sample types include a first type of training sample and a second type of training sample, the first type of training sample is a training sample for performing pre-training, and the second type of training sample is a training sample for performing supervised fine-tuning training; The step of determining a sample type corresponding to the question type comprises: determining, in response to the problem type being determined to be the model capability problem, that the sample type is the first class of training samples; in response to determining that the problem type is the data overwriting problem or the data quality problem, determining that the sample type is the second class of training samples. The method for obtaining training samples according to claim 5.
7. determining a query type of each of the candidate queries prior to selecting a target query from the candidate queries; After selecting a target query from the candidate queries, the method further includes: collecting statistics on the number of target queries belonging to different query types; and determining processing capabilities of the large-scale model for different query types based on the statistical results. The method for obtaining training samples according to any one of claims 1 to 3.
8. 1. A large scale model optimization training method, comprising: obtaining training samples, the training samples being corresponding training samples constructed based on each target query, the target queries being queries that the large-scale model selected from candidate queries cannot correctly process, the candidate queries being queries collected from a predetermined data source that can be used as input for the large-scale model; and optimizing training the large-scale model using the training samples. Large-scale model optimization training methods.
9. The training samples include a first type of training samples and a second type of training samples, The step of optimizing training the large-scale model using the training samples includes the steps of: pre-training the large-scale model using the training samples of the first class to obtain a first model; performing supervised fine-tuning training on the first model using the training samples of the second class to obtain a second model; and using the second model to perform actual reasoning applications; or pre-training the large-scale model using the training samples of the first class and performing supervised fine-tuning training on the large-scale model using the training samples of the second class, and after the supervised fine-tuning training is completed to obtain a third model, in response to the pre-training not being completed, performing actual reasoning applications using the third model; and in response to the pre-training being completed, obtaining the first model, performing supervised fine-tuning training on the first model using the training samples of the second class to obtain a second model, and using the second model to replace the third model to perform actual reasoning applications.
9. The large scale model optimization training method of claim 8.
10. After the step of optimizing and training the large-scale model using the training samples, the step of testing the large-scale model after the optimization training using test queries respectively corresponding to different query types, and determining processing capabilities of the large-scale model after the optimization training for the different query types based on the test results.
10. The large scale model optimization training method according to claim 8 or 9.
11. A training sample acquisition device, comprising: Including a query mining module, a problem discovery module, and a sample construction module; the query mining module is adapted to, in response to determining that an optimization trigger condition is met, generate candidate queries from queries collected from predefined data sources that may serve as inputs for a large-scale model; the problem discovery module is used to screen a target query from the candidate queries, the target query being a query that the large-scale model cannot process correctly; The sample construction module is used to construct a corresponding training sample based on each target query, and the training sample is used to perform optimization training on the large-scale model. Training sample acquisition device.
12. The problem discovery module performs the following operations for each candidate query, the operations including: taking the candidate query as an input to the large-scale model; obtaining a response corresponding to the candidate query generated by the large-scale model; and, in response to determining that the response is an error response that does not match the candidate query, taking the candidate query as a selected target query. The training sample obtaining device according to claim 11.
13. The problem discovery module inputs the candidate query and the answer into a pre-trained evaluation model, and obtains an evaluation result of whether the answer output by the evaluation model matches the candidate query. The training sample obtaining device according to claim 12.
14. The sample construction module performs, for any target query, the following processes, respectively: determining a problem type corresponding to the target query; determining a sample type corresponding to the problem type; and constructing training samples of the sample type based on the target query; A training sample obtaining device according to any one of claims 11 to 13.
15. the problem types include data overwrite problems, model capability problems, and data quality problems; The sample construction module searches for a training sample set for each target query, the training sample set including training samples used in performing supervised fine-tuning training on the large-scale model; in response to no training sample matching the target query being found, the sample construction module determines that the problem type corresponding to the target query is the data overwriting problem; in response to a training sample matching the target query being found, the sample construction module determines through a context learning manner whether the problem type corresponding to the target query is the model capability problem or the data quality problem. The training sample obtaining device according to claim 14.
16. The sample types include a first type of training sample and a second type of training sample, the first type of training sample is a training sample for performing pre-training, and the second type of training sample is a training sample for performing supervised fine-tuning training; the sample construction module determines, in response to the problem type being determined to be the model capability problem, that the sample type is the first class of training samples, and in response to the problem type being determined to be the data overwrite problem or the data quality problem, that the sample type is the second class of training samples. The training sample obtaining device according to claim 15.
17. the query mining module is further adapted to respectively determine a query type for each candidate query; The problem discovery module is further used for respectively collecting statistics on the number of target queries belonging to different query types, and determining the processing capabilities of the large-scale model for different query types based on the statistical results. A training sample obtaining device according to any one of claims 11 to 13.
18. 1. A large scale model optimization training apparatus, comprising: It includes a sample acquisition module and a model training module. The sample acquisition module is used to acquire training samples, and the training samples are corresponding training samples respectively constructed based on each target query, and each target query is a query that the large-scale model cannot correctly process, selected from candidate queries, and the candidate queries are queries collected from a predetermined data source that can be an input for the large-scale model; The model training module is used to perform optimization training on the large-scale model using the training samples. Large-scale model optimization training device.
19. The training samples include a first type of training samples and a second type of training samples, the model training module performs pre-training on the large-scale model using the first type of training samples to obtain a first model, performs supervised fine-tuning training on the first model using the second type of training samples to obtain a second model, and performs actual reasoning application using the second model; or performs pre-training on the large-scale model using the first type of training samples and performs supervised fine-tuning training on the large-scale model using the second type of training samples, respectively, and after the supervised fine-tuning training is completed to obtain a third model, in response to the pre-training not being completed, performs actual reasoning application using the third model; and in response to the pre-training being completed, obtains the first model, performs supervised fine-tuning training on the first model using the second type of training samples to obtain a second model, and uses the second model to replace the third model in the actual reasoning application.
20. A large scale model optimization training apparatus according to claim 18.
20. The model training module is further used for performing optimization training on the large-scale model using the training samples, and then testing the large-scale model after optimization training using test queries respectively corresponding to different query types, and determining processing capabilities of the large-scale model after optimization training for the different query types based on the test results.
20. A large scale model optimization training apparatus according to claim 18 or 19.
21. An electronic device, At least one processor; a memory in communication with the at least one processor; The memory stores instructions executable by the at least one processor, the instructions, when executed by the at least one processor, causing the at least one processor to perform a method according to any one of claims 1, 2, 3, 8 or 9. electronic equipment.
22. A non-transitory computer-readable storage medium having computer instructions stored thereon, comprising: The computer instructions cause a computer to carry out a method according to any one of claims 1, 2, 3, 8 or 9. A non-transitory computer-readable storage medium.
23. A computer program comprising: The computer program, when executed by a processor, implements the method according to any one of claims 1 to 3. Computer program.
Citation Information
Patent Citations
Generative large language model training method and model-based search method
CN116226334A
Model training method and device suitable for large language model, equipment and medium
CN116976424A
Neural network system, machine learning method, and program
WO2019031305A1
