Task processing method and device for continual learning based on prompt tuning

By transferring the weights of the pre-trained model and sampling feature statistics to generate unindicated and indicated features, and freezing the weights of the backbone network, the limitations of continuous learning through fine-tuning of prompt words in existing technologies are overcome, thereby improving the adaptability and performance of the network model and reducing the cost of GPU memory and labeled data.

CN117312909BActive Publication Date: 2025-11-25TSINGHUA UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311180684.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-13
Publication Date
2025-11-25
Estimated Expiration
2043-09-13

AI Technical Summary

Technical Problem

Existing continuous learning task processing methods based on cue word fine-tuning have limitations, resulting in poor adaptability and performance. In particular, they require a large amount of labeled data and the effect of cue word fine-tuning is limited, failing to fully activate the potential of the network model.

Method used

By transferring the weight parameters of the pre-trained model, a prompt word query and fine-tuning network model is constructed. Iterative training is performed using the task to be processed and historical datasets to generate feature statistics. Unindicated and indicated features are sampled and generated. The backbone network weights are frozen and only the classifier and prompt word pool are updated to reduce the GPU memory requirement.

Benefits of technology

It improves the task processing adaptability and performance of the network model, reduces the demand for GPU memory, lowers the cost of labeled data, and enhances the effect of fine-tuning prompt words.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117312909B_ABST
    Figure CN117312909B_ABST
Patent Text Reader

Abstract

The application provides a task processing method and device based on prompt word fine-tuning continuous learning. The method comprises: obtaining input data of a task to be processed; sending the input data to a first backbone network in a preset prompt word query network model to extract a feature vector, and obtaining a task label output by a task classifier network in the prompt word query network model; determining a prompt word corresponding to the input data from a preset prompt word pool based on the task label; inputting the prompt word and the input data into a second backbone network in a preset prompt word fine-tuning network model to extract a feature vector, and obtaining a prediction result output by a category classifier in the prompt word fine-tuning network model. The method provided by the application can perform task processing by using a network model obtained by fine-tuning a prompt word using only a small amount of parameters, thereby reducing the required video memory and improving the adaptability and performance of the network model in task processing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a task processing method and device for continuous learning based on prompt word fine-tuning. In addition, an electronic device and a processor readable storage medium are also disclosed. BACKGROUND

[0002] Artificial intelligence (AI) is a branch of computer science that aims to develop systems and technologies that can mimic human intelligence. AI uses big data, machine learning, deep learning, and other related technologies to enable computers to perceive, understand, learn, and make decisions in ways similar to human thought, learning, reasoning, and problem solving. The goal is to achieve intelligent computer systems that can handle and solve complex tasks such as speech recognition, image recognition, natural language processing, autonomous driving, intelligent recommendation, and medical diagnosis. In addition, artificial intelligence is also widely studied and applied in expert systems, robotics, virtual assistants, and intelligent games.

[0003] In machine learning, continuous learning refers to the ability of a network model to continuously learn new tasks or data without forgetting previously learned knowledge. Unlike traditional machine learning methods, which typically train on a fixed dataset and cannot add new data or tasks once the network model is trained, continuous learning allows the addition of new data or tasks to a network model that has already been trained, enabling the network model to continuously learn and adapt to new environments. However, during continuous learning, there is a challenge in balancing plasticity and catastrophic forgetting.

[0004] With the development of the field of continuous learning, pre-training technology has become one of the most important technologies. Pre-training technology not only enables positive knowledge transfer, but also enhances resistance to catastrophic forgetting. Currently, an innovative method has emerged in the existing technology, which uses a supervised pre-training model for prompt word fine-tuning. This method freezes the core weights of the pre-training model and uses a few prompt word parameters to guide representation learning. However, the current task processing method for continuous learning based on prompt word fine-tuning of pre-training models has high limitations, such as the need for large amounts of labeled data for supervised pre-training models, which results in high human cost, high cost of labeled data, and low efficiency. In addition, the effect of prompt word fine-tuning is also limited. The existing continuous learning methods can only achieve suboptimal results when fine-tuning prompt words based on self-supervised pre-training, and cannot fully activate their full potential, thereby limiting the adaptability and performance improvement of network models on new tasks. Therefore, how to more effectively fine-tune the task processing scheme for continuous learning based on prompt words has become a problem that needs to be solved. SUMMARY

[0005] To this end, the present application provides a task processing method and device for prompt fine-tuning based lifelong learning, to solve the high limitation of the task processing scheme for prompt fine-tuning based lifelong learning in the prior art, thereby causing the defects of poor adaptability and performance.

[0006] In a first aspect, the present application provides a task processing method for prompt fine-tuning based lifelong learning, comprising:

[0007] obtaining input data of a task to be processed;

[0008] sending the input data to a first backbone network in a preset prompt query network model to extract a feature vector, and obtaining a task label output by a task classifier network in the prompt query network model; determining a prompt corresponding to the input data from a preset prompt pool based on the task label; wherein the weight parameters of the first backbone network are obtained by pre-training and migration based on a third backbone network of a corresponding pre-training model, and the task classifier network is obtained by iterative training of a current data set of the task to be processed and a historical data set of a previously processed task;

[0009] inputting the prompt and the input data into a second backbone network in a preset prompt fine-tuning network model to extract a feature vector, and obtaining a prediction result output by a category classifier in the prompt fine-tuning network model; wherein the weight parameters of the second backbone network are obtained by pre-training and migration based on a fourth backbone network of a corresponding pre-training model, and the category classifier network is obtained by iterative training of a current data set of the task to be processed and its prompt and a historical data set of a previously processed task and its prompt.

[0010] Further, before obtaining the input data of the task to be processed, further comprising:

[0011] determining a pre-training model; wherein the pre-training model comprises a third backbone network pre-trained and its weight parameters of the third backbone network obtained through the pre-training process, a fourth backbone network pre-trained and its weight parameters of the fourth backbone network obtained through the pre-training process;

[0012] pre-constructing an initial prompt query network model and an initial prompt fine-tuning network model; wherein the initial prompt query network model comprises a first backbone network and a task classifier network; the initial prompt fine-tuning network model comprises a second backbone network, a category classifier network and a prompt pool;

[0013] migrate the weight parameters of the third backbone network to a first backbone network in the initial prompt query network model, and iteratively train a task classifier network in the initial prompt query network model based on a current data set of the to-be-processed task and a historical data set of a previously processed task, to obtain the prompt query network model; and migrate the weight parameters of the fourth backbone network to a second backbone network in the initial prompt fine-tuning network model; and iteratively train a class classifier in the initial prompt fine-tuning network model based on a current data set of the to-be-processed task and a prompt thereof and a historical data set of a previously processed task and a prompt thereof, to obtain the prompt fine-tuning network model.

[0014] Further, the current data set of the to-be-processed task is a second data set, and the historical data set of the previously processed task is a first data set.

[0015] The iteratively training the task classifier network in the initial prompt query network model based on the current data set of the to-be-processed task and the historical data set of the previously processed task to obtain the prompt query network model specifically includes:

