Large model training method and device, electronic equipment, storage medium and program product

By screening and fine-tuning training Q&A pairs, the big model training method solves the problem of low processing efficiency of computer equipment, improves the utilization of computing resources, and is suitable for model fine-tuning in specific industries or fields.

CN119293500APending Publication Date: 2025-01-10CHINA UNITED NETWORK COMM GRP CO LTD +2
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411312091.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In the prior art, the training and development of large models has problems such as low processing efficiency of computer equipment and waste of computing resources, especially in the fine-tuning training process of specific industries or fields.

Method used

By obtaining knowledge corpus and converting it into question-and-answer pairs, filtering out test answers with wrong answers, creating training question-and-answer pairs, fine-tuning training of the trained big models, improving processing efficiency and saving computing resources.

Benefits of technology

It improves the processing efficiency of computer equipment, saves computing resources, and is suitable for fine-tuning training of large models in specific industries or fields, improving the performance capabilities of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293500A_ABST
    Figure CN119293500A_ABST
Patent Text Reader

Abstract

The invention provides a large model training method and device, electronic equipment, a storage medium and a program product. The method comprises the following steps: according to a preset role cue word, a conversion cue word, a standardized cue word and a reply cue word, converting a knowledge corpus into a plurality of question and answer pairs; sequentially inputting a plurality of standard questions in the plurality of question and answer pairs into the to-be-trained large model to output a plurality of test answers corresponding to the plurality of standard questions; according to a preset evaluation prompt word and a plurality of standard answers corresponding to the plurality of standard questions, respectively evaluating the plurality of test answers to obtain a plurality of evaluation results; screening out all test answers of which the evaluation results are wrong answers, and storing question-answer pairs to which standard questions corresponding to the test answers belong to a training question-answer pair set; performing fine tuning training on the to-be-trained large model by adopting the training question and answer pair set to obtain a trained large model; and storing the trained large model as a target large model. The processing efficiency of the computer equipment can be improved, and computing resources are saved.
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, and in particular to a large model training method, device, electronic device, storage medium and program product. Background Art

[0002] The open-source general-purpose large-scale model technology has developed rapidly, showing strong generalization and generalization capabilities. These large-scale models have achieved remarkable results in many fields such as natural language processing and image recognition.

[0003] At present, when developing large models for specific industries or scenarios, the full amount of industry or field data is generally used to fine-tune and train the large models on computer equipment.

[0004] However, in the existing technology, the training and development of large models has the problems of low processing efficiency of computer equipment and waste of computing resources. Summary of the invention

[0005] The present application provides a large model training method, device, electronic device, storage medium and program product to solve the technical problems of low processing efficiency of computer equipment and waste of computing resources in the prior art.

[0006] In a first aspect, the present application provides a large model training method, comprising:

[0007] Acquire knowledge corpus;

[0008] According to preset role prompt words, conversion prompt words, standardization prompt words and reply prompt words, the knowledge corpus is converted into a plurality of question-answer pairs, wherein each question-answer pair includes a standard question and a standard answer corresponding to the standard question;

[0009] Inputting multiple standard questions in the multiple question-answer pairs into the large model to be trained in sequence to output multiple test answers corresponding to the multiple standard questions;

[0010] According to the preset evaluation prompt words and the multiple standard answers corresponding to the multiple standard questions, the multiple test answers are evaluated respectively to obtain multiple evaluation results;

[0011] Filter out all test answers whose evaluation results are incorrect, and save the question-answer pairs to which the standard questions corresponding to the test answers belong into a training question-answer pair set;

[0012] Using the training question-answer pair set to fine-tune the large model to be trained to obtain a trained large model;

[0013] The trained large model is saved as the target large model.

[0014] Optionally, the method as described above, wherein the knowledge corpus is converted into multiple question-answer pairs according to preset role prompts, conversion prompts, standardization prompts and reply prompts, comprises: inputting the preset role prompts into a preset auxiliary big model to set the role of the preset auxiliary big model; inputting the preset conversion prompts and the knowledge corpus into the preset auxiliary big model to output multiple questions corresponding to the knowledge corpus; inputting the preset standardization prompts and the multiple questions into the preset auxiliary big model for standardization processing to output multiple standard questions; inputting the preset reply prompts, the multiple standard questions and the knowledge corpus into the preset auxiliary big model to output multiple question-answer pairs.

