Task model processing method, task processing method and answer correcting method

By expanding the processing layer matrix size of the machine learning model, the problems of high model training costs and waste of computing resources are solved, the goals of model parameter expansion and performance maintenance are achieved, and subsequent training costs are reduced.

CN118569405APending Publication Date: 2024-08-30BEIJING YUANLI WEILAI SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410658320.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the existing technology, machine learning model training costs are high and computing resources are wasted, especially when the number of model parameters needs to be increased to adapt to complex scenarios.

Method used

By determining the first processing layer and the second processing layer of the initial task model, and expanding its matrix size according to different expansion rules, the target task model is obtained, and the expansion of model parameters is achieved without changing the number of network layers and other model parameters. Thereby reducing computing resource consumption.

Benefits of technology

It is possible to reduce model training costs and computing resource consumption without changing model performance, and subsequent training only needs to train the expanded part, improving training efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569405A
    Figure CN118569405A
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of computers, and provides a task model processing method, a task processing method and an answer correcting method.The task model processing method comprises the steps that a first processing layer and a second processing layer of an initial task model are determined, the first processing layer is used for mapping the feature vector from a first dimension to a second dimension, the second processing layer is used for mapping the feature vector from the second dimension to the first dimension, and the second dimension is greater than the first dimension; expanding a first matrix size of the first processing layer according to a first expansion rule, and expanding a second matrix size of the second processing layer according to a second expansion rule to obtain a target task model; wherein the first expansion rule is used for performing model parameter filling on a first matrix of the first processing layer, the second expansion rule is used for performing model parameter filling on a second matrix of the second processing layer, and the model parameters filled in the first expansion rule and the second expansion rule are different.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology, and in particular to a task model processing method, a task processing method, and an answer correction method. Background Art

[0002] Generally, the larger the number of parameters of a machine learning model, the better the performance and processing effect of the model. In practical applications, different scenarios require different number of model parameters. For example, in simple scenarios, a model with a smaller number of parameters can perform the task, while in complex scenarios, a model with a larger number of parameters is required to process the task in order to ensure the effect of task processing.

[0003] However, in order to obtain a model with a larger number of parameters based on a model with a smaller number of parameters, the model needs to be retrained, which leads to high model training costs and wastes computing resources of computing devices. Therefore, an effective technical solution is urgently needed to solve the above problems. Summary of the invention

[0004] In view of this, an embodiment of this specification provides a task model processing method. One or more embodiments of this specification also relate to a task model processing device, a task processing method, a task processing device, an answer correction method, an answer correction device, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects of the prior art that the model training cost is high and the computing resources of the computing device are wasted.

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

[0006] Determining a first processing layer and a second processing layer of an initial task model, wherein the first processing layer is used to map a feature vector from a first dimension to a second dimension, and the second processing layer is used to map the feature vector from the second dimension to the first dimension, and the second dimension is larger than the first dimension;

[0007] Expanding the size of the first matrix of the first processing layer according to a first expansion rule, and expanding the size of the second matrix of the second processing layer according to a second expansion rule, to obtain a target task model;

[0008] The first expansion rule is to fill the model parameters of the first matrix of the first processing layer, and the second expansion rule is to fill the model parameters of the second matrix of the second processing layer. The model parameters filled in the first expansion rule and the second expansion rule are different.

[0009] According to a second aspect of an embodiment of this specification, there is provided a task model processing device, including:

[0010] A determination module is configured to determine a first processing layer and a second processing layer of an initial task model, wherein the first processing layer is used to map a feature vector from a first dimension to a second dimension, and the second processing layer is used to map the feature vector from the second dimension to the first dimension, and the second dimension is larger than the first dimension;

[0011] an expansion module, configured to expand the size of the first matrix of the first processing layer according to a first expansion rule, and to expand the size of the second matrix of the second processing layer according to a second expansion rule, to obtain a target task model;

[0012] The first expansion rule is to fill the model parameters of the first matrix of the first processing layer, and the second expansion rule is to fill the model parameters of the second matrix of the second processing layer. The model parameters filled in the first expansion rule and the second expansion rule are different.

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

[0014] Identify the information to be processed;

[0015] Inputting the information to be processed into a target task model, and performing linear transformation processing on a feature vector of the information to be processed according to a first processing layer and a second processing layer included in the target task model to obtain a prediction result;

[0016] Among them, the target task model is the target task model provided by the first aspect of the embodiment of this specification.

[0017] According to a fourth aspect of the embodiments of this specification, there is provided a task processing device, including:

[0018] A determination module, configured to determine information to be processed;

[0019] An input module is configured to input the information to be processed into a target task model, and perform linear transformation processing on a feature vector of the information to be processed according to a first processing layer and a second processing layer included in the target task model to obtain a prediction result;

[0020] Among them, the target task model is the target task model provided by the first aspect of the embodiment of this specification.

[0021] According to a fifth aspect of the embodiments of this specification, a method for correcting answers is provided, comprising:

[0022] Determine the answer text;