[0016] training the initial prompt query network model based on the first data set to obtain a first completed prompt query network model; extracting first unindicated features of the first data set based on the first prompt query network model, and storing first feature statistical information of the first unindicated features of each class; wherein the first feature statistical information includes statistical information of mean and variance of the first unindicated features;

[0017] training the first prompt query network model based on the second data set to obtain a second completed prompt query network model; extracting second unindicated features of the second data set based on the second prompt query network model, and storing third feature statistical information of the second unindicated features of each class; wherein the third feature statistical information includes statistical information of mean and variance of the second unindicated features;

[0018] generating historical unindicated features corresponding to the first unindicated features based on the third feature statistical information; and training the task classifier in the second prompt query network model based on the historical unindicated features, to obtain the prompt query network model.

[0019] Further, the class classifier in the initial prompt fine-tuning network model is iteratively trained based on the current data set of the to-be-processed task and the prompt words thereof and the historical data set of the previously processed task and the prompt words thereof, to obtain the prompt fine-tuning network model, and specifically includes:

[0020] A first prompt word corresponding to the first data set in the prompt word pool is selected.

[0021] The prompt fine-tuning network model is trained based on the first data set and the first prompt word, to obtain a first prompt fine-tuning network model after training; first indication features of the first data set are extracted based on the first prompt fine-tuning network model, and second feature statistical information of the first indication features of each class is stored; wherein the second feature statistical information includes statistical information of the mean and variance of the first indication features.

[0022] A second prompt word corresponding to the second data set in the prompt word pool is selected.

[0023] The first prompt fine-tuning network model is trained based on the second data set and the second prompt word, to obtain a second prompt fine-tuning network model after training; second indication features of the second data set are extracted based on the second prompt fine-tuning network model, and fourth feature statistical information of the second indication features of each class is stored; wherein the fourth feature statistical information includes statistical information of the mean and variance of the second indication features; historical indication features corresponding to the first indication features are generated based on the fourth feature statistical information; and the class classifier in the second prompt fine-tuning network model is trained based on the historical indication features, to obtain the prompt fine-tuning network model.

[0024] Further, the feature vector is extracted from the first backbone network in the preset prompt query network model based on the input data, and a task label output by a task classifier network in the prompt query network model is obtained, and specifically includes:

[0025] The feature vector is extracted from the first backbone network in the preset prompt query network model based on the input data, to obtain a feature vector of the input data.

[0026] The feature vector of the input data is input to the task classifier network for task discrimination, and a task label output by the task classifier network is obtained.

[0027] Further, the prompt word and the input data are input into a second backbone network in a preset prompt word fine-tuning network model to extract a feature vector, and a prediction result output by a category classifier in the prompt word fine-tuning network model is obtained, and specifically comprising:

[0028] The prompt word and the input data are input into a second backbone network in a preset prompt word fine-tuning network model to extract a feature vector, and the feature vector of the prompt word is spliced with the feature vector of the input data to obtain a feature vector of the spliced data;

[0029] The feature vector of the spliced data is input into the category classifier for classification judgment to obtain a prediction result output by the category classifier in the prompt word fine-tuning network model.

[0030] In a second aspect, the present application further provides a task processing device based on continuous learning of prompt word fine-tuning, comprising:

[0031] An input data acquisition unit is configured to acquire input data of a task to be processed;

[0032] A task discrimination unit is configured to send the input data to a first backbone network in a preset prompt word query network model to extract a feature vector, and obtain a task label output by a task classifier network in the prompt word query network model; determine a prompt word corresponding to the input data from a preset prompt word pool based on the task label; wherein the weight parameters of the first backbone network are obtained by pre-training and migration based on a third backbone network of a corresponding pre-training model, and the task classifier network is obtained by iterative training of a current data set of the task to be processed and a historical data set of a previously processed task;

[0033] An input data classification unit is configured to input the prompt word and the input data into a second backbone network in a preset prompt word fine-tuning network model to extract a feature vector, and obtain a prediction result output by a category classifier in the prompt word fine-tuning network model; wherein the weight parameters of the second backbone network are obtained by pre-training and migration based on a fourth backbone network of a corresponding pre-training model, and the category classifier network is obtained by iterative training of a current data set of the task to be processed and its prompt word and a historical data set of a previously processed task and its prompt word.

[0034] Further, before acquiring the input data of the task to be processed, further comprising:

[0035] The pre-training model determination unit is configured to determine a pre-training model, wherein the pre-training model comprises a third backbone network and weight parameters of the third backbone network obtained through a pre-training process, a fourth backbone network and weight parameters of the fourth backbone network obtained through a pre-training process.

[0036] The network model construction unit is configured to pre-construct an initial prompt query network model and an initial prompt fine-tuning network model, wherein the initial prompt query network model comprises a first backbone network and a task classifier network, and the initial prompt fine-tuning network model comprises a second backbone network, a category classifier network and a prompt pool.

[0037] The network model continuous learning training unit is configured to migrate the weight parameters of the third backbone network to the first backbone network in the initial prompt query network model, and iteratively train the task classifier network in the initial prompt query network model based on a current data set of the to-be-processed task and a historical data set of a previously processed task, to obtain the prompt query network model; and migrate the weight parameters of the fourth backbone network to the second backbone network in the initial prompt fine-tuning network model, and iteratively train the category classifier in the initial prompt fine-tuning network model based on the current data set of the to-be-processed task and its prompt and the historical data set of the previously processed task and its prompt, to obtain the prompt fine-tuning network model.

[0038] Further, the current data set of the to-be-processed task is a second data set, and the historical data set of the previously processed task is a first data set.

[0039] The initial prompt query network model is trained based on the first data set to obtain a first trained prompt query network model, and first unindicated features of the first data set are extracted based on the first prompt query network model, and first feature statistical information of the first unindicated features of each category is stored.

[0040] The initial prompt query network model is trained based on the first data set to obtain a first trained prompt query network model, and first unindicated features of the first data set are extracted based on the first prompt query network model, and first feature statistical information of the first unindicated features of each category is stored.

[0041] training the first prompt query network model based on the second data set to obtain a second trained prompt query network model; extracting second unindicated features of the second data set based on the second prompt query network model, and storing third feature statistical information of the second unindicated features of each class; wherein the third feature statistical information includes statistical information of the mean and variance of the second unindicated features;

[0042] generating historical unindicated features corresponding to the first unindicated features based on the third feature statistical information; and training a task classifier in the second prompt query network model based on the historical unindicated features to obtain the prompt query network model.

[0043] Further, the task discrimination unit is specifically configured to:

[0044] selecting a first prompt corresponding to the first data set in the prompt pool;

[0045] training the prompt fine-tuning network model based on the first data set and the first prompt to obtain a first trained prompt fine-tuning network model; extracting first indicated features of the first data set based on the first prompt fine-tuning network model, and storing second feature statistical information of the first indicated features of each class; wherein the second feature statistical information includes statistical information of the mean and variance of the first indicated features;

[0046] selecting a second prompt corresponding to the second data set in the prompt pool;