[0015] Optionally, the method as described above, wherein the multiple test answers are evaluated respectively according to preset evaluation prompt words and the multiple standard answers corresponding to the multiple standard questions to obtain multiple evaluation results, including: for each question and answer pair of the multiple question and answer pairs, the standard questions of the question and answer pair, the standard answers corresponding to the standard questions, and the test answers corresponding to the standard questions are created as triples to obtain multiple triples; and the preset evaluation prompt words and the multiple triples are input into a preset auxiliary large model to output multiple evaluation results.

[0016] Optionally, the method as described above, wherein the preset evaluation prompt words and the multiple triples are input into a preset auxiliary large model to output multiple evaluation results, includes: traversing the multiple triples in sequence, and performing the following steps for the traversed triples: using the preset auxiliary large model, and according to the preset evaluation prompt words, calculating the correlation between the test answers and the standard answers in the triples; through the preset auxiliary large model, if it is determined that the correlation reaches a preset correlation threshold, then generating an evaluation result with a correct answer; if it is determined that the correlation does not reach the preset correlation threshold, then generating an evaluation result with an incorrect answer.

[0017] Optionally, the method as described above, wherein the use of the training question-answer pair set to fine-tune the large model to be trained to obtain a trained large model, includes: configuring the batch size, learning rate and number of training rounds of the large model to be trained according to preset hyperparameters; inputting the training question-answer pair set into the large model to be trained; and using a low-order adaptive algorithm to fine-tune the large model to be trained according to the batch size and learning rate until the number of training rounds reaches the number of training rounds to obtain a trained large model.

[0018] Optionally, in the method described above, the preset auxiliary large model has logical reasoning capabilities.

[0019] In a second aspect, the present application provides a large model training device, comprising:

[0020] Acquisition module, used to acquire knowledge corpus;

[0021] A conversion module, used to convert the knowledge corpus into a plurality of question-answer pairs according to preset role prompt words, conversion prompt words, standardization prompt words and reply prompt words, wherein each question-answer pair includes a standard question and a standard answer corresponding to the standard question;

[0022] An output module, used to sequentially input a plurality of standard questions in the plurality of question-answer pairs into the large model to be trained, so as to output a plurality of test answers corresponding to the plurality of standard questions;

[0023] An evaluation module, used to evaluate the multiple test answers respectively according to preset evaluation prompt words and multiple standard answers corresponding to the multiple standard questions to obtain multiple evaluation results;

[0024] A screening module is used to screen out all test answers whose evaluation results are wrong, and save the question-answer pairs to which the standard questions corresponding to the test answers belong into a training question-answer pair set;

[0025] A training module, used for fine-tuning the large model to be trained using the training question-answer pair set to obtain a trained large model;

[0026] The saving module is used to save the trained large model as the target large model.

[0027] In a third aspect, the present application provides a computer device, comprising: a processor, and a memory communicatively connected to the processor;

[0028] The memory stores computer-executable instructions;

[0029] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the large model training method described in the first aspect and various possible designs of the first aspect.

[0030] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect and various possible designs of the first aspect.

[0031] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in the first aspect and various possible designs of the first aspect.

[0032] The large model training method, device, electronic device, storage medium and program product provided in the present application respectively evaluate multiple test answers according to preset evaluation prompt words and multiple standard answers corresponding to multiple standard questions to obtain multiple evaluation results; filter out all test answers with incorrect evaluation results, and save the question and answer pairs belonging to the standard questions corresponding to the test answers to a training question and answer pair set; use the training question and answer pair set to fine-tune the large model to be trained to obtain a trained large model, which can improve the processing efficiency of computer equipment and save computing resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0034] Figure 1 A schematic diagram of an application scenario of the large model training method provided in an embodiment of the present application;

[0035] Figure 2 A flowchart of a large model training method provided for one embodiment of the present application;