[0023] Inputting the answer text into the target task model, performing linear transformation processing on the feature vector of the answer text according to the first processing layer and the second processing layer included in the target task model, and obtaining the correction result corresponding to the answer text;

[0024] Among them, the target task model is the target task model provided by the first aspect of the embodiment of this specification.

[0025] According to a sixth aspect of the embodiments of this specification, there is provided an answer correction device, comprising:

[0026] a determination module configured to determine an answer text;

[0027] An input module is configured to input the answer text into a target task model, perform linear transformation processing on a feature vector of the answer text according to a first processing layer and a second processing layer included in the target task model, and obtain a correction result corresponding to the answer text;

[0028] Among them, the target task model is the target task model provided by the first aspect of the embodiment of this specification.

[0029] According to a seventh aspect of an embodiment of this specification, there is provided a computing device, including:

[0030] Memory and processor;

[0031] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above method are implemented.

[0032] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores a computer program / instruction, and the steps of the above method are implemented when the computer program / instruction is executed by a processor.

[0033] According to a ninth aspect of the embodiments of this specification, there is provided a computer program product, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.

[0034] An embodiment of the present specification determines the first processing layer and the second processing layer of the initial task model, and expands the first matrix size of the first processing layer and the second matrix size of the second processing layer, thereby achieving parameter expansion of the first processing layer and the second processing layer of the initial task model, without changing the number of network layers of the initial task model and the model parameters of other network layers, thereby reducing the computing resource consumption of the computing device, and can ensure that the output results of the obtained target task model and the initial task model are consistent, thereby ensuring the performance of the target task model. In subsequent training, only the changed part of the initial task model (i.e., the expanded part) can be trained, thereby reducing the model training cost and thereby reducing the computing resource consumption during model training. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 is a flowchart of a task model processing method provided by an embodiment of this specification;

[0036] Figure 2 is a processing flow chart of a task model processing method provided by an embodiment of this specification;

[0037] Figure 3 It is a structural schematic diagram of a task model processing device provided by an embodiment of this specification;

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

[0039] Figure 5 is a structural diagram of a task processing device provided by an embodiment of this specification;

[0040] Figure 6 is a flow chart of an answer correction method provided by an embodiment of this specification;

[0041] Figure 7 It is a structural schematic diagram of an answer correction device provided by an embodiment of this specification;

[0042] Figure 8 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

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

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

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

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

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

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

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

[0050] MLP: Multi layer Perceptron, a type of feedforward artificial neural network, contains at least three layers (input layer, hidden layer, output layer) of fully connected neural network. MLP can identify complex patterns between the outputs of nonlinear models. In large language models, MLP is often used to provide additional nonlinear transformations or increase model complexity after the Self-Attention Mechanism. This structure is similar to the Feed Forward Network part of the Transformer model, and its basic structure is usually two fully connected layers separated by an activation function. The purpose of this is to enhance the expressiveness of the model and capture more complex and abstract features in the input.

[0051] Pre-training: Pre-training is actually training a model to understand the language rules and patterns learned from a large amount of unlabeled text data. In this process, the model tries to predict or generate the next word in the text, or generate missing words given the previous and next contexts, or predict the next sentence, etc. The pre-training stage is an unsupervised learning process, and the model learns the language statistics in a large amount of text data. The pre-trained model obtained in this way is like a general language understanding model, which can already understand basic language structure, syntax, semantics, and some common sense.

[0052] Model parameter quantity: The parameter quantity of a model refers to the number of weights and biases that need to be learned in the model. The number of parameters is usually related to the complexity of the model, its ability to process information, and the amount of training data required. Comparing a model with 13B (13 billion) parameters and a model with 70B (70 billion) parameters, it is understandable that the 70B model is more complex than the 13B model and can theoretically capture more patterns and deeper semantic information. It may contain more layers, larger hidden layer sizes, or more complex structures.

[0053] In practical applications, model parameters can usually be expanded by copying them. However, this will cause the gradients of model parameters to be relatively consistent during model training, which in turn leads to consistent updated values ​​and consistent updated results in the group, causing the model to fall into a local optimal solution, resulting in insufficient training. Therefore, an effective technical solution is urgently needed to solve the above problems.

[0054] In this specification, a task model processing method is provided. This specification also involves a task model processing device, a task processing method, a task processing device, an answer correction method, an answer correction device, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.

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

[0056] Step 102: Determine a first processing layer and a second processing layer of an initial task model, wherein the first processing layer is used to map a feature vector from a first dimension to a second dimension, and the second processing layer is used to map the feature vector from the second dimension to the first dimension, and the second dimension is larger than the first dimension.

[0057] Specifically, the task model processing method provided in the embodiments of this specification can be applied to the field of model parameter expansion, and the task model processing method can be used to increase the number of parameters of the task model, so that the task model can meet the task requirements of complex scenarios. The task model processing method can be implemented by the server or by other computing devices.

