A large model distillation method, device and storage medium

By building teacher and student models, obtaining complex instructions and answers, and using data distillation methods to train student models, we solve the problem of large-scale language model deployment and achieve efficient knowledge transfer and performance improvement.

CN118093832BActive Publication Date: 2024-09-13BEIJING LANZHOU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410464552.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-17
Publication Date
2024-09-13
Estimated Expiration
2044-04-17

AI Technical Summary

Technical Problem

The computationally intensive nature of large-scale language models during the deployment process leads to deployment difficulties. Existing distillation methods require a large amount of training data and effectively stimulate large model knowledge, and there are difficulties in the student model training mechanism.

Method used

By building a teacher model and an initial student model, we obtain initial instructions to perform complex instruction operations, generate complex instructions, use complex instructions and answers to build high-quality instruction-answer training data, use data distillation methods to train student models, and combine KL scattering Optimizing student models with degree and logarithmic loss functions.

Benefits of technology

Effectively activate teacher model knowledge, improve student model knowledge, reduce the size of training data, reduce computing costs, improve training efficiency, and improve student model performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118093832B
    Figure CN118093832B
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence technology, and in particular to a large model distillation method, device and storage medium. The large model distillation method provided by the present invention constructs a teacher model and an initial student model; obtains initial instructions to perform instruction complication operations to obtain complex instructions; inputs the complex instructions into the teacher model to generate answers, and constructs instruction-answer training data based on the complex instructions and answers; uses the instruction-answer training data to train the initial student model using a data distillation method. The present invention constructs a knowledge distillation mechanism for large models, an instruction complication method and a feedback learning method based on instruction complexity. Through iterative training using the above method, the knowledge and capabilities contained in the large model can be distilled into a smaller-scale dedicated model, effectively reducing the memory and computing resources required for model operation, achieving twice the result with half the effort training effect, and providing support for the natural language processing business of a large number of enterprises.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a large model distillation method, device and storage medium. Background Art

[0002] With the continuous development of deep learning technology, the scale of models used in the field of natural language processing is also expanding. The huge number of parameters provides unprecedented performance for large models, enabling them to provide good services even with a small number of samples; but at the same time, the scale of the model also poses a great challenge to computing. Nowadays, large-scale language models often have more than 100 billion parameters. Due to the computationally intensive nature of large models, how to deploy them in real application scenarios is still a problem that cannot be ignored.

[0003] Currently, in order to circumvent the deployment challenges of large models, researchers and companies usually choose to deploy smaller dedicated models. These smaller-scale models can be derived from the distillation training paradigm. Distillation aims to use the labels generated by a larger language model to train smaller models with poor performance. Larger language models have stronger knowledge emergence capabilities and can generate a large amount of high-quality labeled data to train small models. Although this training paradigm can effectively compress the scale of the model used, it still faces many challenges. On the one hand, a large amount of training data is required to improve the effect of the small model. At the same time, methods are needed to effectively stimulate and efficiently transfer the knowledge of the large model, as well as an effective student model training mechanism, which brings difficulties to existing work. Summary of the invention

[0004] In order to solve the above problems, the present invention provides a large model distillation method, device and storage medium.