[0036] Figure 3 A schematic diagram of the structure of a large model training device provided in an embodiment of the present application;

[0037] Figure 4 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present application.

[0038] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0039] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0040] The open-source general-purpose large model technology has developed rapidly, showing strong general and generalization capabilities. However, in actual use, it is found that these general-purpose large models do not perform well in some specific industries or fields, such as medicine, agriculture and other professional fields. Therefore, it is necessary to use industry knowledge data to fine-tune the general-purpose large models on computer devices to meet actual needs. Since these open-source general-purpose large models usually do not open training data, it is impossible to obtain the degree of overlap between the general-purpose large model training data and the industry or field knowledge data. Usually, the general-purpose large model is fine-tuned and trained directly on the computer device using the full amount of industry or field knowledge data. However, if the industry or field knowledge data has a considerable overlap with the training data of the general-purpose large model, it will lead to low processing efficiency of the computer equipment and waste of computing resources.

[0041] In order to solve the above technical problems, the embodiments of the present application propose the following technical ideas: Considering that if the industry or field knowledge data has a considerable overlap ratio with the training data of the general large model, it will lead to low processing efficiency of computer equipment and waste of computing resources. The inventors have come up with a method of using a preset large model to automatically identify and locate knowledge corpora that have not performed well and have not been mastered, and use the above industry or field knowledge as a training set to fine-tune the preset large model. It can improve the processing efficiency of computer equipment and save computing resources.

[0042] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0043] Figure 1 Schematic diagram of the application scenario of the large model training method provided in the embodiment of the present application. Figure 1 As shown, the scenario is a computer device, including: a receiving device 101, a processor 102 and a display device 103.

[0044] It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the object identification method. In other feasible implementations of the present application, the above architecture may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown may be implemented in hardware, software, or a combination of software and hardware.

[0045] In a specific implementation process, the receiving device 101 may be an input / output interface or a communication interface, and may acquire knowledge corpus.

[0046] The processor 102 can convert the knowledge corpus into multiple question-answer pairs, select a training question-answer pair set from the multiple question-answer pairs, and use the training question-answer pair set to fine-tune the large model to be trained to obtain a target large model.

[0047] The display device 103 can be used to display the above-mentioned question-answer pairs, training question-answer pair sets, etc.

[0048] The display device may also be a touch display screen, which is used to receive user instructions while displaying the above content to achieve interaction with the user.

[0049] It should be understood that the above-mentioned processor can be implemented by the processor reading instructions in the memory and executing the instructions, or it can be implemented by a chip circuit.

[0050] In addition, the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Ordinary technicians in this field can know that with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0051] Figure 2 A flowchart of a large model training method provided in one embodiment of the present application. The execution subject of this embodiment can be Figure 1 The computer equipment shown in . Figure 2 As shown, the method includes:

[0052] S201: Acquire knowledge corpus.

[0053] Specifically, knowledge corpus is acquired from a preset data source.

[0054] S202: Convert the knowledge corpus into a plurality of question-answer pairs according to preset role prompt words, conversion prompt words, standardization prompt words and reply prompt words, wherein each question-answer pair includes a standard question and a standard answer corresponding to the standard question.

[0055] Specifically, according to the preset role prompt words, conversion prompt words, standardization prompt words and reply prompt words, the knowledge corpus is converted into multiple question-answer pairs through the preset auxiliary large model using zero-shot learning or few-shot learning.

[0056] Specifically, S202 specifically includes S2021 to S2024:

[0057] S2021: Inputting a preset role prompt word into a preset auxiliary large model to set the role of the preset auxiliary large model.

[0058] Among them, the preset role prompt words can be: You are a language expert who can convert most of the text into independent and complete questions and use the detailed content of the text to answer the questions.

[0059] S2022: Input the preset conversion prompt words and knowledge corpus into the preset auxiliary large model to output multiple questions corresponding to the knowledge corpus.

[0060] Specifically, the preset conversion prompt words and knowledge corpus are input into the preset auxiliary large model, and a plurality of questions corresponding to the knowledge corpus are output in a preset question output format.