[0058] Among them, the initial task model can be understood as the task model before the model parameter expansion, and the initial task model can be a machine learning model or a large model, etc. The task model can be applicable to various types of data processing tasks, such as text processing tasks, image processing tasks, etc., and this specification embodiment does not limit this. The first processing layer and the second processing layer of the initial task model can be understood as the MLP of the task model. The first processing layer can be understood as a fully connected layer of the MLP, which is used to map the feature vector from the first dimension to the second dimension (i.e., from low dimension to high dimension), such as the first processing layer can map the feature vector from 100 dimensions to 200 dimensions, and the second processing layer can be understood as a fully connected layer of the MLP, which is used to map the feature vector from the second dimension to the first dimension (i.e., from high dimension to low dimension). For example, the second processing layer can map the feature vector from 200 dimensions back to 100 dimensions. The feature vector can be understood as the feature vector of the information input into the initial task model, such as when the information input into the initial task model is text information, the feature vector is a text feature vector, or when the information input into the initial task model is image information, the feature vector is an image feature vector.

[0059] Based on this, the first processing layer and the second processing layer in the initial task model can be determined by the server from a plurality of network layers included in the initial task model.

[0060] In one embodiment of the present specification, the initial task model may be a pre-trained task model. Under the premise of not introducing noise and maintaining the original capabilities of the task model, the task model processing method provided in the embodiment of the present specification may be smoothly expanded based on the pre-trained task model.

[0061] Step 104: Expand the size of the first matrix of the first processing layer according to a first expansion rule, and expand the size of the second matrix of the second processing layer according to a second expansion rule to obtain a target task model.

[0062] The first expansion rule is to fill the model parameters of the first matrix of the first processing layer, and the second expansion rule is to fill the model parameters of the second matrix of the second processing layer. The model parameters filled in the first expansion rule and the second expansion rule are different.

[0063] The first matrix size of the first processing layer can be understood as the matrix size of the first processing layer. The matrix size of the first processing layer may include the row size and column size of the first matrix. Correspondingly, the second matrix size of the second processing layer can be understood as the matrix size of the second processing layer, and the matrix size of the second processing layer may include the row size and column size of the second matrix.

[0064] In a specific implementation, before expanding the size of the first matrix of the first processing layer according to the first expansion rule, the method further includes:

[0065] Determining an expansion dimension of the initial task model;

[0066] The expansion dimension is determined as the expansion size corresponding to the initial task model.

[0067] Among them, the expanded dimension of the initial task model can be understood as the target dimension that the initial task model needs to expand. For example, the first processing layer of the initial task model can currently map the feature vector from 100 dimensions to 200 dimensions. At this time, the feature vector needs to be mapped from 100 dimensions to 500 dimensions. Then, the 500 dimensions are the expanded dimensions of the initial task model. Correspondingly, when the first processing layer can map the feature vector from 100 dimensions to 200 dimensions, the second processing layer can also map the feature vector from 200 dimensions to 100 dimensions. Then, when the feature vector needs to be mapped from 100 dimensions to 500 dimensions, the feature vector also needs to be mapped from 500 dimensions to 100 dimensions. Then, the expanded dimension of the initial task model can also be understood as the expanded dimensions corresponding to the first processing layer and the second processing layer of the initial task model.

[0068] Furthermore, the expansion size corresponding to the initial task model can be understood as the expansion size corresponding to the first processing layer and the second processing layer. The row size of the first matrix is ​​the first dimension, the column size of the first matrix is ​​the second dimension, and the row size of the second matrix is ​​the second dimension, and the column size of the second matrix is ​​the first dimension.

[0069] Using the above example, when the first processing layer can map the feature vector from 100 dimensions to 200 dimensions, 100 dimensions are the first dimension and 200 dimensions are the second dimension. Then the row size of the first matrix is ​​100, and the column size of the first matrix is ​​200, that is, the matrix size of the first processing layer is (100, 200). Correspondingly, when the second processing layer can map the feature vector from 200 dimensions to 100 dimensions, the row size of the second matrix is ​​200, and the column size of the second matrix is ​​100, that is, the matrix size of the second processing layer is (200, 100).

[0070] Based on this, after determining the expansion dimension of the initial task model, the expansion dimension can be determined as the expansion size corresponding to the first processing layer and the second processing layer. Using the above example, the matrix size of the first processing layer needs to be adjusted to (100,500), and the matrix size of the second processing layer needs to be adjusted to (500,100).

[0071] In practical applications, the expansion dimension of the initial task model can be determined according to the data processing task of the task model.

[0072] In summary, by determining the expansion size according to the expansion dimension, it is convenient to subsequently expand the parameters of the initial task model.

[0073] In a specific implementation, the step of expanding the size of the first matrix of the first processing layer according to the first expansion rule includes:

[0074] According to the expanded size, filling the first model parameter on the first matrix of the first processing layer so that the size of the first matrix of the first processing layer is expanded to the expanded size;

[0075] Correspondingly, the expanding the size of the second matrix of the second processing layer according to the second expansion rule includes:

