Model training method and sample determination method for model training

By screening out target samples with high learning value and training on large models, the problems of high cost of manual annotation data and low training efficiency in the existing technology are solved, and efficient and low-cost model training effects are achieved.

CN119357679BActive Publication Date: 2025-05-02ALIBABA CLOUD FEITIAN (HANGZHOU) CLOUD COMPUTING TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411918022.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-05-02
Estimated Expiration
2044-12-24

AI Technical Summary

Technical Problem

When the prior art conducts instruction tuning training for large models, a large amount of manual labeling data is required, resulting in high labeling costs and low training efficiency. Expanding the sample set size does not necessarily improve the training effect, but may introduce noise and redundant information.

Method used

By obtaining the candidate sample set of training tasks, determining the reference information of the candidate sample, determining the quality index of the candidate sample based on the model to be trained, filtering out the target sample with high learning value, training the trained model, and obtaining the target task processing model.

Benefits of technology

This reduces the cost of model training, improves training efficiency, ensures model performance, pays attention to the quality of samples rather than quantity, and avoids the introduction of noise and redundant information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357679B_ABST
    Figure CN119357679B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a model training method and a sample determination method for model training, wherein the model training method includes: obtaining a candidate sample set for a training task, wherein the candidate sample set includes candidate samples; determining reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set; determining a quality index of the first candidate sample based on the model to be trained according to the first candidate sample and the reference information, wherein the quality index is used to indicate the learning value of the first candidate sample for the model to be trained; determining a target sample from each candidate sample according to the quality index of each candidate sample, training the model to be trained based on the target sample, obtaining a target task processing model, wherein the learning value of the target sample for the model to be trained is higher than the learning value of other samples in each candidate sample for the model to be trained. Focusing on the quality of samples rather than the quantity ensures model performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of deep learning technology, and in particular to a model training method and a sample determination method for model training. Background Art

[0002] With the rapid development of computer technology and artificial intelligence technology, large models are being used more and more widely and are now able to perform a variety of complex language tasks, including writing, translation, conversation, question-and-answer, etc. Large models can quickly learn from a large amount of sample data and generate processing results that are more in line with task requirements. Instruction tuning training is a method of enhancing model performance by carefully adjusting the model's response to task instructions. It can significantly improve the performance of the model, enabling the model to better understand the user's intent, thereby generating more contextually relevant and personalized responses that align with instructions.

[0003] In the prior art, when training large models for instruction tuning, it is necessary to accumulate larger, more diverse and more complex sample sets, which usually requires manual labeling of a large amount of data, which has high labeling costs. Moreover, blindly expanding the size of the sample set does not necessarily improve the training effect. Instead, it may introduce noise and redundant information, diluting the effectiveness and value of the sample set, resulting in high training costs and low training efficiency for large models. Therefore, a lower-cost and more efficient model training solution is urgently needed. Summary of the invention

[0004] In view of this, an embodiment of this specification provides a model training method. One or more embodiments of this specification also relate to a sample determination method for model training, a task processing method, an information processing method based on a target task processing model, a model training platform, a computing device, an electronic device, a computer-readable storage medium, and a computer program product to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, a model training method is provided, including:

[0006] Acquire a candidate sample set for a training task, wherein the candidate sample set includes candidate samples;

[0007] Determine reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set;

[0008] Determining, according to the first candidate sample and the reference information, a quality indicator of the first candidate sample based on the model to be trained, wherein the quality indicator is used to indicate the learning value of the first candidate sample for the model to be trained;

[0009] According to the quality indicators of each candidate sample, a target sample is determined from the candidate samples, and the model to be trained is trained based on the target sample to obtain a target task processing model, wherein the learning value of the target sample for the model to be trained is higher than the learning value of other samples in the candidate samples for the model to be trained.

[0010] According to a second aspect of an embodiment of this specification, a sample determination method for model training is provided, including:

[0011] Acquire a candidate sample set for a training task, wherein the candidate sample set includes candidate samples;

[0012] Determine reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set;

[0013] Determining, according to the first candidate sample and the reference information, a quality indicator of the first candidate sample based on the model to be trained, wherein the quality indicator is used to indicate the learning value of the first candidate sample for the model to be trained;

[0014] According to the quality indicators of each candidate sample, a target sample is determined from the candidate samples, wherein the target sample is used to train an initial model, the learning value of the target sample for the model to be trained is higher than the learning value of other samples in the candidate samples for the model to be trained, and the initial model includes other models that belong to the same scenario but have different model specification parameters as the model to be trained.

[0015] According to a third aspect of an embodiment of this specification, a task processing method is provided, including:

[0016] Get the task data of the target task;

[0017] The task data is processed using a target task processing model corresponding to the target task to obtain a target processing result of the target task, wherein the target task processing model is trained based on the above-mentioned model training method.

[0018] According to a fourth aspect of an embodiment of this specification, there is provided an information processing method based on a target task processing model, which is applied to a task platform and includes:

[0019] Receiving a model request sent by a terminal device, wherein the model request includes a scene identifier of a target scene, scene input data of the target scene, and at least one of a model specification parameter;

[0020] Based on the model request, a corresponding target task processing model is determined from at least one task processing model, wherein the at least one task processing model is trained based on the model training method as described above.

[0021] According to a fifth aspect of an embodiment of this specification, there is provided a model training platform, including a request interface unit, a model training unit and a response unit;

[0022] The request interface unit is used to receive a model training request, wherein the model training request includes model attribute information of a model to be trained;

[0023] The model training unit is used to determine the model to be trained according to the model attribute information; obtain a candidate sample set for the training task, wherein the candidate sample set includes candidate samples; determine reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set; determine a quality indicator of the first candidate sample based on the model to be trained according to the first candidate sample and the reference information, wherein the quality indicator is used to indicate the learning value of the first candidate sample for the model to be trained; determine a target sample according to the quality indicator of each candidate sample, train the model to be trained based on the target sample, and obtain a target task processing model;

[0024] The response unit is used to output the target task processing model.

[0025] According to a sixth aspect of an embodiment of this specification, a computing device is provided, including:

[0026] Memory and processor;

[0027] Among them, the memory is used to store computer programs / instructions, and the processor is used to execute computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on the target task processing model are implemented.

[0028] According to a seventh aspect of the embodiments of this specification, an electronic device is provided, including:

[0029] A memory and a processor, wherein the memory and the processor are connected via a bus;

[0030] Among them, the memory is used to store computer programs / instructions, and the processor is used to execute computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on the target task processing model are implemented.

[0031] According to the eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on the target task processing model.

[0032] According to the ninth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on a target task processing model.

[0033] The embodiments of the present specification provide a model training method, which realizes determining reference information of a first candidate sample, determining a quality indicator of the first candidate sample based on the first candidate sample and the reference information, the quality indicator can indicate the learning value of the first candidate sample for the model to be trained, and then based on the quality indicators of each candidate sample in the candidate sample set, screen out a target sample from each candidate sample, and then train the model to be trained based on the target sample, the learning value of the screened target sample for the model to be trained is higher than the learning value of other samples in each candidate sample for the model to be trained, that is, screen out target samples with higher learning value for the model to be trained from each candidate sample, and then perform model training, focusing on the quality of the samples rather than the quantity, without blindly expanding the size of the candidate sample set, reducing the cost of model training, and the screened target samples are samples with high learning value for the model to be trained, so the target samples are more conducive to enhancing the performance of the model to be trained, improving the model task performance ability of the model to be trained, greatly improving the model training efficiency, and ensuring the model performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 This is an application architecture diagram of a model training provided by an embodiment of this specification;

[0035] Figure 2 is a flow chart of a model training method provided by an embodiment of this specification;

[0036] Figure 3 It is a flow chart of a model training process provided by an embodiment of this specification;

[0037] Figure 4 is a flow chart of a sample determination method for model training provided by an embodiment of this specification;

[0038] Figure 5 is a flowchart of a task processing method provided by an embodiment of this specification;

[0039] Figure 6 is a processing flow chart of a model training method provided by an embodiment of this specification;

[0040] Figure 7 is a flow chart of an information processing method based on a target task processing model provided by an embodiment of this specification;

[0041] Figure 8 It is a structural diagram of a model training platform provided by an embodiment of this specification;

[0042] Fig. 9 It is a structural schematic diagram of a model training device provided by an embodiment of this specification;

[0043] Fig.10 is a structural schematic diagram of a sample determination device for model training provided by an embodiment of this specification;

[0044] Fig.11 is a structural diagram of a task processing device provided by an embodiment of this specification;

[0045] Fig.12 is a structural block diagram of a computing device provided by one embodiment of this specification;

[0046] Fig.13 It is a structural block diagram of an electronic device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0047] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0048] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0049] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0050] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0051] In one or more embodiments of this specification, a large model refers to a deep learning model with large-scale model parameters, which usually contains hundreds of millions, tens of billions, hundreds of billions, trillions, or even more than 10 trillion model parameters. A large model can also be called a foundation model / foundation model. The large model is pre-trained with large-scale unlabeled corpus to produce a pre-trained model with more than 100 million parameters. This model can adapt to a wide range of downstream tasks, and the model has good generalization ability, such as a large-scale language model (LLM, Large Language Model), a multi-modal pre-training model, etc.

[0052] When the big model is used in practice, only a small number of samples are needed to fine-tune the pre-trained model and it can be applied to different tasks. The big model can be widely used in natural language processing (NLP), computer vision and other fields. Specifically, it can be applied to computer vision tasks such as visual question answering (VQA), image description (IC, Image Caption), image generation, as well as natural language processing tasks such as text-based sentiment classification, text summary generation, and machine translation. The main application scenarios of the big model include digital assistants, intelligent robots, search, online education, office software, e-commerce, intelligent design, etc.

[0053] First, the terms involved in one or more embodiments of this specification are explained.

[0054] In-Context Learning (ICL): is a technique that has emerged in the fields of Natural Language Processing (NLP) and Machine Learning in recent years. It refers to the ability of a model to use given contextual information to improve its performance and response quality when processing new inputs. This technique is particularly suitable for large pre-trained language models, such as the GPT (Generative Pre-trained Transformer) series, BERT (Bidirectional Encoder Representation from Transformers), etc. Contextual information in ICL usually refers to a piece of text or a set of examples provided to the model, which can help the model better understand and generate new content. In specific implementation, some relevant contextual information or examples can be added before the data input to the model. This contextual information can be a task description, a known answer, or other relevant information. When processing the input, the model will use this contextual information to generate more accurate and relevant outputs. As the contextual information changes, the output of the model will also be adjusted accordingly, thereby achieving a more flexible response.

