Task processing method, system, device, medium and computer program product

By training remotely through knowledge distillation across heterogeneous devices, and using a large model to train a small model for generating thought chains, the hardware limitations of the small model are solved, and the performance and capabilities of the small model are improved.

CN119167982BActive Publication Date: 2026-05-12WEBANK (CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WEBANK (CHINA)
Filing Date
2024-08-30
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In the era of large language models, small model owners have difficulty running large models locally due to hardware limitations, making it impossible to improve model performance through traditional knowledge distillation methods.

Method used

By deploying a small model on the first device and a large model on the second device, the small model is remotely trained using the thought chain output by the large model. This includes sending a task processing thought chain generation request, determining multi-objective joint training instruction information, and iteratively training the small model until the conditions are met.

Benefits of technology

This approach allows small models to retain task processing capabilities while increasing their ability to generate thought chains, thus avoiding hardware limitations and improving the performance of small models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119167982B_ABST
    Figure CN119167982B_ABST
Patent Text Reader

Abstract

The application discloses a task processing method, system, device, medium and computer program product, relates to the technical field of knowledge distillation, and the method comprises the following steps: sending a task processing thought chain generation request to a second device based on a task training set corresponding to at least one task, and receiving a task processing thought chain fed back by the second device according to a large model and the task training set; determining first target indication information and second target indication information of multi-target joint training of a small model based on task data, training a first target of the small model based on the task data, a task processing result label and the first target indication information, iteratively training a second target of the small model based on the task data, the task processing thought chain and the second target indication information, and obtaining the small model trained until a preset joint training end condition is met, so as to perform task processing according to the small model trained. The application can realize knowledge distillation of the small model according to the large model of the remote end.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the specific field of knowledge distillation technology, and in particular to task processing methods, systems, devices, media, and computer program products. Background Technology

[0002] In the era of large language models, with the widespread application of large models with huge parameters such as GPT-4 (Generative Pre-trained Transformer 4) and GLM-4, knowledge distillation between large and small models is difficult to achieve. Traditional knowledge distillation algorithms require deploying both large and small models locally and training them simultaneously. However, many small model owners are unable to run large-scale large models locally due to their hardware limitations. Therefore, for small model owners who only have small models, it is impossible to perform knowledge distillation on the small model based on the large model, thereby improving the performance of the small model.

[0003] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main objective of this application is to provide a task processing method, system, device, medium, and computer program product, which aims to solve the technical problem of how to perform knowledge distillation on the small model based on the large model for a holder of only a small model.

[0005] To achieve the above objectives, this application proposes a task processing method applied to a first device connected to a second device. The first device deploys a small model to be trained, and the second device deploys a large model. The method includes:

[0006] Based on the task training set corresponding to at least one task, a task processing thought chain generation request is sent to the second device, and the task processing thought chain is received from the second device. The task training set includes task data and task processing result labels. The task processing thought chain is used to explain the thought chain logic of processing the task data to generate task processing result labels. The second device outputs the task processing thought chain based on the large model and the task training set.

[0007] Based on the task data, a first target indication information and a second target indication information are determined for the multi-target joint training of the small model. The first target indication information is used to indicate the processing of the task data, and the second target indication information is used to indicate the logical chain of thought for processing the task data.

[0008] Based on the task data, the task processing result label, and the first target indication information, the first target of the small model is trained, and the second target of the small model is iteratively trained based on the task data, the task processing thought chain, and the second target indication information until the preset joint training termination condition is met, and the trained small model is obtained, so as to perform task processing according to the trained small model.

[0009] In one embodiment, based on the task data, determining the first target indication information and the second target indication information for the multi-target joint training of the small model includes:

[0010] Obtain a preset task processing prefix, and concatenate the preset task processing prefix and the task data to obtain the first target indication information;

[0011] Obtain a preset thought chain generation prefix, and concatenate the preset thought chain generation prefix and the task data to obtain the second target indication information.

[0012] In one embodiment, the first objective of training the small model based on the task data, the task processing result label, and the first target indication information includes:

[0013] Based on the first target indication information, determine the first prediction result output by the small model corresponding to the task data;

[0014] Based on the first prediction result and the task processing result label, the first prediction loss is calculated;

[0015] The small model is optimized based on the first prediction loss to train the small model for the first objective.

[0016] In one embodiment, based on the task data, the task processing thought chain, and the second target indication information, iteratively training the second target of the small model includes:

[0017] Based on the second target indication information, determine the second prediction result output by the small model corresponding to the task data;

[0018] Based on the second prediction result and the task processing thought chain, the second prediction loss is calculated;

[0019] The small model is optimized based on the second prediction loss to train the small model for the second objective.

[0020] In one embodiment, the small model is trained to train a first objective based on the task data, the task processing result label, and the first objective indication information, and the small model is iteratively trained to train a second objective based on the task data, the task processing thought chain, and the second objective indication information, further comprising:

[0021] In each round of iterative training, a first prediction loss is determined based on the task data, the task processing result label, and the first target indication information;

[0022] Based on the task data, the task processing thought chain, and the second target indication information, a second predicted loss is determined.

[0023] The first prediction loss and the second prediction loss are weighted and summed to obtain the total prediction loss. The small model is then optimized based on the total prediction loss to jointly train the first objective and the second objective of the small model.

[0024] In one embodiment, the task processing thought chain generation request includes determining the task processing thought chain generation request and the question-and-answer task processing thought chain generation request.

[0025] Sending a task processing thought chain generation request to the second device based on the task training set corresponding to at least one task includes:

[0026] When the task is a judgment task, a judgment task processing thought chain generation request is generated based on the task training set corresponding to the judgment task, and the judgment task processing thought chain generation request is sent to the second device; and / or,

[0027] When the task is a question-and-answer task, a question-and-answer task processing thought chain generation request is generated based on the task training set corresponding to the question-and-answer task, and the question-and-answer task processing thought chain generation request is sent to the second device.

[0028] Furthermore, to achieve the above objectives, this application provides a task processing method applied to a second device connected to a first device. The first device deploys a small model to be trained, and the second device deploys a large model. The method includes:

[0029] The system receives a task processing thought chain generation request sent by the first device based on a task training set corresponding to at least one task, wherein the task training set includes task data and task processing result labels, and the task processing thought chain is used to explain the thought chain logic of processing the task data to generate task processing result labels.

[0030] Based on the task processing thought chain generation request, the task data in the task training set is input into the large model, the task processing thought chain is output, and the task processing thought chain is sent to the first device.

[0031] The first device, based on the task data, determines first target indication information and second target indication information for the multi-target joint training of the small model. Based on the task data, the task processing result label, and the first target indication information, it trains the first target of the small model. It then iteratively trains the second target of the small model based on the task data, the task processing thought chain, and the second target indication information until a preset joint training termination condition is met, thus obtaining a trained small model. The trained small model is then used for task processing. The first target indication information is used to indicate the processing of the task data, and the second target indication information is used to indicate the explanation of the thought chain logic for processing the task data.

[0032] Furthermore, to achieve the above objectives, this application provides a task processing system, including a first device and a second device interconnected, wherein a small model to be trained is deployed in the first device, and a large model is deployed in the second device.

[0033] The first device is configured to send a task processing thought chain generation request to the second device based on a task training set corresponding to at least one task, and receive the task processing thought chain fed back by the second device, wherein the task training set includes task data and task processing result labels, and the task processing thought chain is used to explain the thought chain logic of processing the task data to generate task processing result labels.

[0034] The second device is configured to receive a task processing thought chain generation request sent by the first device based on a task training set corresponding to at least one task, input task data from the task training set into the large model based on the task processing thought chain generation request, output a task processing thought chain, and send the task processing thought chain to the first device.

[0035] The first device is further configured to determine, based on the task data, a first target indication information and a second target indication information for the multi-target joint training of the small model, wherein the first target indication information is used to indicate the processing of the task data, and the second target indication information is used to indicate the interpretation of the thought chain logic for processing the task data.

[0036] The first device is further configured to train the first target of the small model based on the task data, the task processing result label and the first target indication information, and iteratively train the second target of the small model based on the task data, the task processing thought chain and the second target indication information until a preset joint training termination condition is met, thereby obtaining a trained small model for task processing based on the trained small model.

[0037] In addition, to achieve the above objectives, this application also proposes a task processing device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the task processing method as described above.

[0038] In addition, to achieve the above objectives, this application also proposes a medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the task processing method described above.

[0039] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the task processing method described above.

[0040] In this embodiment, a small model is deployed on a first device and a large model is deployed on a second device. The thought chain output by the large model in the second device performs knowledge distillation on the small model in the first device. This avoids the phenomenon that traditional distillation methods require the simultaneous deployment of both a large model and a small model locally in order to use the large model to perform knowledge distillation on the small model. It also avoids the hardware limitations and high costs of deploying a large model locally, enabling more institutions and enterprises to leverage the capabilities of the large model to enhance their local small models.

[0041] Furthermore, the first device sends a task processing thought chain generation request to the second device based on a task training set corresponding to at least one task, and receives the task processing thought chain returned by the second device. The task training set includes task data and task processing result labels, and the task processing thought chain is used to explain the thought chain logic of processing task data to generate task processing result labels. Therefore, the first device can construct a task processing thought chain generation request based on its own stored task training set, so that the task processing thought chain returned by the second device is more closely aligned with the tasks in the task training set. The second device also outputs the task processing thought chain based on the large model and the task training set. This allows the second device to utilize the model capabilities of the large model to output a task processing thought chain corresponding to the task training set.

[0042] Furthermore, the first device determines first and second target indication information for the multi-target joint training of the small model based on task data. The first target indication information is used to guide the processing of task data, while the second target indication information is used to explain the thought process logic for processing task data. This allows the first device to guide the small model in multi-target joint training, such as using the first and second target indication information. This enables the small model to retain its ability to process task data while also increasing its ability to generate thought process logic during subsequent multi-target joint training. Based on task data, task processing result labels, and the first target indication information, the first target of the small model is trained. Based on task data, the task processing thought process, and the second target indication information, the second target of the small model is iteratively trained until the preset joint training termination condition is met, resulting in a trained small model for task processing. In other words, when the small model is trained, it performs two objectives for a given task data: processing the task data and interpreting the thought process logic used to process it. This allows the trained small model to retain its task processing capabilities while generating the corresponding thought process logic, thus improving its performance. Furthermore, the small model is trained using the task processing thought process logic sent by the large model. Since the large and small models can reside on different devices, it's possible for a model holder with only the small model to remotely access the large model on a second device. Using the task processing thought process logic generated by the large model, the small model can be trained, enabling knowledge distillation of the small model. This allows the small model holder, possessing only the small model, to perform knowledge distillation based on the large model, giving the small model the ability to generate thought processes. Attached Figure Description

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

[0044] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 This is a flowchart illustrating the first embodiment of the task processing method of this application;

[0046] Figure 2 A schematic diagram illustrating the scenario of model training for organization A and organization B in the task processing method of this application;

[0047] Figure 3 This is a flowchart illustrating the third embodiment of the task processing method of this application.

[0048] Figure 4 This is a schematic diagram of the scenario architecture of the first and second devices in the task processing system of this application embodiment;

[0049] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the task processing method in the embodiments of this application.

[0050] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0051] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0052] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0053] The following presents a first embodiment of the task processing method of this application. (Refer to...) Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the task processing method of this application. In this embodiment, the task processing method is applied to a first device, which is communicatively connected to a second device. Both the first and second devices can be computing service devices with data processing, network communication, and program execution functions, such as servers, tablets, personal computers, and mobile phones. The first and second devices can be deployed in different enterprises. Therefore, each enterprise can use its own devices to jointly train the model. In specific implementations, specific natural language processing tasks can be set according to the specific needs of each enterprise. For example, in a dialogue scenario, a task of generating a response and thought chain based on the preceding text can be set; in a summary generation scenario, a task of generating a text summary and thought chain based on the text can be set. The operations performed or functions implemented by the first and second devices during model training can be different or the same. Therefore, in the following embodiments, the two devices are distinguished as first and second. In some application scenarios, the first device can also be referred to as a server or coordinator, etc., and the second device can be referred to as a client or participant, etc.