[0076] According to the expanded size, the second matrix of the second processing layer is filled with second model parameters so that the size of the second matrix of the second processing layer is expanded to the expanded size.

[0077] Specifically, the first model parameters can be filled in the first matrix of the first processing layer according to the expansion size, so that the size of the first matrix of the first processing layer is expanded to the expansion size, and the second model parameters can be filled in the second matrix of the second processing layer, so that the size of the second matrix of the second processing layer is expanded to the expansion size.

[0078] Furthermore, the first matrix of the first processing layer can be filled with the first model parameters so that the column size of the first matrix of the first processing layer is expanded to the expanded size, and the second matrix of the second processing layer can be filled with the second model parameters so that the row size of the second matrix of the second processing layer is expanded to the expanded size.

[0079] Continuing with the above example, it is necessary to fill the first model parameters of the first matrix of the first processing layer, expanding the column size of the first matrix of the first processing layer from 200 to 500, and it is necessary to fill the second model parameters of the second matrix of the second processing layer, that is, expanding the row size of the second matrix of the second processing layer from 200 to 500.

[0080] In summary, by filling the first matrix with the first model parameters and filling the second matrix with the second model parameters, the size of the first matrix and the size of the second matrix are expanded, and the initial task model parameters are further expanded.

[0081] In one embodiment of the present specification, the first model parameter is a preset parameter value, and the second model parameter is a random parameter value; or, the first model parameter is a random parameter value, and the second model parameter is a preset parameter value.

[0082] The preset parameter value may be understood as a pre-set value, and in one embodiment of the present specification, the preset parameter value may be 0. The random parameter value may be a randomly determined value, such as 1, 5, 7, 9, and the like.

[0083] Based on this, the first matrix of the first processing layer can be filled with preset parameter values, and the second matrix of the second processing layer can be filled with random parameter values; or the first matrix of the first processing layer can be filled with random parameter values, and the second matrix of the second processing layer can be filled with preset parameter values.

[0084] For example, the extended part of the first matrix of the first processing layer may be initialized to all 0s, and the extended part of the second matrix of the second processing layer may be randomly initialized; or the extended part of the first matrix of the first processing layer may be randomly initialized, and the extended part of the second matrix of the second processing layer may be initialized to all 0s.

[0085] In practical applications, for a two-dimensional feature vector H, the first matrix P of the first processing layer is as shown in the following formula, and the second matrix Q of the second processing layer is as shown in the following formula. Then, after mapping the two-dimensional feature vector H through the first matrix P, the obtained H*P is as shown in the following formula, and after mapping the second-dimensional feature vector H through the second matrix Q, the obtained H*P*Q is as shown in the following formula.

[0086] H={h1,h2}

[0087]

[0088] Among them, h1 and h2 are two-dimensional feature vectors, a1, a2, b1, b2 are model parameters of the first matrix before model expansion, and z1, z2, y1, y2 are model parameters of the second matrix before model expansion.

[0089] Then, when the expansion size is 3, the expanded first matrix P, the second matrix Q and the mapping result are as shown in the following formulas.

[0090] H={h1,h2}

[0091]

[0092] Based on this, it can be seen that in order to ensure the consistency of processing results before and after the expansion of the task model parameters, the conditions that need to be met are: (h1*a3+h2*b3)*z3=0 and (h1*a3+h2*b3)*y3=0, then, the expanded part of the first matrix can be initialized to all 0s and the expanded part of the second matrix can be randomly initialized, or the expanded part of the first matrix can be randomly initialized and the expanded part of the second matrix can be initialized to all 0s.

[0093] In practical applications, when running the test code to test the task model before and after the model parameter expansion, according to the test results, it can be seen that the processing results before and after the task model parameter expansion are consistent, and when the expanded part of the first matrix is ​​randomly initialized, the gradient part is 0, and when the expanded part of the second matrix is ​​initialized with all 0s, the gradient part is not 0, then the target task model after expansion can maintain the same model performance as the initial task model before expansion.

[0094] In summary, the sizes of the first matrix and the second matrix are expanded through different expansion methods. On the basis of realizing the expansion of model parameters, the processing results before and after the expansion of model parameters are guaranteed to be consistent. Under the premise of not changing the model results, only the model parameters need to be expanded, and there is no need to adjust the training code for subsequent training. The implementation is simple, and the target task model can continue to be pre-trained, and the model capability does not require a recovery period.

[0095] In addition, after obtaining the target task model, the method further includes:

[0096] Determine a training data set corresponding to the target task model;

[0097] The target task model is trained according to the training data set.

[0098] The training data set may be determined according to the data processing task processed by the target task model. The target task model obtained at this time may map the feature vector of the first dimension to the feature vector of the expanded dimension.

[0099] Specifically, the training data set can be determined according to the data processing task processed by the target task model, and the target task model can be trained based on the accumulated data set.

[0100] In a specific implementation, the target task model is trained according to the training data set, including:

[0101] Inputting the training samples in the training data set into the target task model;

[0102] According to the first processing layer and the second processing layer, a linear transformation process is performed on the feature vector of the training sample to obtain a prediction result;