[0047] training the first prompt fine-tuning network model based on the second data set and the second prompt to obtain a second trained prompt fine-tuning network model; extracting second indicated features of the second data set based on the second prompt fine-tuning network model, and storing fourth feature statistical information of the second indicated features of each class; wherein the fourth feature statistical information includes statistical information of the mean and variance of the second indicated features; generating historical indicated features corresponding to the first indicated features based on the fourth feature statistical information; and training a class classifier in the second prompt fine-tuning network model based on the historical indicated features to obtain the prompt fine-tuning network model.

[0048] Further, the task discrimination unit is specifically configured to:

[0049] The input data is sent to a first backbone network in a preset prompt word query network model to extract a feature vector, and a feature vector of the input data is obtained;

[0050] The feature vector of the input data is input to the task classifier network for task discrimination, and a task label output by the task classifier network is obtained.

[0051] Further, the input data classification unit is specifically configured to:

[0052] The prompt word and the input data are input to a second backbone network in a preset prompt word fine-tuning network model to extract a feature vector, so as to splice the feature vector of the prompt word and the feature vector of the input data, and obtain a feature vector of the spliced data;

[0053] The feature vector of the spliced data is input to the category classifier for classification judgment, and a prediction result output by the category classifier in the prompt word fine-tuning network model is obtained.

[0054] In a third aspect, the present application further provides an electronic device, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the task processing method for continuous learning based on prompt word fine-tuning according to any one of the above.

[0055] In a fourth aspect, the present application further provides a processor-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the task processing method for continuous learning based on prompt word fine-tuning according to any one of the above.

[0056] The application provides a task processing method based on prompt word fine-tuning of continuous learning, which comprises the following steps: obtaining input data of a task to be processed, sending the input data to a first backbone network in a preset prompt word query network model to extract a feature vector, and obtaining a task label output by a task classifier network in the prompt word query network model, and determining a prompt word corresponding to the input data from a preset prompt word pool based on the task label. The weight parameters of the first backbone network are obtained by pre-training and migration based on a third backbone network of a corresponding pre-training model, and the task classifier network is obtained by iterative training based on a current data set of the task to be processed and a historical data set of a previously processed task. Then, the prompt word and the input data are input to a second backbone network in a preset prompt word fine-tuning network model to extract a feature vector, and a prediction result output by a category classifier in the prompt word fine-tuning network model is obtained. The weight parameters of the second backbone network are obtained by pre-training and migration based on a fourth backbone network of a corresponding pre-training model, and the category classifier network is obtained by iterative training based on a current data set of the task to be processed and its prompt word and a historical data set of a previously processed task and its prompt word. The network model obtained by using only a small amount of parameters for prompt word fine-tuning can be used for task processing, the required video memory is reduced, and the adaptability and performance of the network model for task processing are improved. BRIEF DESCRIPTION OF DRAWINGS

[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can also obtain other drawings according to these drawings without any creative effort.

[0058] Figure 1 is a flowchart of the task processing method based on prompt word fine-tuning of continuous learning provided by the embodiments of the present application;

[0059] Figure 2 is a schematic diagram of the backbone network weight parameter migration provided by the embodiments of the present application;

[0060] Figure 3 is a schematic diagram of the inference and prediction process in the task processing method based on prompt word fine-tuning of continuous learning provided by the embodiments of the present application;

[0061] Figure 4 is a schematic diagram of the result prediction process between network models provided by the embodiments of the present application;

[0062] Figure 5is a structural schematic diagram of a task processing device based on prompt word fine-tuning of continuous learning provided by an embodiment of the present application.

[0063] Figure 6 is a physical structure schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0064] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0065] It should be noted that the terms "first", "second" and the like in the specification of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0066] The embodiments of the task processing method based on prompt word fine-tuning of continuous learning will be described in detail below. As shown in Figure 1 The flowchart of the task processing method based on prompt word fine-tuning of continuous learning provided by an embodiment of the present application is shown in the figure, and the specific implementation process includes the following steps:

[0067] Step 101: obtaining input data of a task to be processed.

[0068] Specifically, the task to be processed can include but is not limited to a picture classification task, a speech recognition task, an image recognition task, a natural language processing task, etc. The input data includes but is not limited to picture, speech, etc. data, which is not limited here.

[0069] It should be noted that in the embodiment of the present application, before this step is performed, the method of continuous learning based on prompt word fine-tuning needs to be performed in advance to complete the construction and training process of the network model. Specifically, first, the world knowledge is used for pre-training to determine the pre-training model. The pre-training model includes a third backbone network whose pre-training is completed and the weight parameters of the third backbone network obtained through the pre-training process, a fourth backbone network whose pre-training is completed and the weight parameters of the fourth backbone network obtained through the pre-training process; the pre-training model can include at least two, such as two different pre-training models corresponding to the initial prompt word query network model and the initial prompt word fine-tuning network model respectively. Of course, the initial prompt word query network model and the initial prompt word fine-tuning network model can also correspond to the same pre-training model, that is, the weight parameters of the first backbone network and the weight parameters of the second backbone network are all the weight parameters of the third backbone network or the weight parameters of the fourth backbone network. The pre-training model can be selected from a convolutional network or a transformer / converter, etc. The third backbone network and the fourth backbone network are the backbone network of the convolutional network or the transformer / converter.

[0070] In the embodiment of the present application, the world knowledge can be used for pre-training. The world knowledge is usually a large amount of additional data, such as in picture classification, the ImageNet dataset is usually used as additional data for pre-training. The ImageNet dataset is a computer vision dataset, which contains a large number of pictures and indexes. The ImageNet dataset is a benchmark for evaluating the performance of image classification algorithms, and is a large image dataset established to promote the development of computer image recognition technology. By pre-training with a large amount of world knowledge, a pre-training model and its corresponding weight parameters can be obtained. The pre-training model includes a backbone part (i.e. a backbone network) and an additional part that may be introduced due to different pre-training methods, such as a class classifier part in addition to the backbone part in the case of supervised pre-training.

[0071] Then, the initial prompt word query network model and the initial prompt word fine-tuning network model are constructed in advance. The initial prompt word query network model includes a first backbone network and a task classifier network; the initial prompt word fine-tuning network model includes a second backbone network, a class classifier network and a prompt word pool.

[0072] In the embodiments of the present application, two neural network models can be created, one for query prompt words, referred to as a prompt word query network (i.e., a prompt word query network model), including a backbone part (i.e., a first backbone network) and a task classifier (i.e., a task classifier network); the other for adding prompt word fine-tuning tasks in the backbone part, referred to as a prompt word fine-tuning network (i.e., a prompt word fine-tuning network model), including a backbone part (i.e., a second backbone network), a prompt word pool, and a class classifier (i.e., a class classifier network). Each backbone part is usually referred to as a feature extractor. In the process of specifically constructing a neural network model, for a convolutional network model, it is a plurality of convolutional layers, and for a transformer, it is a plurality of self-attention layers and fully connected layers. Each prompt word in the prompt word pool is usually a feature parameter, which is used to splice into the intermediate features output by each layer of the backbone part. The task classifier and the class classifier are usually fully connected networks. As shown in Figure 2 During the subsequent task learning process, the backbone part is frozen and not updated, and only the classifiers (including the task classifier and the class classifier) and the prompt word pool part are updated.