[0054] The first device deploys a small model to be trained, while the second device deploys a large model. The small model can be a small language model, and the large model can be a large language model. Language models are models that can be used to perform natural language processing tasks, such as GPT-4 (a pre-trained language model), OPT (Open Pre-trained Transformer), BLOOM (BigScience), CLIP (Contrastive Language-Image Pre-training), and EVA (Distributed Database System). In this embodiment, both the large and small language models are language models. The large language model has a more complex structure and more parameters, while the small language model has a relatively simpler structure and fewer parameters. The models that different companies can deploy or support may be heterogeneous. Therefore, in this embodiment, the small model deployed on the first device and the large model deployed on the second device are heterogeneous. Heterogeneity means that the two models have different model architectures and different scales of model parameters. Due to differences in structure and number of parameters, large models are better at handling natural language tasks than small models. Therefore, large models can be used to assist in training small models, enabling small models to acquire some of the capabilities of large models. For example, a large model can be trained to generate thought chains, and then the small model can be trained based on the thought chains generated by the large model, so that the small model also has the ability to generate thought chains.

[0055] The model to be trained refers to the model whose parameters need to be optimized through the training process. Its initial model parameters can be obtained after model pre-training (or, a pre-trained model can be used as the model to be trained), or they can be initialized empirically or randomly. Using a pre-trained model as the model to be trained and training it on a specific processing task is also called "fine-tuning," and the term "training" is used to represent this process in the following embodiments. In a specific implementation, using a pre-trained small model as the small model to be trained, and further training the small model, can achieve better training results, meaning that the trained model can have stronger task processing capabilities, such as generating accurate thought chains. In this embodiment, it is not limited to using a pre-trained small model as the small model to be trained, nor is the specific pre-training method limited.

[0056] In this embodiment, the task processing method is applied to a first device, which is connected to a second device. A small model to be trained is deployed in the first device, and a large model is deployed in the second device. The task processing method includes steps S10-S30.