[0103] The target task model is trained according to the training labels in the training data set and the prediction results.

[0104] Among them, linear transformation processing can be understood as mapping processing, which can include dimensionality increase processing and dimensionality reduction processing.

[0105] Based on this, the training samples can be input into the target task model. In the target task model, the feature vector (first dimension) of the training samples is extracted through the encoding layer of the target task model, and the feature vector of the training samples is linearly transformed through the first processing layer to obtain the feature vector after dimensionality increase (expanded dimension). The feature vector after dimensionality increase is linearly transformed through the second processing layer to obtain the feature vector after dimensionality reduction (first dimension), and the prediction result is obtained based on the feature vector after dimensionality reduction. The target task model is trained according to the training labels and the prediction results.

[0106] Furthermore, the extended parts of the first processing layer and the second processing layer of the target task model can be trained according to the training labels and the prediction results to reduce the training cost.

[0107] In one embodiment of the present specification, the target task model can be used to perform learning data processing tasks, the training samples are text samples (such as students' answers to questions), and the training labels are the correction results corresponding to the text samples.

[0108] In another embodiment of the present specification, the target task model can also be used to perform an article generation task, in which case the training sample can be a text summary sample, and the training label can be an article sample.

[0109] It is understandable that the target task model of the embodiment of this specification can also be used for other data processing tasks, and the embodiment of this specification does not limit this.

[0110] In summary, the performance of the target task model is guaranteed by training the target task model.

[0111] An embodiment of the present specification determines the first processing layer and the second processing layer of the initial task model, and expands the first matrix size of the first processing layer and the second matrix size of the second processing layer, thereby achieving parameter expansion of the first processing layer and the second processing layer of the initial task model, without changing the number of network layers of the initial task model and the model parameters of other network layers, thereby reducing the computing resource consumption of the computing device, and can ensure that the output results of the obtained target task model and the initial task model are consistent, thereby ensuring the performance of the target task model. In subsequent training, only the changed part of the initial task model (i.e., the expanded part) can be trained, thereby reducing the model training cost and thereby reducing the computing resource consumption during model training.

[0112] The following combination Figure 2 Taking the application of the task model processing method provided in this specification in model parameter expansion as an example, the task model processing method is further described. Figure 2A processing flow chart of a task model processing method provided by an embodiment of the present specification is shown, which specifically includes the following steps.

[0113] Step 202: Determine the expansion dimension of the initial task model.

[0114] The initial task model includes a first processing layer and a second processing layer, the first processing layer is used to map the feature vector from low dimension to high dimension, and the second processing layer is used to map the feature vector from high dimension back to low dimension.

[0115] For example, the first processing layer of the initial task model can currently map the feature vector from 1 dimension to 3 dimensions. At this time, the feature vector needs to be mapped from 1 dimension to 16 dimensions. Then, the 16 dimensions are the expanded dimensions of the initial task model. Correspondingly, when the first processing layer can map the feature vector from 1 dimension to 3 dimensions, the second processing layer can also map the feature vector from 3 dimensions to 1 dimension. Then, when it is necessary to map the feature vector from 1 dimension to 16 dimensions, it is also necessary to map the feature vector from 16 dimensions to 1 dimension. Then, the expanded dimensions of the initial task model can also be understood as the expanded dimensions corresponding to the first processing layer and the second processing layer of the initial task model.

[0116] Step 204: Determine the expansion dimension as the expansion size corresponding to the initial task model.

[0117] Specifically, the expansion dimension is 16, that is, the column size of the first matrix of the first processing layer is expanded to 16, and the row size of the second matrix of the second processing layer is expanded to 16. The expansion dimension is 16.

[0118] Continuing with the above example, when the first processing layer can map the eigenvector from 1 dimension to 3 dimension, the row size of the first matrix of the first processing layer is 1, and the column size of the first matrix is ​​3, that is, the matrix size of the first processing layer is (1,3); when the second processing layer can map the eigenvector from 3 to 1, the row size of the second matrix is ​​3 and the column size of the second matrix is ​​1, that is, the matrix size of the second processing layer is (3,1).

[0119] Step 206: Fill the first matrix of the first processing layer with first model parameters according to the expanded size, so that the size of the first matrix of the first processing layer is expanded to the expanded size.

[0120] The first model parameter may be 0 or a random number.

[0121] Specifically, the expanded part of the first matrix of the first processing layer may be initialized with all zeros or randomly initialized, so that the size of the first matrix is ​​expanded to (1, 16).

[0122] Step 208: Fill the second matrix of the second processing layer with second model parameters according to the expanded size, so that the size of the second matrix of the second processing layer is expanded to the expanded size, and obtain the target task model.

[0123] The second model parameter may be a random number or 0.

[0124] Corresponding to step 206, the expanded part of the second matrix of the second processing layer may be randomly initialized or initialized to all zeros, so that the size of the second matrix is ​​expanded to (16, 1).

[0125] It can be understood that when the first model parameter is 0, the second model parameter is a random number; when the first model parameter is a random number, the second model parameter is 0.

[0126] Step 210: Determine a training data set corresponding to the target task model, and train the target task model according to the training data set.

[0127] The training data set may include training samples and training labels.

[0128] Specifically, the training samples can be input into the target task model. In the target task model, the feature vector (low dimension) of the training samples is extracted through the encoding layer of the target task model, the feature vector of the training samples is linearly transformed through the first processing layer to obtain the feature vector after dimensionality increase (high dimension), the feature vector after dimensionality increase is linearly transformed through the second processing layer to obtain the feature vector after dimensionality reduction (low dimension), and the prediction result is obtained based on the feature vector after dimensionality reduction, and the target task model is trained based on the training label and the prediction result.

[0129] Furthermore, the extended parts of the first processing layer and the second processing layer of the target task model can be trained according to the training labels and the prediction results to reduce the training cost.

[0130] An embodiment of the present specification determines the first processing layer and the second processing layer of the initial task model, and expands the first matrix size of the first processing layer and the second matrix size of the second processing layer, thereby achieving parameter expansion of the first processing layer and the second processing layer of the initial task model, without changing the number of network layers of the initial task model and the model parameters of other network layers, thereby reducing the computing resource consumption of the computing device, and can ensure that the output results of the obtained target task model and the initial task model are consistent, thereby ensuring the performance of the target task model. In subsequent training, only the changed part of the initial task model (i.e., the expanded part) can be trained, thereby reducing the model training cost and thereby reducing the computing resource consumption during model training.

[0131] Corresponding to the above method embodiment, this specification also provides a task model processing device embodiment, Figure 3 FIG. 1 is a schematic diagram showing the structure of a task model processing device provided by an embodiment of the present specification. Figure 3 As shown, the device comprises:

[0132] A determination module 302 is configured to determine a first processing layer and a second processing layer of an initial task model, wherein the first processing layer is used to map a feature vector from a first dimension to a second dimension, and the second processing layer is used to map the feature vector from the second dimension to the first dimension, and the second dimension is larger than the first dimension;

[0133] An expansion module 304 is configured to expand the first matrix size of the first processing layer according to a first expansion rule, and expand the second matrix size of the second processing layer according to a second expansion rule, to obtain a target task model;

[0134] The first expansion rule is to fill the model parameters of the first matrix of the first processing layer, and the second expansion rule is to fill the model parameters of the second matrix of the second processing layer. The model parameters filled in the first expansion rule and the second expansion rule are different.

[0135] In an optional embodiment, the determining module 302 is further configured to:

[0136] Determining an expansion dimension of the initial task model;

[0137] The expansion dimension is determined as the expansion size corresponding to the initial task model.

[0138] In an optional embodiment, the expansion module 304 is further configured to:

[0139] According to the expanded size, filling the first model parameter on the first matrix of the first processing layer so that the size of the first matrix of the first processing layer is expanded to the expanded size;

[0140] Correspondingly, the expanding the size of the second matrix of the second processing layer according to the second expansion rule includes:

[0141] According to the expanded size, the second matrix of the second processing layer is filled with second model parameters, so that the size of the second matrix of the second processing layer is expanded to the expanded size.

[0142] In an optional embodiment, the first model parameter is a preset parameter value, and the second model parameter is a random parameter value; or, the first model parameter is a random parameter value, and the second model parameter is a preset parameter value.

[0143] In an optional embodiment, the device further includes a training module configured to:

[0144] Determine a training data set corresponding to the target task model;

[0145] The target task model is trained according to the training data set.

[0146] In an optional embodiment, the training module is further configured to:

[0147] Inputting the training samples in the training data set into the target task model;

[0148] According to the first processing layer and the second processing layer, a linear transformation process is performed on the feature vector of the training sample to obtain a prediction result;

[0149] The target task model is trained according to the training labels in the training data set and the prediction results.

[0150] In an optional embodiment, the training sample is a text sample, and the training label is a correction result corresponding to the text sample.

[0151] An embodiment of the present specification determines the first processing layer and the second processing layer of the initial task model, and expands the first matrix size of the first processing layer and the second matrix size of the second processing layer, thereby achieving parameter expansion of the first processing layer and the second processing layer of the initial task model, without changing the number of network layers of the initial task model and the model parameters of other network layers, thereby reducing the computing resource consumption of the computing device, and can ensure that the output results of the obtained target task model and the initial task model are consistent, thereby ensuring the performance of the target task model. In subsequent training, only the changed part of the initial task model (i.e., the expanded part) can be trained, thereby reducing the model training cost and thereby reducing the computing resource consumption during model training.

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

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

[0154] Step 402: Determine information to be processed;

[0155] Step 404: input the information to be processed into a target task model, and perform linear transformation processing on a feature vector of the information to be processed according to a first processing layer and a second processing layer included in the target task model to obtain a prediction result;

[0156] Among them, the target task model is the target task model provided by the first aspect of the embodiment of this specification.

[0157] The information to be processed can be determined according to a specific data processing task, and the information to be processed may be, for example, text information, image information, etc.

[0158] Specifically, after obtaining the target task model according to the above-mentioned task model processing method, the information to be processed can be input into the target task model, and according to the first processing layer and the second processing layer included in the target task model, the feature vector of the information to be processed is linearly transformed to obtain a prediction result.

[0159] In specific implementation, the information to be processed can be input into the target task model. In the target task model, the feature vector (first dimension) of the information to be processed is extracted through the encoding layer of the target task model, and the feature vector of the information to be processed is linearly transformed through the first processing layer to obtain the feature vector after dimensionality increase (expanded dimension). The feature vector after dimensionality increase is linearly transformed through the second processing layer to obtain the feature vector after dimensionality reduction (first dimension), and the prediction result is obtained based on the feature vector after dimensionality reduction.

[0160] An embodiment of the present specification determines the first processing layer and the second processing layer of the initial task model, and expands the first matrix size of the first processing layer and the second matrix size of the second processing layer, thereby achieving parameter expansion of the first processing layer and the second processing layer of the initial task model, without changing the number of network layers of the initial task model and the model parameters of other network layers, thereby reducing the computing resource consumption of the computing device, and can ensure that the output results of the obtained target task model and the initial task model are consistent, thereby ensuring the performance of the target task model. In subsequent training, only the changed part of the initial task model (i.e., the expanded part) can be trained, thereby reducing the model training cost and thereby reducing the computing resource consumption during model training.

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

[0162] A determination module 502 is configured to determine information to be processed;

[0163] An input module 504 is configured to input the information to be processed into a target task model, and perform linear transformation processing on a feature vector of the information to be processed according to a first processing layer and a second processing layer included in the target task model to obtain a prediction result;

[0164] Among them, the target task model is the target task model provided by the first aspect of the embodiment of this specification.

[0165] An embodiment of the present specification determines the first processing layer and the second processing layer of the initial task model, and expands the first matrix size of the first processing layer and the second matrix size of the second processing layer, thereby achieving parameter expansion of the first processing layer and the second processing layer of the initial task model, without changing the number of network layers of the initial task model and the model parameters of other network layers, thereby reducing the computing resource consumption of the computing device, and can ensure that the output results of the obtained target task model and the initial task model are consistent, thereby ensuring the performance of the target task model. In subsequent training, only the changed part of the initial task model (i.e., the expanded part) can be trained, thereby reducing the model training cost and thereby reducing the computing resource consumption during model training.

[0166] The above is a schematic scheme of a task processing device of this embodiment. It should be noted that the technical scheme of the task processing device and the technical scheme of the above task processing method belong to the same concept, and the details of the technical scheme of the task processing device that are not described in detail can all be referred to the description of the technical scheme of the above task processing method.

[0167] See also Figure 6 , Figure 6 A flow chart of a method for correcting answers provided according to an embodiment of the present specification is shown, which specifically includes the following steps.

[0168] Step 602: Determine the answer text;

[0169] Step 604: input the answer text into the target task model, perform linear transformation processing on the feature vector of the answer text according to the first processing layer and the second processing layer included in the target task model, and obtain the correction result corresponding to the answer text;

[0170] Among them, the target task model is the target task model provided by the first aspect of the embodiment of this specification.

[0171] In an optional embodiment, the determining the answer text includes:

[0172] Receive the answer text sent by the client;

[0173] Correspondingly, after obtaining the correction result corresponding to the answer text, the method further includes:

[0174] The correction result is sent to the client and displayed through the display interface of the client.

[0175] Specifically, the answer text sent by the user through the client can be received, and the answer text can be input into the target task model. According to the first processing layer and the second processing layer included in the target task model, the feature vector of the answer text can be linearly transformed to obtain the correction result corresponding to the answer text, and the correction result can be sent to the client and displayed to the user through the client's display interface.

[0176] It can be understood that after the answer text is input into the target task model, the process of performing linear transformation processing on the feature vector of the answer text is similar to the aforementioned process of performing linear transformation processing on the feature vector of the information to be processed, and will not be repeated here.

[0177] In summary, the target task model after expanding the model parameters can be used to carry out learning data processing tasks and realize the correction of students' homework.

[0178] Corresponding to the above method embodiment, this specification also provides an answer correction device embodiment, Figure 7 FIG. 2 shows a schematic diagram of the structure of an answer correction device provided by an embodiment of the present specification. Figure 7 As shown, the device comprises:

[0179] A determination module 702, configured to determine an answer text;

[0180] An input module 704 is configured to input the answer text into a target task model, and perform a linear transformation process on a feature vector of the answer text according to a first processing layer and a second processing layer included in the target task model to obtain a correction result corresponding to the answer text;

[0181] Among them, the target task model is the target task model provided by the first aspect of the embodiment of this specification.

[0182] In an optional embodiment, the determining module 702 is further configured to:

[0183] Receive the answer text sent by the client;

[0184] Accordingly, the device further includes a sending module configured to:

[0185] The correction result is sent to the client and displayed through the display interface of the client.

[0186] In summary, the target task model after expanding the model parameters can be used to carry out learning data processing tasks and realize the correction of students' homework.

[0187] The above is a schematic scheme of an answer correction device of this embodiment. It should be noted that the technical scheme of the answer correction device and the technical scheme of the answer correction method described above are of the same concept, and the details not described in detail in the technical scheme of the answer correction device can be found in the description of the technical scheme of the answer correction method described above.

[0188] Figure 8 The block diagram of a computing device 800 according to an embodiment of the present specification is shown. The components of the computing device 800 include but are not limited to a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.

[0189] The computing device 800 also includes an access device 840 that enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0190] In one embodiment of the present application, the above components of the computing device 800 and Figure 8 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 8 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

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