[0055] Instruction Tuning: It is a technique in the field of natural language processing (NLP) that aims to optimize the model's ability to understand and respond to instructions through specific training methods. This method is particularly suitable for tasks that require generating high-quality output based on user instructions, such as text generation, question-answering systems, and dialogue systems. The core idea of ​​instruction tuning is to enable the model to better understand the intent of the instruction and generate more accurate and relevant responses by providing specific instructions and corresponding expected outputs.

[0056] Instruction Following Difficulty (IFD): is an indicator used to evaluate the difficulty of a model in understanding and following instructions. It can quantify the challenges of the model in understanding instructions, parsing instruction intent, and generating correct responses. This indicator can help researchers and developers understand the performance of the model when processing different types of instructions, thereby guiding the improvement and optimization of the model.

[0057] Model Instruction Weakness Value (MIWV): is an indicator used to evaluate the weaknesses or deficiencies of the model in understanding and following the responses corresponding to the instruction output. This indicator can help researchers and developers identify problems when the model handles certain types of instructions, thereby guiding the improvement and optimization of the model.

[0058] It should be noted that large models LLM are already able to perform various complex language tasks, including writing, translation, conversation, question and answer, etc. They can quickly learn from a large number of samples and generate results that are more in line with task requirements. Instruction tuning is a method to enhance model performance by carefully adjusting the model's response to task instructions. It can significantly improve the performance of the model, enable the model to better understand the user's intentions, and thus generate more contextually relevant and personalized answers that align with instructions.

[0059] Most of the work related to instruction tuning focuses on accumulating larger, more diverse, and more complex sample sets, which usually involves manual annotation or using large models LLM to generate corpus and manual re-annotation. However, blindly expanding the size of the sample set does not always bring the expected results. Instead, it may introduce noise and redundant information, diluting the effectiveness and value of the sample set. Therefore, the key to instruction tuning lies in an effective sample screening strategy that focuses on the quality of the sample rather than the sheer quantity.

[0060] In one implementation, ChatGPT can be used to score the quality of samples. Samples with high scores are of high quality. However, using ChatGPT to make decisions will increase the cost of using the model, and its performance is significantly subject to the rate limit set by the model service provider. Using the model to evaluate the quality of samples is a relatively easy solution, so this work can serve as a baseline for sample quality screening.

[0061] In another implementation method, the instruction following difficulty (IFD) indicator can be used to select high-quality samples for instruction tuning. It first uses a clustering algorithm to find diverse seed samples, then trains an empirical model, and uses empirical model reasoning to calculate indicator values ​​for sample screening. However, the working steps of using IFD scores for clustering and training empirical models will affect efficiency to a certain extent.

[0062] In another implementation, a smaller GPT2 model can be used as the empirical model, and then IFD is also used to select high-quality samples for instruction tuning. Although the efficiency problem of empirical model reasoning is solved, there is a difference between the model used for sample screening and the target model for instruction tuning, which may have a negative impact on the instruction tuning of the model.

[0063] As can be seen from the above, the above-mentioned sample quality screening focuses on the data quality itself, but under the premise that the data is correct, the sample quality depends on the performance of the target large model for instruction tuning. In other words, samples that are beneficial to improving the performance of model tasks are high-quality samples. Therefore, in order to improve the efficiency and performance of large model LLM instruction tuning, the embodiment of this specification provides a model training scheme, which quantifies the learning value of candidate samples for the target LLM based on the difference in inference responses of the contextual learning ICL strategy, and obtains the model instruction weakness value index (MIWV). The model instruction weakness value index (MIWV) is the quality index of the candidate sample, which can indicate the learning value of the candidate sample for the model to be trained, and guide the selection of samples that are worth learning and beneficial to improving the performance of model tasks from a large-scale candidate sample set for instruction tuning training. It is direct and effective, and ensures that each screened target sample is a sample that is beneficial to improving the performance of the model task during instruction tuning training.

[0064] In the embodiments of this specification, candidate samples that are beneficial to improving the model task performance are regarded as high-quality sample data, and during instruction tuning training, it is ensured that each target sample is screened out and is beneficial to improving the model task performance; moreover, there is no need to pay to call the scoring model to score the sample quality, nor is there any need to perform less efficient pre-screening steps such as clustering and empirical model training, so the training efficiency is high and the implementation is simple.

[0065] To solve the above technical problems, in this specification, a model training method is provided. This specification also involves a sample determination method for model training, a task processing method, an information processing method based on a target task processing model, a model training platform, a model training device, a sample determination method device for model training, a task processing device, a computing device, an electronic device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.

[0066] Considering the huge number of model parameters of the large model and the limited computing resources of the mobile terminal, the model training method provided in the embodiment of the present application can be applied to Figure 1 The application scenarios shown are not limited to these. Figure 1 In the application scenario shown, the large model is deployed in the server 10, and the server 10 can be connected to one or more client devices 20 through a local area network connection, a wide area network connection, an Internet connection, or other types of data networks. The client device 20 here may include but is not limited to: smart phones, tablet computers, laptops, PDAs, personal computers, smart home devices, vehicle-mounted devices, etc. The client device 20 can interact with the user through a graphical user interface to implement the call of the large model, thereby implementing the method provided in the embodiments of this specification.

[0067] In an embodiment of the present specification, a system composed of a client device and a server can execute the following steps: the client device executes task information of uploading a training task; the server executes obtaining a candidate sample set for the training task, wherein the candidate sample set includes candidate samples; determining reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set; determining a quality indicator of the first candidate sample based on the model to be trained according to the first candidate sample and the reference information, wherein the quality indicator is used to indicate the learning value of the first candidate sample for the model to be trained; determining a target sample according to the quality indicator of each candidate sample, training the model to be trained based on the target sample, and obtaining a target task processing model.

[0068] It should be noted that, when the operating resources of the client device can meet the deployment and operating conditions of the large model, the embodiments of the present application can be carried out in the client device.

[0069] See also Figure 2 , Figure 2 A flowchart of a model training method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0070] Step 202: Obtain a candidate sample set for a training task, wherein the candidate sample set includes candidate samples.

[0071] The embodiments of this specification are applied to a model training platform with a model training function, which can realize the processing of training tasks and train the model to be trained. A training task refers to a task initiated by a user to train a model to be trained for a target scene. The candidate sample set includes multiple candidate samples. The candidate sample refers to the training data obtained based on the training task, which is used for model training of the model to be trained. Among them, the target scene is any scene that requires model training, such as a question-and-answer scene, a visual understanding scene, a translation scene, etc. The visual understanding scene can be a text-based image scene, an image recognition scene, a virtual image creation scene, etc.

[0072] For example, in the question-answering scenario, the training task may be the instruction tuning training task of the initial question-answering model, and the candidate sample set may be the question-answering sample set; in the visual understanding scenario, the training task may be the training task of the initial visual model. For example, in the text-image scenario, the training task may be the training task of the initial text-image model, and the candidate sample set may be the text-image sample set; in the image recognition scenario, the training task may be the training task of the initial image recognition model, and the candidate sample set may be the image recognition sample set; in the virtual image creation scenario, the training task may be the training task of the initial virtual image creation model, and the candidate sample set may be the virtual image creation sample set; in the translation scenario, the training task may be the training task of the initial translation model, and the candidate sample set may be the translation sample set.

[0073] In an optional implementation of this embodiment, obtaining a candidate sample set for a training task includes:

[0074] Get the task information of the training task uploaded by the front end;

[0075] Based on the task information, a candidate sample set is obtained.

[0076] Among them, the task information may refer to relevant information of the training task, such as the task information may include at least one of the scenario identification, task type, and model attribute information of the machine learning model to be trained.

[0077] In actual implementation, the front end can initiate a training task based on demand and upload the task information of the initiated training task. The model training platform can obtain the candidate sample set required for training based on the obtained task information. In an optional implementation method, when the front end initiates a training task, it directly carries the corresponding candidate sample set in the task information. After the model training platform receives the task information of the training task, it can parse the task information to obtain the candidate sample set. In another optional implementation method, after obtaining the task information of the training task uploaded by the front end, the model training platform parses the task information to obtain at least one of the scene identification, task type, and model attribute information of the machine learning model to be trained. Based on the information obtained by the analysis, the relevant candidate sample set is queried from the local storage module, other third-party databases, search engines, etc.

[0078] For example, the training task is the instruction tuning training task of the question-answering model, and the task information is the question-answering scenario and instruction tuning. The model training platform can obtain a large number of question-answering data pairs based on the question-answering scenario and instruction tuning as candidate sample sets, and subsequently perform indicator tuning training on the training model. Each candidate sample in the candidate sample set is a question-answer data pair. For example, the candidate sample set includes candidate sample 1 "Please explain what a musical is; a musical is a form of stage performance that tells a story through music, songs, dance and dramatic elements, usually including dialogue and singing parts", candidate sample 2 "Please explain the Pythagorean theorem; the Pythagorean theorem states that the sum of the squares of the two right-angled sides of a right triangle is equal to the square of the hypotenuse", candidate sample 3 "Please calculate what 15 times 23 equals; 345", candidate sample 4 "Please tell me how to make a cup of coffee; prepare coffee beans and a grinder, grind the coffee beans into powder, put the coffee powder into filter paper, brew the coffee powder with hot water, wait a few minutes, pour out the coffee, and add sugar and milk (according to personal taste)", candidate sample 5 "Please tell me what animals are in this picture; there is a cat and a dog in the picture".

[0079] In the embodiments of the present specification, the task information of the training task uploaded by the front end can be obtained, and the corresponding candidate sample set can be obtained based on the task information. Different training tasks can carry different task information, so as to obtain different candidate sample sets, thereby achieving different candidate sample sets for different scenarios, different task identifiers, and different models. This facilitates subsequent targeted training based on the obtained candidate sample set, improves training efficiency, and ensures training results.

[0080] Step 204: Determine reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set.

[0081] The reference information refers to the context information of the first candidate sample in the candidate sample set.

[0082] It should be noted that each candidate sample in the candidate sample set can be used as the first candidate sample to determine the corresponding reference information, so as to evaluate the learning value of the candidate sample for the model to be trained, and to screen out a diverse subset that is beneficial to enhancing the performance of the model to be trained from a large number of candidate samples in the candidate sample set for instruction tuning training.