[0057] Step S10: Send a task processing thought chain generation request to the second device based on the task training set corresponding to at least one task, and receive the task processing thought chain fed back by the second device.

[0058] It should be noted that the task training set includes task data and task processing result labels. The task processing thought chain is used to explain the thought chain logic of processing task data to generate task processing result labels. The second device outputs the task processing thought chain based on the large model and the task training set.

[0059] Optionally, the task can be a decision-making task (such as an emotion classification task), a question-and-answer task (i.e., selecting the correct answer from a set of question answers, such as a multiple-choice question), or any other task suitable for processing by a small model. Optionally, the thought chain can be textual data that provides a step-by-step reasoning solution to a problem. A task processing thought chain is a thought chain corresponding to task data, including the thought chain logic that explains the task data processing to generate task processing result labels.

[0060] Optionally, the first device can remotely call upon the large model of the second device to assist in training the small model in the first device by leveraging the model capabilities of the large model in the second device.

[0061] Optionally, the first device can call the large model interface provided by the second device, or use other calling methods to call the large model in the second device, so as to use the large model in the second device to train the model on each task data in the task training set, output the task processing thought chain corresponding to each task data, and feed back all task processing thought chains to the first device.

[0062] Optionally, the first device may first determine a task training set for at least one task, and construct a task processing thought chain generation request corresponding to the task training set. Optionally, the task processing thought chain generation request may include: describing the task content, and requesting the large model in the second device to answer the question and explain why the answer is this one, thereby generating a thought chain.

[0063] Optionally, a task processing thought chain generation request can be sent to a second device, and a task training set can also be sent to the second device. The large model in the second device trains the model on the task data in the task training set according to the task processing thought chain generation request, outputs the task processing thought chain corresponding to each task data, and feeds back all task processing thought chains to the first device.

[0064] For example, if the task is a question-and-answer task, then the task data in the corresponding task training set is the question-and-answer task data, and the task processing result label is the correct answer. For instance, the question in the question-and-answer task data is "A migratory bird flew north over the highest peak on Earth, where is it now?", and the candidate answers for the question-and-answer task data include "A. China; B. USA; C. Japan; D. Centaurus". The task processing result label is A. China. The first device can construct a task processing thought chain generation request, which may include: answering the question-and-answer task data and requesting the large model in the second device to answer the question and explain why the question is the correct answer, thereby generating a thought chain. Optionally, the task processing thought chain generation request can be a prompt. The first device sends the thought chain generation request to the second device. When the large model in the second device is training the model on the task data, it will provide the following reasoning answer based on the task processing thought chain generation request: "Because the highest peak in the world is Mount Everest, it is located on the border between China and Nepal. China is in the north, therefore, this migratory bird flew into China. Based on the above reasoning, the final answer is A, China." This reasoning is the task processing thought process. This thought process is then fed back to the first device to train the small model within it.

[0065] Optionally, this task-processing thought chain can be used as a medium for knowledge distillation (transfer) between the larger model in the second device and the smaller model in the first device. Because the smaller model (such as a small language model) is inherently weak and sometimes unable to complete task reasoning independently, a correct thought chain containing correct logic can effectively improve the smaller model's ability to perform the task.

[0066] In one feasible embodiment, the task processing thought chain generation request includes a decision task processing thought chain generation request and a question-and-answer task processing thought chain generation request.

[0067] In step S10, a task processing thought chain generation request is sent to the second device based on the task training set corresponding to at least one task, including at least one of steps a10-a20.

[0068] Step a10: When the task is a decision task, generate a decision task processing thought chain generation request based on the task training set corresponding to the decision task, and send the decision task processing thought chain generation request to the second device; and / or,

[0069] Step a20: When the task is a question-and-answer task, generate a question-and-answer task processing thought chain generation request based on the task training set corresponding to the question-and-answer task, and send the question-and-answer task processing thought chain generation request to the second device.

[0070] Optionally, the first device may store task training sets corresponding to different types of tasks. For example, a task training set for a decision-making task, or a task training set for a question-answering task. Optionally, each task training set may include at least one task data set and its corresponding task processing result label.

[0071] Optionally, the first device can determine the task training set for model training based on different actual scenario requirements. If the actual scenario requires processing a decision task, then the task training set for model training is determined to be the task training set corresponding to the decision task; if the actual scenario requires processing a question-answering task, then the task training set for model training is determined to be the task training set corresponding to the question-answering task.

[0072] Optionally, when the task is determined to be a decision task, the task training set corresponding to the decision task stored in the storage area of ​​the first device can be determined, and a decision task processing thought chain generation request can be generated based on the task data and task processing result labels corresponding to the decision task in the task training set. Optionally, a prompt can be used to describe the relevant information of the decision task processing thought chain generation request, such as answering the decision task data and requiring the large model in the second device to answer the question and explain why the answer is this, thereby generating a thought chain.

[0073] Optionally, after the first device determines the request to generate the decision task processing thought chain corresponding to the decision task, it will send it to the second device. The second device will train the model based on the large model and the task training set corresponding to the decision task, output the task processing thought chain, and feed it back to the first device.

[0074] Optionally, when the task is determined to be a question-answering task, the task training set corresponding to the question-answering task stored in the storage area of ​​the first device can be determined, and a question-answering task processing thought chain generation request can be generated based on the task data and task processing result labels corresponding to the question-answering task in the task training set. Optionally, a prompt can be used to describe the relevant information of the question-answering task processing thought chain generation request, such as answering the question-answering task data and requiring the large model in the second device to answer the question and explain why the answer is this one, thereby generating a thought chain.

[0075] Optionally, after determining the question-and-answer task processing thought chain generation request corresponding to the question-and-answer task, the first device will send it to the second device. The second device will train the model based on the large model and the task training set corresponding to the question-and-answer task, output the task processing thought chain, and feed it back to the first device.

[0076] In this embodiment, when the task is a judgment task, a judgment task processing thought chain generation request, generated based on the task training set corresponding to the judgment task, is sent to the second device. This allows the task processing thought chain generated by the second device based on the judgment task processing thought chain generation request to be more closely aligned with the judgment task. Similarly, when the task is a question-and-answer task, a question-and-answer task processing thought chain generation request, generated based on the task training set corresponding to the question-and-answer task, is sent to the second device. This allows the task processing thought chain generated by the second device based on the question-and-answer task processing thought chain generation request to be more closely aligned with the question-and-answer task.

[0077] Step S20: Based on the task data, determine the first target indication information and the second target indication information for the multi-target joint training of the small model. The first target indication information is used to indicate the processing of the task data, and the second target indication information is used to indicate the logical chain of thinking for interpreting the processing of the task data.

[0078] Optionally, when the first device trains a local small model, it can input task data from the task training set into the small model. During model training, the small model can be configured for multi-task learning. That is, it can set and determine the target indication information for each target when the small model performs multi-target joint training on the task data, namely, the first target indication information used to indicate the processing of the task data and the thought chain logic used to indicate the processing of the task data.