[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: a large model distillation method, comprising the following steps:

[0006] Step S1, constructing a teacher model and an initial student model;

[0007] Step S2, obtaining an initial instruction and performing an instruction complication operation to obtain a complicated instruction, wherein the complicated instruction is a complicated instruction in the field of natural language;

[0008] Step S3, inputting the complicated instruction into the teacher model to generate an answer, wherein the answer is an answer in the natural language field, and constructing instruction-answer training data based on the complicated instruction and the answer;

[0009] Step S4, using the instruction-answer training data to train the initial student model using a data distillation method;

[0010] The complicated operation in step S2 specifically includes the following steps:

[0011] Step S21, expanding the initial instruction into a primary complex instruction based on the pre-trained complex model;

[0012] Step S22, inputting the primary complex instruction into the student model to obtain a primary answer, and scoring the primary answer based on the pre-trained feedback model;

[0013] Step S23, determining whether the scoring score is lower than a preset threshold, and if so, taking the corresponding primary complex instruction as a complex instruction.

[0014] Preferably, the step S21 specifically includes the following steps:

[0015] Step S211, constructing an instruction template based on few-shot learning;

[0016] Step S212, the pre-trained complex model expands the initial instruction into a primary complex instruction based on the instruction template learned by few-shot;

[0017] Wherein, step S212 also includes the following steps: the complication model determines whether the complexity of the primary complication instruction logic exceeds a preset threshold, and if so, adds step-by-step instructions to the primary complication instruction to guide the complication model to perform the instruction complication operation with the step-by-step instructions.

[0018] Preferably, the step S4 specifically includes the following steps:

[0019] Step S41, inputting the complicated instruction into the teacher model and the student model respectively, obtaining a first prediction probability output by the teacher model and a second prediction probability output by the student model;

[0020] Step S42, obtaining a KL divergence loss function based on the KL divergence according to the first prediction probability and the second prediction probability;

[0021] Step S43, obtaining a general training loss function based on the logarithmic loss according to the second prediction probability;

[0022] Step S44, obtaining a total loss function based on the KL divergence loss function and the general training loss function;

[0023] Step S45, iteratively update the current student model based on the total loss function.

[0024] Preferably, the KL divergence loss function in step S42 is specifically:

[0025]

[0026] in The output answer is represents the kth word in the output answer, Represents the output of the teacher model The predicted probability of Represents the output of the student model The predicted probability of .

[0027] Preferably, the general training loss function in step S43 is specifically:

[0028]

[0029] in The answer to the output is represents the kth word in the output answer, Represents the output of the student model The predicted probability of represents the probability, express The word that appears before, Representation basis The previous word predicts the next word to be probability.

[0030] Preferably, the total loss function obtained in step S44 based on the KL divergence loss function and the general training loss function is specifically:

[0031] Step S441: assign a weight parameter α to the KL divergence loss function and a weight parameter 1-α to the general training loss function, where α ranges from 0 to 1;

[0032] Step S442, performing weighted summation of the KL divergence loss function and the general training loss function to obtain a total loss function.

[0033] Preferably, the pre-training of the feedback model in step S22 specifically includes the following steps:

[0034] Step S221, constructing an initial feedback model;

[0035] Step S222, inputting the initial instruction into the teacher model to obtain a positive example and inputting the initial instruction into the initial student model to obtain a negative example;

[0036] Step S223, using positive and negative examples to train the initial feedback model to obtain a feedback model.

[0037] In order to solve the above technical problems, the present invention provides another technical solution as follows: a large model distillation device, used to implement any one of the above large model distillation methods, the large model distillation device comprises the following modules:

[0038] The initial module is used to build the teacher model and the initial student model;

[0039] The instruction complication module is used to obtain the initial instruction to perform the instruction complication operation, expand the initial instruction into a primary complex instruction based on the pre-trained complication model; input the primary complex instruction into the student model to obtain the primary answer, and score the primary answer based on the pre-trained feedback model; determine whether the score is lower than a preset threshold, and if so, use the corresponding primary complex instruction as a complex instruction, wherein the complex instruction is a complex instruction in the natural language field;

[0040] An instruction-answer training data generation module is used to input complex instructions into a teacher model to generate answers, wherein the answers are answers in the natural language field, and construct instruction-answer training data based on the complex instructions and the answers;

[0041] A training module is used to train an initial student model using the instruction-answer training data with a data distillation method.

[0042] In order to solve the above technical problems, the present invention provides another technical solution as follows: a computer-readable storage medium, which implements any one of the large model distillation methods described above when the computer program is executed.

[0043] Compared with the prior art, the large-model distillation method, device and storage medium provided by the present invention have the following beneficial effects:

[0044] 1. A large model distillation method is provided in an embodiment of the present invention, which comprises constructing a teacher model and an initial student model; obtaining initial instructions to perform instruction complication operations to obtain complex instructions; inputting the complex instructions into the teacher model to generate answers, and constructing high-quality instruction-answer training data based on the complex instructions and answers; and using the high-quality instruction-answer training data to train the initial student model using a data distillation method. By using a general instruction complication method to obtain initial instructions and perform instruction complication operations, complex instructions are obtained to effectively activate the knowledge of the teacher model. The initial instructions can be complicated from different angles such as the initial instruction logic complexity and knowledge coverage, thereby improving the complexity and richness of the complex instructions. Compared with simple instructions, the complex instructions are of higher quality and contain more complex knowledge. They can effectively activate the knowledge of the teacher model and effectively improve the knowledge of the student model. The student model can learn more complex tasks, and the learning process is more efficient. The complex instructions input into the student model exceed its ability range, thereby effectively improving the training efficiency. At the same time, the knowledge distillation mechanism for the teacher model is utilized and the data distillation method is adopted for training. Data distillation refers to transferring the knowledge of the teacher model to the student model by using data as a bridge. Compared with the existing data distillation, the data distillation of the present invention obtains complex instructions and answers. Compared with simple instructions, the instruction-answer training data is of higher quality and contains more complex knowledge. Using high-quality instruction-answer training data to train the initial student model by the data distillation method can effectively activate the knowledge of the teacher model on the one hand, and the high-knowledge-density answers output by the teacher model fully contain the knowledge of the teacher model; on the other hand, the knowledge of the student model can be effectively improved to learn more complex tasks. Obtaining high-quality training data with teacher model knowledge to train the student model and transferring key information such as the teacher model's knowledge to the student model can efficiently distill the knowledge of the large-scale parameter teacher model into the small-scale parameter student model, reduce the scale of training data, reduce the training and reasoning computing costs, effectively stimulate and efficiently transfer the high-level knowledge of the teacher model, make the student model training mechanism more effective, and the student model obtained through training has better performance, thereby achieving twice the result with half the effort.

[0045] 2. The complex operation provided in the embodiment of the present invention specifically includes expanding the initial instruction into a primary complex instruction based on a pre-trained complex model; inputting the primary complex instruction into the student model to obtain a primary answer, and scoring the primary answer based on the pre-trained feedback model; judging whether the scoring score is lower than a preset threshold, and if so, using the corresponding primary complex instruction as a complex instruction. During the training process, the ability of the student model will be continuously enhanced with the training, and the training difficulty accepted by the student model will be continuously reduced. By constructing a feedback learning method based on the complexity detection of primary complex instructions and enhancing the performance of the student model, the feedback model scores the primary answer output by the student model, and judges whether the scoring score is lower than a preset threshold. A score lower than the preset threshold means that the student model has not learned the relevant knowledge of the primary complex instruction well. The primary complex instruction corresponding to the score lower than the preset threshold is used as a complex instruction, which can dynamically adjust and guide the update of the complex instruction to ensure that the complexity and richness of the complex instruction exceed the ability level of the student model. Since simply using training data cannot maximize the performance of the student model, a feedback learning method based on primary complex instruction complexity detection and enhancement of student model performance is adopted. If the current student model does not perform well on certain instructions or tasks, it will be scored based on the feedback model in the future, and this part of the performance will be selectively enhanced to continuously improve the weak capabilities of the student model. Since the performance difference between the teacher model and the student model will reach the maximum on complex problems, the real-time evaluation feedback of the feedback model can ensure that the student model is trained with complex instructions that meet the complexity requirements, and the performance difference between the student model and the teacher model on complex problems is reduced with high efficiency, so that the student model can better learn the knowledge of the teacher model and achieve the best overall performance for a variety of instructions or tasks.

[0046] 3. Step S21 in the embodiment of the present invention specifically includes the following steps: constructing an instruction template based on few-shot learning; the pre-trained complication model expands the initial instruction into a primary complication instruction based on the instruction template of few-shot learning. Few-shot learning is a machine learning paradigm that aims to enable the model to complete learning tasks with a small number of samples. By constructing an instruction template based on few-shot learning, the pre-trained complication model expands the initial instruction into a primary complication instruction based on the instruction template of few-shot learning, so that only a small number of high-quality instruction complication learning examples need to be prepared to guide the large model to complete the instruction complication process. It can further reduce the amount of training data used. Through the instruction template based on few-shot learning, the complication model can obtain excellent generalization ability and generate primary complication instructions with clear and concise language, polite sentences, no illegal information and no ambiguity, thereby avoiding the generation of meaningless content and only expanding the instructions in length.

[0047] 4. Step S4 provided in the embodiment of the present invention specifically includes: inputting the complicated instruction into the teacher model and the student model respectively, obtaining the first prediction probability output by the teacher model and the second prediction probability output by the student model; obtaining the KL divergence loss function based on the KL divergence according to the first prediction probability and the second prediction probability; obtaining the general training loss function based on the logarithmic loss according to the second prediction probability; obtaining the total loss function based on the KL divergence loss function and the general training loss function, and iteratively updating the current student model based on the total loss function. The initial student model is trained by the instruction-answer training data using the data distillation method. The answer obtained by inputting the complicated instruction into the teacher model in the instruction-answer training data is generated by the teacher model and thus includes the knowledge of the teacher model. The complicated instruction can better stimulate the ability of the teacher model, obtain high-quality training data with knowledge, and thus be more conducive to improving the performance of the student model. By inputting the complicated instruction into the teacher model and the student model respectively, based on the predicted probability distribution, the student model is optimized by constructing the total loss function based on the KL divergence and logarithmic loss, thereby improving the training efficiency of the student model.

[0048] 5. In the embodiment of the present invention, a specific KL divergence loss function is defined, and a training target based on KL divergence is used to quantify the difference in output probability distribution between the teacher model and the student model to enhance the knowledge distillation process. By minimizing the KL divergence according to the KL divergence loss function, the student model will continuously learn the knowledge and abilities mastered by the teacher model, narrow the gap between the teacher model and the student model, and realize knowledge distillation for the teacher model.

[0049] 6. In the embodiment of the present invention, a specific general training loss function is defined. Based on the idea of ​​maximum likelihood estimation, the training goal is to maximize the corresponding likelihood function, which has better probability distribution representation performance, prompting the student model to pay more attention to the correct classification of complex instruction training samples, thereby improving the training efficiency of the student model.

[0050] 7. The total loss function obtained based on the KL divergence loss function and the general training loss function provided in the embodiment of the present invention is specifically as follows: assigning a weight parameter α to the KL divergence loss function, assigning a weight parameter 1-α to the general training loss function, wherein α ranges from 0 to 1; performing weighted summation of the KL divergence loss function and the general training loss function to obtain the total loss function. By assigning weight parameters to the KL divergence loss function and the general training loss function, and performing weighted summation to obtain the total loss function, the weight parameters can be adjusted according to the actual situation to adjust the total loss function.

[0051] 8. The pre-training of the feedback model provided in the embodiment of the present invention specifically includes the following steps: constructing an initial feedback model; inputting the initial instruction into the teacher model to obtain a positive example and inputting the initial instruction into the initial student model to obtain a negative example; using the positive and negative examples to train the initial feedback model to obtain a feedback model. By inputting the initial instruction into the teacher model and the initial student model to construct positive and negative examples respectively, and using the positive and negative examples to train the feedback model, the feedback model obtained by training can effectively guide the instruction complication operation to update the current primary complication instruction, ensuring that the student model is trained with the complication instruction that meets the complexity requirements.

[0052] 9. An embodiment of the present invention also provides a large-model distillation device and a computer-readable storage medium, which have the same beneficial effects as the above-mentioned large-model distillation method, and will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0054] Figure 1 It is a step flow chart of a large model distillation method provided in the first embodiment of the present invention.