[0061] Among them, the preset auxiliary large model has logical reasoning ability and can be the Qwen1.5-14B-Chat large model.

[0062] Among them, the preset conversion prompt word can be: directly convert the knowledge corpus into questions.

[0063] S2023: Inputting the preset standardized prompt words and multiple questions into the preset auxiliary large model for standardization processing to output multiple standard questions.

[0064] Specifically, the preset standardized prompt words and multiple questions are input into the preset auxiliary large model for standardization processing, and the multiple standard questions are output in the preset standard question output format.

[0065] Among them, the preset standardized prompt words can be: correct the problem according to the preset standardized rules.

[0066] Among them, the preset standardized rules can be: each question is independent and belongs to one of the following categories: "how", "why", "what", "who", "when" or "where".

[0067] S2024: Input preset response prompt words, multiple standard questions and knowledge corpus into the preset auxiliary large model to output multiple question-answer pairs.

[0068] Among them, the preset reply prompt words may be: use the detailed content of the knowledge corpus to answer the standard questions, and the answers should cover all relevant aspects of the knowledge corpus.

[0069] Specifically, the preset response prompt words, multiple standard questions and knowledge corpus are input into the preset auxiliary large model to output standard answers corresponding to the multiple standard questions; according to the multiple standard questions and the multiple standard answers corresponding to the multiple standard questions, multiple question and answer pairs are generated according to the preset question and answer pair output format.

[0070] S203: Input multiple standard questions in the multiple question-answer pairs into the large model to be trained in sequence to output multiple test answers corresponding to the multiple standard questions.

[0071] The large model to be trained may be a large model with logical reasoning capability or a large model without logical reasoning capability. The large model to be trained may be Qwen1.5-14B-Chat, Qwen1.5-14B-Chat, etc.

[0072] It should be noted that if the large model to be trained has logical reasoning capabilities, the large model to be trained can be used instead of the preset auxiliary large model.

[0073] S204: According to the preset evaluation prompt words and the multiple standard answers corresponding to the multiple standard questions, the multiple test answers are evaluated respectively to obtain multiple evaluation results.

[0074] The preset evaluation prompt words can be: You are a teacher who is proficient in language. Standard questions and standard answers corresponding to the standard questions are now provided, as well as test answers corresponding to the standard questions. As a teacher, you will divide the test answers into two levels based on their consistency and accuracy: correct answers and incorrect answers.

[0075] Specifically, according to preset evaluation prompts, multiple test answers corresponding to multiple standard questions are compared with multiple standard answers to calculate the accuracy, completeness and relevance of the multiple test answers; and multiple evaluation results are obtained based on the accuracy, completeness and relevance.

[0076] Specifically, multiple test answers are traversed in sequence, and the following steps are performed for the traversed test answers: according to preset evaluation prompts, the test answers are compared with the standard answers, and the accuracy of the parts of the test answers that are consistent with the standard answers is marked; the accuracy of the test answers is calculated according to the accuracy marking; according to the preset evaluation prompts, the test answers are compared with the standard answers, and the key points of the standard answers contained in the test answers are marked for completeness, and the integrity of the test answers is calculated according to the integrity marking; according to the preset evaluation prompts, the cosine similarity between the test answers and the standard answers is calculated to obtain the correlation of the test answers; and the evaluation results are obtained according to the accuracy, completeness and correlation of the test answers.

[0077] S205: Filter out all test answers that are evaluated as incorrect answers, and save the question-answer pairs to which the standard questions corresponding to the test answers belong into a training question-answer pair set.

[0078] S206: Fine-tune the large model to be trained using the training question-answer pair set to obtain a trained large model.

[0079] Specifically, S206 includes S2061 to S2063:

[0080] S2061: According to the preset hyperparameters, configure the batch size, learning rate, and number of training rounds of the large model to be trained.

[0081] S2062: Input the training question-answer pair set into the large model to be trained.

[0082] S2063: Use a low-order adaptation algorithm to fine-tune the large model to be trained according to the batch size and learning rate until the number of training times reaches the number of training rounds to obtain a trained large model.