[0079] For example, when the task data is question-and-answer task data, the question and candidate answers of the question-and-answer task data can be input into a small model. The small model will perform multi-objective joint training on the question-and-answer task data, such as training two objectives simultaneously under one task. Before performing multi-objective joint training, it will generate first and second objective indication information. The first objective indication information can be used to indicate how to answer the question and candidate answers of the question-and-answer task data and determine the task processing result label (i.e., the correct answer). The second objective indication information can be used to indicate the logical chain of thought that leads to the correct answer of the question-and-answer task data.

[0080] In one feasible embodiment, in step S20, based on the task data, the first target indication information and the second target indication information for multi-target joint training of the small model are determined, including steps b10-b20.

[0081] Step b10: Obtain the preset task processing prefix, and concatenate the preset task processing prefix and task data to obtain the first target indication information;

[0082] Optionally, the preset task processing prefix can be a string used to characterize how the small model processes the task data. For example, the preset task processing prefix could be a string like "Please select the correct answer from the candidate answers".

[0083] Optionally, the preset task processing prefix and task data can be concatenated, for example, by string concatenation, to obtain the first target indication information. Optionally, the prefix part of the string corresponding to the task data can be determined, and the string corresponding to the preset task processing prefix can be added to that prefix part, thereby completing the concatenation process of the preset task processing prefix and task data.

[0084] For example, if the task data is the question-and-answer task data corresponding to a question-and-answer task, and the question-and-answer task data includes questions and candidate answers, then the question-and-answer task data can be input into a small model. During the training of the small model, a preset task processing prefix can be added to the prefix of the question-and-answer task data, such as the string "Please select the correct answer from the candidate answers," to obtain the first target indication information. This allows the small model to train its first target based on the first target indication information during training. For example, it can generate the correct answer from the candidate answers.

[0085] Step b20: Obtain the preset thought chain generation prefix, and concatenate the preset thought chain generation prefix and task data to obtain the second target indication information.

[0086] Optionally, the preset thought chain generation prefix can be used to characterize and explain the thought chain logic used to process task data. For example, the preset thought chain generation prefix can be a string like "Please answer this question and explain why".

[0087] Optionally, the preset thought chain generation prefix and task data can be concatenated, for example, by string concatenation, to obtain the first target indication information. Optionally, the prefix part of the string corresponding to the task data can be determined, and the string corresponding to the preset thought chain generation prefix can be added to that prefix part, thereby completing the concatenation process of the preset thought chain generation prefix and task data.

[0088] Optionally, if the task data is question-and-answer task data, which includes questions and candidate answers, then the question-and-answer task data can be input into the small model. When training the small model, a pre-defined thought chain can be added to the prefix part of the question-and-answer task data, such as the string "Please answer the question and explain why", to obtain the second target indication information. This allows the small model to train the second target based on the second target indication information during training.

[0089] In this embodiment, the first target indication information is obtained by concatenating the preset task processing prefix with the task data, thereby ensuring the validity of the obtained first target indication information. The second target indication information is obtained by concatenating the preset thought chain generation prefix with the task data, thereby ensuring the validity of the obtained second target indication information.

[0090] Step S30: Based on task data, task processing result labels, and first target indication information, train the first target of the small model, and iteratively train the second target of the small model based on task data, task processing thought chain, and second target indication information until the preset joint training termination condition is met, and obtain the trained small model, so as to perform task processing according to the trained small model.

[0091] Optionally, the first objective could be for the small model to process task data and generate task processing result labels, such as the small model generating the correct answer from among the candidate answers. The second objective could be for the small model to process task data and generate the thought process logic for task processing result labels, such as the small model generating a thought process chain corresponding to the task data.

[0092] Optionally, the preset joint training termination condition can be a pre-set condition required for the joint training of the small models to end. It can be set as needed, and this embodiment does not impose any restrictions on it. For example, in a specific implementation, it can be set to the convergence of the loss function of the small model, or the number of joint training rounds reaching a set number of rounds, or the duration of joint training reaching a set duration, etc.

[0093] Optionally, the small model in the first device can perform two objectives during model training. When training the small model for the first objective, it can train on task data based on the first objective indication information to obtain a first prediction result (i.e., the task processing result label predicted by the small model). Then, based on the task processing result label and the first prediction result, the model parameters of the small model are optimized to achieve the training of the small model for the first objective. The small model can also train on task data based on the second objective indication information to obtain a second prediction result (i.e., the thought chain predicted by the small model). Then, based on the task processing thought chain and the second prediction result, the model parameters of the small model are optimized to achieve the training of the small model for the second objective. Optionally, the small model can undergo multiple iterative training iterations until a preset joint training termination condition is met, resulting in a fully trained small model. Subsequently, in application processes, the fully trained small model can be directly used for task processing, allowing the small model to output both the task processing result label and the corresponding thought chain.

[0094] In addition, to help understand the principle of knowledge distillation of small models using large models in this embodiment, an example is given below.

[0095] If the task data is a decision-making task, such as an emotion classification task (e.g., determining whether a text is "positive" or "negative"), the emotion classification task in the task training set includes text data (X) and corresponding emotion labels (y). Optionally, the first device can construct a task processing thought chain generation request based on the task training set and send it to the second device. The large model in the second device, based on the task processing thought chain generation request, trains the model on the emotion classification task data corresponding to the emotion classification task in the task training set to generate the corresponding task processing thought chain.

[0096] Optionally, a task processing thought chain generation request can be generated by describing the task data for the emotion classification task using a prompt, for example: "Given a text, please determine its emotion and explain why. The text content is as follows: This movie is so good it makes me sleepy." Then, the large model in the second device is invoked, and the task processing thought chain generation request and the task training set are sent to the large model in the second device. The large model in the second device trains the model on each task data in the task training set to generate the corresponding task processing thought chain, which is then fed back to the first device. For example, the task processing thought chain could be: "Although this comment mentions 'good,' it's actually ironic, so I think it contains negative emotions."

[0097] Optionally, the first device can call the large model interface provided by the second device to process the task data in the task training set using the large model in the second device, outputting a corresponding task processing thought chain, and feeding it back to the first device. The task processing thought chain can be encrypted before being fed back to the first device, which then decrypts the encrypted thought chain to obtain the task processing thought chain corresponding to the task data in the task training set. Optionally, each task data in the task training set has a corresponding task processing thought chain. Furthermore, after obtaining the task processing thought chain, the first device can update the task processing thought chain in the task training set, ensuring a one-to-one correspondence between the task data, task processing result labels, and task processing thought chains in the task training set.

[0098] Optionally, the first device can train a small model locally and input task data from the task training set into the small model. Based on the task data, it will determine the first and second target indication information for the multi-target joint training of the small model. During multi-target joint training, the first target of the small model is trained based on the task data, task processing result labels, and the first target indication information, while the second target of the small model is trained based on the task data, task processing thought chain, and the second target indication information.