[0055] Figure 2 It is a flowchart of the complicated operation of step S2 of a large model distillation method provided in the first embodiment of the present invention.

[0056] Figure 3 It is a flow chart of step S21 of a large model distillation method provided in the first embodiment of the present invention.

[0057] Figure 4 It is a flowchart of the steps of feedback model pre-training in step S22 of a large model distillation method provided in the first embodiment of the present invention.

[0058] Figure 5 It is a flow chart of step S4 of a large model distillation method provided in the first embodiment of the present invention.

[0059] Figure 6 It is a flow chart of step S44 of a large model distillation method provided in the first embodiment of the present invention.

[0060] Figure 7 It is a schematic structural diagram of a large-scale model distillation apparatus provided in the second embodiment of the present invention.

[0061] Description of the accompanying drawings:

[0062] 1. Initial module; 2. Instruction complication module; 3. Instruction-answer training data generation module; 4. Training module. DETAILED DESCRIPTION

[0063] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and implementation examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0064] See also Figure 1 The first embodiment of the present invention provides a large model distillation method, comprising the following steps:

[0065] Step S1, constructing a teacher model and an initial student model;

[0066] Step S2, obtaining the initial instruction and performing an instruction complication operation to obtain a complicated instruction;

[0067] Step S3, inputting the complicated instruction into the teacher model to generate an answer, and constructing instruction-answer training data based on the complicated instruction and the answer;

[0068] Step S4, using the instruction-answer training data to train the initial student model using the data distillation method.

[0069] It can be understood that a large model distillation method of the present invention has the steps of first constructing a teacher model and an initial student model; then obtaining the initial instructions to perform instruction complication operations to obtain complex instructions; then inputting the complex instructions into the teacher model to generate answers, and constructing high-quality instruction-answer training data based on the complex instructions and answers; finally, using the high-quality instruction-answer training data to train the initial student model using the data distillation method. By using a general instruction complication method to obtain initial instructions and perform instruction complication operations, complex instructions are obtained to effectively activate the knowledge of the teacher model. The initial instructions can be complicated from different angles such as the initial instruction logic complexity and knowledge coverage, thereby improving the complexity and richness of the complex instructions. Compared with simple instructions, the complex instructions are of higher quality and contain more complex knowledge. They can effectively activate the knowledge of the teacher model and effectively improve the knowledge of the student model. The student model can learn more complex tasks, and the learning process is more efficient. The complex instructions input into the student model exceed its ability range, thereby effectively improving the training efficiency. At the same time, the knowledge distillation mechanism for the teacher model is utilized and the data distillation method is adopted for training. Data distillation refers to transferring the knowledge of the teacher model to the student model by using data as a bridge. Compared with the existing data distillation, the data distillation of the present invention obtains complex instructions and answers. Compared with simple instructions, the instruction-answer training data is of higher quality and contains more complex knowledge. Using high-quality instruction-answer training data to train the initial student model by the data distillation method can effectively activate the knowledge of the teacher model on the one hand, and the high-knowledge-density answers output by the teacher model fully contain the knowledge of the teacher model; on the other hand, the knowledge of the student model can be effectively improved to learn more complex tasks. Obtaining high-quality training data with teacher model knowledge to train the student model and transferring key information such as the teacher model's knowledge to the student model can efficiently distill the knowledge of the large-scale parameter teacher model into the small-scale parameter student model, reduce the scale of training data, reduce the training and reasoning computing costs, effectively stimulate and efficiently transfer the high-level knowledge of the teacher model, make the student model training mechanism more effective, and the student model obtained through training has better performance, thereby achieving twice the result with half the effort.