[0083] Among them, the low-rank adaptation algorithm can be LoRA (Low-Rank Adaptation).

[0084] S207: Save the trained large model as the target large model.

[0085] From the above description, it can be seen that the present application evaluates multiple test answers according to preset evaluation prompts and multiple standard answers corresponding to multiple standard questions to obtain multiple evaluation results; screens out all test answers whose evaluation results are incorrect answers, and saves the question and answer pairs belonging to the standard questions corresponding to the test answers into a training question and answer pair set; uses the training question and answer pair set to fine-tune the large model to be trained to obtain a trained large model, which can improve the processing efficiency of computer equipment and save computing resources.

[0086] In one embodiment of the present application, based on the above embodiment, step S204 also provides another implementation method, which is described in detail as follows:

[0087] S2041: For each question-answer pair among the multiple question-answer pairs, create a triple of the standard question of the question-answer pair, the standard answer corresponding to the standard question, and the test answer corresponding to the standard question to obtain multiple triples.

[0088] The triplet may be in the form of: {standard question, standard answer, test answer}.

[0089] S2042: Input the preset evaluation prompt words and multiple triples into the preset auxiliary large model to output multiple evaluation results.

[0090] Specifically, S2042 specifically includes Sa:

[0091] Sa: traverse multiple triples in sequence, and execute the following steps Sa-1 to Sa-2 for the traversed triples.

[0092] Sa-1: Use the preset auxiliary large model to calculate the correlation between the test answer and the standard answer in the triple according to the preset evaluation prompt words.

[0093] The preset evaluation prompt words can be: You are a teacher who is proficient in language. Standard questions and standard answers corresponding to the standard questions are now provided, as well as test answers corresponding to the standard questions. As a teacher, you will divide the test answers into two levels based on their consistency and accuracy: correct answers and incorrect answers.

[0094] Specifically, according to the preset evaluation prompt words, the first similarity between the test answer and the standard answer and the second similarity between the test answer and the standard question are calculated; according to the preset weight configuration, the first similarity and the second co-similarity are comprehensively calculated to obtain the comprehensive similarity; the comprehensive similarity is determined as the correlation between the test answer and the standard answer.

[0095] Sa-2: Through the preset auxiliary large model, if the correlation is determined to reach the preset correlation threshold, an evaluation result of a correct answer is generated; if the correlation is determined not to reach the preset correlation threshold, an evaluation result of an incorrect answer is generated.

[0096] From the above description, it can be seen that in this application, the standard questions of the question-answer pairs, the standard answers corresponding to the standard questions, and the test answers corresponding to the standard questions are created as triplets, and a preset auxiliary large model is used to calculate the correlation between the test answers and the standard answers in the triplet according to the preset evaluation prompt words, which can improve the accuracy of the similarity calculation.

[0097] Figure 3 This is a schematic diagram of the structure of the large model training device provided in the embodiment of the present application. Figure 3 As shown, the large model training device 30 includes: an acquisition module 301, a conversion module 302, an output module 303, an evaluation module 304, a screening module 305, a training module 306 and a storage module 307.

[0098] An acquisition module 301 is used to acquire knowledge corpus;

[0099] A conversion module 302, configured to convert the knowledge corpus into a plurality of question-answer pairs according to preset role prompt words, conversion prompt words, standardization prompt words, and reply prompt words, wherein each question-answer pair includes a standard question and a standard answer corresponding to the standard question;

[0100] An output module 303 is used to sequentially input the multiple standard questions in the multiple question-answer pairs into the large model to be trained, so as to output multiple test answers corresponding to the multiple standard questions;

[0101] An evaluation module 304, configured to evaluate the plurality of test answers respectively according to preset evaluation prompt words and the plurality of standard answers corresponding to the plurality of standard questions, so as to obtain a plurality of evaluation results;

[0102] A screening module 305 is used to screen out all test answers that are evaluated as wrong answers, and save the question-answer pairs to which the standard questions corresponding to the test answers belong into a training question-answer pair set;

[0103] A training module 306 is used to fine-tune the large model to be trained using the training question-answer pair set to obtain a trained large model;