[0099] For example, when training the small model for the first objective, it can be processed in the following format: Please select the correct answer from the answers: Question: This movie is so good it makes me sleepy, what emotion does it express? Options: Positive, Negative --- Training Objective ---> Negative. When training the small model for the second objective, it can be processed in the following format: Please answer the question and explain why, Question: This movie is so good it makes me sleepy, what emotion does it express? Options: Positive, Negative --- Training Objective ---> Although this comment mentions "good," it is actually ironic, so I think it contains a negative emotion. Then, use the appropriate loss function for joint training until the model converges, obtaining the trained small model, completing the small model distillation process.

[0100] In addition, such as Figure 2 As shown, if organization B is the large model demander in the first device, and organization A is the large model owner in the second device. Optionally, in the thought chain generation stage, organization B can determine at least one task training set corresponding to a task. The task training set includes task data X and label y (i.e., task processing result label). It can also use the prompt project to construct a prompt request for the large model to analyze problem X and generate a thought chain, thereby generating a prompt text (i.e., a task processing thought chain generation request).

[0101] The prompt text is sent along with the task training set to Institution A. Institution A's large model (of considerable size) trains on the task data in the training set, including training in two directions: answering questions and generating thought chains. The output thought chains are then fed back to Institution B as task processing thought chains. Institution B updates the task training set based on the acquired thought chains, ensuring the updated set includes task data X, labels y, and thought chains c. During the distillation training phase, Institution B can determine the first and second objective indications for the multi-objective joint training of the smaller model based on the task data X, labels y, and thought chains c in the training set. The first objective indication can be generated by concatenating the prediction prefix and task data X with the task data X using a prediction prefix (i.e., a pre-defined task processing prefix). The second objective indication is generated by concatenating the thought chain prefix and task data X with the task data X using a thought chain prefix (i.e., a pre-defined thought chain generation prefix). The data is then input into a smaller model (with limited capabilities, suitable for single tasks) in organization B. Within this smaller model, the first objective y is trained based on task data, task processing result labels, and the first objective indication information. The second objective c is iteratively trained based on task data, the task processing thought process, and the second objective indication information. A joint loss (Loss) is then calculated. This joint loss value is used to update the model until it converges, completing the training and resulting in an enhanced smaller model.

[0102] Optionally, this embodiment avoids deploying large models locally. Traditional distillation methods require deploying both large and small models locally, placing high demands on computing resources. This embodiment, however, avoids the hardware limitations and high costs of locally deploying large models by remotely calling large models from other institutions, allowing more institutions to leverage the capabilities of large models to enhance their local small models. It also simplifies the distillation process by generating thought chains through task processing, such as the prompt project, making the distillation process more streamlined and automated. The thought chain is obtained from the large model, and distillation is completed by jointly training small models locally. It has a wide range of applications, suitable for a broad range of task types, including but not limited to emotion classification and question-and-answer analysis. Only adjustments to the task processing thought chain generation request are needed, allowing it to be applied to different task scenarios.

[0103] In this embodiment, by deploying a small model on the first device and a large model on the second device, the thought chain output by the large model in the second device performs knowledge distillation on the small model in the first device. This avoids the phenomenon in traditional distillation methods where both a large model and a small model need to be deployed locally at the same time in order to use the large model to perform knowledge distillation on the small model. It also avoids the hardware limitations and high costs of deploying a large model locally, enabling more institutions and enterprises to use the capabilities of the large model to enhance their local small models.

[0104] Furthermore, the first device sends a task processing thought chain generation request to the second device based on a task training set corresponding to at least one task, and receives the task processing thought chain returned by the second device. The task training set includes task data and task processing result labels, and the task processing thought chain is used to explain the thought chain logic of processing task data to generate task processing result labels. Therefore, the first device can construct a task processing thought chain generation request based on its own stored task training set, so that the task processing thought chain returned by the second device is more closely aligned with the tasks in the task training set. The second device also outputs the task processing thought chain based on the large model and the task training set. This allows the second device to utilize the model capabilities of the large model to output a task processing thought chain corresponding to the task training set.

[0105] Furthermore, the first device determines first and second target indication information for the multi-target joint training of the small model based on task data. The first target indication information is used to guide the processing of task data, while the second target indication information is used to explain the thought process logic for processing task data. This allows the first device to guide the small model in multi-target joint training, such as using the first and second target indication information. This enables the small model to retain its ability to process task data while also increasing its ability to generate thought process logic during subsequent multi-target joint training. Based on task data, task processing result labels, and the first target indication information, the first target of the small model is trained. Based on task data, the task processing thought process, and the second target indication information, the second target of the small model is iteratively trained until the preset joint training termination condition is met, resulting in a trained small model for task processing. In other words, when the small model is trained, it performs two objectives for a given task data: processing the task data and interpreting the thought process logic used to process it. This allows the trained small model to retain its task processing capabilities while generating the corresponding thought process logic, thus improving its performance. Furthermore, the small model is trained using the task processing thought process logic sent by the large model. Since the large and small models can reside on different devices, it's possible for a model holder with only the small model to remotely access the large model on a second device. Using the task processing thought process logic generated by the large model, the small model can be trained, enabling knowledge distillation of the small model. This allows the small model holder, possessing only the small model, to perform knowledge distillation based on the large model, giving the small model the ability to generate thought processes.

[0106] Based on the first embodiment of this application, in the second embodiment of this application, the same or similar content as the above embodiment can be referred to the above description, and will not be repeated hereafter. On this basis, in step S30, the step of training the first target of the small model based on task data, task processing result labels and first target indication information includes steps c10-c30.

[0107] Step c10: Determine the first prediction result output by the small model corresponding to the task data based on the first target indication information;

[0108] Optionally, the first prediction result can be the task processing result label predicted by the small model for the task data. For example, the correct answer predicted for question-and-answer task data.

[0109] Optionally, the first device can train the model according to the first target instruction information when training the model on the input task data. That is, it processes the task data to output a first prediction result. For example, if the task data is question-and-answer task data, such as the question "A migratory bird flew north over the highest peak on Earth, where is it now?", and the candidate answers to the question-and-answer task data include "A. China; B. United States; C. Japan; D. Centaurus", then the first prediction result can be the answer to the question, such as the answer A. China.

[0110] Step c20: Calculate the first prediction loss based on the first prediction result and the task processing result label;

[0111] Optionally, a first loss function, such as a cross-entropy loss function, can be determined corresponding to the first target indication information. The first prediction result and the task processing result label corresponding to the same task data are input into the first loss function for calculation to obtain the first prediction loss.

[0112] Step c30: Optimize the small model based on the first prediction loss to train the small model for the first objective.

[0113] Optionally, after determining the first prediction loss, the model parameters of the small model can be updated in reverse based on the first prediction loss to achieve the first objective of training the small model.

[0114] While training the small model for the first objective, it also iteratively trains the small model for the second objective based on task data, task processing thought processes, and second objective indications. Joint training of the small model for the first and second objectives is then performed until a preset joint training termination condition is met, resulting in a fully trained small model.

[0115] Optionally, the small model includes an adapter and a model ontology, and the model parameters of the adapter in the small model can be optimized based on the first prediction loss to train the small model for the first objective.