[0070] It should be noted that the teacher model refers to a large model, which has a single complex network or a collection of networks, with parameters up to hundreds of billions, and has good performance and generalization capabilities, but also has the problem of being computationally intensive and difficult to deploy; the student model is a dedicated model that is smaller in scale than the teacher model. By constructing complex instructions to train the initial student model, the capabilities of the teacher model can be effectively distilled to the initial student model, reducing the size of the model while ensuring the reasoning effect, speeding up the reasoning speed and reducing the resource requirements for the device.

[0071] Specifically, step S1 constructs the teacher model and the initial student model by using Transformer (self-attention mechanism), CNN (Convolutional Neural Network), RNN (Recurrent Neural Network) or any other model of any structure, which is not limited here.

[0072] Specifically, in step S2, the initial instruction is obtained to perform an instruction complex operation to obtain a complex instruction. The initial instruction can be constructed by constructing an initial instruction data set. ( ) to obtain it from it, Refers to the first Instructions, Refers to the number of samples in the initial instruction data set.

[0073] Specifically, the complex instruction obtained in step S2 refers to an instruction with more complex logical steps and richer content information than the initial instruction from the perspective of logical complexity and content coverage. The generated complex instruction extends the length of the initial instruction, and the language is clear and concise, unambiguous, polite and contains no illegal information.

[0074] Specifically, in step S2, the complex operation of using the initial instruction to generate the complex instruction can use LLM (Large Language Model) to perform the instruction complex operation on the initial instruction, so as to generate the complex instruction. LLM is a model based on machine learning and natural language processing technology. It learns the ability to serve human language understanding and generation by training a large amount of text data. The core idea of ​​LLM is to learn the patterns and language structures of natural language through large-scale unsupervised training, which can simulate the human language cognition and generation process to a certain extent. Compared with the traditional NLP model, LLM can better understand and generate natural text, and can also show certain logical thinking and reasoning ability. LLM can generate natural language text or understand the meaning of language text, and handle a variety of natural language tasks, such as text classification, question and answer, dialogue, etc., which is an important way to artificial intelligence. OpenAI's GPT-4 or Google's LaMDA are typical representatives of LLM.

[0075] It can be understood that using LLM to output complex instructions based on the input initial instructions is only an important specific implementation method of the complex operation, and the key purpose is to convert the input initial instructions into the output complex instructions. Other complex implementation methods that can achieve the complexity of instructions, such as building a complex instruction dictionary lookup table, etc., are not limited here as long as they can achieve the conversion of the input initial instructions into the output complex instructions. Step S2 realizes the conversion of the input initial instructions to the output complex instructions through complex operations, so that the output complex instructions have higher logical complexity and knowledge richness than the initial instructions, thereby ensuring that the complex instructions received by the student model exceed its ability range, effectively stimulating and efficiently transferring the knowledge of the teacher model, making the student model training mechanism more effective, achieving twice the result with half the effort with less training data, and improving training efficiency.

[0076] Specifically, step S3 inputs the complex instructions into the answers generated by the teacher model, which fully contain the knowledge of the teacher model. The knowledge contained in the answers generated by the teacher model refers to the weights and biases learned by the teacher model. Constructing high-quality instruction-answer training data based on complex instructions and answers can form high-quality training data with teacher model knowledge. Complex instructions can effectively activate the knowledge of the teacher model to output answers with higher knowledge density, and can also effectively improve the knowledge of the student model, so that the instruction-answer training data has higher quality than simple instructions.

[0077] Specifically, step S4 uses high-quality instruction-answer training data to train the initial student model using a data distillation method. The answers generated by the teacher model guided by complex instructions are used as the training data of the student model. Since this type of training data is generated by the teacher model, it includes the knowledge of the teacher model. The complex instructions can fully stimulate the ability of the teacher model compared to the initial instructions, thereby effectively activating the knowledge of the teacher model to output answers with high knowledge density. Data distillation refers to transferring the knowledge of the teacher model to the student model through data as a bridge. Compared with the existing data distillation, the data distillation of the present invention obtains complex instructions and answers. Compared with simple instructions, the instruction-answer training data is of higher quality and contains more complex knowledge. Using high-quality instruction-answer training data to train the initial student model using a data distillation method can effectively activate the knowledge of the teacher model on the one hand, and the high-knowledge-density answers output by the teacher model fully include the knowledge of the teacher model; on the other hand, it can effectively improve the knowledge of the student model and learn more complex tasks. Obtaining high-quality training data with teacher model knowledge to train the student model and transferring key information such as the teacher model's knowledge to the student model can efficiently distill the knowledge of the large-scale parameter teacher model into the small-scale parameter student model, which can reduce the scale of training data, reduce the training inference computing cost, and improve the student model training efficiency.

[0078] See also Figure 2 The complicated operation in step S2 specifically includes the following steps:

[0079] Step S21, expanding the initial instruction into a primary complex instruction based on the pre-trained complex model;

[0080] Step S22, inputting the primary complex instruction into the student model to obtain a primary answer, and scoring the primary answer based on the pre-trained feedback model;

[0081] Step S23, determining whether the scoring score is lower than a preset threshold, and if so, taking the corresponding primary complex instruction as a complex instruction.