[0073] Finally, the weight parameters of the third backbone network are migrated to the first backbone network in the initial prompt word query network model, and the task classifier network in the initial prompt word query network model is iteratively trained based on the current data set of the to-be-processed task and the historical data set of the previously processed task, to obtain the prompt word query network model; and the weight parameters of the fourth backbone network are migrated to the second backbone network in the initial prompt word fine-tuning network model; and the class classifier in the initial prompt word fine-tuning network model is iteratively trained based on the current data set of the to-be-processed task and its prompt words and the historical data set of the previously processed task and its prompt words, to obtain the prompt word fine-tuning network model.

[0074] It should be noted that the historical data set is the statistical information of the representation of the historical processing task or the previously learned task. The present application does not save the data set (such as pictures) of the historical processing task, but the statistical information of the representation (including the indicated feature and the unindicated feature) of the historical processing task, such as regarding the representation (including the indicated feature and the unindicated feature) of each class as a Gaussian distribution, saving the mean and variance of the Gaussian distribution, and sampling the representation obeying the Gaussian distribution from it when used, to replace the historical data set that is no longer available to train the task classifier network and the class classifier network.

[0075] In the embodiments of the present application, as shown in Figure 2As shown, the weight parameters of the backbone part of the pre-trained model can be imported into the constructed initial prompt query network model and the initial prompt fine-tuning network model. That is, the weight parameters of the backbone part (i.e., the backbone neural network or the backbone network) in the pre-trained model are copied to the backbone weight of the initial prompt query network and the backbone weight of the initial prompt fine-tuning network. It should be noted that the weight parameters described in the present application are the weights of the backbone neural network after pre-training. For example, the backbone network of the transformer architecture includes a plurality of self-attention layers, and the weight parameters are the parameters of these self-attention layers. Compared with randomly initialized weights, the weights after pre-training enable the backbone network to extract meaningful features, and only fine-tuning these weights is needed to make the extracted features well adapt to downstream tasks, thereby improving the performance of downstream tasks.

[0076] The current data set of the to-be-processed task can be a second data set, the historical data set of the previously processed task can be a first data set, and of course other new data sets can also be included, which will not be described in detail here. The first data set can be a data set of a first task, and the second data set can be a data set of a second task.

[0077] The initial prompt query network model is iteratively trained based on the current data set of the to-be-processed task and the historical data set of the previously processed task to obtain the prompt query network model, specifically including: training the initial prompt query network model based on the first data set to obtain a first prompt query network model after training; extracting first unindicated features of the first data set based on the first prompt query network model, and storing first feature statistical information of the first unindicated features of each class. The first feature statistical information includes statistical information of the mean and variance of the first unindicated features. Training the first prompt query network model based on the second data set to obtain a second prompt query network model after training; extracting second unindicated features of the second data set based on the second prompt query network model, and storing third feature statistical information of the second unindicated features of each class. The third feature statistical information includes statistical information of the mean and variance of the second unindicated features. Since the mean and variance record the feature information in the Gaussian distribution data, based on the third feature statistical information for sampling and restoring, historical unindicated features corresponding to the first unindicated features can be generated; training the task classifier in the second prompt query network model based on the historical unindicated features to obtain the prompt query network model.

[0078] Specifically, as Figure 3As shown, the initial prompt query network model is trained using the first data set. After the training is completed, the first data set is extracted using the trained first prompt query network model, and the extracted features are referred to as first unindicated features. The mean and variance of the first unindicated features of each class are saved. The first prompt query network model is trained using the second data set. After the training is completed, the second data set is extracted using the second prompt query network model, and the extracted features are referred to as second unindicated features. The mean and variance of the second unindicated features of each class are saved. The saved mean and variance of the unindicated features of each class of the previous data set (i.e., the historical data set of the previous task) and the current data set (i.e., the current data set of the task to be processed) are loaded. Assuming that the unindicated features of each class of the data set (the first data set and the second data set) are Gaussian distribution, the approximate unindicated features are obtained by sampling based on the statistical information such as the mean and the variance. The task classifier network of the second prompt query network model is further trained using the sampled approximate unindicated features (i.e., the restored historical unindicated features), thereby preventing the catastrophic forgetting of the previous data set caused by the training of only the current data set. The approximate unindicated features can be the approximate unindicated features of the previous data set and the current data set obtained by sampling restoration based on the mean and the variance.

[0079] The category classifier in the initial prompt fine-tuning network model is iteratively trained based on the current data set of the to-be-processed task and its prompt word and the historical data set of the previously processed task and its prompt word, and the prompt fine-tuning network model is obtained, and the corresponding specific implementation process comprises: selecting a first prompt word corresponding to the first data set in the prompt word pool; training the prompt fine-tuning network model based on the first data set and the first prompt word to obtain a first prompt fine-tuning network model after training; extracting first indication features of the first data set based on the first prompt fine-tuning network model, and storing second feature statistical information of the first indication features of each class; wherein the second feature statistical information comprises statistical information of the mean and variance of the first indication features; selecting a second prompt word corresponding to the second data set in the prompt word pool. Training the first prompt fine-tuning network model based on the second data set and the second prompt word to obtain a second prompt fine-tuning network model after training; extracting second indication features of the second data set based on the second prompt fine-tuning network model, and storing fourth feature statistical information of the second indication features of each class; wherein the fourth feature statistical information comprises statistical information of the mean and variance of the second indication features; based on the fourth feature statistical information, sampling generates historical indication features corresponding to the first indication features; training the category classifier in the second prompt fine-tuning network model based on the historical indication features to obtain the prompt fine-tuning network model. The statistical information or each feature statistical information is the representation statistical information of the processing task.

[0080] Specifically, as Figure 3As shown, the exclusive prompt words of the first data set are added to the prompt word pool, referred to as first prompt words, the first data set and the first prompt words are used to train the first prompt word query network model, after the training is completed, the first data set is extracted by using the trained first prompt word query network model, referred to as first indication features, and the statistical information of the mean and variance of the first indication features of each class is saved. The exclusive prompt words of the second data set are added to the prompt word pool, referred to as second prompt words. The second data set, the second prompt words and the mean of the indication features of each class of the previous data set (i.e. the historical data set of the previous task) are used to train the first prompt word fine-tuning network model. Among them, the mean of the indication features of each class of the previous data set is added to compare the indication features of each class obtained in the training process of the current data set (i.e. the current data set of the task to be processed), so as to obtain indication features farther from the indication features of the previous data set. After the training is completed, the second prompt word fine-tuning network extracts the features of the second data set, referred to as second indication features. The statistical information of the mean and variance of the second indication features of each class is saved. The mean and variance of the indication features (first indication features and second indication features) of each class of the previous data set and the current data set are loaded, it is assumed that the indication features of each class of the data set (the previous data set and the current data set) are Gaussian distribution, and the approximate indication features are sampled. The class classifier of the second prompt word fine-tuning network model is further trained using the sampled approximate indication features, so as to prevent the catastrophic forgetting of the previous data set caused by the training of only the current data set. The approximate indication features can be the approximate indication features of the previous data set and the current data set restored by sampling based on the mean and variance.