[0116] In this embodiment, the first prediction result corresponding to the task data output by the small model is determined based on the first target indication information. The first prediction loss is calculated based on the first prediction result and the task processing result label. The small model is then optimized based on the first prediction loss to train the first target of the small model, thereby enabling the trained small model to process the task data.

[0117] Furthermore, in a feasible embodiment, step S30, which iteratively trains the second target of the small model based on task data, task processing thought chain, and second target indication information, includes steps d10-d30.

[0118] Step d10: Determine the second prediction result corresponding to the task data output by the small model based on the second target indication information;

[0119] Optionally, the second prediction result can be an explanation of the thought process that generates the task processing result label by processing the task data. For example, the logical explanation of the thought process for predicting the correct answer to a question-and-answer task.

[0120] Optionally, the first device can train the model according to the second objective instruction information while training the model on the input task data, so as to output the predicted thought chain and use it as the second prediction result. For example, when the task data is question-and-answer task data, the question in the question-and-answer task data is "A migratory bird flew north over the highest peak on Earth, where is it now?", and the candidate answers to the question-and-answer task data include "A. China; B. United States; C. Japan; D. Centaurus". Then the second prediction result can be because the highest peak in the world is Mount Everest, which is located on the border between China and Nepal. China is in the north, so the migratory bird flew into China. Based on the above reasoning, the final answer is A, China.

[0121] Step d20: Based on the second prediction result and the task processing thought chain, calculate the second prediction loss;

[0122] Optionally, a second loss function corresponding to the second target indication information can be determined, such as a sequence-to-sequence model loss function. The second prediction result corresponding to the same task data and the task processing thought chain are input into the second loss function for calculation to obtain the second prediction loss.

[0123] Step d30: Optimize the small model based on the second prediction loss to train the second objective of the small model.

[0124] Optionally, after determining the second prediction loss, the model parameters of the small model can be updated in reverse based on the second prediction loss to achieve the second objective of training the small model.

[0125] While training the second objective of the small model, the first objective of the small model will also be iteratively trained based on task data, task processing result labels, and first objective indication information. Joint training of the first and second objectives of the small model will then be performed until a preset joint training termination condition is met, resulting in a fully trained small model.

[0126] Optionally, the small model includes an adapter and a model ontology, and the model parameters of the adapter in the small model can be optimized according to the second prediction loss to train the second objective of the small model.

[0127] In this embodiment, the second prediction result corresponding to the task data output by the small model is determined based on the second target indication information. The second prediction loss is calculated based on the second prediction result and the task processing thought chain. The small model is optimized based on the second prediction loss to train the second target of the small model. This enables the trained small model to have the ability to generate thought chains, thereby improving the model performance of the small model.

[0128] Furthermore, in a feasible embodiment, step S30, which involves training the first target of the small model based on task data, task processing result labels, and first target indication information, and iteratively training the second target of the small model based on task data, task processing thought chain, and second target indication information, also includes steps e10-e30.

[0129] Step e10: In each round of iterative training, the first prediction loss is determined based on the task data, the task processing result label, and the first target indication information.

[0130] Optionally, during each iteration of training the small model, the first prediction result output by the small model corresponding to the task data can be determined based on the first target indication information. The first prediction result corresponding to the same task data and the task processing result label are then input into the first loss function to calculate the first prediction loss. Specific implementation details can be found in the above embodiments.

[0131] Step e20: Based on task data, task processing thought chain, and second target indication information, determine the second predicted loss;

[0132] Optionally, during each iteration of training the small model, the second prediction result output by the small model corresponding to the task data can be determined based on the second target indication information. The second prediction result corresponding to the same task data and the task processing thought chain are then input into the second loss function to calculate the second prediction loss. Specific implementation details can be found in the above embodiments.

[0133] Step e30: The first prediction loss and the second prediction loss are weighted and summed to obtain the total prediction loss. The small model is then optimized based on the total prediction loss to jointly train the first objective and the second objective of the small model.

[0134] Optionally, after calculating the first prediction loss corresponding to the first target indication information and the second prediction loss corresponding to the second target indication information, the two can be weighted and summed to obtain the total prediction loss. Optionally, different weights can be set for the first prediction loss and the second prediction loss according to preset weight setting rules. Then, the total prediction loss is obtained by weighting and summing the first prediction loss, the weights corresponding to the second prediction loss, and the second prediction loss. The model parameters of the small model are then optimized based on the total prediction loss to achieve the first and second objectives of jointly training the small model.

[0135] Optionally, the weight setting rules can be user-defined or based on other rules, without any restrictions. For example, the weight corresponding to the first prediction loss is 0.5, and the weight corresponding to the second prediction loss is 0.5.

[0136] For example, if the small model is a language model, the loss function generated by the language model is L, which is the cross-entropy loss function, the language model is f, the task data is X, Xg = f(X), and Xg is the generated result text, such as the first prediction result (e.g., the predicted correct answer) and / or the second prediction result (e.g., the predicted thought chain). Then Ltotal = aL1(f(X), y) + bL2(f(X), c);

[0137] Where Ltotal is the total prediction loss. L1(f(X), y) is the first prediction loss. L2(f(X), c) is the second prediction loss. a is the weight corresponding to the first prediction loss. b is the weight corresponding to the second prediction loss. c is the task processing thought chain. y is the task processing result label. Optionally, the sum of a and b is 1, and can be set according to user needs, such as setting a to 0.5 and b to 0.5.

[0138] Optionally, the small model includes an adapter and a model ontology, and the model parameters of the adapter in the small model can be optimized based on the total prediction loss to jointly train the first and second objectives of the small model.

[0139] In this embodiment, a first prediction loss is determined based on task data, task processing result labels, and first target indication information. A second prediction loss is determined based on task data, task processing thought chain, and second target indication information. The first and second prediction losses are weighted and summed to obtain the total prediction loss. The small model is then optimized based on the total prediction loss to jointly train the small model's first and second targets. This allows the small model to process task data while also generating thought chains. Furthermore, since the task processing thought chain is output by the large model in the second device, the large model can use the task processing thought chain as a medium to perform knowledge distillation on the small model, enabling the small model to also generate thought chains.

[0140] Furthermore, embodiments of this application provide a task processing method, referring to... Figure 3 , Figure 3 This is a flowchart illustrating the third embodiment of the task processing method of this application. Optionally, the third embodiment of this application can be based on the first or second embodiment. Content that is the same as or similar to the above embodiments can be referred to the above description and will not be repeated hereafter.

[0141] In this embodiment, the task processing method is applied to a second device, which is connected to a first device. A small model to be trained is deployed in the first device, and a large model is deployed in the second device. The task processing method includes steps S100 to S200.

[0142] Step S100: Send a task processing thought chain generation request based on the task training set corresponding to at least one task;

[0143] It should be noted that the task training set includes task data and task processing result labels. The task processing thought chain is used to explain the thought chain logic of processing task data to generate task processing result labels.

[0144] Optionally, the specific details of the first and second devices can be found in the above embodiments and will not be elaborated here.