[0192] The processor 820 is used to execute the following computer program / instructions, which implement the steps of the above method when executed by the processor.

[0193] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computing device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0194] An embodiment of the present specification further provides a computer-readable storage medium storing a computer program / instruction, which implements the steps of the above method when executed by a processor.

[0195] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the computer-readable storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0196] An embodiment of the present specification also provides a computer program product, including a computer program / instruction, which implements the steps of the above method when executed by a processor.

[0197] The above is a schematic solution of a computer program product of this embodiment. It should be noted that the technical solution of the computer program product and the technical solution of the above method belong to the same concept, and the details not described in detail in the technical solution of the computer program product can be referred to the description of the technical solution of the above method.

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

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

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

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

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

Claims

1. A task model processing method, characterized in that: include: Determining a first processing layer and a second processing layer of an initial task model, wherein the first processing layer is used to map a feature vector from a first dimension to a second dimension, and the second processing layer is used to map the feature vector from the second dimension to the first dimension, and the second dimension is larger than the first dimension; Expanding the size of the first matrix of the first processing layer according to a first expansion rule, and expanding the size of the second matrix of the second processing layer according to a second expansion rule, to obtain a target task model; The first expansion rule is to fill the model parameters of the first matrix of the first processing layer, and the second expansion rule is to fill the model parameters of the second matrix of the second processing layer. The model parameters filled in the first expansion rule and the second expansion rule are different.

