Model training method and device, refrigerator autonomous system, electronic equipment and storage medium
By constructing a hierarchical large language model and using user feedback for multiple iterations of training, the problem of low accuracy in predicting food interest and recipe preference in the refrigerator autonomous system was solved, improving human-computer interaction capabilities and reducing training costs.
Patent Information
- Application Number
- CN202410876413.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2026-01-09
AI Technical Summary
The refrigerator autonomous system suffers from problems such as low accuracy in predicting food interests and recipe preferences, low accuracy in food text classification, insufficient human-computer interaction and dialogue capabilities, and high model training costs.
A hierarchical large language model is used as the teacher model. Seed model, node model and leaf model are constructed through pre-training and distillation learning methods. User feedback information is used to perform multiple iterations of training to generate a lightweight student model, which reduces training cost and improves prediction accuracy.
It improved the accuracy of predicting food interest and recipe preferences, as well as the accuracy of human-computer interaction dialogue, reduced model training costs, and enhanced the intelligence capabilities of the refrigerator's autonomous system.
Smart Images

Figure CN121303246A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of electrical appliances, and particularly relates to a model training method and device, a refrigerator autonomous system, an electronic device and a storage medium. BACKGROUND
[0002] In the related art, due to insufficient intelligentization, self-learning and self-training, self-evaluation capabilities of the refrigerator autonomous system, high model training costs, the refrigerator autonomous system has low precision or accuracy in food material interest and recipe preference prediction, food material text data type imbalance is prone to sparsity, leading to low food material text classification accuracy, and the human-computer interaction dialogue or information acquisition service capability is insufficient, low in accuracy and poor in timeliness. SUMMARY
[0003] The application aims to at least solve one of the technical problems in the related art. To this end, the application provides a model training method, device, refrigerator autonomous system, electronic device and storage medium.
[0004] In a first aspect, the application provides a model training method, which comprises:
[0005] obtaining a training data set;
[0006] pre-training a teacher model based on the training data set and a pre-training task, the teacher model being a large language model comprising a seed model, a node model and a leaf model;
[0007] saving parameters of the teacher model after the pre-training ends;
[0008] training a student model based on the training data set and an output result of the teacher model, and saving parameters of the student model after the training ends.
[0009] The model training method provided by the embodiments of the application trains the teacher model by constructing a large language model comprising a seed model, a node model and a leaf model as the teacher model. Since the teacher model adopts a hierarchical structure to capture feature information of different granularities, the prediction precision or accuracy corresponding to the prediction task can be improved. After the pre-training ends, the student model is trained based on distillation learning, so that the subsequent prediction task can be performed using a lightweight student model, thereby saving computing resources and reducing training costs.
[0010] According to an embodiment of the application, the training data set is obtained by:
[0011] collecting target data, the target data comprising refrigerator self information and internal and external environment information, human-computer interaction data, agent data, terminal data and historical data;
[0012] preprocessing the target data to obtain preprocessed data;
[0013] performing text aggregation and prompt learning on the preprocessed data to obtain the training data set.
[0014] In the above technical solution, by collecting multiple target data, the data set can be more comprehensive and rich, and by performing text aggregation and prompt learning on the preprocessed data, the quality of the data set can be improved, which is helpful for subsequent model training.
[0015] According to an embodiment of the present application, the pre-training task includes at least one of the following:
[0016] food material interest prediction, recipe preference prediction, and food material text classification;
[0017] human-computer interaction dialogue;
[0018] information acquisition service.
[0019] In the above technical solution, different pre-training tasks can be performed according to different scenarios and user needs, which has better flexibility and applicability.
[0020] According to an embodiment of the present application, based on the training data set and the pre-training task, the teacher model is pre-trained, including:
[0021] using seed data corpus to train the seed model to complete the food material interest prediction, recipe preference prediction, and food material text classification large model training task, and output the results as food material interest information and recipe preference information, the seed data corpus including the full amount of data of the training data set;
[0022] obtaining first feedback information of the user on the output result of the seed model, updating the seed data corpus based on the first feedback information to generate intermediate data corpus, using the intermediate data corpus to train the node model to complete the food material interest prediction, recipe preference prediction, and food material text classification large model training task, and output the results as food material interest information and recipe preference information;
[0023] obtaining second feedback information of the user on the output result of the node model, updating the intermediate data corpus based on the second feedback information to generate leaf data corpus, using the leaf data corpus to train the leaf model to complete the food material interest prediction, recipe preference prediction, and food material text classification large model training task, and output the results as food material interest information and recipe preference information;
[0024] The training step is repeatedly performed, and when a training end condition is met, the training is stopped, and parameters of the seed model, the node model, and the leaf model are saved.
[0025] In the technical solution, the large language model including the seed model, the node model, and the leaf model is constructed as the teacher model, pre-training of the teacher model is performed, the feedback information of the output result of the seed model is used to train the node model, the feedback information of the output result of the node model is used to train the leaf model, the pre-training is ended when the pre-training end condition is reached after multiple loop training, the initial seed model can quickly capture the basic characteristics of the data through hierarchical training, and then the characteristics are gradually refined and optimized in the node model and the leaf model, the accuracy and robustness of the teacher model can be improved, the teacher model can continuously learn and improve through the continuous addition of new user feedback data in the pre-training process of the teacher model, the understanding and prediction ability for new data is continuously improved, and therefore the prediction precision or accuracy of the corresponding prediction task can be improved, the student model is trained based on the distillation learning after the pre-training is ended, and therefore the subsequent prediction task can be performed by using the lightweight student model, the calculation resource can be saved, and the training cost is reduced.
[0026] According to an embodiment of the present application, the method further comprises:
[0027] The third feedback information of the user for the output result of the leaf model is acquired.
[0028] The seed data corpus is updated based on the third feedback information.
[0029] In the technical solution, the third feedback information of the user for the output result of the leaf model is acquired, and the seed corpus is updated, the loop training of the seed model, the node model, and the leaf model is realized, the pre-training is ended when the pre-training end condition is reached after multiple loop training, and the prediction precision or accuracy of the corresponding prediction task can be improved due to the feedback information of the user being integrated in the pre-training process of the teacher model.
[0030] According to an embodiment of the present application, the seed model, the node model, and the leaf model each include an encoder module and a feature fusion module.
[0031] The encoder module is configured to encode the input data of the corresponding model to extract semantic features of the input data.
[0032] The feature fusion module is configured to fuse the semantic features, and the fused features are used to calculate the food material interest prediction result, the recipe preference result, and the food material text classification result.
[0033] In the technical solution, the coding module can increase the granularity, help to extract more detailed granularity semantic feature content, and obtain high-value useful context semantic feature information. The feature fusion module can fuse the semantic features, and make the prediction result more accurate.
[0034] According to an embodiment of the present application, the training of the student model based on the training data set and the output result of the teacher model comprises:
[0035] The training data set is input into the student model and the teacher model respectively;
[0036] Based on the distillation loss function, the difference between the output result of the student model and the real label, and the difference between the output result of the student model and the output result of the teacher model are calculated to obtain a joint loss;
[0037] The parameters of the student model are updated to minimize the joint loss.
[0038] In the technical solution, the training of the teacher model and the student model can transfer the knowledge of the teacher model to the student model, improve the performance of the student model, and consider the difference between the student model and the real label and the difference between the student model and the teacher model. The performance of the student model can be maintained while making it closer to the prediction ability of the teacher model, so that the subsequent light student model can be used to perform the corresponding prediction task, saving the computing resources and reducing the training cost.
[0039] In a second aspect, the present application provides a model training device, which comprises:
[0040] An acquisition unit is configured to acquire a training data set;
[0041] A pre-training unit is configured to pre-train a teacher model based on the training data set and a pre-training task, the teacher model being a large language model comprising a seed model, a node model and a leaf model;
[0042] A saving unit is configured to save the parameters of the teacher model after the pre-training is completed;
[0043] A distillation learning unit is configured to train a student model based on the training data set and the output result of the teacher model, and save the parameters of the student model after the training is completed.
[0044] In the technical solution, the training data set is obtained by the obtaining unit, the teacher model is pre-trained according to the pre-training task and the training data set by the pre-training unit, the teacher model is a large language model including a seed model, a node model and a leaf model, the pre-training of the teacher model adopts a hierarchical structure to capture feature information of different granularities, and the prediction accuracy or precision corresponding to the prediction task can be improved, and after the pre-training is completed, the training of the student model is implemented based on the distillation learning, so that the subsequent light student model can be used to perform the corresponding prediction task, the calculation resources can be saved, and the training cost can be reduced.
[0045] In a third aspect, the application provides a refrigerator autonomous system, comprising: a model training device and a cloud service module as described in the second aspect,
[0046] The cloud service module is configured to execute a first function based on input data, the first function including at least one of the following: food material interest prediction, recipe preference prediction, and food material text classification; human-computer interaction dialogue; information acquisition service.
[0047] The model used by the cloud service module is a student model trained by the model training method of the first aspect.
[0048] In the technical solution, the refrigerator autonomous system uses the student model trained by the model training method of the cloud service module to implement food material interest prediction, recipe preference prediction, food material text classification, human-computer interaction dialogue, information acquisition service and other functions, which can improve the accuracy or precision of food material interest prediction, recipe preference prediction, food material text classification accuracy, improve the human-computer interaction dialogue or information acquisition service capability of the refrigerator autonomous system, improve the accuracy and timeliness of the human-computer interaction dialogue or information acquisition service, and improve the user experience.
[0049] In a fourth aspect, the application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the model training method of the first aspect when executing the program.
[0050] In a fifth aspect, the application provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the model training method of the first aspect.
[0051] In a sixth aspect, the application provides a chip, comprising a processor and a communication interface, the communication interface and the processor are coupled, the processor is configured to run a program or an instruction to implement the model training method of the first aspect.
[0052] In a seventh aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the model training method according to the first aspect.
[0053] Additional aspects and advantages of the present application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS
[0054] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, including the appended drawings.
[0055] Figure 1 is a flowchart of the model training method provided by an embodiment of the present application;
[0056] Figure 2 is a structural schematic diagram of a teacher-student model provided by an embodiment of the present application;
[0057] Figure 3 is a schematic diagram of obtaining a training data set provided by an embodiment of the present application;
[0058] Figure 4 is a structural schematic diagram of an encoder module and a feature fusion module provided by an embodiment of the present application;
[0059] Figure 5 is a schematic diagram of a model training device provided by the present application;
[0060] Figure 6 is a schematic diagram of a refrigerator autonomous system provided by an embodiment of the present application;
[0061] Figure 7 is a schematic diagram of an electronic device provided by an embodiment of the present application.
[0062] BRIEF DESCRIPTION OF DRAWINGS
[0063] 50: model training device; 501: obtaining unit; 502: pre-training unit;
[0064] 503: saving unit; 504: distillation learning unit; 60: refrigerator autonomous system;
[0065] 601: cloud service module; 602: refrigerator; 700: electronic device;
[0066] 701: processor; 702: memory. DETAILED DESCRIPTION
[0067] With reference to the drawings, the technical solutions in the embodiments of the present application will be clearly described below. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art are within the scope of protection of the present application.
[0068] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally a category and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the objects before and after are in an "or" relationship.
[0069] The model training method provided by the embodiments of the present application can be executed by an electronic device or a functional module or functional entity capable of implementing the model training method in the electronic device. The electronic device mentioned in the embodiments of the present application includes but is not limited to a controller in a refrigeration device, a processor in a refrigeration device, an edge server, a background server, a cloud server, a mobile phone, a tablet computer, a computer, a camera, a wearable device, and the like. The model training method provided by the embodiments of the present application will be described below with the electronic device as an example.
[0070] With the rapid development and landing application of large language models, generative artificial intelligence, data enhancement and synthesis, and other artificial intelligence and big data technologies, there are many challenges and series of problems in improving the interest and preference prediction method, system, and other applications of the self-contained system constructed for the refrigerator. If these problems are not solved, it will directly affect the improvement of the intelligent level of the refrigerator and the user experience.
[0071] Currently, the refrigerator has the following problems in food material interest, recipe preference recommendation or self-contained ability, and real example description.
[0072] (1) The refrigerator self-contained system is insufficient in intelligence, self-learning, self-training, and self-evaluation.
[0073] Example one, there are typical limitations of intelligence, such as food material interest not fully utilizing historical information or historical learning, user comment information, user information re-commenting data re-training not playing or not using, resulting in user demand for refrigerator in food material interest, recipe, refrigerator native knowledge, food material text classification not being fully satisfied or not reflecting the due value. Traditional machine learning methods, deep learning in the utilization rate of user reply information or data, model self-training and performance improvement are insufficient, such as weak reasoning ability of food material interest.
[0074] Example two, lack of self-training and self-model improvement ability: such as obtaining user's first or second, third and multiple times of reply information about food material interest, recipe preference, and then collecting a large amount of data for training and improving model performance, and finally generating or recommending food material interest, food material information, recipe and other information accuracy.
[0075] Example three, lack of periodic recommendation of food material, recipe and nutritional health knowledge, including refrigerator periodic maintenance or cleaning reminder information.
[0076] (2) The cost of building a large model or model related data, research and development, and intelligence is too high.
[0077] Example one, the cost of building corpus, labeling data such as voice, text, audio and video, and image data is too high, and even the cost of obtaining data is high and the utilization rate is low;
[0078] Example two, the intelligent cost of large model pre-training is difficult for general enterprises to bear.
[0079] In order to solve the above problems, the model training method provided by the embodiments of the present application is provided, and the model training method, device, refrigerator autonomous system, electronic equipment and storage medium provided by the embodiments of the present application are described in detail below in combination with the drawings and through specific embodiments and application scenarios.
[0080] Figure 1 The flowchart of the model training method provided by the embodiments of the present application is shown in Figure 1 The model training method includes steps 110, 120, 130 and 140.
[0081] Step 110, obtaining a training data set;
[0082] Optionally, the training data set can be a data set obtained from sources such as refrigerator self-information or internal and external environment information, human-computer interaction, multi-round dialogue, personal intelligent assistant, data transmission, data generation tool, data upload, etc.
[0083] The training data set is, for example, food material data, recipe data, containing real-time and historical data, including user reply data or comment data.
[0084] The training data set can be real-time or offline voice, text, video data collected in various input modes, such as 5G / 6G, WiFi, APP, sound pickup, mobile phone, Bluetooth, etc.
[0085] It should be noted that the training data set can be collected by a software device or a hardware device, wherein the hardware collector can be a separate peripheral device or a hardware collection device embedded in the refrigerator.
[0086] Optionally, a voice receiver can be used to collect voice data, such as a sound pickup, a microphone, or a mobile phone to collect real-time voice information; the collected real-time voice is subjected to noise reduction, echo removal, and de-reverberation, etc. operation, and is converted into effective text data, and the voice text data is used as the training data set.
[0087] Optionally, a video collection device can be used to collect video data, such as a mobile phone, a camera, Bluetooth, etc. to collect continuous image sequences, and perform video-to-text operation to obtain video text data, and the video text data is used as the training data set.
[0088] Optionally, the original text data can be directly obtained, and initial text processing is performed, such as removing duplicate data, irrelevant data, and missing abnormal data, to clean the text data, and the processed text data is used as the training data set.
[0089] It should be noted that the training data set can be one of voice, text, and video data, or a combination of multiple types.
[0090] Step 120, pre-training a teacher model based on the training data set and a pre-training task, the teacher model being a large language model including a seed model, a node model, and a leaf model;
[0091] It should be noted that the pre-training task can be set according to the actual scene and application, for example, the pre-training task can be predicting user food material interest, recipe preference, interactive dialogue, etc.
[0092] According to the training data set and the pre-training task, the teacher model is pre-trained, and the teacher model is a large language model including a seed model, a node model, and a leaf model.
[0093] It should be noted that the input of the seed model is the initial training data set, the training data set is updated as the input of the node model based on the feedback information of the user on the prediction result of the seed model after the seed model training is completed, the training data set is updated as the input of the leaf model based on the feedback information of the user on the prediction result of the node model after the node model training is completed, the training data set is updated as the input of the seed model based on the feedback information of the user on the prediction result of the leaf model after the leaf model training is completed, and the seed model, the node model and the leaf model are iteratively trained.
[0094] It should be noted that the number of iterations of the teacher model can be set according to the structure of the seed model, the node model and the leaf model, or the initial iteration threshold can be set according to the actual situation.
[0095] Optionally, the teacher model is pre-trained based on the training data set and the pre-training task, comprising:
[0096] The seed model is trained using seed data corpus to complete the pre-training task, and the seed data corpus includes full-amount data of the training data set.
[0097] The first feedback information of the user on the output result of the seed model is obtained, the seed data corpus is updated based on the first feedback information to generate intermediate data corpus, and the node model is trained using the intermediate data corpus to complete the pre-training task.
[0098] The second feedback information of the user on the output result of the node model is obtained, the intermediate data corpus is updated based on the second feedback information to generate leaf data corpus, and the leaf model is trained using the leaf data corpus to complete the pre-training task.
[0099] The training steps are repeatedly executed, and when the training end condition is met, the training is stopped, and the parameters of the seed model, the node model and the leaf model are saved.
[0100] Step 130, after the pre-training is completed, the parameters of the teacher model are saved;
[0101] After the pre-training of the teacher model is completed, the parameters of the teacher model are saved as the input parameters of the student model.
[0102] Step 140, the student model is trained based on the training data set and the output result of the teacher model, and after the training is completed, the parameters of the student model are saved.
[0103] Figure 2 is a structure diagram of the teacher-student model provided by the embodiment of the application, as Figure 2As shown, the training data set includes voice data, text data, video data, data collected through voice-to-text and video-to-text processing, and text data obtained through prompt learning of the text data. The training data set is used as the initial seed corpus of the seed model of the teacher model. When the seed model training is completed, user feedback information is collected and the training data set is updated as the input data set of the node model. When the node model training is completed, user feedback information is collected and the training data set is updated as the input data set of the leaf model. When the teacher model pre-training is completed, the parameters of the teacher model are saved, the training data set is used as the input of the student model, and the parameters of the teacher model are used as the initial parameters of the student model. The student model is trained, and the parameters of the student model are saved after the training is completed.
[0104] The model training method provided by the embodiments of the present application can improve the prediction accuracy or precision of the corresponding prediction task by constructing a large language model including a seed model, a node model and a leaf model as a teacher model, pre-training the teacher model, and training a student model based on distillation learning after the pre-training is completed, so that the subsequent prediction task can be performed by using a lightweight student model, thereby saving computing resources and reducing training costs.
[0105] According to an embodiment of the present application, the training data set is obtained, including:
[0106] The target data includes refrigerator self information and internal and external environment information, human-computer interaction data, agent data, terminal data, and historical data.
[0107] The target data is pre-processed to obtain pre-processed data.
[0108] The pre-processed data is subjected to text aggregation and prompt learning to obtain the training data set.
[0109] It should be noted that the target data includes refrigerator self information and internal and external environment information, human-computer interaction data, agent data, terminal data, and historical data. The form of the target data can be one or more of voice data, video data, and text data.
[0110] Optionally, the voice data can be obtained by collecting user voice through a sound pickup device, a microphone array or the like arranged in the refrigerator.
[0111] Optionally, the video data can be collected by shooting through a camera or the like arranged in the refrigerator, or the voice and video transmitted by the user can be obtained through a client terminal connected to the refrigerator based on a wireless communication protocol.
[0112] It should be noted that the client terminal is an electronic device with information sending function, such as mobile phone, tablet computer, smart sound, smart bracelet or Bluetooth headset.
[0113] After obtaining the target data, the data needs to be preprocessed. The preprocessing includes data cleaning, format conversion and storage tasks. For video data, speech and video separation can be performed using tools or scripts to obtain effective speech and video data. For text data, stop word removal, deduplication and other processing can be performed.
[0114] Figure 3 is a schematic diagram provided by the embodiment of the application for obtaining a training data set, as Figure 3 After collecting speech data, speech-to-text processing can be performed on the speech data. A transformer Block speech recognition model architecture based on convolution enhancement can be used to obtain context information of the speech data. Convolution enhancement can also be used to obtain efficient local speech semantic feature information.
[0115] Optionally, the speech-to-text model can be a Gaussian neural network model or an end-to-end deep neural network model based on coding and decoding structure.
[0116] Optionally, after collecting video data, image features can be extracted from the video data, and text content can be identified. This can be achieved through a migration and distillation diffusion deep fusion network model based on spatiotemporal and long-distance dependency features.
[0117] After converting the collected data set into text, text aggregation and filtering can be performed to effectively fuse and filter the text data to obtain a high-quality data set.
[0118] Text data after text aggregation can be prompted to learn, and the obtained text data can be effectively fused and prompted to perform engineering tasks. The text data can be uniformly mapped and an embedding space model can be constructed. If there is a text prompt with personalized features, an integrated template method can be used. Through these steps, text data content with efficient prompt engineering information can be obtained.
[0119] It should be noted that when processing historical data, text vectorization and transfer learning tasks can be performed to unify data representation and measurement. Deep convolutional networks can be used to extract data features to obtain data representation.
[0120] In the above technical solution, by collecting multiple target data, the data set can be more comprehensive and rich. Text aggregation and prompt learning on preprocessed data can improve the quality of the data set, which is helpful for subsequent model training.
[0121] According to one embodiment of the present application, the pre-training task comprises at least one of the following:
[0122] food material interest prediction, recipe preference prediction, and food material text classification;
[0123] human-computer interaction dialogue;
[0124] information acquisition service.
[0125] Optionally, the pre-training task can be food material interest prediction, recipe preference prediction, and food material text classification. By training the model, the user's food material interest prediction can be output, for example, the user is interested in corn. The recipe preference prediction can be output, for example, the user's preferred recipe is braised pork, tomato beef brisket, and the food material text classification can be output, for example, the food material is classified into categories such as vegetables, meat, and eggs.
[0126] Optionally, the pre-training task can be human-computer interaction dialogue. By training the model, a dialogue with the user can be completed. When the user asks a question, an answer can be provided to the user, for example, the user asks "What is the weather today?" and the corresponding answer can be output.
[0127] Optionally, the pre-training task can be information acquisition service. By training the model, the user can obtain corresponding information, for example, telling the user the food materials in the refrigerator, providing medication reminders, schedule reminders, etc.
[0128] In the above technical solution, different pre-training tasks can be performed according to different scenarios and user needs, which has better flexibility and applicability.
[0129] According to one embodiment of the present application, the pre-training of the teacher model based on the training data set and the pre-training task comprises:
[0130] The seed model is trained using seed data corpus to complete the food material interest prediction, recipe preference prediction, and food material text classification large model training task, and the output result is food material interest information and recipe preference information. The seed data corpus includes the full amount of data of the training data set.
[0131] The first feedback information of the user on the output result of the seed model is obtained, the seed data corpus is updated based on the first feedback information to generate intermediate data corpus, the node model is trained using the intermediate data corpus to complete the food material interest prediction, recipe preference prediction, and food material text classification large model training task, and the output result is food material interest information and recipe preference information.
[0132] obtaining second feedback information of the user on the output result of the node model, updating the intermediate data corpus based on the second feedback information, generating a leaf data corpus, training the leaf model using the leaf data corpus, completing the food material interest prediction, recipe preference prediction, and food material text classification large model training task, and outputting food material interest information and recipe preference information as the result;
[0133] repeating the training step, stopping training when a training end condition is met, and saving parameters of the seed model, the node model, and the leaf model.
[0134] It is easy to understand that in the embodiment, the pre-training task is food material interest prediction, recipe preference prediction, and food material text classification.
[0135] The seed model is pre-trained using the seed data corpus. After pre-training is completed, the seed model can generate prediction information about user food material interest and recipe preference. When the user scores or feeds back on the prediction results, the teacher model records the feedback information. Over time, the feedback information will constitute a new data set for subsequent node model training.
[0136] The output result of the user on the seed model is taken as first feedback information, the seed data corpus is updated to generate an intermediate data corpus, the node model is pre-trained using the intermediate data corpus, the food material interest prediction, recipe preference prediction, and food material text classification large model training task are completed, and the output result of the node model is fed back by the user to obtain second feedback information.
[0137] The obtained second feedback information is input into the intermediate data corpus for updating to generate a leaf data corpus, the leaf model is trained using the leaf data corpus, the food material interest prediction, recipe preference prediction, and food material text classification large model training task are completed, and food material interest information and recipe preference information are output as the result, and the output result of the leaf model is fed back by the user to obtain third feedback information.
[0138] According to an embodiment of the present application, the method further comprises:
[0139] obtaining third feedback information of the user on the output result of the leaf model;
[0140] updating the seed data corpus based on the third feedback information.
[0141] The obtained third feedback information is input into the seed corpus for updating to generate a new seed data corpus, the seed model is trained using the seed data corpus, the food material interest prediction, recipe preference prediction, and food material text classification large model training task are completed, and food material interest information and recipe preference information are output as the result.
[0142] In the technical solution, the third feedback information of the user on the output result of the leaf model is obtained to update the seed corpus, the cycle training of the seed model, the node model and the leaf model is realized, and the pre-training is ended when the pre-training end condition is reached after multiple cycle training. Since the feedback information of the user is integrated in the pre-training process of the teacher model, the prediction accuracy or precision corresponding to the prediction task can be improved.
[0143] It is worth noting that the seed model, the node model and the leaf model are iterated cyclically when the teacher model is trained, and the cycle is stopped when the iteration threshold is reached, and the pre-training of the teacher model is ended.
[0144] It should be noted that the structures of the seed model, the node model and the leaf model are similar to a binary tree, and the cycle iteration number can be set according to the number of layers of the seed model, the node model and the leaf model, or can be set according to the convergence effect of the teacher model.
[0145] In the technical solution, a large language model including the seed model, the node model and the leaf model is constructed as the teacher model, the teacher model is pre-trained, the feedback information of the user on the output result of the seed model is used to train the node model, the feedback information of the user on the output result of the node model is used to train the leaf model, the pre-training is ended when the pre-training end condition is reached after multiple cycle training, the basic features of the data can be quickly captured by the initial seed model through hierarchical training, and then the features are gradually refined and optimized in the node model and the leaf model, which can improve the accuracy and robustness of the teacher model. The teacher model can continuously learn and improve by continuously adding new user feedback data in the pre-training process of the teacher model, and the understanding and prediction ability of the teacher model for new data can be continuously improved, so that the prediction accuracy or precision corresponding to the prediction task can be improved. After the pre-training is ended, the training of the student model is realized based on the distillation learning, so that the subsequent light student model can be used to perform the corresponding prediction task, the computing resources can be saved, and the training cost can be reduced.
[0146] According to an embodiment of the present application, the seed model, the node model and the leaf model each include an encoder module and a feature fusion module.
[0147] The encoder module is configured to encode the input data of the corresponding model to extract semantic features of the input data.
[0148] The feature fusion module is configured to fuse the semantic features, and the fused features are used to calculate the food interest prediction result, the recipe preference result and the food text classification result.
[0149] Figure 4is a structural schematic diagram of an encoder module and a feature fusion module provided by the embodiment of the present application, as shown Figure 4 The encoder module can adopt a transformer structure, and the transformer large model construction can adopt a semantic compression large language model with only encoding, only decoding, and encoding and decoding, such as a large language model with a graph neural network, an attention mechanism, a transformer model and its variants or improvements, a distillation network large language model, a latent / diffusion large language model, a U-net network and other deep network large language models, a fusion deep network large language model such as a bidirectional long short-term memory network + multi-modal convolutional neural network-recurrent neural network based on transformer, a bidirectional long short-term memory network + multi-modal convolutional neural network + attention, a multi-modal convolutional neural network + bidirectional long short-term memory network + attention fusion large language model, a GRU + convolutional neural network, a GRU + convolutional neural network + attention model, a deep reinforcement learning and reward model, a RAG large language model, and a series of neural network or deep neural network large language models, and a Gaussian mixture deep neural network model.
[0150] The encoder module first completes embedding layer encoding, which can be divided into several sub-blocks, so that the encoding unit has finer granularity, which is beneficial to subsequent extraction of more detailed granular semantic feature content.
[0151] After the encoder module completes the embedding layer encoding, it continues to obtain multi-layer semantic features with a multi-head attention mechanism, and then performs residual and root mean square normalization calculation. The root mean square normalization calculation module is performed after the multi-head attention mechanism, i.e., after the residual, and then the FFN layer operation is calculated again. Finally, residual and normalization calculation are performed to obtain high-value useful context semantic feature information.
[0152] The feature fusion module can fuse semantic features to complete the correlation, dependency and other multi-semantic features of the semantic features. The prediction result is calculated by the feature vector of the fused feature, wherein the prediction result can adopt a classification function or top-k score calculation.
[0153] It should be noted that the encoding module can adopt any one of the only encoding module, the only decoding module, and the encoding and decoding module, and the embodiment of the present application does not limit the form of the encoding module.
[0154] In the above technical solution, the use of the encoding module can increase the fine granularity, which is beneficial to subsequent extraction of more detailed granular semantic feature content, and can obtain high-value useful context semantic feature information. The use of the feature fusion module to fuse semantic features can make the prediction result more accurate.
[0155] According to one embodiment of the present application, the training of the student model based on the training data set and the output result of the teacher model comprises:
[0156] inputting the training data set into the student model and the teacher model respectively;
[0157] calculating the difference between the output result of the student model and the real label and the difference between the output result of the student model and the output result of the teacher model based on the distillation loss function to obtain a joint loss;
[0158] updating the parameters of the student model to minimize the joint loss.
[0159] It is easy to understand that the training data set is input into the student model and the teacher model respectively, the difference between the output result of the student model and the real label and the difference between the output result of the student model and the output result of the teacher model are calculated based on the distillation loss function to obtain a joint loss, and the parameters of the student model are updated to minimize the joint loss.
[0160] Optionally, the distillation loss function can use a cross-entropy loss function to compare the output result of the student model with the real label and calculate the difference therebetween, which can reflect the performance of the student model in the training task.
[0161] The output result of the student model is compared with the output result of the teacher model to calculate the difference therebetween. This difference reflects the deviation of the student model in attempting to copy the prediction ability of the teacher model, and the joint loss is obtained, the parameters of the student model are updated, and the difference between the student model and the real label and the difference between the student model and the teacher model are considered comprehensively.
[0162] Optionally, a joint loss function can be defined according to the specific scene, and the joint loss function is minimized, for example, the parameters of the student model are updated by a back propagation algorithm, so that the student model can better fit the real label and also imitate the prediction ability of the teacher model.
[0163] In the above technical solution, the knowledge of the teacher model can be transferred to the student model through the training of the teacher model and the student model, the performance of the student model can be improved, and the difference between the student model and the real label and the difference between the student model and the teacher model are considered, so that the student model can be closer to the prediction ability of the teacher model while maintaining its performance, thereby the lightweight student model can be used to perform the corresponding prediction task subsequently, the calculation resources can be saved, and the training cost can be reduced.
[0164] Figure 5 is a schematic diagram of a model training device provided by the present application, as Figure 5As shown, the model training apparatus 50 comprises an acquisition unit 501, a pre-training unit 502, a saving unit 503 and a distillation learning unit 504.
[0165] The acquisition unit 501 is configured to acquire a training data set.
[0166] The pre-training unit 502 is configured to pre-train a teacher model based on the training data set and a pre-training task, the teacher model being a large language model comprising a seed model, a node model and a leaf model.
[0167] The saving unit 503 is configured to save parameters of the teacher model after pre-training is completed.
[0168] The distillation learning unit 504 is configured to train a student model based on the training data set and an output result of the teacher model, and save parameters of the student model after training is completed.
[0169] Optionally, the acquisition unit 501 is configured to:
[0170] acquire target data, the target data comprising refrigerator self information and internal and external environment information, human-computer interaction data, agent data, terminal data and historical data;
[0171] pre-process the target data to obtain pre-processed data;
[0172] perform text aggregation and prompt learning on the pre-processed data to obtain the training data set.
[0173] Optionally, the pre-training task comprises at least one of the following:
[0174] food material interest prediction, recipe preference prediction and food material text classification;
[0175] human-computer interaction dialogue;
[0176] information acquisition service.
[0177] Optionally, the pre-training unit 502 is configured to:
[0178] the pre-training of the teacher model based on the training data set and the pre-training task comprises:
[0179] training the seed model using seed data corpus to complete the food material interest prediction, recipe preference prediction and food material text classification large model training task, and outputting results of food material interest information and recipe preference information, the seed data corpus comprising full-amount data of the training data set;
[0180] obtaining first feedback information of the user on the output result of the seed model, updating the seed data corpus based on the first feedback information, generating an intermediate data corpus, training the node model using the intermediate data corpus, completing the food material interest prediction, recipe preference prediction and food material text classification large model training task, and outputting food material interest information and recipe preference information as the result;
[0181] obtaining second feedback information of the user on the output result of the node model, updating the intermediate data corpus based on the second feedback information, generating a leaf data corpus, training the leaf model using the leaf data corpus, completing the food material interest prediction, recipe preference prediction and food material text classification large model training task, and outputting food material interest information and recipe preference information as the result;
[0182] repeating the training step until a training end condition is met, stopping the training, and saving the parameters of the seed model, the node model and the leaf model.
[0183] Optionally, the pre-training unit 502 is configured to:
[0184] obtain third feedback information of the user on the output result of the leaf model;
[0185] update the seed data corpus based on the third feedback information.
[0186] Optionally, the seed model, the node model and the leaf model each include an encoder module and a feature fusion module.
[0187] The encoder module is configured to encode input data of a corresponding model to extract semantic features of the input data.
[0188] The feature fusion module is configured to fuse the semantic features, and the fused features are used to calculate food material interest prediction results, recipe preference results and food material text classification results.
[0189] Optionally, the distillation learning unit 504 is configured to:
[0190] The training of the student model based on the training data set and the output result of the teacher model includes:
[0191] inputting the training data set into the student model and the teacher model respectively;
[0192] based on a distillation loss function, calculating the difference between the output result of the student model and the real label, and the difference between the output result of the student model and the output result of the teacher model, to obtain a joint loss;
[0193] update parameters of the student model to minimize the joint loss.
[0194] In the technical solution, the training data set is acquired by the acquisition unit, the teacher model is pre-trained according to the pre-training task and the training data set by the pre-training unit, the teacher model is a large language model including a seed model, a node model and a leaf model, the pre-training of the teacher model adopts a hierarchical structure to capture feature information of different granularities, and the prediction accuracy or precision corresponding to the prediction task can be improved. After the pre-training is completed, the training of the student model is realized based on distillation learning, so that the subsequent light student model can be used to perform the corresponding prediction task, the calculation resources can be saved, and the training cost can be reduced.
[0195] The model training apparatus 50 in the embodiments of the present application can be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal, such as a network device, a server, and the like. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), and the like, and can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, and the like, and the embodiments of the present application are not limited specifically.
[0196] The model training apparatus 50 in the embodiments of the present application can be a device with an operating system. The operating system can be a Microsoft (Windows) operating system, an Android operating system, an IOS operating system, or other possible operating systems, and the embodiments of the present application are not limited specifically.
[0197] The model training apparatus 50 provided in the embodiments of the present application can implement the method embodiments Figures 1 to 4 The method embodiments, and each process is not repeated here to avoid repetition.
[0198] The embodiments of the present application also provide a refrigerator autonomous system, which includes the model training apparatus and a cloud service module,
[0199] The cloud service module is configured to perform a first function based on the input data, the first function comprising at least one of: food material interest prediction, recipe preference prediction, and food material text classification; human-computer interaction dialogue; information acquisition service.
[0200] The model used by the cloud service module is a student model trained by the model training method described above.
[0201] It is easy to understand that the cloud service module performs a first function based on the input data of the user, and the first function includes at least one of food material interest prediction, recipe preference prediction, and food material text classification; human-computer interaction dialogue; information acquisition service.
[0202] Optionally, when the first function is food material interest prediction or recipe preference prediction, the cloud service module uses the student model trained by the model training method described above to train the input data, and outputs the food material interest of the user, such as corn, or the recipe preference, such as braised pork.
[0203] Optionally, when the first function is food material text classification, the cloud service module uses the student model trained by the model training method described above to train the input data, and outputs the text classification result of the food material. For example, vegetables, fruits, and meat.
[0204] It is worth noting that the cloud service module can be deployed on an APP, a computer, a mini program, a display screen, and the user can input through gestures, voice input, text input, video upload, image acquisition, etc.
[0205] It should be noted that the refrigerator autonomous system can be applied to household appliances, hotels, industries, indoor and outdoor occasions, military and aerospace, etc., and can be in the form of flat embedding, vehicle embedding, integration, etc.
[0206] Figure 6 is a schematic diagram of a refrigerator autonomous system provided by an embodiment of the present application, as Figure 6 shown, the refrigerator autonomous system 60 includes a model training device 50, a cloud service module 601, and a refrigerator 602.
[0207] In the above technical solution, the refrigerator autonomous system uses the student model trained by the cloud service module using the model training method described above to realize food material interest prediction, recipe preference prediction, food material text classification, human-computer interaction dialogue, information acquisition service, etc., which can improve the accuracy or accuracy of food material interest prediction, recipe preference prediction, food material text classification accuracy, improve the human-computer interaction dialogue or information acquisition service capability of the refrigerator autonomous system, improve the accuracy and timeliness of human-computer interaction dialogue or information acquisition service, and improve the user experience.
[0208] In some embodiments, asFigure 7 As shown, the electronic device 700 in the embodiments of the present application includes a processor 701, a memory 702, and a computer program stored in the memory 702 and executable on the processor 701. The program is executed by the processor 701 to implement the processes of the model training method embodiments described above and achieve the same technical effects. To avoid repetition, details are not described here.
[0209] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device described above.
[0210] The embodiments of the present application also provide a non-transitory computer readable storage medium having a computer program stored thereon. The computer program is executed by a processor to implement the processes of the model training method embodiments described above and achieve the same technical effects. To avoid repetition, details are not described here.
[0211] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0212] The embodiments of the present application also provide a computer program product including a computer program. The computer program is executed by a processor to implement the model training method described above.
[0213] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0214] The embodiments of the present application also provide a chip including a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to run a program or an instruction to implement the processes of the model training method embodiments described above and achieve the same technical effects. To avoid repetition, details are not described here.
[0215] It should be understood that the chip mentioned in the embodiments of the present application can also be referred to as a system level chip, a system chip, a chip system or a system on chip, etc.
[0216] It should be noted that, in the present document, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a", "comprising", or "comprises" does not, without more constraints, preclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element. Additionally, it should be noted that the terms "one embodiment", "some embodiments", "certain embodiments", "certain examples", or "some examples" as used in the present document are intended to refer to one or more embodiments or examples that do not necessarily have to cover all embodiments or examples of the present application. In other words, use of the above terms does not necessarily refer to the same embodiment or example. Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0217] From the above description of the embodiments, it is apparent that the above-mentioned method can be realized by means of software and necessary universal hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solution of the present application can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disc, optical disc), and includes a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, or network equipment, etc.) execute the method described in various embodiments of the present application.
[0218] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, which are only illustrative but not restrictive, and a person of ordinary skill in the art can make many forms without departing from the purpose of the present application and the scope protected by the claims.
[0219] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "illustrative embodiment", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the described specific features, structures, materials or characteristics can be combined in any suitable manner in any one or more embodiments or examples.
[0220] While the embodiments of the application have been shown and described, it is to be understood that the embodiments can be varied, modified, substituted and changed by those skilled in the art without departing from the principles and spirit of the application, the scope of which is defined by the claims and their equivalents.
Claims
1. A model training method, characterized in that, include: Obtain the training dataset; Based on the training dataset and pre-training task, the teacher model is pre-trained, which is a large language model including a seed model, a node model and a leaf model. After pre-training is complete, save the parameters of the teacher model; The student model is trained based on the training dataset and the output of the teacher model. After training, the parameters of the student model are saved.
2. The model training method according to claim 1, characterized in that, The acquisition of the training dataset includes: Collect target data, which includes: refrigerator self-information and internal and external environment information, human-computer interaction data, intelligent agent data, terminal data, and historical data; The target data is preprocessed to obtain preprocessed data; The preprocessed data is subjected to text aggregation and prompt learning to obtain the training dataset.
3. The model training method according to claim 1, characterized in that, The pre-training task includes at least one of the following: Ingredient interest prediction, recipe preference prediction, and ingredient text classification; Human-computer interaction dialogue; Information retrieval services.
4. The model training method according to claim 3, characterized in that, The pre-training of the teacher model based on the training dataset and the pre-training task includes: Using the seed data corpus, the seed model is trained to complete the training tasks of large models for food interest prediction, recipe preference prediction, and food text classification. The output results are food interest information and recipe preference information. The seed data corpus includes the full data of the training dataset. Obtain the first feedback information from the user regarding the output of the seed model, update the seed data corpus based on the first feedback information, generate intermediate data corpus, train the node model using the intermediate data corpus, complete the training tasks of the large model for food interest prediction, recipe preference prediction, and food text classification, and output the food interest information and recipe preference information. Obtain the second feedback information of the user on the output of the node model, update the intermediate data corpus based on the second feedback information, generate leaf data corpus, train the leaf model using the leaf data corpus, complete the training tasks of large model for food interest prediction, recipe preference prediction and food text classification, and output the food interest information and recipe preference information. Repeat the training steps. When the training termination condition is met, stop the training and save the parameters of the seed model, node model, and leaf model.
5. The model training method according to claim 4, characterized in that, The method further includes: Obtain third feedback information from the user regarding the output of the leaf model; Based on the third feedback information, the seed data corpus is updated.
6. The model training method according to claim 4 or 5, characterized in that, The seed model, node model, and leaf model each include: an encoder module and a feature fusion module; The encoder module is used to encode the input data of the corresponding model in order to extract the semantic features of the input data; The feature fusion module is used to fuse the semantic features, and the fused features are used to calculate the food interest prediction result, recipe preference result, and food text classification result.
7. The model training method according to claim 1, characterized in that, The training of the student model based on the training dataset and the output of the teacher model includes: Input the training dataset into the student model and the teacher model respectively; Based on the distillation loss function, the difference between the student model's output and the true label, as well as the difference between the student model's output and the teacher model's output, are calculated to obtain the joint loss. Update the parameters of the student model to minimize the joint loss.
8. A model training device, characterized in that, include: The acquisition unit is used to acquire the training dataset. The pre-training unit is used to pre-train the teacher model based on the training dataset and the pre-training task. The teacher model is a large language model that includes a seed model, a node model, and a leaf model. A storage unit is used to save the parameters of the teacher model after pre-training is completed; The distillation learning unit is used to train the student model based on the training dataset and the output of the teacher model, and saves the parameters of the student model after training.
9. A refrigerator autonomous system, characterized in that, include: The model training device and cloud service module as described in claim 8, The cloud service module is used to execute a first function based on input data, the first function including at least one of the following: ingredient interest prediction, recipe preference prediction, and ingredient text classification; human-computer interaction dialogue; and information acquisition service. The model used by the cloud service module is a student model trained using the model training method described in any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the model training method as described in any one of claims 1-7.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the model training method as described in any one of claims 1-7.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the model training method as described in any one of claims 1-7.
Citation Information
Cited By
Data cleaning scheme generation method and device and readable storage medium
CN121561262A