[0081] It should be noted that the present application includes two types of representations, one is the representation of backbone network + prompt word extraction, referred to as "indication feature", and the other is the representation directly extracted by the backbone network, referred to as "unindicated feature". The mean and variance of the indication features of the previous task and the mean and variance of the unindicated features (i.e. two sets of mean and variance) are saved respectively; the mean and variance of the unindicated features are used to restore the previous unindicated features, so as to train the task classifier and obtain prompt words suitable for each processing task; the mean and variance of the indication features are used to restore the previous indication features, so as to train the class classifier as the final output of all classes.

[0082] In addition, it should be noted that new data sets can also be included in the training process to enable continuous learning. For subsequent new data sets (e.g., third data set, fourth data set, fifth data set, etc.), use the new data set, and add the exclusive prompt word corresponding to the new data set to the prompt word pool, and continue to train the prompt word query network model and the prompt word fine-tuning network model obtained by iteration in a manner similar to the above. The prompt word pool is actually a container for storing prompt words, containing a set of pre-set exclusive prompt words.

[0083] Step 102: sending the input data to the first backbone network in the preset prompt word query network model to extract a feature vector, and obtaining a task label output by a task classifier network in the prompt word query network model; determining a prompt word corresponding to the input data from a preset prompt word pool based on the task label; wherein the weight parameters of the first backbone network are pre-trained and migrated based on the third backbone network of the corresponding pre-training model, and the task classifier network is obtained by iterative training of the current data set of the task to be processed and the historical data set of the previously processed task.

[0084] As shown in Figure 3 In the process of sending the input data to the first backbone network in the preset prompt word query network model to extract a feature vector, and obtaining a task label output by a task classifier network in the prompt word query network model, the input data can be sent to the first backbone network in the preset prompt word query network model to extract a feature vector, and the feature vector of the input data is obtained, such as the input of the backbone network is an image, and the output is a feature vector corresponding to the image. The feature vector of the input data is input to the task classifier network for task discrimination, and a task label output by the task classifier network is obtained. The task label is used to distinguish different task types, such as image classification, speech recognition, image recognition, natural language processing, etc.

[0085] Step 103: inputting the prompt word and the input data to the second backbone network in the preset prompt word fine-tuning network model to extract a feature vector, and obtaining a prediction result output by a class classifier in the prompt word fine-tuning network model; wherein the weight parameters of the second backbone network are pre-trained and migrated based on the fourth backbone network of the corresponding pre-training model, and the class classifier network is obtained by iterative training of the current data set and its prompt word of the task to be processed and the historical data set and its prompt word of the previously processed task.

[0086] Specifically, the prompt word and the input data can be input into a second backbone network in a preset prompt word fine-tuning network model to splice a feature vector of the prompt word with a feature vector of the input data, to obtain a feature vector of the spliced data; the feature vector of the spliced data is input into the category classifier for classification judgment, to obtain a prediction result output by the category classifier in the prompt word fine-tuning network model, such as a classification result of a picture, an image recognition result, etc. According to a task label, a corresponding neural network module (a prompt word query network model and a prompt word fine-tuning network model obtained after iterative training) is called for processing, each group of prompt word query network model and prompt word fine-tuning network model can correspond to a type of task, and it is determined which prompt word of which task is used. For example, if there are five types of tasks, there are five groups of prompt word network models (i.e. prompt word query network model and prompt word fine-tuning network model).

[0087] In a training process, a plurality of data sets of processing tasks to be distinguished can be obtained; the data sets include a first data set and a second data set. The prompt word query network model is trained based on the first data set to obtain a trained first prompt word query network model; the first unindicated feature of the first data set is extracted based on the first prompt word query network model, and the first feature statistical information of the first unindicated feature of each class is stored; wherein the first feature statistical information includes the statistical information of the mean and variance of the first unindicated feature. The first prompt word corresponding to the first data set in the prompt word pool is selected; the prompt word fine-tuning network model is trained based on the first data set and the first prompt word to obtain a trained first prompt word fine-tuning network model; the first indicated feature of the first data set is extracted based on the first prompt word fine-tuning network model, and the second feature statistical information of the first indicated feature of each class is stored; wherein the second feature statistical information includes the statistical information of the mean and variance of the first indicated feature; the second prompt word corresponding to the second data set in the prompt word pool is selected; the first prompt word fine-tuning network model is trained based on the second data set and the second prompt word to obtain a trained second prompt word fine-tuning network model; the second indicated feature of the second data set is extracted based on the second prompt word fine-tuning network model, and the fourth feature statistical information of the second indicated feature of each class is stored; wherein the fourth feature statistical information includes the statistical information of the mean and variance of the second indicated feature; based on the fourth feature statistical information, the historical indicated feature corresponding to the first indicated feature is sampled and generated; the class classifier in the second prompt word fine-tuning network model is trained based on the historical indicated feature to obtain a third prompt word fine-tuning network model. The first prompt word query network model is trained based on the second data set to obtain a trained second prompt word query network model; the second unindicated feature of the second data set is extracted based on the second prompt word query network model, and the third feature statistical information of the second unindicated feature of each class is stored; wherein the third feature statistical information includes the statistical information of the mean and variance of the second unindicated feature; based on the third feature statistical information, the historical unindicated feature corresponding to the first unindicated feature is sampled and generated; the task classifier in the second prompt word query network model is trained based on the historical unindicated feature to obtain a third prompt word query network model.select a second prompt word corresponding to the second data set from the prompt word pool; train the first prompt word fine-tuning network model based on the second data set and the second prompt word, to obtain a second prompt word fine-tuning network model that has completed training; extract a second indication feature of the second data set based on the second prompt word fine-tuning network model, and store fourth feature statistical information of the second indication feature of each class; wherein the fourth feature statistical information includes statistical information of the mean and variance of the second indication feature; based on the fourth feature statistical information, sample and generate a historical indication feature corresponding to the first indication feature; and train a class classifier in the second prompt word fine-tuning network model based on the historical indication feature, to obtain a third prompt word fine-tuning network model.

[0088] The task processing method based on prompt word fine-tuning continuous learning provided in the embodiment of the application comprises the following steps: obtaining input data of a task to be processed; sending the input data to a first backbone network in a preset prompt word query network model to extract a feature vector, and obtaining a task label output by a task classifier network in the prompt word query network model; determining a prompt word corresponding to the input data from a preset prompt word pool based on the task label. The weight parameters of the first backbone network are obtained by pre-training and migration based on a third backbone network of a corresponding pre-training model, and the task classifier network is obtained by iterative training based on a current data set of the task to be processed and a historical data set of a previously processed task. Then, the prompt word and the input data are input to a second backbone network in a preset prompt word fine-tuning network model to extract a feature vector, and a prediction result output by a class classifier in the prompt word fine-tuning network model is obtained. The weight parameters of the second backbone network are obtained by pre-training and migration based on a fourth backbone network of a corresponding pre-training model, and the class classifier network is obtained by iterative training based on a current data set of the task to be processed and a prompt word thereof and a historical data set of a previously processed task and a prompt word thereof. The task processing method based on prompt word fine-tuning continuous learning can use only a small amount of parameters to fine-tune the network model, reduce the required video memory, and improve the adaptability and performance of the network model in task processing.