2. The task model processing method according to claim 1, characterized in that: Before expanding the first matrix size of the first processing layer according to the first expansion rule, the method further includes: Determining an expansion dimension of the initial task model; The expansion dimension is determined as the expansion size corresponding to the initial task model.

3. The task model processing method according to claim 2, characterized in that: The step of expanding the size of the first matrix of the first processing layer according to the first expansion rule includes: According to the expanded size, filling the first model parameter on the first matrix of the first processing layer so that the size of the first matrix of the first processing layer is expanded to the expanded size; Correspondingly, the expanding the size of the second matrix of the second processing layer according to the second expansion rule includes: According to the expanded size, the second matrix of the second processing layer is filled with second model parameters, so that the size of the second matrix of the second processing layer is expanded to the expanded size.

4. The task model processing method according to claim 3, characterized in that: The first model parameter is a preset parameter value, and the second model parameter is a random parameter value; or, the first model parameter is a random parameter value, and the second model parameter is a preset parameter value.

5. The task model processing method according to claim 1, characterized in that: After obtaining the target task model, the method further includes: Determine a training data set corresponding to the target task model; The target task model is trained according to the training data set.

6. The task model processing method according to claim 5, characterized in that: The step of training the target task model according to the training data set includes: Inputting the training samples in the training data set into the target task model; According to the first processing layer and the second processing layer, a linear transformation process is performed on the feature vector of the training sample to obtain a prediction result; The target task model is trained according to the training labels in the training data set and the prediction results.

7. The task model processing method according to claim 6, characterized in that: The training sample is a text sample, and the training label is a correction result corresponding to the text sample.

8. A task processing method, characterized in that: include: Identify the information to be processed; Inputting the information to be processed into a target task model, and performing linear transformation processing on a feature vector of the information to be processed according to a first processing layer and a second processing layer included in the target task model to obtain a prediction result; Wherein, the target task model is the target task model described in claim 1.

9. A method for correcting answers, characterized in that: include: Determine the answer text; Inputting the answer text into the target task model, performing linear transformation processing on the feature vector of the answer text according to the first processing layer and the second processing layer included in the target task model, and obtaining the correction result corresponding to the answer text; Wherein, the target task model is the target task model described in claim 1.

10. The answer correction method according to claim 9, characterized in that: The determined answer text includes: Receive the answer text sent by the client; Correspondingly, after obtaining the correction result corresponding to the answer text, the method further includes: The correction result is sent to the client and displayed through the display interface of the client.

11. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the method described in any one of claims 1 to 10 are implemented.

12. A computer-readable storage medium, characterized in that: It stores a computer program / instruction, which implements the steps of the method described in any one of claims 1 to 10 when executed by a processor.

13. A computer program product, characterized in that The invention comprises a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 10.