[0082] It is understandable that the ability of the student model will be continuously enhanced during the training process, and the training difficulty of the student model will be continuously reduced. By constructing a feedback learning method based on the complexity detection of primary complex instructions and enhancing the performance of the student model, the feedback model scores the primary answers output by the student model and determines whether the score is lower than the preset threshold. The score lower than the preset threshold means that the student model has not learned the relevant knowledge of the primary complex instruction well. The primary complex instructions corresponding to the score lower than the preset threshold are used as complex instructions, which can dynamically adjust and guide the update of complex instructions to ensure that the complexity and richness of complex instructions exceed the ability level of the student model. Since the performance of the student model cannot be maximized by simply using training data, a feedback learning method based on the complexity detection of primary complex instructions and enhancing the performance of the student model is adopted. If the current student model does not perform well on certain instructions or tasks, it will be scored based on the feedback model in the future, and this part of the performance will be selectively enhanced to continuously improve the weak capabilities of the student model. Since the performance difference between the teacher model and the student model will reach the maximum on complex problems, the real-time evaluation feedback of the feedback model can ensure that the student model is trained with complex instructions that meet the complexity requirements, and narrow the performance difference between the student model and the teacher model on complex problems with higher efficiency, so that the student model can better learn the knowledge of the teacher model and achieve the best overall performance for multiple instructions or tasks.

[0083] Specifically, a pre-trained LLM with advanced capabilities can be used as a complication model for primary complex instructions, expanding the initial instructions into primary complex instructions, thereby improving the logical complexity and content richness of the primary complex instructions.

[0084] As an optional implementation, the complex model can also judge the complexity of the primary complex instruction logic. When the complex model judges that the complexity of the primary complex instruction logic exceeds the set threshold, a step-by-step guide will be added to the primary complex instruction to guide the complex model to perform the instruction complex operation, ensuring that the student module can understand the connotation of the complex instruction in the subsequent training steps.

[0085] See also Figure 3 , step S21 specifically includes the following steps:

[0086] Step S211, constructing an instruction template based on few-shot learning;

[0087] Step S212, the pre-trained complex model expands the initial instructions into primary complex instructions based on the instruction template learned by few-shot learning.

[0088] Understandably, few-shot learning is a machine learning paradigm that aims to enable the model to complete learning tasks with a small number of samples. By constructing an instruction template based on few-shot learning, the pre-trained complication model expands the initial instructions into primary complication instructions based on the instruction template of few-shot learning, so that only a small number of high-quality instruction complication learning examples need to be prepared to guide the large model to complete the instruction complication process. Further reducing the amount of training data used, through the instruction template based on few-shot learning, the complication model can obtain excellent generalization ability, generate primary complication instructions with clear and concise language, polite sentences, no illegal information and no ambiguity, thereby avoiding the generation of meaningless content and only expanding the instructions in length. This process can be formally expressed as = ,in is the initial instruction, For some examples of complicated instructions, Depend on The instructions obtained after complication.

[0089] The specific examples of instruction templates based on few-shot learning are as follows:

[0090] Hello, I will give you an instruction. I need you to add some qualifications to the instruction / add 1-2 steps to the instruction or add a relevant knowledge point to the instruction according to the field or task involved in this instruction.

[0091] At the same time, please ensure that the generated instructions are concise, effective, unambiguous, and polite. If the generated instructions are too complicated, you can add more guidance steps to improve the readability of the instructions.

[0092] Examples of complication you can refer to are:

[0093] "Describe the existing plant species and their evolutionary history in a unique manner and way." This question can be explored in more depth and comprehensively. For example, it can be expanded to: "Please describe the existing plant species and their evolutionary history in a unique manner and way through literature, art or narrative. Express your understanding and views on the number, geographical distribution, economic value and reproductive characteristics of existing plant species."

[0094] By constructing an instruction template based on few-shot learning, it can be effectively ensured that the complex model can expand the initial instructions with only a small number of high-quality instruction complex learning examples to generate primary complex instructions that meet the requirements.

[0095] Furthermore, after the initial instruction is expanded into a primary complex instruction, the primary complex instruction is input into the student model to obtain a primary answer, and the primary answer is scored based on the pre-trained feedback model; it is determined whether the score is lower than the preset threshold, and if so, the corresponding primary complex instruction is used as a complex instruction. The primary answer corresponding to the primary complex instruction is obtained through the student model. If the feedback model scores the primary answer output by the student model highly, it is considered that the student model has well learned the relevant knowledge of the primary complex instruction, and subsequent training will reduce the attention to the primary complex instruction; if the feedback model scores the primary answer output by the student model low, it is considered that the student model has not well learned the relevant knowledge of the instruction, and the corresponding primary complex instruction is used as a complex instruction for subsequent steps to input into the teacher model to generate the corresponding answer.

[0096] As an optional implementation, the feedback model consists of an LLM followed by a linear scoring layer. The linear scoring layer is used to score the output of the student model. Refers to the output of the feedback model to the student model during training S Scoring, setting threshold , the feedback model will ≥ The corresponding primary complexification instructions are defined as simple instructions, because these instructions are relatively simple relative to the student model, so the student model can get a higher score; < The corresponding primary complex instruction is used as the complex instruction. In this way, the feedback model can effectively guide the instruction complex operation to update the current instruction.

[0097] See also Figure 4 , further, as an optional implementation, the pre-training of the feedback model in step S22 specifically includes the following steps:

[0098] Step S221, constructing an initial feedback model;

[0099] Step S222, inputting the initial instruction into the teacher model to obtain a positive example and inputting the initial instruction into the initial student model to obtain a negative example;

[0100] Step S223, using positive and negative examples to train the initial feedback model to obtain a feedback model.

[0101] Understandably, based on the initial instructions, a batch of positive and negative examples are constructed .in, Refers to the initial instruction data set. The positive examples corresponding to the instructions are output by the teacher model; Refers to the initial instruction data set. The negative examples corresponding to the instructions are output by the initialized student model. The initial instructions are input into the teacher model and the initial student model to construct positive and negative examples, and the feedback model is trained using positive and negative examples, so that the trained feedback model can effectively guide the instruction complication operation to update the current primary complication instruction, ensuring that the student model is trained with complex instructions that meet the complexity requirements.