[0089] Corresponding to the task processing method based on prompt word fine-tuning continuous learning provided above, the application also provides a task processing device based on prompt word fine-tuning continuous learning. Since the embodiments of the device are similar to the embodiments of the above method, they are described simply, and the relevant parts can be referred to the description of the above method embodiments. The embodiments of the task processing device based on prompt word fine-tuning continuous learning described below are only illustrative. Please refer to the above method embodiments Figure 5As shown, it is a structural schematic diagram of a task processing apparatus for prompt word fine-tuning based lifelong learning provided by an embodiment of the present application. The task processing apparatus for prompt word fine-tuning based lifelong learning provided by the present application specifically includes the following parts:

[0090] The input data acquisition unit 501 is configured to acquire input data of a task to be processed.

[0091] The task discrimination unit 502 is configured to send the input data to a first backbone network in a preset prompt word query network model to extract a feature vector, and obtain a task label output by a task classifier network in the prompt word query network model; determine a prompt word corresponding to the input data from a preset prompt word pool based on the task label; wherein the weight parameters of the first backbone network are obtained by pre-training and migration based on a third backbone network of a corresponding pre-training model, and the task classifier network is obtained by iterative training of a current data set of the task to be processed and a historical data set of a previously processed task.

[0092] The input data classification unit 503 is configured to input the prompt word and the input data into a second backbone network in a preset prompt word fine-tuning network model to extract a feature vector, and obtain a prediction result output by a category classifier in the prompt word fine-tuning network model; wherein the weight parameters of the second backbone network are obtained by pre-training and migration based on a fourth backbone network of a corresponding pre-training model, and the category classifier network is obtained by iterative training of a current data set of the task to be processed and its prompt word and a historical data set of a previously processed task and its prompt word.

[0093] Further, before acquiring the input data of the task to be processed, the method further comprises:

[0094] The pre-training model determination unit is configured to determine a pre-training model; wherein the pre-training model includes a third backbone network pre-trained and its weight parameters of the third backbone network obtained through the pre-training process, a fourth backbone network pre-trained and its weight parameters of the fourth backbone network obtained through the pre-training process; the pre-training model contains at least two;

[0095] The network model construction unit is configured to pre-construct an initial prompt word query network model and an initial prompt word fine-tuning network model; wherein the initial prompt word query network model includes a first backbone network and a task classifier network; the initial prompt word fine-tuning network model includes a second backbone network, a category classifier network and a prompt word pool;

[0096] The network model continuous learning training unit is configured to: migrate the weight parameters of the third backbone network to a first backbone network in the initial prompt word query network model, and iteratively train a task classifier network in the initial prompt word query network model based on a current data set of the to-be-processed task and a historical data set of a previously processed task, to obtain the prompt word query network model; and migrate the weight parameters of the fourth backbone network to a second backbone network in the initial prompt word fine-tuning network model, and iteratively train a category classifier in the initial prompt word fine-tuning network model based on a current data set of the to-be-processed task and a prompt word thereof and a historical data set of a previously processed task and a prompt word thereof, to obtain the prompt word fine-tuning network model.

[0097] Further, the current data set of the to-be-processed task is a second data set, and the historical data set of the previously processed task is a first data set.

[0098] The iterative training of the task classifier network in the initial prompt word query network model based on the current data set of the to-be-processed task and the historical data set of the previously processed task to obtain the prompt word query network model specifically includes:

[0099] training the initial prompt word query network model based on the first data set to obtain a first completed prompt word query network model, extracting first unindicated features of the first data set based on the first prompt word query network model, and storing first feature statistical information of the first unindicated features of each category; wherein the first feature statistical information includes statistical information of the mean and variance of the first unindicated features.

[0100] training the first prompt word query network model based on the second data set to obtain a second completed prompt word query network model, extracting second unindicated features of the second data set based on the second prompt word query network model, and storing third feature statistical information of the second unindicated features of each category; wherein the third feature statistical information includes statistical information of the mean and variance of the second unindicated features.

[0101] generating historical unindicated features corresponding to the first unindicated features based on the third feature statistical information, and training the task classifier in the second prompt word query network model based on the historical unindicated features to obtain the prompt word query network model.

[0102] Further, the class classifier in the initial prompt fine-tuning network model is iteratively trained based on the current data set of the to-be-processed task and the prompt words thereof and the historical data set of the previously processed task and the prompt words thereof, to obtain the prompt fine-tuning network model, and the prompt fine-tuning network model is trained based on the first data set and the first prompt word, and the first indication feature of the first data set is extracted based on the first prompt fine-tuning network model, and the second feature statistical information of the first indication feature of each class is stored; wherein the second feature statistical information includes the statistical information of the mean and variance of the first indication feature.

[0103] The first prompt word corresponding to the first data set in the prompt word pool is selected.

[0104] The prompt fine-tuning network model is trained based on the first data set and the first prompt word, and the first indication feature of the first data set is extracted based on the first prompt fine-tuning network model, and the second feature statistical information of the first indication feature of each class is stored; wherein the second feature statistical information includes the statistical information of the mean and variance of the first indication feature.

[0105] The second prompt word corresponding to the second data set in the prompt word pool is selected.

[0106] The first prompt fine-tuning network model is trained based on the second data set and the second prompt word, and the second indication feature of the second data set is extracted based on the second prompt fine-tuning network model, and the fourth feature statistical information of the second indication feature of each class is stored; wherein the fourth feature statistical information includes the statistical information of the mean and variance of the second indication feature; based on the fourth feature statistical information, the historical indication feature corresponding to the first indication feature is sampled and generated; the class classifier in the second prompt fine-tuning network model is trained based on the historical indication feature, to obtain the prompt fine-tuning network model.

[0107] Further, the task discrimination unit is specifically configured to:

[0108] The input data is sent to a first backbone network in a preset prompt word query network model to extract a feature vector of the input data, to obtain the feature vector of the input data;

[0109] The feature vector of the input data is input to the task classifier network for task discrimination, and a task label output by the task classifier network is obtained.

[0110] Further, the input data classification unit is specifically configured to:

[0111] The prompt word and the input data are input to a second backbone network in a preset prompt fine-tuning network model to extract a feature vector of the prompt word and the input data, to splice the feature vector of the prompt word and the feature vector of the input data, and obtain a feature vector of the spliced data.

[0112] The feature vector of the spliced data is input to the category classifier for classification judgment to obtain a prediction result output by the category classifier in the prompt word fine-tuning network model.

[0113] The task processing device based on the prompt word fine-tuning continuous learning provided in the embodiment of the application obtains the input data of the task to be processed, sends the input data to the first backbone network in the preset prompt word query network model to extract a feature vector, and obtains a task label output by the task classifier network in the prompt word query network model. The task label is used to determine the prompt word corresponding to the input data from the preset prompt word pool. The weight parameters of the first backbone network are obtained by pre-training and migration based on the third backbone network of the corresponding pre-training model, and the task classifier network is obtained by iterative training based on the current data set of the task to be processed and the historical data set of the previously processed task. Then, the prompt word and the input data are input to the second backbone network in the preset prompt word fine-tuning network model to extract a feature vector, and a prediction result output by the category classifier in the prompt word fine-tuning network model is obtained. The weight parameters of the second backbone network are obtained by pre-training and migration based on the fourth backbone network of the corresponding pre-training model, and the category classifier network is obtained by iterative training based on the current data set of the task to be processed and the historical data set of the previously processed task. The network model obtained by fine-tuning the prompt word using only a small amount of parameters can be used to process the task, which reduces the required video memory and improves the adaptability and performance of the network model in task processing.