[0083] In an optional implementation of this embodiment, determining the reference information of the first candidate sample in the candidate sample set includes:

[0084] Determine the similarity between the first candidate sample and each second candidate sample, wherein the second candidate sample is other candidate samples in the candidate sample set except the first candidate sample;

[0085] A similar sample to the first candidate sample is determined from each second candidate sample according to the similarity, and the similar sample is used as reference information of the first candidate sample.

[0086] In actual implementation, the similarity between the first candidate sample and other second candidate samples in the candidate sample set except the first candidate sample can be calculated, and the similar sample with the highest similarity to the first candidate sample can be determined from each second candidate sample as the reference information of the first candidate sample, and the reference information is the context information of the first candidate sample in the candidate sample set.

[0087] Continuing with the above example, the candidate set originally includes candidate samples 1-5. Assume that candidate sample 1 "Please explain what a musical is; a musical is a stage performance that tells a story through music, songs, dance and dramatic elements, usually including dialogue and singing parts" is the first candidate sample. At this time, the similarities between candidate sample 1 and candidate sample 2, candidate sample 3, candidate sample 4, and candidate sample 5 can be calculated respectively. Assume that they are 65%, "40%", "52%", and "15%" respectively. At this time, it can be determined that the similar sample of candidate sample 1 is candidate sample 2, and candidate sample 2 is used as the reference information of candidate sample 1, that is, candidate sample 2 is the context information of candidate sample 1.

[0088] In the embodiments of the present specification, similar samples other than each candidate sample are recalled as reference information. Subsequently, based on the reference information of each candidate sample, a quality assessment can be performed on the learning value of each candidate sample for the model to be trained, and similar samples are retrieved for quality assessment. The reference information of the candidate samples is introduced, the screening accuracy of the candidate samples is improved, and the complex working steps of data clustering and empirical model training are avoided, thereby improving the screening efficiency of the candidate samples.

[0089] It is worth noting that in addition to the above-mentioned determination of the similar sample with the highest similarity to the first candidate sample as the reference information of the first candidate sample, other contextual information related to the first candidate sample can also be extracted as the reference information, such as querying the content to which the first candidate sample belongs, such as articles, images, videos, etc., and extracting the contextual information of the first candidate sample based on the content as the reference information of the first candidate sample.

[0090] In an optional implementation of this embodiment, determining the similarity between the first candidate sample and each second candidate sample includes:

[0091] Based on the embedding model, determining a first sample vector of the first candidate sample and a second sample vector of each second candidate sample respectively;

[0092] The similarities between the first sample vector and each second sample vector are calculated respectively to obtain the similarities between the first candidate sample and each second candidate sample.

[0093] Among them, the embedding model is a technology in machine learning and natural language processing, which is used to map discrete, high-dimensional symbols (such as words, characters, images, etc.) into a low-dimensional continuous vector space. By converting the input data into a vector form, mathematical operations and similarity calculations can be easily performed. These vectors are usually called embedding vectors, which capture the semantic relationship and structural information between symbols. They can represent the original data in a multidimensional space and retain certain semantic relationships between data. These vectors usually have a fixed dimension, such as 100 or 300 dimensions. Embedding models have played an important role in many tasks, such as knowledge question answering, text classification, sentiment analysis, machine translation, recommendation systems, etc. The embedding model can be an embedding layer in a neural network, which converts the input symbol into a corresponding embedding vector. The embedding layer is usually a lookup table, in which each symbol corresponds to a vector.

[0094] In actual implementation, an open source embedding model can be obtained, and the first candidate sample and each second candidate sample can be input into the embedding model to obtain the first sample vector of the first candidate sample and the second sample vector of each second candidate sample as output; then, the similarity between the first sample vector and each second sample vector can be calculated respectively to obtain the similarity between the first candidate sample and each second candidate sample.

[0095] Specifically, the first candidate sample and each second candidate sample can be input into the embedding model in sequence to obtain the corresponding first sample vector and second sample vector, or the first candidate sample and each second candidate sample can be input into the embedding model together to obtain the corresponding first sample vector and second sample vector, and the embodiments of this specification do not limit this.

[0096] In addition, for the first sample vector and any second sample vector, the cosine similarity between the first sample vector and any second sample vector can be calculated, and the cosine similarity is used as the vector similarity between the first sample vector and any second sample vector. Among them, the cosine similarity is a measure of the cosine value of the angle between two non-zero vectors in a multidimensional space. It is mainly used to measure the directional similarity between vectors without considering the size of the vectors.

[0097] Of course, in actual implementation, other similarities may also be used, such as Euclidean distance, Manhattan distance, Jaccard similarity, etc., and the embodiments of this specification do not limit this.

[0098] In the embodiments of the present specification, the first sample vector of the first candidate sample and the second sample vector of each second candidate sample can be extracted respectively based on the open source embedding model, and the similarity between the first candidate sample and each second candidate sample is measured based on the vector similarity between the sample vectors. It is only necessary to perform vector extraction based on the open source embedding model to determine similar samples as context information, which is simple to operate and efficient.

[0099] It is worth noting that in addition to determining the similarity between the first candidate sample and each second candidate sample based on the vector similarity of the sample vector as mentioned above, the similarity judgment model can also be directly acquired or trained, and the first candidate sample and each second candidate sample are input into the similarity judgment model. The similarity judgment model performs a similarity analysis on the input first candidate sample and each second candidate sample, and outputs a similar sample that is most similar to the first candidate sample.

[0100] Step 206: Determine a quality indicator of the first candidate sample based on the model to be trained according to the first candidate sample and the reference information, wherein the quality indicator is used to indicate the learning value of the first candidate sample for the model to be trained.

[0101] The model to be trained is the initial machine learning model in any target scenario that needs to be trained, and the model to be trained can be a large model. For example, the model to be trained in the question-answering scenario is the initial question-answering model, the model to be trained in the Chinese-language-image scenario in the visual understanding scenario is the initial Chinese-language-image model, the model to be trained in the image recognition scenario in the visual understanding scenario is the initial image recognition model, the model to be trained in the virtual image creation scenario in the visual understanding scenario is the initial virtual image creation model, and the model to be trained in the translation scenario is the initial translation model.

[0102] It should be noted that the quality index can be used to measure the learning value of the first candidate sample for the model to be trained, and the quality index of each candidate sample is used to screen out candidate samples that can improve the task performance ability of the model to be trained, that is, to screen out candidate samples with high learning value for the model to be trained. For example, the higher the quality index, the higher its learning value for the model to be trained, and the more conducive it is to improving the task performance ability of the model to be trained.

[0103] In actual implementation, each candidate sample in the candidate sample set can be used as the first candidate sample. Based on each candidate sample, its corresponding reference information can be determined, and the quality index of each candidate sample can be determined in combination with the reference information of each candidate sample, providing a data basis for subsequent sample screening.

[0104] In an optional implementation of this embodiment, determining the quality indicator of the first candidate sample based on the model to be trained according to the first candidate sample and the reference information includes:

[0105] constructing demonstration data based on the first candidate sample and the reference information;

[0106] Input the first candidate sample into the model to be trained to obtain a first response result corresponding to the first candidate sample; input the demonstration data into the model to be trained to obtain a second response result corresponding to the demonstration data;

[0107] A quality indicator of the first candidate sample is determined according to the label of the first candidate sample, the first response result, and the second response result.

[0108] In actual implementation, the first candidate sample can be input into the model to be trained, and the model to be trained analyzes and processes the first candidate sample and outputs the corresponding first response result; and the reference information can be used as a demonstration example of the first candidate sample to construct demonstration data, and the demonstration data can be input into the model to be trained, so that the model to be trained can process the first candidate sample with reference to the processing method of the reference information in the demonstration data and output the corresponding second response result. Based on the first response result and the second response result, the quality index of the first candidate sample can be determined. The quality index evaluates how much the first candidate sample can improve the ability of the model to be trained by two reasoning responses to the first candidate sample with and without the introduction of the demonstration example.

[0109] Specifically, a prompt instruction may be generated based on the reference information of the first candidate sample, and the prompt instruction and the first candidate sample may be combined into a demonstration example.

[0110] It should be noted that the first response result can indicate the processing capability of the model to be trained on the first candidate sample without a demonstration example, and the second response result can indicate the processing capability of the model to be trained on the first candidate sample with a demonstration example. The closer the first response result and the second response result are, the better the performance of the model to be trained on the first candidate sample without a demonstration example, and the lower the learning value of the model to be trained, so the lower the priority of selecting it for instruction tuning training, that is, the lower the quality index; the greater the difference between the first response result and the second response result, the worse the performance of the model to be trained on the first candidate sample without a demonstration example, and the better the performance of the model to be trained on the first candidate sample under the guidance of the demonstration example, which means that learning the first candidate sample brings more improvement to the ability of the model to be trained, and the higher the learning value of the model to be trained, so the higher the priority of selecting it for instruction tuning training, that is, the higher the quality index.

[0111] In specific implementation, the first response index can be calculated based on the label of the first candidate sample and the first response result, and the second response index can be calculated based on the label of the first candidate sample and the second response result, and the difference between the first response index and the second response index is used as the quality index of the first candidate sample.

[0112] As an example, take the model to be trained as a question-answering model, and the first candidate sample as a question-answering data pair. Assume that the first candidate sample is candidate sample 1 "Please explain what a musical is; a musical is a stage performance that tells a story through music, songs, dance, and dramatic elements, usually including dialogue and singing parts", and the reference information of the first candidate sample is candidate sample 2 "Please explain the Pythagorean theorem; the Pythagorean theorem states that the sum of the squares of the two right-angled sides of a right triangle is equal to the square of the hypotenuse". The questions in the candidate samples are taken as input data and the answers are taken as labels. Based on the questions in candidate sample 1 and candidate sample 2, demonstration data can be constructed: "Please refer to the given demonstration examples to answer the input questions. Demonstration examples: question 'Please explain the Pythagorean theorem', answer 'The Pythagorean theorem states that the sum of the squares of the two right-angled sides of a right triangle is equal to the square of the hypotenuse'", "Please explain what a musical is".