[0145] Optionally, the first device can first determine the task scenario in which the small model needs to be applied, and then determine a task training set corresponding to at least one task based on the task scenario. Based on the task training set, it sends a task processing thought chain generation request to the second device. Optionally, the task may include question-answering tasks, decision-making tasks, and other types of tasks, without limitation.

[0146] Optionally, the first device sends the task processing thought chain generation request and the task training set to the second device via wired or wireless transmission. Optionally, the second device can first determine whether the first device has permission to access the large model, and if so, receive the task training set and task processing thought chain generation request sent by the first device. Optionally, the second device can also directly receive the task training set and task processing thought chain generation request sent by the first device. It can also receive them indirectly through a third-party device.

[0147] Step S200: Generate a request based on the task processing thought chain, input the task data in the task training set into the large model, output the task processing thought chain, and send the task processing thought chain to the first device.

[0148] It should be noted that the first device determines the first target indication information and the second target indication information for multi-target joint training of the small model based on task data. Based on task data, task processing result labels, and the first target indication information, it trains the first target of the small model. Based on the task data, task processing thought chain, and the second target indication information, it iteratively trains the second target of the small model until the preset joint training termination condition is met, and obtains the trained small model. The task is then processed based on the trained small model. The first target indication information is used to indicate the processing of task data, and the second target indication information is used to indicate the thought chain logic for interpreting the processing of task data.

[0149] Optionally, after receiving the task training set and the task processing thought chain generation request, the second device can first determine each task data in the task training set, and then input each task data sequentially into the large model for thought chain inference training according to the task processing thought chain generation request. That is, the large model will perform logical analysis on the task data based on the task processing thought chain generation request to determine the thought chain logic of the prediction result corresponding to the task data. For example, when the task data is question-and-answer task data, the question and candidate answers are input into the large model, which will provide the predicted correct answer and analyze why it is the correct answer, then output the analysis process to obtain the task processing thought chain corresponding to that task data.

[0150] For example, in a question-and-answer task, the question might be, "A migratory bird flew north over the highest peak on Earth. Where is it now?" The candidate answers include "A. China; B. USA; C. Japan; D. Centaurus." A large model with strong reasoning capabilities, built using the thought chain template information from the prompt project, can then answer this question and provide reasoning data explaining why it answers this way. Therefore, after inputting the question, candidate answers, and thought chain template information into the large model, it would provide the following reasoning answer: "Because the highest peak in the world is Mount Everest, located on the border between China and Nepal, and China is in the north, this migratory bird flew into China. Based on this reasoning, the final answer is A, China." This reasoning is the task processing thought chain corresponding to this question-and-answer task data.

[0151] Optionally, after the large model in the second device generates a thought chain corresponding to each task data in the task training set using the task processing thought chain generation request sent by the first device, it will send the thought chain corresponding to each task data to the first device. After receiving the thought chain corresponding to each task data sent by the second device, the first device will associate and store the thought chain corresponding to each task data with its corresponding task data.

[0152] In this embodiment, by deploying a small model on the first device and a large model on the second device, the thought chain output by the large model in the second device performs knowledge distillation on the small model in the first device. This avoids the phenomenon in traditional distillation methods where both a large model and a small model need to be deployed locally at the same time in order to use the large model to perform knowledge distillation on the small model. It also avoids the hardware limitations and high costs of deploying a large model locally, enabling more institutions and enterprises to use the capabilities of the large model to enhance their local small models.

[0153] Furthermore, the first device sends a task processing thought chain generation request to the second device based on a task training set corresponding to at least one task, and receives the task processing thought chain returned by the second device. The task training set includes task data and task processing result labels, and the task processing thought chain is used to explain the thought chain logic of processing task data to generate task processing result labels. Therefore, the first device can construct a task processing thought chain generation request based on its own stored task training set, so that the task processing thought chain returned by the second device is more closely aligned with the tasks in the task training set. The second device also outputs the task processing thought chain based on the large model and the task training set. This allows the second device to utilize the model capabilities of the large model to output a task processing thought chain corresponding to the task training set.

[0154] Furthermore, the first device determines first and second target indication information for the multi-target joint training of the small model based on task data. The first target indication information is used to guide the processing of task data, while the second target indication information is used to explain the thought process logic for processing task data. This allows the first device to guide the small model in multi-target joint training, such as using the first and second target indication information. This enables the small model to retain its ability to process task data while also increasing its ability to generate thought process logic during subsequent multi-target joint training. Based on task data, task processing result labels, and the first target indication information, the first target of the small model is trained. Based on task data, the task processing thought process, and the second target indication information, the second target of the small model is iteratively trained until the preset joint training termination condition is met, resulting in a trained small model for task processing. In other words, when the small model is trained, it performs two objectives for a given task data: processing the task data and interpreting the thought process logic used to process it. This allows the trained small model to retain its task processing capabilities while generating the corresponding thought process logic, thus improving its performance. Furthermore, the small model is trained using the task processing thought process logic sent by the large model. Since the large and small models can reside on different devices, it's possible for a model holder with only the small model to remotely access the large model on a second device. Using the task processing thought process logic generated by the large model, the small model can be trained, enabling knowledge distillation of the small model. This allows the small model holder, possessing only the small model, to perform knowledge distillation based on the large model, giving the small model the ability to generate thought processes.

[0155] In addition, to achieve the above objectives, refer to Figure 4 This application also proposes a task processing system comprising a first device A100 and a second device A200 interconnected, wherein a small model to be trained is deployed in the first device A100 and a large model is deployed in the second device A200. The system includes:

[0156] The first device A100 is used to send a task processing thought chain generation request to the second device based on a task training set corresponding to at least one task, and to receive the task processing thought chain fed back by the second device. The task training set includes task data and task processing result labels, and the task processing thought chain is used to explain the thought chain logic of processing task data to generate task processing result labels.

[0157] The second device A200 is used to receive a task processing thought chain generation request sent by the first device based on a task training set corresponding to at least one task, input task data in the task training set into the large model based on the task processing thought chain generation request, output the task processing thought chain, and send the task processing thought chain to the first device.

[0158] The first device A100 is also used to determine the first target indication information and the second target indication information for multi-target joint training of the small model based on task data. The first target indication information is used to indicate the processing of task data, and the second target indication information is used to indicate the logical chain of thinking for interpreting the processing of task data.

[0159] The first device A100 is also used to train the first target of the small model based on task data, task processing result labels and first target indication information, and iteratively train the second target of the small model based on task data, task processing thought chain and second target indication information until the preset joint training termination condition is met, so as to obtain the trained small model and perform task processing based on the trained small model.

[0160] The task processing system provided in this application, employing the task processing method described in the above embodiments, can perform knowledge distillation on small models based on large models for holders of only small models. Compared with the prior art, the beneficial effects of the task processing system provided in this application are the same as those of the task processing method described in the above embodiments, and other technical features of the task processing system are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0161] This application provides a task processing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the task processing method in Embodiment 1 above.