[0114] Corresponding to the task processing method based on the prompt word fine-tuning continuous learning provided above, the application also provides an electronic device. Since the embodiments of the electronic device are similar to the above-mentioned method embodiments, they are described relatively simply, and the relevant parts are described in the above-mentioned method embodiment part. The electronic device described below is only illustrative. As Figure 6As shown, it is a physical structure schematic diagram of an electronic device disclosed by the embodiment of the application. The electronic device can include a processor 601, a memory 602 and a communication bus 603, wherein the processor 601 and the memory 602 complete mutual communication through the communication bus 603, and communicate with the outside through a communication interface 604. The processor 601 can call the logical instructions in the memory 602 to execute the task processing method based on the prompt word fine tuning of the continuous learning, and the method includes: obtaining input data of a to-be-processed task; sending the input data to a first backbone network in a preset prompt word query network model to extract a feature vector, and obtaining a task label output by a task classifier network in the prompt word query network model; determining a prompt word corresponding to the input data from a preset prompt word pool based on the task label; wherein the weight parameters of the first backbone network are obtained by pre-training and migration based on a third backbone network of a corresponding pre-training model, and the task classifier network is obtained by iterative training of a current data set of the to-be-processed task and a historical data set of a previously processed task; inputting the prompt word and the input data into a second backbone network in a preset prompt word fine tuning network model to extract a feature vector, and obtaining a prediction result output by a category classifier in the prompt word fine tuning network model; wherein the weight parameters of the second backbone network are obtained by pre-training and migration based on a fourth backbone network of a corresponding pre-training model, and the category classifier network is obtained by iterative training of the current data set of the to-be-processed task and its prompt word and the historical data set of the previously processed task and its prompt word.

[0115] In addition, the logical instructions in the memory 602 described above can be implemented in the form of a software function module and sold or used as an independent product, which can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: a storage chip, a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0116] In another aspect, the embodiments of the present application also provide a computer program product, which comprises a computer program stored on a processor readable storage medium, and the computer program comprises program instructions, when the program instructions are executed by a computer, the computer can execute the task processing method based on prompt word fine-tuning of the continuous learning provided by the above-mentioned method embodiments. The method comprises: obtaining input data of a task to be processed; sending the input data to a first backbone network in a preset prompt word query network model to extract a feature vector, and obtaining a task label output by a task classifier network in the prompt word query network model; determining a prompt word corresponding to the input data from a preset prompt word pool based on the task label; wherein the weight parameters of the first backbone network are obtained by pre-training and migration based on a third backbone network of a corresponding pre-training model, and the task classifier network is obtained by iterative training of a current data set of the task to be processed and a historical data set of a previously processed task; inputting the prompt word and the input data into a second backbone network in a preset prompt word fine-tuning network model to extract a feature vector, and obtaining a prediction result output by a category classifier in the prompt word fine-tuning network model; wherein the weight parameters of the second backbone network are obtained by pre-training and migration based on a fourth backbone network of a corresponding pre-training model, and the category classifier network is obtained by iterative training of the current data set of the task to be processed and its prompt word and the historical data set of the previously processed task and its prompt word.

[0117] In yet another aspect, the embodiments of the present application also provide a processor-readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the task processing method for fine-tuning based on a prompt word for continuous learning provided by the above-mentioned embodiments. The method comprises: obtaining input data of a task to be processed; sending the input data to a first backbone network in a preset prompt word query network model to extract a feature vector, and obtaining a task label output by a task classifier network in the prompt word query network model; determining a prompt word corresponding to the input data from a preset prompt word pool based on the task label; wherein the weight parameters of the first backbone network are obtained by pre-training and migration based on a third backbone network of a corresponding pre-training model, and the task classifier network is obtained by iterative training of a current data set of the task to be processed and a historical data set of a previously processed task; inputting the prompt word and the input data to a second backbone network in a preset prompt word fine-tuning network model to extract a feature vector, and obtaining a prediction result output by a category classifier in the prompt word fine-tuning network model; wherein the weight parameters of the second backbone network are obtained by pre-training and migration based on a fourth backbone network of a corresponding pre-training model, and the category classifier network is obtained by iterative training of the current data set of the task to be processed and its prompt word and the historical data set of the previously processed task and its prompt word.

[0118] The processor-readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to a magnetic memory (such as a floppy disk, a hard disk, a magnetic tape, a magneto-optical disk (MO), etc.), an optical memory (such as a CD, a DVD, a BD, a HVD, etc.), and a semiconductor memory (such as a ROM, an EPROM, an EEPROM, a non-volatile memory (NAND FLASH), a solid state disk (SSD)), etc.

[0119] The above-described device embodiments are only schematic, wherein the modules illustrated as separate components can or can not be physically separate, and the components illustrated as modules can or can not be physical modules, i.e., they can be located in one place or distributed on multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purposes of the present embodiments. Those skilled in the art can understand and implement without creative labor.

[0120] Those skilled in the art can clearly understand the technical solutions of the various embodiments from the above description of the embodiments, and the various embodiments can be implemented by means of software with the necessary general hardware platforms, and of course, can also be implemented by hardware. Based on such understanding, the above technical solutions, essentially or in other words, the part of the prior art that makes a contribution, can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, and the like, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0121] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for some technical features therein; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A task processing method based on prompt word fine-tuning of continual learning, characterized in that, The method comprises: obtaining input data of a to-be-processed task; sending the input data to a first backbone network in a preset prompt word query network model to extract a feature vector, and obtaining a task label output by a task classifier network in the prompt word query network model; determining a prompt word corresponding to the input data from a preset prompt word pool based on the task label; wherein the weight parameters of the first backbone network are obtained by pre-training and migration based on a third backbone network of a corresponding pre-training model, and the task classifier network is obtained by iterative training based on a current data set of the to-be-processed task and a historical data set of a previously processed task; inputting the prompt word and the input data into a second backbone network in a preset prompt word fine-tuning network model to extract a feature vector, and obtaining a prediction result output by a category classifier in the prompt word fine-tuning network model; wherein the weight parameters of the second backbone network are obtained by pre-training and migration based on a fourth backbone network of a corresponding pre-training model, and the category classifier network is obtained by iterative training based on a current data set of the to-be-processed task and its prompt word and a historical data set of a previously processed task and its prompt word.

