Deep learning model performance grading method and grading model using method
By constructing a heavy -dwelling key matrix and fine -tuning training for deep learning models, and generating grading models, the problem of unable to classify the performance of deep learning models in existing technologies can be solved, and the effect of providing personalized services according to user needs.
Patent Information
- Application Number
- CN202411612396.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-01-28
AI Technical Summary
The existing technology cannot effectively regulate the inference performance of deep learning models in a hierarchical manner, resulting in artificial intelligence companies that can only provide a single model inference service and cannot provide personalized services based on user needs and payment capabilities.
By constructing a heavy key matrix with different degrees of heavy arrangement, a fine -tuning training for deep learning models is performed, and a hierarchical model containing multiple sub -models containing multiple different levels of rehearsal levels is generated. The user encodes and processes the input data through a specific redemption key matrix, and accesss the corresponding sub -model to generate outputs with specific performance grades.
The performance grading and control of deep learning models can be realized, and can provide different performance -level model services according to the needs of users and payment capabilities, which can improve the personalization and efficiency of the service.
Smart Images

Figure CN119378604A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence, and specifically relates to a deep learning model performance grading method and a grading model use method. Background Art
[0002] In recent years, with the popularity of large-scale pre-trained models and the booming development of large language models, the application of large deep learning models has become increasingly rich. However, the inference cost of large language models is expensive and requires the support of large high-performance computing servers. The construction and maintenance of servers require expensive economic costs and technical support from experts, which makes "AI as a service" the mainstream paradigm. AI companies train models, maintain servers, and provide large model inference services; users pay AI companies to enjoy large model inference services.
[0003] However, due to the lack of research on algorithms for hierarchical regulation of deep learning model performance, coupled with the high cost of hundreds of millions for training a large model, AI companies can only launch a single model inference service and cannot personalize model services based on users. Users have different needs for large models and are willing to pay different amounts for services. However, due to the lack of research on algorithms for hierarchical regulation of deep learning model performance, AI companies do not have any technology to release different levels of performance of existing models to users of different levels. The current practice of related companies is to train or distill a smaller model while training a model to meet the needs of users who do not need high-performance models. The cost of training a model is often very high, time-consuming and labor-intensive, and only three or two levels of grading can be achieved in this way, which is far from personalized hierarchical regulation of model performance. For example, OpenAI currently only runs GPT-4o, GPT-4o mini, GPT-4 and GPT-o1 models in parallel, and only divides them into free users, plus paid users and team paid users, charging according to different usage amounts, and there are only two levels of API charges accordingly; ByteDance Volcano Engine currently runs 4 Doubao-pro models with different context lengths and 3 Doubao-lite models with different context lengths in parallel, and charges them in different levels according to the context length.
[0004] Therefore, how to hierarchically regulate the reasoning performance of the model in the black-box model reasoning service scenario and then generate a hierarchical model is an urgent problem that needs to be solved. Summary of the invention
[0005] The present invention is made to solve the above-mentioned problems, and its purpose is to provide a deep learning model performance grading method and a method for using the graded model.
[0006] The present invention provides a deep learning model performance grading method, which is used to generate a graded model according to a deep learning model, and has the following characteristics, including the following steps: step S1, constructing multiple rearrangement key matrices corresponding to different column rearrangement degrees; step S2, selecting a batch of training data from an existing training data set and inputting them into the deep learning model; step S3, for each training data, randomly selecting a rearrangement key matrix from all rearrangement key matrices as the corresponding rearrangement matrix; step S4, for each training data, obtaining the corresponding rearrangement word unit matrix according to the word unit matrix after the training data is encoded by the deep learning model and the corresponding column rearrangement matrix; step S5, for each training data, processing the corresponding rearrangement word unit matrix through the network backbone of the deep learning model to obtain the corresponding output word unit matrix; step S6, for each training data, obtaining the corresponding final output according to the corresponding output word unit matrix and the column rearrangement matrix; step S7, calculating the loss according to all the final outputs, and optimizing the deep learning model according to the loss result; step S8, repeatedly executing steps S2 to S7 until the deep learning model converges, and then using the optimized deep learning model as the graded model.
[0007] The deep learning model performance grading method provided by the present invention may also have the following features: wherein the grading model generates corresponding outputs of different performance levels based on the input, the degree of rearrangement of each rearrangement key matrix corresponds to a different performance level, and the smaller the degree of rearrangement of the rearrangement key matrix, the higher the corresponding performance level.
[0008] The deep learning model performance grading method provided by the present invention may also have the following feature: wherein, in step S1, the rearrangement order in the rearrangement key matrix is generated by a specified rule or randomly generated, and the specified rule includes an RSA encryption rule.
[0009] The deep learning model performance grading method provided by the present invention may also have the following features: wherein, in step S4, the word unit matrix is right-multiplied by the corresponding column rearrangement matrix for matrix multiplication to obtain the corresponding rearranged word unit matrix; and in step S6, the output word unit matrix is right-multiplied by the transpose of the corresponding transposed column rearrangement matrix for matrix multiplication to obtain the corresponding final output.
[0010] The present invention provides a method for using a hierarchical model, which is used to generate output data with a specific performance level corresponding to input data according to any one of the above-mentioned hierarchical models and a rearrangement key matrix, and has the following characteristics, including the following steps: Step T1, encoding the input data according to the hierarchical model to generate a corresponding encoding word unit matrix; Step T2, performing matrix multiplication on the encoding word unit matrix and the rearrangement key matrix corresponding to the specific performance level to obtain a rearranged encoding word unit matrix; Step T3, processing the rearranged encoding word unit matrix through the network backbone of the hierarchical model to generate a backbone output; Step T4, performing matrix multiplication on the backbone output and the transpose of the rearrangement key matrix corresponding to the specific performance level to obtain output data with a specific performance level.
[0011] Functions and Effects of the Invention
[0012] According to the deep learning model performance grading method and the method for using the graded model involved in the present invention, because, on the one hand, in the fine-tuning training stage, by rearranging the training data to different degrees, the trained graded model contains multiple sub-models with different rearrangement levels; on the other hand, in the application stage, the encoding word unit matrix of the input data is rearranged through the rearrangement key matrix of a specific rearrangement level to access the corresponding sub-model in the graded model, and then the output of the sub-model is reversely rearranged to obtain an output with the performance corresponding to the rearrangement level. Therefore, the deep learning model performance grading method and the method for using the graded model of the present invention can grade and regulate the reasoning performance of the model used by the user. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a schematic flow chart of a deep learning model performance grading method in an embodiment of the present invention;
[0014] Figure 2 is a flow chart of a method for using a hierarchical model in an embodiment of the present invention;
[0015] Figure 3 It is a schematic diagram of the principle of the method for using the hierarchical model in an embodiment of the present invention. DETAILED DESCRIPTION
[0016] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the following embodiments and the accompanying drawings specifically illustrate the deep learning model performance grading method and the grading model use method of the present invention.
[0017] In this embodiment, a deep learning model performance grading method is provided, which is used to generate a grading model according to a deep learning model. The deep learning model is a black box model, such as OpenAI's ChatGPT. In this embodiment, the grading model can generate corresponding outputs of different performance levels according to the input, that is, for the same input, the outputs with the same performance level are generated, and each input corresponds to a performance level. For example, if the performance level of the deep learning model is 100%, corresponding outputs of different performance levels such as 99%, 95%, and 90% can be generated.
[0018] In this embodiment, a hierarchical model is generated according to a deep learning model through a rearrangement method. The principle of the rearrangement method is as follows:
[0019] For a pre-trained deep learning model, the parameters of the deep learning model are rearranged, which will be disturbed and thus cannot inherit all the performance of the original model. The smaller the degree of rearrangement, the smaller the disturbance, and the closer the performance of the rearranged model is to the performance of the original model. That is, rearranging the deep learning model to different degrees can obtain rearranged models with different performance levels.
[0020] Furthermore, training a model by rearranging word units is equivalent to training a rearranged model with normal word units, that is, for a deep learning model that is a black box model, the deep learning model can be fine-tuned by rearranging word units, thereby obtaining a corresponding trained rearranged model. In the fine-tuning training of the deep learning model, word units with different rearrangement degrees are used for integrated training, so that a model with different rearrangement degrees, that is, a hierarchical model containing multiple sub-models, can be generated.
[0021] The specific process of constructing a hierarchical model according to the above rearrangement method is described below in conjunction with the accompanying drawings.
[0022] Figure 1 It is a flowchart of a deep learning model performance grading method in an embodiment of the present invention.
[0023] like Figure 1 As shown, the deep learning model performance grading method includes the following steps:
[0024] Step S1, constructing a plurality of rearrangement key matrices corresponding to different column rearrangement degrees.
[0025] Among them, the degree of rearrangement of each rearrangement key matrix corresponds to a different performance level. The smaller the degree of rearrangement of the columns of the rearrangement key matrix, the higher the corresponding performance level. For example, in the Base size Transformer, 13 levels can be naturally set up, level 0 does not rearrange, level 1 rearranges one head of the multi-head attention, level 2 rearranges two heads... forming 13 levels. The larger the level, the more elements are rearranged, and the worse the performance of the corresponding rearranged model. That is, the corresponding parameters can be selected for rearrangement according to the specific parameter structure of the model, thereby controlling the degree and effect of the rearrangement.
[0026] The rearrangement order in the rearrangement key matrix is generated by a specified rule or randomly generated, and the specified rule includes an RSA encryption rule. For example, the rearrangement key matrix A is used to rearrange the first three elements a, b, and c in the word unit {a, b, c, d, e}. Then, by right-multiplying the randomly generated rearrangement key matrix A, the word unit can be rearranged into different situations such as {b, c, a, d, e} or {c, a, b, d, e}. The rearrangement key matrix A generated by the specified rule rearranges the order of the word units a, b, and c in the specified order.
[0027] Step S2, select a batch of training data from the existing training data set and input it into the deep learning model. In this embodiment, the existing training data set is a training data set corresponding to the downstream task, which is used to fine-tune the deep learning model to adapt to the downstream task.
[0028] Step S3: for each training data, randomly select a rearrangement key matrix from all rearrangement key matrices as the corresponding column rearrangement matrix. i ∈R seq×dim , then the column rearrangement matrix P i The size is R dim×dim , where seq is the sequence length and dim is the parameter dimension.
[0029] Step S4, for each training data, obtain a corresponding rearranged word unit matrix according to the word unit matrix after the training data is encoded by the deep learning model and the corresponding column rearrangement matrix.
[0030] The word unit matrix is right-multiplied by the corresponding column rearrangement matrix to obtain the corresponding rearranged word unit matrix.
[0031] Step S5: for each training data, the corresponding rearranged word-unit matrix is processed through the network backbone of the deep learning model to obtain the corresponding output word-unit matrix.
[0032] Step S6: for each training data, obtain the corresponding output according to the corresponding output word-unit matrix and the column rearrangement matrix.
[0033] Among them, the output word unit matrix is multiplied by the corresponding transposed column rearrangement matrix to obtain the corresponding final output, that is, the output O for a certain training data i ∈R seq×dim and the column rearrangement matrix P i The corresponding final output is
[0034] Step S7, calculate the loss based on all final outputs, and optimize the deep learning model based on the loss results.
[0035] Step S8, repeat steps S2 to S7 until the deep learning model converges, and then use the optimized deep learning model as the hierarchical model.
[0036] In this embodiment, since the hierarchical model includes training results of different rearrangement degrees, i.e., sub-models, it needs to be used in conjunction with a specific rearrangement key matrix to generate the rearrangement effect corresponding to the rearrangement key matrix, i.e., an output with a specific performance level. The following is an explanation of the use of the hierarchical model in conjunction with the accompanying drawings.
[0037] Figure 2 It is a flowchart of a method for using a hierarchical model in an embodiment of the present invention.
[0038] Figure 3 It is a schematic diagram of the principle of the method for using the hierarchical model in an embodiment of the present invention.
[0039] like Figure 2 and Figure 3 As shown, the method for using the hierarchical model is used to generate output data with a specific performance level corresponding to the input data according to the hierarchical model and the rearrangement key matrix, including the following steps:
[0040] Step T1, encoding the input data according to the hierarchical model to generate a corresponding encoding word unit matrix. In this embodiment, the input data is encoded via the initial encoding layer to obtain the encoding word unit matrix, i.e., tokens.
[0041] Step T2: Rearrange the key matrix P corresponding to the encoding word matrix and the specific performance level i Perform matrix multiplication to obtain the rearranged encoded word unit matrix.
[0042] Step T3, processing the rearranged encoded word-unit matrix through the network backbone of the hierarchical model, i.e., the model backbone, to generate a backbone output.
[0043] Step T4, the trunk output is the transposition of the rearrangement key matrix corresponding to the specific performance level Matrix multiplication is performed to obtain output data with a specific performance level, namely, the graded model output.
[0044] In this embodiment, the customer purchases a re-arrangement key matrix of a corresponding level and a generation model in the black box mode. When the customer needs to improve the performance level, the service provider provides a re-arrangement key matrix of a corresponding level based on the customer's actual purchase results, so that the customer does not need to re-install the generation model, and can obtain the corresponding performance output based on the original generation model.
[0045] Functions and Effects of the Embodiments
[0046] According to the deep learning model performance grading method and the method for using the graded model involved in this embodiment, on the one hand, in the fine-tuning training stage, by rearranging the training data to different degrees, the trained graded model contains multiple sub-models with different rearrangement levels; on the other hand, in the application stage, the encoding word unit matrix of the input data is rearranged through the rearrangement key matrix of a specific rearrangement level to access the corresponding sub-model in the graded model, and then the output of the sub-model is reversely rearranged to obtain an output with the performance corresponding to the rearrangement level. In short, this method can grade and regulate the inference performance of the model used by the user.
[0047] Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A deep learning model performance grading method for generating a grading model based on a deep learning model, characterized in that: The following steps are involved: Step S1, constructing a plurality of rearrangement key matrices corresponding to different column rearrangement degrees; Step S2, selecting a batch of training data from an existing training data set and inputting it into the deep learning model; Step S3, for each of the training data, randomly selecting one of the rearrangement key matrices from all the rearrangement key matrices as the corresponding column rearrangement matrix; Step S4, for each of the training data, obtaining a corresponding rearranged word-unit matrix according to the word-unit matrix after the training data is encoded by the deep learning model and the corresponding column rearrangement matrix; Step S5, for each of the training data, the corresponding rearranged word-unit matrix is processed through the network backbone of the deep learning model to obtain a corresponding output word-unit matrix; Step S6, for each of the training data, obtaining a corresponding final output according to the corresponding output word-unit matrix and the column rearrangement matrix; Step S7, calculating the loss according to all the final outputs, and optimizing the deep learning model according to the loss result; Step S8, repeatedly executing steps S2 to S7 until the deep learning model converges, and then using the optimized deep learning model as the hierarchical model.
2. The deep learning model performance grading method according to claim 1, characterized in that: in, The hierarchical model generates corresponding outputs of different performance levels according to the input, The degree of rearrangement of each of the rearrangement key matrices corresponds to a different performance level, The smaller the degree of rearrangement of the rearrangement key matrix, the higher the corresponding performance level.
3. The deep learning model performance grading method according to claim 1, characterized in that: in, In step S1, the rearrangement order in the rearrangement key matrix is generated by a specified rule or randomly. The specified rules include RSA encryption rules.
4. The deep learning model performance grading method according to claim 1, characterized in that: in, In step S4, the word unit matrix is right-multiplied by the corresponding column rearrangement matrix to obtain the corresponding rearranged word unit matrix. In the step S6, the output word unit matrix is right-multiplied by the corresponding transposed column rearrangement matrix to perform matrix multiplication to obtain the corresponding final output.
5. A method for using a hierarchical model, for generating output data with a specific performance level corresponding to input data according to the hierarchical model and the rearrangement key matrix according to any one of claims 1 to 4, characterized in that: The following steps are involved: Step T1, encoding the input data according to the hierarchical model to generate a corresponding encoding word-unit matrix; Step T2, performing matrix multiplication on the coding word unit matrix and the rearrangement key matrix corresponding to the specific performance level to obtain a rearrangement coding word unit matrix; Step T3, processing the rearranged coded word-element matrix through the network backbone of the hierarchical model to generate a backbone output; Step T4, performing matrix multiplication on the trunk output and the transpose of the rearranged key matrix corresponding to the specific performance level to obtain the output data with the specific performance level.