[0102] See also Figure 5 , step S4 specifically includes the following steps:

[0103] Step S41, inputting the complicated instruction into the teacher model and the student model respectively, obtaining a first prediction probability output by the teacher model and a second prediction probability output by the student model;

[0104] Step S42, obtaining a KL divergence loss function based on the KL divergence according to the first prediction probability and the second prediction probability;

[0105] Step S43, obtaining a general training loss function based on the logarithmic loss according to the second prediction probability;

[0106] Step S44, obtaining a total loss function based on the KL divergence loss function and the general training loss function;

[0107] Step S45, iteratively update the current student model based on the total loss function.

[0108] Understandably, with the rapid increase in the number of model parameters, various large-scale language models have achieved performance capabilities far exceeding traditional models. By training on massive text data, such models have mastered a large amount of text knowledge and can learn the probability distribution of real data. The initial student model is trained using the instruction-answer training data using the data distillation method. The answers obtained by inputting the teacher model with complex instructions in the instruction-answer training data include the knowledge of the teacher model because they are generated by the teacher model. Complex instructions can better stimulate the ability of the teacher model and obtain high-quality training data with knowledge, which is more conducive to improving the performance of the student model. By inputting complex instructions into the teacher model and the student model respectively, based on the predicted probability distribution, the student model is optimized by constructing a total loss function based on KL divergence and logarithmic loss, thereby improving the training efficiency of the student model.

[0109] Specifically, in order to achieve effective learning of the knowledge and abilities contained in the teacher model, the complex instructions output by the complex model Input the teacher model and the student model respectively, and get the first prediction probability output by the teacher model And the second predicted probability output by the student model S . The KL divergence loss function is obtained based on the KL divergence according to the first predicted probability and the second predicted probability, which can better guide the learning of the student model by learning the probability distribution of the real data. KL divergence (Kullback-Leibler divergence) is a measurement method used to measure the difference between two probability distributions. Its essence is to measure the information loss or error introduced when one distribution is used to approximate another distribution. Therefore, it can better measure the first predicted probability Distribution function and second prediction probability S Information loss between distribution functions. By minimizing the KL divergence, the student model will continuously learn the knowledge and capabilities mastered by the teacher model, narrow the gap between the student model and the teacher model, and achieve knowledge distillation for the teacher model.

[0110] Specifically, a general training loss function is obtained based on the logarithmic loss according to the second predicted probability. Logarithmic loss (Log Loss) is a loss function used to measure the performance of classification models. It can flexibly model the predicted probability and is sensitive to the difference in probability distribution. It can be understood that when the student model is trained using training samples of complex instructions, the training method for each training sample is to predict the token at the current position based on the context token. The token means the mark in lexical analysis and corresponds to the word. The training goal is to maximize the corresponding likelihood function. The corresponding conditional probability calculation can be obtained by calculating the neural network. Finally, the probability of occurrence of each token at each position is calculated by adding a fully connected layer to the hidden state of the last layer of the Transformer and then normalizing it through softmax.

[0111] Furthermore, the KL divergence loss function in step S42 is specifically:

[0112]

[0113] in The output answer is represents the kth word in the output answer, Indicates the teacher model outputs the corresponding first prediction probability The predicted probability of , Indicates the corresponding second prediction probability in the student model output The predicted probability of .

[0114] Furthermore, the general training loss function in step S43 is specifically:

[0115]

[0116] in The output answer is represents the kth word in the output answer, Indicates the corresponding second prediction probability in the student model output The predicted probability of represents the probability, express The word that appears before, Representation basis The previous word predicts the next word to be probability.

[0117] By minimizing the KL divergence according to the KL divergence loss function, the student model will continuously learn the knowledge and abilities mastered by the teacher model, narrow the gap between the teacher model and the student model, and realize the knowledge distillation for the teacher model. Define a specific general training loss function, based on the idea of ​​maximum likelihood estimation, the training goal is to maximize the corresponding likelihood function, which has good probability distribution representation performance, prompting the student model to pay more attention to the complex instruction training samples that are correctly classified, and improve the training efficiency of the student model.

[0118] See also Figure 6 In step S44, the total loss function obtained based on the KL divergence loss function and the general training loss function is specifically:

[0119] Step S441: assign a weight parameter α to the KL divergence loss function and a weight parameter 1-α to the general training loss function, where α ranges from 0 to 1;

[0120] Step S442, performing weighted summation of the KL divergence loss function and the general training loss function to obtain a total loss function.

[0121] It can be understood that by assigning weight parameters to the KL divergence loss function and the general training loss function and performing weighted summation to obtain the total loss function, the weight parameters can be adjusted according to actual conditions to adjust the total loss function.

[0122] See also Figure 7 The second embodiment of the present invention provides a large-scale distillation device, comprising the following modules:

[0123] Initial module 1, used to build the teacher model and the initial student model;

[0124] The instruction complication module 2 is used to obtain the initial instruction and perform the instruction complication operation to obtain the complicated instruction;

[0125] An instruction-answer training data generating module 3 is used to input the complex instruction into the teacher model to generate the answer, and construct the instruction-answer training data based on the complex instruction and the answer;

[0126] The training module 4 is used to train the initial student model using the instruction-answer training data by a data distillation method.

[0127] The third embodiment of the present invention provides a storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the large model distillation method provided by the first embodiment of the present invention is implemented.

[0128] In the embodiments provided by the present invention, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.

[0129] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. 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 invention.

[0130] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the above-mentioned processes does not mean the necessary order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0131] The flow chart and block diagram in the accompanying drawings of the present invention illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementation schemes, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which is determined based on the functions involved. It should be particularly noted that the combination of each box in the block diagram and / or flow chart, the block diagram and / or the box in the flow chart can be implemented by a dedicated hardware-based system that performs a specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0132] Compared with the prior art, the large-model distillation method, device and storage medium provided by the present invention have the following beneficial effects:

[0133] 1. A large model distillation method is provided in an embodiment of the present invention, which comprises constructing a teacher model and an initial student model; obtaining initial instructions to perform instruction complication operations to obtain complex instructions; inputting the complex instructions into the teacher model to generate answers, and constructing high-quality instruction-answer training data based on the complex instructions and answers; and using the high-quality instruction-answer training data to train the initial student model using a data distillation method. By obtaining the initial instructions by a general instruction complication method and performing the instruction complication operation, the complex instructions are obtained so as to effectively activate the knowledge of the teacher model. The initial instructions can be complicated from different angles such as the initial instruction logic complexity and knowledge coverage, so as to improve the complexity and richness of the complex instructions. Compared with simple instructions, the complex instructions are of higher quality and contain more complex knowledge. They can effectively activate the knowledge of the teacher model and effectively improve the knowledge of the student model. The student model can learn more complex tasks, and the learning process is more efficient. The complex instructions input into the student model exceed its ability range, which effectively improves the training efficiency. At the same time, the knowledge distillation mechanism for the teacher model is used for training by data distillation. Data distillation refers to transferring the knowledge of the teacher model to the student model by using data as a bridge. Compared with the existing data distillation, the data distillation of the present invention obtains complex instructions and answers. Compared with simple instructions, the instruction-answer training data is of higher quality and contains more complex knowledge. Using high-quality instruction-answer training data to train the initial student model by data distillation method can effectively activate the knowledge of the teacher model on the one hand, and the high knowledge density answer output by the teacher model fully contains the knowledge of the teacher model; on the other hand, it can effectively improve the knowledge of the student model and learn more complex tasks. Obtaining high-quality training data with teacher model knowledge to train the student model and transferring key information such as the teacher model's knowledge to the student model can efficiently distill the knowledge of the large-scale parameter teacher model into the small-scale parameter student model, reduce the scale of training data, reduce the training and reasoning computing costs, effectively stimulate and efficiently transfer the high-level knowledge of the teacher model, make the student model training mechanism more effective, and the student model obtained through training has better performance, thereby achieving twice the result with half the effort.

[0134] 2. The complex operation provided in the embodiment of the present invention specifically includes expanding the initial instruction into a primary complex instruction based on a pre-trained complex model; inputting the primary complex instruction into the student model to obtain a primary answer, and scoring the primary answer based on the pre-trained feedback model; judging whether the scoring score is lower than a preset threshold, and if so, using the corresponding primary complex instruction as a complex instruction. During the training process, the ability of the student model will be continuously enhanced with the training, and the training difficulty accepted by the student model will be continuously reduced. By constructing a feedback learning method based on the complexity detection of primary complex instructions and enhancing the performance of the student model, the feedback model scores the primary answer output by the student model, and judges whether the scoring score is lower than a preset threshold. A score lower than the preset threshold means that the student model has not learned the relevant knowledge of the primary complex instruction well. The primary complex instruction corresponding to the score lower than the preset threshold is used as a complex instruction, which can dynamically adjust and guide the update of the complex instruction to ensure that the complexity and richness of the complex instruction exceed the ability level of the student model. Since simply using training data cannot maximize the performance of the student model, a feedback learning method based on primary complex instruction complexity detection and enhancement of student model performance is adopted. If the current student model does not perform well on certain instructions or tasks, it will be scored based on the feedback model in the future, and this part of the performance will be selectively enhanced to continuously improve the weak capabilities of the student model. Since the performance difference between the teacher model and the student model will reach the maximum on complex problems, the real-time evaluation feedback of the feedback model can ensure that the student model is trained with complex instructions that meet the complexity requirements, and the performance difference between the student model and the teacher model on complex problems is reduced with high efficiency, so that the student model can better learn the knowledge of the teacher model and achieve the best overall performance for a variety of instructions or tasks.

[0135] 3. Step S21 in the embodiment of the present invention specifically includes the following steps: constructing an instruction template based on few-shot learning; the pre-trained complication model expands the initial instruction into a primary complication instruction based on the instruction template of few-shot learning. Few-shot learning is a machine learning paradigm that aims to enable the model to complete learning tasks with a small number of samples. By constructing an instruction template based on few-shot learning, the pre-trained complication model expands the initial instruction into a primary complication instruction based on the instruction template of few-shot learning, so that only a small number of high-quality instruction complication learning examples need to be prepared to guide the large model to complete the instruction complication process. It can further reduce the amount of training data used. Through the instruction template based on few-shot learning, the complication model can obtain excellent generalization ability and generate primary complication instructions with clear and concise language, polite sentences, no illegal information and no ambiguity, thereby avoiding the generation of meaningless content and only expanding the instructions in length.

[0136] 4. Step S4 provided in the embodiment of the present invention specifically includes: inputting the complicated instruction into the teacher model and the student model respectively, obtaining the first prediction probability output by the teacher model and the second prediction probability output by the student model; obtaining the KL divergence loss function based on the KL divergence according to the first prediction probability and the second prediction probability; obtaining the general training loss function based on the logarithmic loss according to the second prediction probability; obtaining the total loss function based on the KL divergence loss function and the general training loss function, and iteratively updating the current student model based on the total loss function. The initial student model is trained by the instruction-answer training data using the data distillation method. The answer obtained by inputting the complicated instruction into the teacher model in the instruction-answer training data is generated by the teacher model and thus includes the knowledge of the teacher model. The complicated instruction can better stimulate the ability of the teacher model, obtain high-quality training data with knowledge, and thus be more conducive to improving the performance of the student model. By inputting the complicated instruction into the teacher model and the student model respectively, based on the predicted probability distribution, the student model is optimized by constructing the total loss function based on the KL divergence and logarithmic loss, thereby improving the training efficiency of the student model.

[0137] 5. In the embodiment of the present invention, a specific KL divergence loss function is defined, and a training target based on KL divergence is used to quantify the difference in output probability distribution between the teacher model and the student model to enhance the knowledge distillation process. By minimizing the KL divergence according to the KL divergence loss function, the student model will continuously learn the knowledge and logic mastered by the teacher model, narrow the gap between the teacher model and the student model, and realize knowledge distillation for the teacher model.