2. The task processing method of fine-tuning based on a prompt word for continuous learning according to claim 1, characterized in that, Before obtaining the input data of the to-be-processed task, the method further comprises: determining a pre-training model; wherein the pre-training model comprises a third backbone network that has been pre-trained and its weight parameters obtained through a pre-training process, and a fourth backbone network that has been pre-trained and its weight parameters obtained through a pre-training process; pre-constructing an initial prompt word query network model and an initial prompt word fine-tuning network model; wherein the initial prompt word query network model comprises a first backbone network and a task classifier network; and the initial prompt word fine-tuning network model comprises a second backbone network, a category classifier network, and a prompt word pool; migrating the weight parameters of the third backbone network to the first backbone network in the initial prompt word query network model, and iteratively training the task classifier network in the initial prompt word query network model based on a current data set of the to-be-processed task and a historical data set of a previously processed task to obtain the prompt word query network model; and migrating the weight parameters of the fourth backbone network to the second backbone network in the initial prompt word fine-tuning network model; and iteratively training the category classifier in the initial prompt word fine-tuning network model based on the current data set of the to-be-processed task and its prompt word and the historical data set of the previously processed task and its prompt word to obtain the prompt word fine-tuning network model.

3. The task processing method of fine-tuning based on the prompt word continuous learning according to claim 2, characterized in that, The current data set of the to-be-processed task is a second data set, and the historical data set of the previously processed task is a first data set; The iterative training of the task classifier network in the initial prompt word query network model based on the current data set of the to-be-processed task and the historical data set of the previously processed task to obtain the prompt word query network model specifically comprises: training the initial prompt query network model based on the first data set to obtain a first trained prompt query network model; extracting first unindicated features of the first data set based on the first prompt query network model, and storing first feature statistical information of the first unindicated features of each class; wherein the first feature statistical information comprises statistical information of mean and variance of the first unindicated features; training the first prompt query network model based on the second data set to obtain a second trained prompt query network model; extracting second unindicated features of the second data set based on the second prompt query network model, and storing third feature statistical information of the second unindicated features of each class; wherein the third feature statistical information comprises statistical information of mean and variance of the second unindicated features; generating historical unindicated features corresponding to the first unindicated features based on the third feature statistical information; training a task classifier in the second prompt query network model based on the historical unindicated features to obtain the prompt query network model.

4. The task processing method of prompt-word fine-tuning based continuous learning according to claim 3, characterized in that, The iterative training of the class classifier in the initial prompt fine-tuning network model based on the current data set of the to-be-processed task, the prompt thereof and the historical data set of the previously processed task and the prompt thereof, to obtain the prompt fine-tuning network model, specifically comprises: selecting a first prompt corresponding to the first data set in the prompt pool; training the prompt fine-tuning network model based on the first data set and the first prompt to obtain a first trained prompt fine-tuning network model; extracting first indicated features of the first data set based on the first prompt fine-tuning network model, and storing second feature statistical information of the first indicated features of each class; wherein the second feature statistical information comprises statistical information of mean and variance of the first indicated features; selecting a second prompt corresponding to the second data set in the prompt pool; training the first prompt fine-tuning network model based on the second data set and the second prompt to obtain a second trained prompt fine-tuning network model; extracting second indicated features of the second data set based on the second prompt fine-tuning network model, and storing fourth feature statistical information of the second indicated features of each class; wherein the fourth feature statistical information comprises statistical information of mean and variance of the second indicated features; generating historical indicated features corresponding to the first indicated features based on the fourth feature statistical information; training a class classifier in the second prompt fine-tuning network model based on the historical indicated features to obtain the prompt fine-tuning network model.

5. The task processing method of prompt-word fine-tuning based on continual learning according to claim 1, characterized in that, The first backbone network in the preset prompt query network model extracts a feature vector based on the input data, and obtains a task label output by a task classifier network in the prompt query network model, specifically comprising: The input data is sent to the first backbone network in the preset prompt word query network model to extract feature vectors, thereby obtaining the feature vectors of the input data; The feature vector of the input data is input into the task classifier network for task discrimination, and the task label output by the task classifier network is obtained.

6. The task processing method of prompt-word fine-tuning based continuous learning according to claim 1, characterized in that, The step of inputting the prompt word and the input data into the second backbone network of a preset prompt word fine-tuning network model to extract feature vectors and obtaining the prediction results output by the category classifier in the prompt word fine-tuning network model specifically includes: The prompt word and the input data are input into the second backbone network of the preset prompt word fine-tuning network model to extract feature vectors. The feature vectors of the prompt word and the feature vectors of the input data are then concatenated to obtain the feature vector of the concatenated data. The feature vector of the concatenated data is input into the category classifier for classification judgment, and the prediction result output by the category classifier in the prompt word fine-tuning network model is obtained.

7. A task processing apparatus of prompt word-based fine-tuning continual learning, characterized by, include: The input data acquisition unit is used to acquire the input data of the task to be processed. The task discrimination unit is used to send the input data to the first backbone network of a preset prompt word query network model to extract feature vectors and obtain the task label output by the task classifier network in the prompt word query network model; and determine the prompt word corresponding to the input data from the preset prompt word pool based on the task label; wherein, the weight parameters of the first backbone network are obtained by pre-training and transfer learning based on the third backbone network of the corresponding pre-trained model, and the task classifier network is obtained by iterative training using the current dataset of the task to be processed and the historical dataset of the previously processed tasks; The input data classification unit is used to input the prompt words and the input data into the second backbone network of the preset prompt word fine-tuning network model to extract feature vectors and obtain the prediction results output by the category classifier in the prompt word fine-tuning network model; wherein, the weight parameters of the second backbone network are obtained by pre-training and transfer based on the fourth backbone network of the corresponding pre-trained model, and the category classifier network is obtained by iteratively training the current dataset and prompt words of the task to be processed and the historical dataset and prompt words of the previously processed tasks.

8. The task processing apparatus of prompt-word fine-tuning based continuous learning according to claim 7, characterized in that, Before obtaining the input data for the task to be processed, the following steps are also included: A pre-trained model determination unit is used to determine a pre-trained model; wherein the pre-trained model includes a pre-trained third backbone network and its weight parameters obtained through the pre-training process, and a pre-trained fourth backbone network and its weight parameters obtained through the pre-training process. A network model building unit is used to pre-build an initial prompt word query network model and an initial prompt word fine-tuning network model; wherein, the initial prompt word query network model includes a first backbone network and a task classifier network; the initial prompt word fine-tuning network model includes a second backbone network, a category classifier network, and a prompt word pool; The network model continuous learning training unit is configured to: migrate the weight parameters of the third backbone network to a first backbone network in the initial prompt word query network model, and iteratively train a task classifier network in the initial prompt word query network model based on a current data set of the to-be-processed task and a historical data set of a previously processed task, to obtain the prompt word query network model; and migrate the weight parameters of the fourth backbone network to a second backbone network in the initial prompt word fine-tuning network model, and iteratively train a category classifier in the initial prompt word fine-tuning network model based on a current data set of the to-be-processed task and a prompt word thereof and a historical data set of a previously processed task and a prompt word thereof, to obtain the prompt word fine-tuning network model.

9. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The computer program, when executed by the processor, implements the steps of the task processing method based on prompt word fine-tuning continuous learning according to any one of claims 1 to 6.

10. A processor-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the task processing method based on prompt word fine-tuning continuous learning according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for generating an intent classifier

    CA3123387A1

  • Natural language processing method and device based on knowledge guidance prefix fine tuning, computing equipment, and storage medium

    CN113987209A