[0113] By inputting the question "Please explain what a musical is" in candidate sample 1 into the model to be trained, its output first response result can be obtained; by inputting the demonstration examples "Please refer to the given demonstration example to answer the input question. Demonstration example: question 'Please explain the Pythagorean theorem', answer 'The Pythagorean theorem states that the sum of the squares of the two right-angled sides of a right triangle is equal to the square of the hypotenuse'", "Please explain what a musical is" into the model to be trained, its output second response result can be obtained. Based on the first response result and the label "Musical is a stage performance that tells a story through music, songs, dance, and dramatic elements, usually including dialogue and singing parts", the first response indicator can be determined, and based on the second response result and the label "Musical is a stage performance that tells a story through music, songs, dance, and dramatic elements, usually including dialogue and singing parts", the second response indicator can be determined. The difference between the first response indicator and the second response indicator is used as the quality indicator of candidate sample 1.

[0114] In an embodiment of the present specification, the quality index of the first candidate sample can be determined based on the inference response of the model to be trained to the first candidate sample without a demonstration example, and the inference response to the demonstration data with a demonstration example, based on the difference between the two inference responses. The learning value of the first candidate sample for the model to be trained can be quantified based on the calculated quality index, thereby facilitating the subsequent screening of high-quality samples that are beneficial to improving the task performance ability of the model to be trained.

[0115] In an optional manner of this embodiment, determining the quality indicator of the first candidate sample according to the label of the first candidate sample, the first response result, and the second response result includes:

[0116] Calculate a first loss value according to the label of the first candidate sample and the first response result, wherein the first response result is the prediction result obtained by the to-be-trained model for the input first candidate sample, and the label is the true result of the first candidate sample;

[0117] Calculate a second loss value according to the label of the first candidate sample and the second response result, wherein the second response result is a prediction result obtained by the to-be-trained model for the input demonstration data;

[0118] A loss value difference between the first loss value and the second loss value is determined, and the loss value difference is used as a quality indicator of the first candidate sample.

[0119] In actual implementation, the first loss value can be calculated based on the weight of the model to be trained, the input first candidate sample, the label of the first candidate sample, and the first response result. Specifically, the first loss value can be calculated by the following formula (1); and the first loss value can be calculated based on the weight of the model to be trained, the input demonstration data, the label of the first candidate sample, and the second response result. Specifically, the first loss value can be calculated by the following formula (2):

[0120] (1)

[0121] (2)

[0122] in, is the first loss value; θ represents the weight of the model to be trained; represents the i-th sample of the input, Indicates the label of the i-th input sample. During the instruction adjustment process, the loss of the instruction-response pair is calculated by continuously predicting the next token based on the previous words when a command is given, where N is the length of the label yi, Represents the j-th token of response yi in the first response result or the second response result.

[0123] is the second loss value; Indicates the reference information of the first candidate sample, that is, the similar samples of the first candidate sample.

[0124] In the embodiments of the present specification, an inference can be performed on the first candidate sample based on the model to be trained, and the first response loss of the first response result can be recorded. Similarly, an inference can be performed on the demonstration data based on the model to be trained, and the second response loss of the second response result can be recorded. By calculating the difference in loss values ​​of the two response losses, the quality index of the first candidate sample can be obtained. Using input data with demonstration examples and without demonstration examples, the model to be trained is used to perform inference respectively, and the corresponding quality index is obtained based on the difference in loss values ​​of the two inference responses. There is no need to perform complex quality assessment calculations, the operation is simple, and the efficiency of obtaining quality indicators is high.

[0125] In an optional manner of this embodiment, determining the quality indicator of the first candidate sample according to the label of the first candidate sample, the first response result, and the second response result includes:

[0126] Scoring the first response result according to the label of the first candidate sample and at least one scoring dimension to obtain a first response score, wherein the first response result is a prediction result obtained by the to-be-trained model for the input first candidate sample, and the label is a true result of the first candidate sample;

[0127] Scoring the second response result according to the label of the first candidate sample and at least one scoring dimension respectively to obtain a second response score, wherein the second response result is a prediction result obtained by the model to be trained for the input demonstration data;

[0128] A score difference between the first response score and the second response score is determined, and the score difference is used as a quality indicator of the first candidate sample.

[0129] Among them, the scoring dimension refers to the dimension that measures the quality of the response data, such as at least one scoring dimension can be accuracy, relevance, coherence, naturalness, robustness, diversity, etc. Accuracy refers to whether the response result output by the model to be trained meets the requirements of the input instruction and is consistent with the label. For example, if the instruction requires the generation of a sentence containing specific keywords, whether the model to be trained can generate it correctly. Relevance refers to whether the response result output by the model to be trained is highly relevant to the instruction. For example, if the instruction requires the answer to a specific question, whether the model's answer is relevant and relevant to the label. Coherence refers to whether the response result output by the model to be trained is logically clear and consistent. For example, if the instruction requires the generation of a narrative text, whether the text generated by the model is coherent. Naturalness refers to whether the response result output by the model to be trained is natural and fluent, close to the way humans express themselves. For example, if the instruction requires the generation of a dialogue, whether the dialogue generated by the model is natural. Robustness refers to the performance when facing complex or ambiguous instructions. For example, if the instruction contains multiple steps or conditions, whether the model can correctly parse and execute it. Diversity refers to whether the response results output by the trained model are diverse, rather than always repeating the same pattern. For example, if the instruction requires the generation of multiple different stories, whether the model can generate diverse stories.

[0130] It should be noted that in addition to determining the quality indicator of the first candidate sample based on the response loss, the first response data and the second response data can also be scored based on at least one scoring dimension and with reference to the label of the first candidate sample, respectively, with the same scoring criteria, to obtain the corresponding first response score and second response score, and then use the score difference between the first response score and the second response score as the quality indicator.

[0131] In the embodiments of this specification, the first response data and the second response data can be scored based on at least one scoring dimension to obtain the corresponding first response score and the second response score. By calculating the difference between the two response scores, the quality index of the first candidate sample can be obtained. The input data with and without demonstration examples are used to perform reasoning using the model to be trained, and the corresponding quality index is obtained based on the score difference of the two reasoning responses. There is no need to perform complex quality evaluation calculations, the operation is simple, and the efficiency of obtaining quality indicators is high. In addition, a variety of quality index calculation methods are provided, the operation is flexible, and it can be adapted to a variety of different application scenarios.

[0132] Step 208: Determine a target sample from each candidate sample based on the quality indicators of each candidate sample, train the model to be trained based on the target sample, and obtain a target task processing model, wherein the learning value of the target sample for the model to be trained is higher than the learning value of other samples in the candidate samples for the model to be trained.

[0133] It should be noted that, considering that various pre-trained language models show different performance levels and focus on different task areas, the goal of sample screening is to find sample data that is beneficial to improving the task performance of the model to be trained, that is to say, to screen out target samples with higher learning value for the model to be trained than other samples from each candidate sample, rather than only focusing on the sample itself or indirectly selecting difficult samples through model response. In addition, by introducing contextual information as reference information for candidate samples to achieve the screening of target samples, the complex working steps of data clustering and empirical model training are avoided, and the efficiency of target sample screening is improved. Based on the model training method provided in the embodiments of this specification, the efficiency and performance of model training have better performance.

[0134] In an optional implementation of this embodiment, determining a target sample from each candidate sample according to a quality indicator of each candidate sample includes:

[0135] Rank the quality indicators of each candidate sample;

[0136] Based on the model specification parameters of the model to be trained, target samples are screened from the sorted candidate samples, wherein the number of target samples corresponds to the model specification parameters.

[0137] In actual implementation, the model specification parameters can indicate the model size, data processing capabilities, etc. of the model to be trained. Different model rule parameters have different data processing capabilities and require different numbers of samples. For example, the larger the model size, the more samples are required. Different model specification parameters can be pre-configured to correspond to the required number of samples, and a corresponding number of subsets can be screened out as target samples based on the quality indicators of each candidate sample determined. In other words, the number of target samples obtained by screening corresponds to the model specification parameters.

[0138] In one implementation, the higher the quality index, the higher the learning value of the corresponding candidate sample for the model to be trained, and the more conducive it is to improving the task performance ability of the model to be trained. At this time, the quality index of each candidate sample can be sorted from large to small, and the set number of required samples can be determined based on the model specification parameters of the model to be trained, and the set number of candidate samples with the highest ranking can be selected as the target samples to be screened out. Of course, in actual implementation, it is also possible to sort from small to large, and select the set number of candidate samples with the lowest ranking as the target samples to be screened out, and the embodiments of this specification are not limited to this.

[0139] In another implementation, the higher the quality index, the lower the learning value of the corresponding candidate sample for the model to be trained, and the less conducive it is to improving the task performance ability of the model to be trained. At this time, the quality index of each candidate sample can be sorted from small to large, and the set number of required samples can be determined based on the model specification parameters of the model to be trained, and the set number of candidate samples with the highest ranking can be selected as the target samples to be screened out. Of course, in actual implementation, it is also possible to sort from large to small, and select the set number of candidate samples with the lowest ranking as the target samples to be screened out, and the embodiments of this specification are not limited to this.

[0140] It should be noted that by sorting the quality indicators of each candidate sample and screening out target samples with higher learning value for the model to be trained, high-quality sample data can be obtained efficiently, thereby training the model to be trained. The method is simple and effective, and does not require additional complex work such as clustering of candidate samples, training of empirical models, and collection of validation sets, thereby improving the efficiency of model training and ensuring model performance.

[0141] In another implementation, target samples whose quantity matches the processor performance may be determined from each candidate sample based on the processor performance of the model training platform, that is, target samples are determined from each candidate sample based on the quality index of each candidate sample, including:

[0142] Rank the quality indicators of each candidate sample;

[0143] The processor performance for executing the training task is determined, and target samples are selected from the sorted candidate samples, wherein the number of target samples is adapted to the processor performance.

[0144] In actual implementation, the processor performance may include computing power (such as clock frequency, number of cores, number of threads, etc.), memory management (cache size and hierarchy, memory bandwidth, memory latency, etc.), scalability and compatibility, etc. Of course, other indicators can also be used to indicate the processing performance of the processor, and this specification embodiment does not limit this. Among them, the clock frequency is usually expressed in GHz, which refers to the number of cycles that the processor can execute per second. A higher clock frequency means that the processor can complete more instructions in the same time; modern processors usually have multiple cores, each of which can execute program instructions independently. Multi-core processors can run multiple tasks at the same time or process different parts of a single task in parallel, thereby improving efficiency; the high-speed cache inside the processor can be used to store frequently accessed data and instructions, reducing the time required to read from the main memory, and a larger cache can usually improve performance; thermal design power refers to the expected power consumption of the processor under maximum workload.