[0104] The saving module 307 is used to save the trained large model as the target large model.

[0105] In a possible design, the conversion module 302 is specifically used to: input the preset role prompt words into the preset auxiliary big model to set the role of the preset auxiliary big model; input the preset conversion prompt words and the knowledge corpus into the preset auxiliary big model to output multiple questions corresponding to the knowledge corpus; input the preset standardization prompt words and the multiple questions into the preset auxiliary big model for standardization processing to output multiple standard questions; input the preset reply prompt words, the multiple standard questions and the knowledge corpus into the preset auxiliary big model to output multiple question-answer pairs.

[0106] In one possible design, the evaluation module 304 specifically includes: for each question-answer pair among the multiple question-answer pairs, creating a triple of the standard question of the question-answer pair, the standard answer corresponding to the standard question, and the test answer corresponding to the standard question to obtain multiple triples; inputting preset evaluation prompt words and the multiple triples into a preset auxiliary large model to output multiple evaluation results.

[0107] In one possible design, the evaluation module 304, when "inputting the preset evaluation prompt words and the multiple triples into the preset auxiliary large model to output multiple evaluation results", specifically includes: traversing the multiple triples in sequence, and performing the following steps for the traversed triples: using the preset auxiliary large model, according to the preset evaluation prompt words, calculating the correlation between the test answers and the standard answers in the triples; through the preset auxiliary large model, if it is determined that the correlation reaches a preset correlation threshold, then generating an evaluation result with a correct answer; if it is determined that the correlation does not reach the preset correlation threshold, then generating an evaluation result with an incorrect answer.

[0108] In one possible design, the training module 306 is specifically used to: configure the batch size, learning rate and number of training rounds of the large model to be trained according to preset hyperparameters; input the training question-answer pair set into the large model to be trained; use a low-order adaptive algorithm to fine-tune the large model to be trained according to the batch size and learning rate until the number of training rounds reaches the number of training rounds to obtain a trained large model.

[0109] In a possible design, the preset auxiliary large model has logical reasoning capabilities.

[0110] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.

[0111] Figure 4 Schematic diagram of the hardware structure of the computer device provided in the embodiment of the present application. Figure 4 As shown, the computer device 40 of this embodiment includes: at least one processor 401 and a memory 402; the memory stores computer execution instructions; at least one processor executes the computer execution instructions stored in the memory, so that at least one processor executes the above large model training method;

[0112] Optionally, the memory 402 may be independent or integrated with the processor 401 .

[0113] When the memory 402 is independently provided, the computer device further includes a bus 403 for connecting the memory 402 and the processor 401 .

[0114] An embodiment of the present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the large model training method as described above is implemented.

[0115] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the large model training method as described above.

[0116] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0117] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0118] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0119] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0120] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not otherwise specified, the processor may be any appropriate hardware processor, such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), an FPGA (Field-Programmable Gate Array), a DSP (Digital Signal Processor), and an ASIC (Application-Specific Integrated Circuit). If not otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as RRAM (Resistive Random Access Memory), DRAM (Dynamic Random Access Memory), SRAM (Static Random-Access Memory), EDRAM (Enhanced Dynamic Random Access Memory), HBM (High-Bandwidth Memory), HMC (Hybrid Memory Cube), etc.

[0121] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of each embodiment method of the present application. The aforementioned memory includes: U disk, ROM (Read-Only Memory), RAM (Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc., various media that can store program codes.

[0122] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0123] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0124] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A large model training method, characterized in that: Applicable to computer equipment, including: Acquire knowledge corpus; According to preset role prompt words, conversion prompt words, standardization prompt words and reply prompt words, the knowledge corpus is converted into a plurality of question-answer pairs, wherein each question-answer pair includes a standard question and a standard answer corresponding to the standard question; Inputting multiple standard questions in the multiple question-answer pairs into the large model to be trained in sequence to output multiple test answers corresponding to the multiple standard questions; According to the preset evaluation prompt words and the multiple standard answers corresponding to the multiple standard questions, the multiple test answers are evaluated respectively to obtain multiple evaluation results; Filter out all test answers whose evaluation results are incorrect, and save the question-answer pairs to which the standard questions corresponding to the test answers belong into a training question-answer pair set; Using the training question-answer pair set to fine-tune the large model to be trained to obtain a trained large model; The trained large model is saved as the target large model.