[0138] 6. In the embodiment of the present invention, a specific general training loss function is defined. Based on the idea of ​​maximum likelihood estimation, the training goal is to maximize the corresponding likelihood function, which has better probability distribution representation performance, prompting the student model to pay more attention to the correct classification of complex instruction training samples, thereby improving the training efficiency of the student model.

[0139] 7. The total loss function obtained based on the KL divergence loss function and the general training loss function provided in the embodiment of the present invention is specifically as follows: assigning a weight parameter α to the KL divergence loss function, assigning a weight parameter 1-α to the general training loss function, wherein α ranges from 0 to 1; performing weighted summation of the KL divergence loss function and the general training loss function to obtain the total loss function. By assigning weight parameters to the KL divergence loss function and the general training loss function, and performing weighted summation to obtain the total loss function, the weight parameters can be adjusted according to the actual situation to adjust the total loss function.

[0140] 8. The pre-training of the feedback model provided in the embodiment of the present invention specifically includes the following steps: constructing an initial feedback model; inputting the initial instruction into the teacher model to obtain a positive example and inputting the initial instruction into the initial student model to obtain a negative example; using the positive and negative examples to train the initial feedback model to obtain a feedback model. By inputting the initial instruction into the teacher model and the initial student model to construct positive and negative examples respectively, and using the positive and negative examples to train the feedback model, the feedback model obtained by training can effectively guide the instruction complication operation to update the current primary complication instruction, ensuring that the student model is trained with the complication instruction that meets the complexity requirements.

[0141] 9. An embodiment of the present invention also provides a large-model distillation device and a computer-readable storage medium, which have the same beneficial effects as the above-mentioned large-model distillation method, and will not be described in detail here.

[0142] The above is a detailed introduction to a large-model distillation method, device and storage medium disclosed in an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention. Any modifications, equivalent substitutions and improvements made within the principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A large model distillation method, characterized in that: The following steps are involved: Step S1, constructing a teacher model and an initial student model; Step S2, obtaining an initial instruction and performing an instruction complication operation to obtain a complicated instruction, wherein the complicated instruction is a complicated instruction in the field of natural language; Step S3, inputting the complicated instruction into the teacher model to generate an answer, wherein the answer is an answer in the natural language field, and constructing instruction-answer training data based on the complicated instruction and the answer; Step S4, using the instruction-answer training data to train the initial student model using a data distillation method; The complicated operation in step S2 specifically includes the following steps: Step S21, expanding the initial instruction into a primary complex instruction based on the pre-trained complex model; Step S22, inputting the primary complex instruction into the student model to obtain a primary answer, and scoring the primary answer based on the pre-trained feedback model; Step S23, determining whether the scoring score is lower than a preset threshold, and if so, taking the corresponding primary complex instruction as a complex instruction.

2. The large model distillation method according to claim 1, characterized in that: The step S21 specifically includes the following steps: Step S211, constructing an instruction template based on few-shot learning; Step S212, the pre-trained complex model expands the initial instruction into a primary complex instruction based on the instruction template learned by few-shot; Wherein, step S212 also includes the following steps: the complication model determines whether the complexity of the primary complication instruction logic exceeds a preset threshold, and if so, adds step-by-step instructions to the primary complication instruction to guide the complication model to perform the instruction complication operation with the step-by-step instructions.

3. The large model distillation method according to claim 1, characterized in that: The step S4 specifically comprises the following steps: Step S41, inputting the complicated instruction into the teacher model and the student model respectively, obtaining a first prediction probability output by the teacher model and a second prediction probability output by the student model; Step S42, obtaining a KL divergence loss function based on the KL divergence according to the first prediction probability and the second prediction probability; Step S43, obtaining a general training loss function based on the logarithmic loss according to the second prediction probability; Step S44, obtaining a total loss function based on the KL divergence loss function and the general training loss function; Step S45, iteratively update the current student model based on the total loss function.

4. The large model distillation method according to claim 3, characterized in that: The KL divergence loss function in step S42 is specifically: in The answer to the output is represents the kth word in the output answer, Represents the output of the teacher model The predicted probability of Represents the output of the student model The predicted probability of .

5. The large model distillation method according to claim 3, characterized in that: The general training loss function in step S43 is specifically: in The answer to the output is represents the kth word in the output answer, Represents the output of the student model The predicted probability of represents the probability, express The word that appears before, Representation basis The word that appeared before predicts the next word to be probability.

6. The large model distillation method according to claim 3, characterized in that: The total loss function obtained in step S44 based on the KL divergence loss function and the general training loss function is specifically: Step S441: assign a weight parameter α to the KL divergence loss function and a weight parameter 1-α to the general training loss function, where α ranges from 0 to 1; Step S442, performing weighted summation of the KL divergence loss function and the general training loss function to obtain a total loss function.

7. The large model distillation method according to claim 1, characterized in that: The pre-training of the feedback model in step S22 specifically includes the following steps: Step S221, constructing an initial feedback model; Step S222, inputting the initial instruction into the teacher model to obtain a positive example and inputting the initial instruction into the initial student model to obtain a negative example; Step S223, using positive and negative examples to train the initial feedback model to obtain a feedback model.

8. A large model distillation apparatus for implementing the large model distillation method according to any one of claims 1 to 7, characterized in that: The large-scale distillation device includes the following modules: The initial module is used to build the teacher model and the initial student model; The instruction complication module is used to obtain the initial instruction to perform the instruction complication operation, expand the initial instruction into a primary complex instruction based on the pre-trained complication model; input the primary complex instruction into the student model to obtain the primary answer, and score the primary answer based on the pre-trained feedback model; determine whether the score is lower than a preset threshold, and if so, use the corresponding primary complex instruction as a complex instruction, wherein the complex instruction is a complex instruction in the natural language field; An instruction-answer training data generation module is used to input complex instructions into a teacher model to generate answers, wherein the answers are answers in the natural language field, and construct instruction-answer training data based on the complex instructions and the answers; A training module is used to train an initial student model using the instruction-answer training data with a data distillation method.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the large model distillation method as described in any one of claims 1 to 7 is implemented.