[0145] Specifically, the processor performance can indicate the current processing capability of the processor of the model training platform. The higher the processor performance, the more target samples can be processed, and the worse the processor performance, the fewer target samples can be processed. Different processor performances can be pre-configured to correspond to the number of samples that can be processed, and a corresponding number of subsets can be screened out as target samples based on the quality indicators of each candidate sample determined. In other words, the number of target samples obtained by screening matches the processor performance.

[0146] It should be noted that the current processor performance of the processor that executes the training task on the model training platform can be determined, and then a number of target samples that match the current processor performance can be screened out from the sorted candidate samples to avoid the processor processing too many samples during model training, resulting in excessive pressure on the processor, and then causing the model training platform to overload.

[0147] Figure 3 This is a flow chart of a model training process provided by an embodiment of this specification, such as Figure 3 As shown, the model training process is divided into four stages. In the first stage, candidate samples are obtained, and embedded features are extracted based on the embedded model for each candidate sample to obtain the corresponding sample vector. For any candidate sample, the corresponding similar sample is determined based on the sample vector, and demonstration data is constructed based on any candidate sample and the similar sample to obtain each candidate sample and the demonstration data of each candidate sample. In the second stage, based on each candidate sample, the large model to be trained is input, and the first loss value is determined based on the label of each candidate sample and the first response result output by the large model to be trained for each candidate sample; based on the demonstration data of each candidate sample, the large model to be trained is input, and the second loss value is determined based on the label of each candidate sample and the second response result output by the large model to be trained for each demonstration data. The quality index is determined based on the first loss value and the second loss value. In the third stage, the target samples with higher quality index are selected from each candidate sample as the target samples, so as to select the target samples with high learning value for the large model to be trained from each candidate sample. In the fourth stage, the large model to be trained is trained based on the selected target samples to obtain the target task processing model.

[0148] The embodiments of the present specification provide a model training method, which realizes determining reference information of a first candidate sample, determining a quality indicator of the first candidate sample based on the first candidate sample and the reference information, the quality indicator can indicate the learning value of the first candidate sample for the model to be trained, and then screening out a target sample based on the quality indicators of each candidate sample in the candidate sample set, and then training the model to be trained based on the target sample, the learning value of the screened target sample for the model to be trained is higher than the learning value of other samples in each candidate sample for the model to be trained, that is, the target sample with higher learning value for the model to be trained is screened out from each candidate sample, and then the model is trained, focusing on the quality of the sample rather than the quantity, without blindly expanding the size of the candidate sample set, reducing the cost of model training, and the screened target sample is a sample with high learning value for the model to be trained, so the target sample is more conducive to enhancing the performance of the model to be trained, improving the model task performance ability of the model to be trained, greatly improving the model training efficiency, and ensuring the model performance. In addition, there is no need to train the model to be trained based on each candidate sample. Instead, based on the processor performance, target samples with higher learning value for the model to be trained can be screened out for model training. The number of screened target samples matches the processor performance of the model training platform, avoiding the processing of a large number of samples that cannot be supported by the processor performance, which in turn causes the processor to crash, avoids overloading the model training platform, and ensures the processing performance of the model training platform.

[0149] See also Figure 4 , Figure 4 A flow chart of a sample determination method for model training provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0150] Step 402: Obtain a candidate sample set for a training task, wherein the candidate sample set includes candidate samples.

[0151] Step 404: Determine reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set.

[0152] Step 406: Determine a quality indicator of the first candidate sample based on the model to be trained according to the first candidate sample and the reference information, wherein the quality indicator is used to indicate the learning value of the first candidate sample for the model to be trained.

[0153] Step 408: Determine a target sample from each candidate sample based on the quality index of each candidate sample, wherein the target sample is used to train the initial model, and the learning value of the target sample for the model to be trained is higher than the learning value of other samples in each candidate sample for the model to be trained, and the initial model includes other models that belong to the same scenario but have different model specification parameters as the model to be trained.

[0154] Among them, the initial model may include other models that belong to the same scenario but have different model specification parameters as the model to be trained. For example, the model to be trained is an initial question-answering model of 72B in a question-answering scenario. The target samples screened out based on the model to be trained can be used to train initial question-answering models of other sizes in the question-answering scenario, such as initial question-answering models of sizes such as 7B and 36B.

[0155] Of course, in actual implementation, the initial model may also include the above-mentioned model to be trained, that is, the target samples screened out based on the model to be trained are used to train the model to be trained, and the embodiments of this specification do not limit this.

[0156] The embodiments of this specification provide a sample determination method for model training, which realizes determining reference information of a first candidate sample, determining a quality indicator of the first candidate sample based on the first candidate sample and the reference information, and the quality indicator can indicate the learning value of the first candidate sample for the model to be trained, and then based on the quality indicators of each candidate sample in the candidate sample set, screening out a target sample from each candidate sample, the learning value of the screened target sample for the model to be trained is higher than the learning value of other samples in each candidate sample for the model to be trained, that is, screening out a target sample with higher learning value for the model to be trained from each candidate sample, and then performing model training, focusing on the quality of the sample rather than the quantity, without blindly expanding the size of the candidate sample set, and reducing the sample construction cost.

[0157] The above is a schematic scheme of a sample determination method for model training in this embodiment. It should be noted that the technical scheme of the sample determination method for model training and the technical scheme of the above-mentioned model training method belong to the same concept, and the details not described in detail in the technical scheme of the sample determination method for model training can be referred to the description of the technical scheme of the above-mentioned model training method.

[0158] See also Figure 5 , Figure 5 A flowchart of a task processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0159] Step 502: Obtain task data of the target task.

[0160] The embodiments of this specification are applied to applications, websites or mini-programs with task processing functions. On applications, websites or mini-programs, the target task processing function is implemented. For example, a website with a target task processing model deployed can implement the task processing functions of target tasks such as question and answer, translation, video quality evaluation, video description, and object location in the video. For another example, a third-party application can implement the processing function of the corresponding target task by calling the deployed target task processing model through the application programming interface (Application Programming Interface, referred to as API).

[0161] The target task is a task to be processed, which is used to indicate task processing based on task data. For example, the target task can be a question-answering task, a translation task, a video quality assessment task, a video description task, an audio-visual positioning task, etc. Among them, the task data under the question-answering task can include questions, the task data under the translation task can include the original text, and the task data under the video quality assessment task can include the video to be processed.

[0162] In an optional implementation of this embodiment, obtaining task data of the target task includes:

[0163] Get the task data of the target task uploaded by the front end.

[0164] It should be noted that the task data of the target task can be obtained based on the front-end input, and then the task processing results can be fed back to the front-end after being obtained, so as to realize the interaction with the front-end.

[0165] Step 504: Process the task data using the target task processing model corresponding to the target task to obtain a target processing result of the target task, wherein the target task processing model is trained based on the above-mentioned model training method.

[0166] Among them, the target task processing model is a pre-trained task processing model that can perform feature analysis on task data and output the target processing result of the target task.

[0167] By applying the video task processing method provided in this embodiment, the image information and sound information of the video to be processed can be fine-grainedly integrated at the spatial and temporal levels, promoting the interaction of the visual modality and the auditory modality, so that the target video processing model can more accurately understand the fine-grained characteristics of the image information and sound information of the video to be processed in time and space, and obtain accurate target processing results for the target video task.

[0168] In an optional implementation of this embodiment, after processing the task data using the target task processing model corresponding to the target task to obtain the target processing result of the target task, the method further includes:

[0169] Feedback the target processing results to the front end;

[0170] Receive feedback information sent by the front end regarding the target processing results;

[0171] An updated sample set is constructed based on the feedback information, and the target task processing model is trained based on the updated sample set.

[0172] Among them, feedback information is feedback information on the target processing results provided after the target processing results are generated and displayed to the front end, based on the subjective evaluation and requirements of the content of the target processing results. This feedback information is a detailed description that helps to improve the output of the target task processing model. Feedback information is an important part of realizing human-computer interaction, which can reflect the real feelings and expectations about the processing results of the target task. By collecting and using this feedback information, the performance of the target task processing model can be continuously optimized to more accurately meet actual needs and improve the quality and accuracy of the target processing results.

[0173] In practical applications, feedback information can be analyzed to construct an updated sample set, and the target task processing model can be retrained. The updated sample set is the historical data that has obtained the target processing result corresponding to the target task and received feedback information, which is used to train the target task processing model. Through the interactive feedback mechanism, the samples are updated, and the target task processing model is further trained based on the updated sample set, which improves the model performance of the target task processing model, thereby improving the processing accuracy and quality of the target task.

[0174] The embodiments of this specification provide a task processing method, in which the target task processing model used is obtained by training based on the screened target samples, and the target samples are obtained by screening based on the quality indicators of each candidate sample. The quality indicator of each candidate sample can indicate its learning value for the model to be trained. It focuses on the quality of the samples rather than the quantity, which is conducive to enhancing the performance of the model to be trained, thereby ensuring the task processing effect.

[0175] The following combination Figure 6 , taking the application of the model training method provided in this specification in the question-answering model scenario as an example, the model training method is further explained. Figure 6 A processing flow chart of a model training method provided by an embodiment of the present specification is shown, which specifically includes the following steps.

[0176] Step 602: Obtain a sample set of questions and answers.

[0177] Step 604: For the first question and answer data pair in the question and answer sample set, determine its similarity with each other second question and answer data pair, and determine the one with the highest similarity as a demonstration example of the first question and answer data pair.

[0178] Step 606: Construct demonstration data based on the first question-answer data pair and the demonstration example; determine a first response result of the first question-answer data pair based on the initial question-answer big model, calculate a first loss value based on the answer label and the first response result in the first question-answer data pair, and determine a second response result corresponding to the demonstration data based on the initial question-answer big model, calculate a second loss value based on the answer label and the second response result in the first question-answer data pair; use the loss value difference between the first loss value and the second loss value as the quality indicator of the first candidate sample.

[0179] Each question and answer data pair in the question and answer sample set can be used as the above-mentioned first question and answer data pair to determine the quality indicator.

[0180] Step 608: Sort the quality indicators of the candidate samples from large to small, and select a set number of candidate samples with the highest ranking as target question-answer data pairs.

[0181] Among them, the set number corresponds to the model specification parameters of the initial question-answering large model, or matches the processor performance of the model training platform.