2. The method according to claim 1, characterized in that The step of converting the knowledge corpus into a plurality of question-answer pairs according to preset role prompt words, conversion prompt words, standardization prompt words and reply prompt words includes: Inputting a preset role prompt word into a preset auxiliary large model to set the role of the preset auxiliary large model; Inputting the preset conversion prompt words and the knowledge corpus into the preset auxiliary large model to output a plurality of questions corresponding to the knowledge corpus; Inputting the preset standardized prompt words and the plurality of questions into the preset auxiliary large model for standardization processing to output a plurality of standard questions; The preset answer prompt words, the multiple standard questions and the knowledge corpus are input into the preset auxiliary large model to output multiple question-answer pairs.

3. The method according to claim 1, characterized in that The plurality of test answers are evaluated respectively according to the preset evaluation prompt words and the plurality of standard answers corresponding to the plurality of standard questions to obtain a plurality of evaluation results, including: For each question-answer pair of the multiple question-answer pairs, create a triple of the standard question of the question-answer pair, the standard answer corresponding to the standard question, and the test answer corresponding to the standard question to obtain multiple triples; The preset evaluation prompt words and the multiple triples are input into the preset auxiliary large model to output multiple evaluation results.

4. The method according to claim 3, characterized in that The step of inputting the preset evaluation prompt words and the plurality of triples into the preset auxiliary large model to output a plurality of evaluation results includes: The multiple triples are traversed in sequence, and the following steps are performed for the traversed triples: Using a preset auxiliary large model, and according to preset evaluation prompt words, calculating the correlation between the test answer and the standard answer in the triple; Through the preset auxiliary large model, if it is determined that the correlation reaches the preset correlation threshold, an evaluation result of a correct answer is generated; if it is determined that the correlation does not reach the preset correlation threshold, an evaluation result of an incorrect answer is generated.

5. The method according to any one of claims 1 to 4, characterized in that: The fine-tuning training of the large model to be trained by using the training question-answer pair set to obtain a trained large model includes: According to the preset hyperparameters, the batch size, learning rate and number of training rounds of the large model to be trained are configured; Inputting the training question-answer pair set into the large model to be trained; A low-order adaptation algorithm is used to fine-tune the large model to be trained according to the batch size and learning rate until the number of training times reaches the number of training rounds to obtain a trained large model.

6. The method according to claim 2 or 4, characterized in that: The preset auxiliary large model has logical reasoning capabilities.

7. A large model training device, characterized in that: Applicable to computer equipment, including: Acquisition module, used to acquire knowledge corpus; A conversion module, used to convert the knowledge corpus into a plurality of question-answer pairs according to preset role prompt words, conversion prompt words, standardization prompt words and reply prompt words, wherein each question-answer pair includes a standard question and a standard answer corresponding to the standard question; An output module, used to sequentially input a plurality of standard questions in the plurality of question-answer pairs into the large model to be trained, so as to output a plurality of test answers corresponding to the plurality of standard questions; An evaluation module, used to evaluate the multiple test answers respectively according to preset evaluation prompt words and multiple standard answers corresponding to the multiple standard questions to obtain multiple evaluation results; A screening module is used to screen out all test answers whose evaluation results are wrong, and save the question-answer pairs to which the standard questions corresponding to the test answers belong into a training question-answer pair set; A training module, used for fine-tuning the large model to be trained using the training question-answer pair set to obtain a trained large model; The saving module is used to save the trained large model as the target large model.

8. A computer device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the large model training method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the large model training method as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Fine adjustment method and device for large model in vertical field and medium

    CN120069098A

  • E-commerce vertical domain database construction method and related device

    CN120216655A

  • Training sample data generation method and device, readable storage medium and program product

    CN120277419A

  • Method and device for realizing closed-loop fine-tuning training of large model by intelligent computing cloud platform through computing power

    CN121388607A