[0162] The following is for reference. Figure 5 The diagram illustrates a structural schematic of a task processing device suitable for implementing embodiments of this application. The task processing device in the embodiments of this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The task processing device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0163] like Figure 5 As shown, the task processing device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the task processing device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows the task processing device to communicate wirelessly or wiredly with other devices to exchange data. Although the figure shows task processing devices with various systems, it should be understood that it is not required to implement or possess all of the systems shown. More or fewer systems may be implemented alternatively.

[0164] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0165] The task processing device provided in this application, employing the task processing method described in the above embodiments, can perform knowledge distillation on small models based on large models for holders of only small models. Compared with the prior art, the beneficial effects of the task processing device provided in this application are the same as those of the task processing method described in the above embodiments, and other technical features of this task processing device are the same as those disclosed in the previous embodiment method, and will not be repeated here.

[0166] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0167] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0168] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the task processing method described in the above embodiments.

[0169] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0170] The aforementioned computer-readable storage medium may be included in the task processing device or may exist independently and not assembled into the task processing device.

[0171] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by a task processing device, enable the task processing device to perform the steps of the aforementioned task processing method.

[0172] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0173] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0174] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0175] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for performing the above-described task processing method, thereby improving the universality of federated forgetting learning. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the task processing method provided in the above embodiments, and will not be repeated here.

[0176] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the task processing method described above.

[0177] The computer program product provided in this application can perform knowledge distillation on small models based on large models for holders of only small models. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the task processing method provided in the above embodiments, and will not be repeated here.

[0178] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A task processing method, characterized in that, The method, applied to a first device connected to a second device, wherein a small model to be trained is deployed in the first device and a large model is deployed in the second device, includes: Based on the task training set corresponding to at least one task, a task processing thought chain generation request is sent to the second device, and the task processing thought chain is received from the second device. The task training set includes task data and task processing result labels. The task processing thought chain is used to explain the thought chain logic of processing the task data to generate task processing result labels. The second device outputs the task processing thought chain based on the large model and the task training set. Based on the task data, a first target indication information and a second target indication information are determined for the multi-target joint training of the small model. The first target indication information is used to indicate the processing of the task data, and the second target indication information is used to indicate the logical chain of thought for processing the task data. Based on the task data, the task processing result label, and the first target indication information, the first target of the small model is trained, and the second target of the small model is iteratively trained based on the task data, the task processing thought chain, and the second target indication information until the preset joint training termination condition is met, and the trained small model is obtained, so as to perform task processing according to the trained small model.

2. The method according to claim 1, characterized in that, The step of determining the first target indication information and the second target indication information for the multi-target joint training of the small model based on the task data includes: Obtain a preset task processing prefix, and concatenate the preset task processing prefix and the task data to obtain the first target indication information; Obtain a preset thought chain generation prefix, and concatenate the preset thought chain generation prefix and the task data to obtain the second target indication information.

3. The method according to claim 1, characterized in that, The first objective of training the small model based on the task data, the task processing result label, and the first target indication information includes: Based on the first target indication information, determine the first prediction result output by the small model corresponding to the task data; Based on the first prediction result and the task processing result label, the first prediction loss is calculated; The small model is optimized based on the first prediction loss to train the small model for the first objective.

4. The task processing method as described in claim 1, characterized in that, The second objective of iteratively training the small model based on the task data, the task processing thought chain, and the second objective indication information includes: Based on the second target indication information, determine the second prediction result output by the small model corresponding to the task data; Based on the second prediction result and the task processing thought chain, the second prediction loss is calculated; The small model is optimized based on the second prediction loss to train the small model for the second objective.

5. The task processing method as described in claim 1, characterized in that, The step of training the small model's first objective based on the task data, the task processing result label, and the first target indication information, and iteratively training the small model's second objective based on the task data, the task processing thought chain, and the second target indication information, further includes: In each round of iterative training, a first prediction loss is determined based on the task data, the task processing result label, and the first target indication information; Based on the task data, the task processing thought chain, and the second target indication information, a second predicted loss is determined. The first prediction loss and the second prediction loss are weighted and summed to obtain the total prediction loss. The small model is then optimized based on the total prediction loss to jointly train the first objective and the second objective of the small model.

6. The method as described in claim 1, characterized in that, The task processing thought chain generation request includes a judgment task processing thought chain generation request and a question-and-answer task processing thought chain generation request. Sending a task processing thought chain generation request to the second device based on the task training set corresponding to at least one task includes: When the task is a judgment task, a judgment task processing thought chain generation request is generated based on the task training set corresponding to the judgment task, and the judgment task processing thought chain generation request is sent to the second device; and / or, When the task is a question-and-answer task, a question-and-answer task processing thought chain generation request is generated based on the task training set corresponding to the question-and-answer task, and the question-and-answer task processing thought chain generation request is sent to the second device.

7. A task processing method, characterized in that, The method, applied to a second device connected to a first device, wherein a small model to be trained is deployed in the first device and a large model is deployed in the second device, includes: The system receives a task processing thought chain generation request sent by the first device based on a task training set corresponding to at least one task, wherein the task training set includes task data and task processing result labels, and the task processing thought chain is used to explain the thought chain logic of processing the task data to generate task processing result labels. Based on the task processing thought chain generation request, the task data in the task training set is input into the large model, the task processing thought chain is output, and the task processing thought chain is sent to the first device. The first device, based on the task data, determines first target indication information and second target indication information for the multi-target joint training of the small model. Based on the task data, the task processing result label, and the first target indication information, it trains the first target of the small model. It then iteratively trains the second target of the small model based on the task data, the task processing thought chain, and the second target indication information until a preset joint training termination condition is met, thus obtaining a trained small model. The trained small model is then used for task processing. The first target indication information is used to indicate the processing of the task data, and the second target indication information is used to indicate the explanation of the thought chain logic for processing the task data.

8. A task processing system, characterized in that, It includes a first device and a second device that are interconnected. The first device deploys a small model to be trained, and the second device deploys a large model. The first device is configured to send a task processing thought chain generation request to the second device based on a task training set corresponding to at least one task, and receive the task processing thought chain fed back by the second device, wherein the task training set includes task data and task processing result labels, and the task processing thought chain is used to explain the thought chain logic of processing the task data to generate task processing result labels. The second device is configured to receive a task processing thought chain generation request sent by the first device based on a task training set corresponding to at least one task, input task data from the task training set into the large model based on the task processing thought chain generation request, output a task processing thought chain, and send the task processing thought chain to the first device. The first device is further configured to determine, based on the task data, a first target indication information and a second target indication information for the multi-target joint training of the small model, wherein the first target indication information is used to indicate the processing of the task data, and the second target indication information is used to indicate the interpretation of the thought chain logic for processing the task data. The first device is further configured to train the first target of the small model based on the task data, the task processing result label and the first target indication information, and iteratively train the second target of the small model based on the task data, the task processing thought chain and the second target indication information until a preset joint training termination condition is met, thereby obtaining a trained small model for task processing based on the trained small model.

9. A task processing device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the task processing method as described in any one of claims 1 to 7.

10. A medium, characterized in that, The medium is a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the task processing method as described in any one of claims 1 to 7.

11. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the task processing method as described in any one of claims 1 to 7.