[0182] Step 610: Based on the target question and answer data pairs obtained through screening, the initial question and answer big model is trained to obtain the target question and answer big model.

[0183] Step 612: In response to the question-answering task processing request, the question of the question-answering task is obtained, the question is processed using the target question-answering big model, the answer to the question is obtained, and the question and answer of the question is used as the processing result of the question-answering task.

[0184] The embodiments of this specification provide a task processing method, which realizes determining similar question and answer data pairs of a first question and answer data pair, determining the quality index of the first question and answer data pair based on the first question and answer data pair and the similar question and answer data pair, and the quality index can indicate the learning value of the first question and answer data pair for the initial question and answer large model, and then screen out the target question and answer data pair based on the quality index of each question and answer data pair in the question and answer sample set, and then train the initial question and answer large model based on the target question and answer data to obtain the target question and answer large model, and realize the processing of the question and answer task based on the target question and answer large model. The quality index of each question and answer data pair can indicate its learning value for the initial question and answer large model, focusing on the quality of the sample rather than the quantity, which is conducive to enhancing the training performance of the initial question and answer large model, and thus ensuring the processing effect of the question and answer task.

[0185] See also Figure 7 , Figure 7 A flowchart of an information processing method based on a target task processing model provided according to an embodiment of the present specification is shown, which is applied to a task platform and specifically includes the following steps.

[0186] Step 702: Receive a model request sent by a terminal device, wherein the model request includes a scene identifier of a target scene, scene input data of the target scene, and at least one of a model specification parameter.

[0187] It should be noted that the task platform is an online platform that provides model services, allowing developers, enterprises or individual users to submit tasks, obtain resources or implement specific functions through API calls, web interfaces or other interactive methods. In the embodiments of this specification, the task platform is a cloud service platform that can provide deep learning models, allowing external applications (such as e-commerce platforms, navigation applications, social applications, film and television production applications, and online education platforms, etc.) to access and use. The task platform ensures efficient and accurate response to requests from terminal devices by managing model training, updating, optimization, load balancing, scheduling and reasoning. The terminal device is a terminal device that requests to obtain the target task processing model.

[0188] In actual implementation, a model request is a request sent by a terminal device to a task platform to obtain or use a specific model service. The model request may include a scene identifier of a target scene, scene input data of a target scene, and at least one of the model specification parameters.

[0189] Among them, the target scene is the specific environment or situation in which the target task processing model will be applied, which describes the purpose and expected effect of the model service. The scene identifier of the target scene is the identification information of the target scene used for identification, which is used to assist in quickly locating the model related to the specific scene, for example, "video question and answer", "video navigation", "video monitoring", "video quality evaluation", "video object positioning", "video product positioning and search", etc. The scene input data of the target scene can be the input data used to train the initial task model to adapt to the target scene in the target scene, such as the scene input data in the question and answer scenario can be sample questions with answers. In addition, the model specification parameters are attribute specification parameters that define the model architecture, performance or configuration, such as model model, model type, model size, etc. The model specification parameters are used to determine the model that adapts to user needs.

[0190] For example, on the task platform client of the terminal device, the user clicks on the scene identifier of the target scene as "Question and Answer", selects the required model size as: 32GB, uploads the scene input data of the target scene, and the terminal device generates a model request and sends it to the task platform. The task platform receives the model request sent by the terminal device to the task platform, where the model request includes the scene identifier of the target scene, the scene input data of the target scene, and the model specification parameters.

[0191] In the embodiments of the present specification, a user can independently select a scene identifier of a target scene, scene input data of a target scene, and at least one of model specification parameters on a terminal device to trigger a model request. The task platform can receive the model request sent by the terminal device, and provide reference information for selecting a target task processing model based on the scene identifier of the target scene, scene input data of the target scene, and at least one of the model specification parameters, which is applicable to a wider range of scenarios.

[0192] Step 704: Based on the model request, determine a corresponding target task processing model from at least one task processing model, wherein at least one task processing model is trained based on the model training method as described above.

[0193] It should be noted that based on the model request, the corresponding target task processing model is determined from at least one task processing model. One optional method is: based on the model request, the corresponding target task processing model is searched from at least one task processing model included in the model library; another optional method is: based on the model request, the target task processing model is trained; another optional method is: based on the model request, the target task processing model is constructed, which is not limited here.

[0194] For example, based on the scene identification of the target scene, you can first search for at least one pre-trained task processing model from the model library, then filter out a task processing model of corresponding size from at least one task processing model based on the model specification parameters, and then train the task processing model of corresponding size based on the scene input data of the target scene to obtain a target task processing model that meets user needs.

[0195] At least one task processing model is obtained by training according to the above-mentioned model training method. Figure 2 The embodiments of the specification shown are based on the same inventive concept. For specific methods, please refer to the content of the above-mentioned model training, which will not be repeated here.

[0196] In an optional implementation of this embodiment, the model request includes a scene identifier of the target scene; based on the model request, determining a corresponding target task processing model from at least one task processing model includes:

[0197] Based on the scenario identifier of the target scenario, a target task processing model suitable for the target scenario is searched from a model library, wherein the model library stores at least one task processing model suitable for different task processing scenarios.

[0198] It should be noted that the model library is a database for storing and managing various pre-trained deep learning models. Multiple task processing models adapted to different task processing scenarios cover different application scenarios and needs. The model library allows users to select appropriate models according to their needs, or directly use the model for task processing through API calls.

[0199] The multiple task processing models adapted to different task processing scenarios are multiple models specially designed for different task processing scenarios stored in the model library, each model is optimized for a specific application environment, and any task processing model is obtained by training according to the above-mentioned model training method. For example, based on the scene identifier "image generation" of the target scene, the target task processing model adapted to the image generation scene can be searched from the model library.

[0200] In the embodiments of this specification, based on the scenario requirements, the target task processing model suitable for the scenario is accurately found through the scenario identification, so that the target processing result is more accurate and fits the scenario, thereby improving the user experience and task processing quality.

[0201] In an optional implementation of this embodiment, the model request includes scene input data of the target scene; based on the model request, determining a corresponding target task processing model from at least one task processing model includes:

[0202] Determining an initial task processing model adapted to the target scenario from at least one task processing model;

[0203] Based on the scene input data of the target scene, the initial task processing model is trained to obtain the target task processing model.

[0204] In actual implementation, the model request may include scene input data of the target scene, and the target task processing model is a task processing model suitable for the target scene.

[0205] In the embodiments of this specification, based on scenario requirements, the general task processing model is further trained through scenario input data to obtain a target task processing model adapted to the scenario, so that the target processing result is more accurate and fits the scenario, thereby improving the user experience and task processing quality.

[0206] In an optional implementation of this embodiment, the model request includes model specification parameters; based on the model request, determining a corresponding target task processing model from at least one task processing model includes:

[0207] Based on the model specification parameters, a corresponding target task processing model is searched from a model library, wherein the model library stores a plurality of task processing models with different model specification parameters.

[0208] The model specification parameter may be a model size, such as based on the model size: 32 GB, searching for a target task processing model of a corresponding size from a model library.

[0209] In the embodiments of this specification, based on the model specification requirements, the corresponding target task processing model is accurately found through the model specification parameters, which ensures the efficient and stable operation of the target task processing model and improves the user experience.

[0210] In an optional implementation of this embodiment, after determining the corresponding target task processing model from at least one task processing model based on the model request, the method further includes:

[0211] Deploy the target task processing model, and build a task processing interface based on the target task processing model so that the terminal device schedules the target task processing model to execute the target task.

[0212] It should be noted that the task processing interface is an interactive programming interface for the terminal device to schedule the target task processing model, which is usually provided in the form of an API. Through the task processing interface, the user can input the task data of the target task, such as at least one question, and effectively control the output of the model, such as the generated answer.

[0213] In actual implementation, an optional way to deploy the target task processing model is to deploy the target task processing model on the distributed system of the task platform. For example, the target task processing model is deployed on the distributed system of the task platform, and based on the target task processing model, a task processing interface is constructed and provided to the terminal device, so that the terminal device schedules the target task processing model to execute the target task of the corresponding processing scenario.

[0214] In the embodiments of this specification, efficient terminal calling is achieved, task processing is optimized, and task processing quality and response speed are improved.

[0215] The information processing method based on the target task processing model provided in the embodiment of this specification is applied to obtain the target task processing model according to user needs, realize personalized model service, provide users with an efficient, flexible and easy-to-use model service method, and improve user experience.

[0216] Corresponding to the above method embodiment, this specification also provides a model training platform embodiment, Figure 8 FIG. 1 shows a schematic diagram of a model training platform provided by an embodiment of the present specification. Figure 8 As shown, it includes a request interface unit 802, a model training unit 804 and a response unit 806;

[0217] The request interface unit 802 is used to receive a model training request, wherein the model training request includes model attribute information of the model to be trained;

[0218] The model training unit 804 is used to determine the model to be trained according to the model attribute information; obtain a candidate sample set of the training task, wherein the candidate sample set includes candidate samples; determine reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set; determine a quality index of the first candidate sample based on the model to be trained according to the first candidate sample and the reference information, wherein the quality index is used to indicate the learning value of the first candidate sample for the model to be trained; determine a target sample according to the quality index of each candidate sample, train the model to be trained based on the target sample, and obtain a target task processing model;

[0219] The response unit 806 is used to output the target task processing model.

[0220] Optionally, the model training platform further includes a data receiving unit.

[0221] The data receiving unit is used to receive the candidate sample set of the training task input by the user and send the candidate sample set to the model training unit.

[0222] Optionally, the model training platform further includes a model library, wherein the model library stores a plurality of initial task models;

[0223] The model training unit is also used to determine the model to be trained from the model library according to the model attribute information.

[0224] In the embodiments of this specification, the model training platform adapts to user demand acquisition to perform model training, realizes personalized model training services, provides users with an efficient, flexible and easy-to-use model training service platform, and improves user experience.

[0225] Corresponding to the above method embodiment, this specification also provides a model training device embodiment, Fig. 9 FIG. 1 shows a schematic diagram of a model training device provided by an embodiment of the present specification. Fig. 9 As shown, the device comprises:

[0226] A first acquisition module 902 is configured to acquire a candidate sample set for a training task, wherein the candidate sample set includes candidate samples;

[0227] A first determination module 904 is configured to determine reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set;

[0228] A second determination module 906 is configured to determine a quality indicator of the first candidate sample based on the model to be trained according to the first candidate sample and the reference information, wherein the quality indicator is used to indicate the learning value of the first candidate sample for the model to be trained;

[0229] The third determination module 908 is configured to determine a target sample from each candidate sample according to the quality indicators of each candidate sample, train the model to be trained based on the target sample, and obtain a target task processing model, wherein the learning value of the target sample for the model to be trained is higher than the learning value of other samples in the candidate samples for the model to be trained.

[0230] Optionally, the first determining module 904 is further configured to:

[0231] Determine the similarity between the first candidate sample and each second candidate sample, wherein the second candidate sample is other candidate samples in the candidate sample set except the first candidate sample;

[0232] Determine similar samples of the first candidate sample from the second candidate samples according to the similarity, and use the similar samples as reference information of the first candidate sample.

[0233] Optionally, the first determining module 904 is further configured to:

[0234] Based on the embedding model, determining a first sample vector of the first candidate sample and a second sample vector of each second candidate sample respectively;

[0235] The similarities between the first sample vector and each second sample vector are calculated respectively to obtain the similarities between the first candidate sample and each second candidate sample.

[0236] Optionally, the second determining module 906 is further configured to:

[0237] constructing demonstration data based on the first candidate sample and the reference information;

[0238] Input the first candidate sample into the model to be trained to obtain a first response result corresponding to the first candidate sample; input the demonstration data into the model to be trained to obtain a second response result corresponding to the demonstration data;

[0239] A quality indicator of the first candidate sample is determined according to the label of the first candidate sample, the first response result, and the second response result.

[0240] Optionally, the second determining module 906 is further configured to:

[0241] Calculate a first loss value according to the label and the first response result of the first candidate sample, wherein the first response result is a prediction result obtained by the to-be-trained model for the input first candidate sample, and the label is a true result of the first candidate sample;

[0242] Calculate a second loss value according to the label of the first candidate sample and the second response result, wherein the second response result is a prediction result obtained by the to-be-trained model for the input demonstration data;

[0243] A loss value difference between the first loss value and the second loss value is determined, and the loss value difference is used as a quality indicator of the first candidate sample.

[0244] Optionally, the second determining module 906 is further configured to:

[0245] Scoring the first response result according to the label of the first candidate sample and at least one scoring dimension to obtain a first response score, wherein the first response result is a prediction result obtained by the to-be-trained model for the input first candidate sample, and the label is a true result of the first candidate sample;

[0246] Scoring the second response result according to the label of the first candidate sample and at least one scoring dimension respectively to obtain a second response score, wherein the second response result is a prediction result obtained by the model to be trained for the input demonstration data;

[0247] A score difference between the first response score and the second response score is determined, and the score difference is used as a quality indicator of the first candidate sample.

[0248] Optionally, the third determining module 908 is further configured to:

[0249] Rank the quality indicators of each candidate sample;

[0250] Based on the model specification parameters of the model to be trained, target samples are screened from the sorted candidate samples, wherein the number of the target samples corresponds to the model specification parameters.

[0251] Optionally, the first acquisition module 902 is further configured to:

[0252] Get the task information of the training task uploaded by the front end;

[0253] Based on the task information, a candidate sample set is obtained.

[0254] The embodiments of the present specification provide a model training device, which realizes determining the reference information of the first candidate sample, determining the quality index of the first candidate sample based on the first candidate sample and the reference information, and the quality index can indicate the learning value of the first candidate sample for the model to be trained, and then based on the quality index of each candidate sample in the candidate sample set, screen out the target sample from each candidate sample, and then train the model to be trained based on the target sample, the learning value of the screened target sample for the model to be trained is higher than the learning value of other samples in each candidate sample for the model to be trained, that is, the target sample with higher learning value for the model to be trained is screened out from each candidate sample, and then the model is trained, focusing on the quality of the sample rather than the quantity, without blindly expanding the size of the candidate sample set, reducing the cost of model training, and the screened target sample is a sample with high learning value for the model to be trained, so the target sample is more conducive to enhancing the performance of the model to be trained, improving the model task performance ability of the model to be trained, greatly improving the model training efficiency, and ensuring the model performance.

[0255] The above is a schematic scheme of a model training device of this embodiment. It should be noted that the technical scheme of the model training device and the technical scheme of the above-mentioned model training method belong to the same concept, and the details not described in detail in the technical scheme of the model training device can be referred to the description of the technical scheme of the above-mentioned model training method.

[0256] Corresponding to the above method embodiment, this specification also provides a sample determination device embodiment for model training, Fig.10 FIG. 1 is a schematic diagram showing a structure of a sample determination device for model training provided by an embodiment of the present specification. Fig.10 As shown, the device comprises:

[0257] A second acquisition module 1002 is configured to acquire a candidate sample set for a training task, wherein the candidate sample set includes candidate samples;

[0258] The fourth determination module 1004 is configured to determine reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set;

[0259] A fifth determination module 1006 is configured to determine a quality indicator of the first candidate sample based on the model to be trained according to the first candidate sample and the reference information, wherein the quality indicator is used to indicate the learning value of the first candidate sample for the model to be trained;

[0260] The sixth determination module 1008 is configured to determine a target sample from the candidate samples based on the quality indicators of each candidate sample, wherein the target sample is used to train the initial model, the learning value of the target sample for the model to be trained is higher than the learning value of other samples in the candidate samples for the model to be trained, and the initial model includes other models belonging to the same scenario but with different model specification parameters as the model to be trained.

[0261] The embodiments of the present specification provide a sample determination device for model training, which determines reference information of a first candidate sample, determines a quality indicator of the first candidate sample based on the first candidate sample and the reference information, and the quality indicator can indicate the learning value of the first candidate sample for the model to be trained, and then based on the quality indicators of each candidate sample in the candidate sample set, screens out a target sample from each candidate sample, and the learning value of the screened target sample for the model to be trained is higher than the learning value of other samples in each candidate sample for the model to be trained, that is, screens out a target sample with higher learning value for the model to be trained from each candidate sample, and then performs model training, focusing on the quality of the sample rather than the quantity, without blindly expanding the size of the candidate sample set, and reducing the sample construction cost.

[0262] The above is a schematic scheme of a sample determination device for model training of this embodiment. It should be noted that the technical scheme of the sample determination device for model training and the technical scheme of the sample determination method for model training described above belong to the same concept, and the details of the technical scheme of the sample determination device for model training that are not described in detail can be found in the description of the technical scheme of the sample determination method for model training described above.

[0263] Corresponding to the above method embodiment, this specification also provides a task processing device embodiment, Fig.11 FIG. 1 shows a schematic diagram of a task processing device provided by an embodiment of the present specification. Fig.11 As shown, the device comprises:

[0264] The third acquisition module 1102 is configured to acquire task data of the target task;

[0265] The processing module 1104 is configured to process the task data using a target task processing model corresponding to the target task to obtain a target processing result of the target task, wherein the target task processing model is trained based on the above-mentioned model training method.

[0266] The embodiments of this specification provide a task processing device, which uses a target task processing model obtained by training based on screened target samples, and the target samples are obtained by screening based on the quality indicators of each candidate sample. The quality indicator of each candidate sample can indicate its learning value for the model to be trained. It focuses on the quality of the samples rather than the quantity, which is conducive to enhancing the performance of the model to be trained, thereby ensuring the task processing effect.

[0267] Fig.12 A structural block diagram of a computing device provided by an embodiment of the present specification is shown.

[0268] The computing device 1200 includes:

[0269] Memory 1210 and processor 1220;

[0270] The memory 1210 is used to store computer programs / instructions, and the processor 1220 is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor 1220, the steps of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on the target task processing model are implemented.

[0271] In one or more embodiments of the present specification, the computing device 1200 may be understood as an integrated intelligent terminal, including but not limited to a server, a desktop computer, a PC (Personal Computer), an all-in-one model machine, a mobile phone, a tablet computer or other portable intelligent terminal, etc., and the computing device may be pre-installed with the models in the above embodiments of the present application.

[0272] Specifically, the computing device 1200 can preset multiple types of models, including but not limited to models in the fields of natural language processing, visual processing, speech processing, code processing, multimodal task processing, etc., so as to provide a variety of model selections. In different product forms, the computing device 1200 can support one or more model usage methods, including but not limited to model training, model calling, model fine-tuning, model deployment, model reasoning and application, etc. In some product forms, the computing device 1200 also supports model management, including but not limited to multi-type model management (supporting the management of multiple types of models such as discriminants and generative models), model version control (supporting the control of different model versions), model evaluation (based on model evaluation tools, evaluating the performance and effect of models), etc. In other product forms, the computing device 1200 can also create applications based on models, provide API (Application Programming Interface, application programming interface) calling capabilities, and can call models to the created applications through API interfaces, while providing application management tools to achieve management and monitoring of applications.

[0273] Furthermore, the computing device 1200 may also include data management (supporting the creation and management of model tuning data sets), a training center (providing rich training resources to help users learn artificial intelligence technology), and basic management and control capabilities (providing enterprise-level basic management and control capabilities to ensure the security and efficient operation of the system). Through the above functions, a comprehensive, integrated artificial intelligence development, training, deployment and application device is provided.

[0274] Fig.13 A structural block diagram of an electronic device provided by an embodiment of the present specification is shown.

[0275] The memory 1310 and the processor 1320 are connected via a bus 1330;

[0276] The memory 1310 is used to store computer programs / instructions, and the processor 1320 is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor 1320, the steps of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on the target task processing model are implemented.

[0277] Specifically, the components of the electronic device 1300 include but are not limited to a memory 1310 and a processor 1320. The processor 1320 and the memory 1310 may be connected via a bus 1330.

[0278] The electronic device 1300 may also include an access device 1340, which enables the electronic device 1300 to communicate with a database 1350 storing data via one or more networks 1360. Examples of these networks 1360 include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1340 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).

[0279] In one embodiment of the present specification, the above components of the electronic device 1300 and Fig.13 Other components not shown in the figure may also be connected to each other, for example, via bus 1330. It should be understood that Fig.13 The electronic device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0280] The electronic device 1300 may be any type of stationary or mobile electronic device, including a mobile computer or mobile electronic device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable electronic device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary electronic device such as a desktop computer or a personal computer (PC). The electronic device 1300 may also be a mobile or stationary server.

[0281] The above is a schematic scheme of an electronic device of this embodiment. It should be noted that the technical scheme of the electronic device and the technical schemes of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on the target task processing model belong to the same concept, and the details not described in detail in the technical scheme of the electronic device can be found in the description of the technical schemes of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on the target task processing model.

[0282] An embodiment of the present specification also provides a computer-readable storage medium storing a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on a target task processing model.

[0283] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on the target task processing model belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on the target task processing model.

[0284] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on a target task processing model.

[0285] The above is a schematic scheme of a computer program product of this embodiment. It should be noted that the technical scheme of the computer program product and the technical schemes of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on the target task processing model belong to the same concept, and the details not described in detail in the technical scheme of the computer program product can be found in the description of the technical schemes of the above-mentioned model training method, sample determination method for model training, task processing method, and information processing method based on the target task processing model.

[0286] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0287] Computer programs / instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. Computer readable media may include: any entity or device capable of carrying computer program codes, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memories, read-only memories (ROM), random access memories (RAM), electric carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the contents of computer readable media may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer readable media do not include electric carrier signals and telecommunication signals.

[0288] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0289] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0290] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can understand and use this specification well. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A model training method, comprising: Acquire a candidate sample set for a training task, wherein the candidate sample set includes candidate samples; Determine reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set, and the reference information refers to similar samples of the first candidate sample other than itself in the candidate sample set; Generate a prompt instruction based on the reference information of the first candidate sample, and combine the prompt instruction and the first candidate sample into demonstration data; input the first candidate sample to the model to be trained to obtain a first response result corresponding to the first candidate sample; input the demonstration data to the model to be trained to obtain a second response result corresponding to the demonstration data; determine a quality indicator of the first candidate sample according to the label of the first candidate sample, the first response result, and the second response result, wherein the quality indicator is used to indicate the learning value of the first candidate sample for the model to be trained; The quality indicators of each candidate sample are sorted, the processor performance for executing the training task is determined, the target sample is determined from the sorted candidate samples, the model to be trained is trained based on the target sample, and the target task processing model is obtained, wherein the processor performance is used to indicate the current processing capability of the processor of the model training platform, the number of the target samples is adapted to the processor performance, and the learning value of the target sample for the model to be trained is higher than the learning value of other samples in the candidate samples for the model to be trained.

2. According to the model training method of claim 1, the step of determining the reference information of the first candidate sample in the candidate sample set comprises: Determine the similarity between the first candidate sample and each second candidate sample, wherein the second candidate sample is other candidate samples in the candidate sample set except the first candidate sample; Determine similar samples of the first candidate sample from the second candidate samples according to the similarity, and use the similar samples as reference information of the first candidate sample.

3. The model training method according to claim 2, wherein determining the similarity between the first candidate sample and each second candidate sample comprises: Based on the embedding model, determining first sample vectors of the first candidate samples and second sample vectors of the second candidate samples respectively; The similarities between the first sample vector and each second sample vector are calculated respectively to obtain the similarities between the first candidate sample and each second candidate sample.

4. The model training method according to claim 1, wherein determining the quality index of the first candidate sample according to the label of the first candidate sample, the first response result and the second response result comprises: Calculate a first loss value according to the label of the first candidate sample and the first response result, wherein the first response result is a prediction result obtained by the to-be-trained model for the input first candidate sample, and the label is a true result of the first candidate sample; Calculate a second loss value according to the label of the first candidate sample and the second response result, wherein the second response result is a prediction result obtained by the model to be trained for the input demonstration data; A loss value difference between the first loss value and the second loss value is determined, and the loss value difference is used as a quality indicator of the first candidate sample.

5. The model training method according to claim 1, wherein determining the quality index of the first candidate sample according to the label of the first candidate sample, the first response result and the second response result comprises: Scoring the first response result according to the label of the first candidate sample and at least one scoring dimension to obtain a first response score, wherein the first response result is a prediction result obtained by the to-be-trained model for the input first candidate sample, and the label is a true result of the first candidate sample; Scoring the second response result according to the label of the first candidate sample and at least one scoring dimension respectively to obtain a second response score, wherein the second response result is a prediction result obtained by the model to be trained for the input demonstration data; A score difference between the first response score and the second response score is determined, and the score difference is used as a quality indicator of the first candidate sample.

6. According to the model training method according to any one of claims 1 to 5, determining the target sample from the sorted candidate samples comprises: Based on the model specification parameters of the model to be trained, the target samples are screened from the sorted candidate samples, wherein the number of the target samples corresponds to the model specification parameters.

7. According to any one of claims 1 to 5, the step of obtaining a candidate sample set for a training task comprises: Obtaining task information of the training task uploaded by the front end; Based on the task information, the candidate sample set is obtained.

8. A sample determination method for model training, comprising: Acquire a candidate sample set for a training task, wherein the candidate sample set includes candidate samples; Determine reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set, and the reference information refers to similar samples of the first candidate sample other than itself in the candidate sample set; Generate a prompt instruction based on the reference information of the first candidate sample, and combine the prompt instruction and the first candidate sample into demonstration data; input the first candidate sample to the model to be trained to obtain a first response result corresponding to the first candidate sample; input the demonstration data to the model to be trained to obtain a second response result corresponding to the demonstration data; determine a quality indicator of the first candidate sample according to the label of the first candidate sample, the first response result, and the second response result, wherein the quality indicator is used to indicate the learning value of the first candidate sample for the model to be trained; The quality indicators of each candidate sample are sorted, the processor performance for executing the training task is determined, and the target sample is determined from the sorted candidate samples, wherein the processor performance is used to indicate the current processing capability of the processor of the model training platform, the number of the target samples is adapted to the processor performance, the target samples are used to train the initial model, the learning value of the target sample for the model to be trained is higher than the learning value of other samples in the candidate samples for the model to be trained, and the initial model includes other models that belong to the same scenario as the model to be trained but have different model specification parameters.

9. A task processing method, comprising: Get the task data of the target task; The task data is processed using a target task processing model corresponding to the target task to obtain a target processing result of the target task, wherein the target task processing model is trained based on the model training method described in any one of claims 1 to 7.

10. The task processing method according to claim 9, wherein the step of obtaining the task data of the target task comprises: Obtaining the task data of the target task uploaded by the front end; Correspondingly, after the target task processing model corresponding to the target task is used to process the task data and obtain the target processing result of the target task, the method further includes: Feeding back the target processing result to the front end; Receiving feedback information sent by the front end regarding the target processing result; An updated sample set is constructed based on the feedback information, and the target task processing model is trained based on the updated sample set.

11. An information processing method based on a target task processing model, applied to a task platform, comprising: Receiving a model request sent by a terminal device, wherein the model request includes a scene identifier of a target scene, scene input data of the target scene, and at least one of a model specification parameter; Based on the model request, a corresponding target task processing model is determined from at least one task processing model, wherein the at least one task processing model is trained based on the model training method according to any one of claims 1 to 7.

12. The method according to claim 11, wherein the model request includes a scene identifier of a target scene; and determining a corresponding target task processing model from at least one task processing model based on the model request comprises: Based on the scenario identifier of the target scenario, searching a target task processing model adapted to the target scenario from a model library, wherein the model library stores at least one task processing model adapted to different task processing scenarios; The model request includes scene input data of a target scene; and determining a corresponding target task processing model from at least one task processing model based on the model request includes: Determining an initial task processing model adapted to the target scenario from at least one task processing model; Based on the scene input data of the target scene, the initial task processing model is trained to obtain a target task processing model; The model request includes model specification parameters; and determining a corresponding target task processing model from at least one task processing model based on the model request includes: Based on the model specification parameters, a corresponding target task processing model is searched from a model library, wherein the model library stores a plurality of task processing models with different model specification parameters.

13. The method according to any one of claims 11 to 12, after determining a corresponding target task processing model from at least one task processing model based on the model request, further comprising: The target task processing model is deployed, and a task processing interface is constructed based on the target task processing model, so that the terminal device schedules the target task processing model to execute the target task.

14. A model training platform, comprising a request interface unit, a model training unit and a response unit; The request interface unit is used to receive a model training request, wherein: The model training request includes model attribute information of the model to be trained; The model training unit is used to determine the model to be trained according to the model attribute information; obtain a candidate sample set for the training task, wherein the candidate sample set includes candidate samples; determine reference information of a first candidate sample in the candidate sample set, wherein the first candidate sample is any candidate sample in the candidate sample set, and the reference information refers to similar samples of the first candidate sample other than itself in the candidate sample set; generate a prompt instruction based on the reference information of the first candidate sample, and combine the prompt instruction and the first candidate sample into demonstration data; input the first candidate sample into the model to be trained to obtain a first response result corresponding to the first candidate sample; input the demonstration data into the model to be trained to obtain a second response result corresponding to the demonstration data result; according to the label of the first candidate sample, the first response result and the second response result, determine the quality indicator of the first candidate sample, wherein the quality indicator is used to indicate the learning value of the first candidate sample for the model to be trained; sort the quality indicators of each candidate sample, determine the processor performance for executing the training task, determine the target sample from the sorted candidate samples, train the model to be trained based on the target sample, and obtain the target task processing model, the processor performance is used to indicate the current processing capacity of the processor of the model training platform, the number of the target samples is adapted to the processor performance, and the learning value of the target sample for the model to be trained is higher than the learning value of other samples in the candidate samples for the model to be trained; The response unit is used to output the target task processing model.

15. The model training platform according to claim 14, further comprising a data receiving unit, The data receiving unit is used to receive a candidate sample set of a training task input by a user, and send the candidate sample set to the model training unit.

16. The model training platform according to claim 14 further comprises a model library, wherein: The model library stores a plurality of initial task models; The model training unit is further used to determine the model to be trained from the model library according to the model attribute information.

17. A computing device comprising: Memory and processor; The memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions. When the computer program or instructions are executed by the processor, the steps of the method according to any one of claims 1 to 13 are implemented.

18. An electronic device, comprising: A memory and a processor, wherein the memory and the processor are connected via a bus; The memory is used to store computer programs or instructions, and the processor is used to execute the computer programs or instructions. When the computer program or instructions are executed by the processor, the steps of the method according to any one of claims 1 to 13 are implemented.

19. A computer-readable storage medium storing a computer program or instruction, wherein the computer program or instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 13.

20. A computer program product, comprising a computer program or instructions, which implement the steps of the method according to any one of claims 1 to 13 when executed by a processor.

Citation Information

Patent Citations

  • Training sample determination method and device, medium, electronic equipment and program product

    CN118094228A