Model multiplexing method and related device

By filtering and adjusting model specifications in the learning materials library, and combining shrinkage and expansion techniques, the problem of model reuse for unstructured tabular data was solved, achieving efficient and accurate model adaptation and task completion.

CN119512535APending Publication Date: 2025-02-25HUAWEI TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311075747.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-24
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Existing model reuse techniques are difficult to apply to unstructured tabular data, and it is difficult to select a suitable model and obtain training data during the model reuse process, resulting in wasted resources and low efficiency.

Method used

By selecting the first reusable model that matches the target dataset from the learning materials library, using model reduction for fast matching, and combining shrinking and expanding adjustments, a target reusable model suitable for the target dataset is obtained.

Benefits of technology

It enables efficient model reuse of unstructured tabular data, reduces resource consumption and training data volume, and improves model reuse performance and task accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512535A_ABST
    Figure CN119512535A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a model multiplexing method and a related device.The model multiplexing method comprises the steps that a first multiplexing model matched with a target data set is determined from a learning item library, the learning item library comprises a plurality of learning items, and each learning item comprises a multiplexing model and a model specification; the first multiplexing model is a multiplexing model included in one learning item in a learning item library, the target data set comprises multiple pieces of target data, and the multiple pieces of target data belong to table type data; performing contraction adjustment on the first multiplexing model based on the target data set to obtain a second multiplexing model; performing model expansion based on the target data set and the second multiplexing model to obtain a third multiplexing model; and integrating the second multiplexing model and the third multiplexing model to obtain a target multiplexing model corresponding to the target data set. By implementing the embodiment of the invention, the model multiplexing can be efficiently performed on the unstructured table data through a small amount of data, and the resource consumption is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model reuse method and related devices. Background Art

[0002] With the continuous advancement of technology, artificial intelligence technology has also gradually developed. At present, machine learning technology has achieved great success, but to learn a high-quality model, it is often necessary to use a large amount of labeled high-quality data for training, and the training process consumes a lot of resources and time. When the target task changes slightly, the model needs to be retrained, resulting in a lot of duplication of work and waste of resources. Therefore, people are studying how to reuse the trained models for different target tasks without starting from scratch, thereby saving a lot of time and resource consumption, and reducing the amount of data used.

[0003] However, existing model reuse technologies are mainly targeted at structured data, such as images and text, and are difficult to apply to unstructured tabular data. Moreover, existing model reuse technologies often require the initial training data of the model when reusing, which is difficult to obtain when the model is reused, greatly increasing the difficulty of model reuse.

[0004] Therefore, how to achieve simple and efficient model reuse for unstructured tabular data is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The embodiments of the present application provide a model reuse method and related devices to achieve efficient model reuse of unstructured tabular data through a small amount of data, thereby reducing resource consumption.

[0006] In a first aspect, an embodiment of the present application provides a model reuse method, comprising determining a first reuse model that matches a target data set from a learning library, the learning library comprising multiple reuse models, the first reuse model being one of the multiple reuse models, and the target data set comprising multiple target data, and the multiple target data being tabular data; shrinking and adjusting the first reuse model based on the target data set to obtain a second reuse model; expanding the model based on the target data set and the second reuse model to obtain a third reuse model; integrating the second reuse model and the third reuse model to obtain a target reuse model corresponding to the target data set.

[0007] The model reuse method in the prior art is not suitable for unstructured tabular data, and the difficulty of model reuse is relatively high. In this regard, the embodiment of the present application provides a model reuse method, which can simply and efficiently reuse the model for unstructured tabular data. Specifically, first, a first reuse model matching the target data set is determined from multiple reuse models in the learning library. The first reuse model selected is the most suitable reusable model for processing the task corresponding to the target data set in the learning library. The target data set includes multiple target data, and the multiple target data belong to tabular data. Then, the user can directly use the first reuse model searched from the learning library or continue to train or adjust on the target data set, so that the user does not have to collect a large amount of data to train the model from scratch, which greatly saves computing power and the amount of data used for training. When the first reuse model needs to be further adjusted, the first reuse model is simply adjusted and trained based on the target data set to obtain the target reuse model corresponding to the target data set. The target reuse model can perform reasoning or decision-making on the target data set to complete the task corresponding to the target data set. For example: statistics or classification of tabular data can be performed. In addition, in the process of adjusting the first reuse model, the embodiment of the present application first shrinks the first reuse model based on the target data set to obtain the second reuse model; then, based on the target data set and the second reuse model, the model is expanded, such as incremental learning, to obtain the third reuse model; finally, the shrunken second reuse model and the expanded third reuse model are integrated to obtain the above-mentioned target reuse model. Compared with other adjustment methods, this model adjustment method of shrinking first and then expanding can provide a hot start when the user has only a small amount of data, reducing the demand for the amount of target data in the target data set. The target reuse model adjusted in this way is more generally applicable to the target data set, which can improve the model reuse performance and the accuracy of completing the task.

[0008] In a possible implementation, the learning component library includes multiple learning components, each of which includes a reuse model and a model specification corresponding to the reuse model, the model specification includes a model parameter vector and text information corresponding to the reuse model, and the text information is used to indicate one or more of the model task, model input, model output, and model operating environment of the corresponding reuse model; determining the first reuse model matching the target data set from the learning component library includes: based on the target specification corresponding to the target data set, determining the first reuse model matching the target data set from the learning component library, the model specification corresponding to the first reuse model is most similar to the target specification; wherein the target specification includes a model parameter vector and target text information corresponding to a trained preset training model, the target text information is used to indicate the target task information of the target data set, and the trained preset training model is a model obtained after a preset linear model is trained based on the target data set.

[0009] Existing model reuse technology usually assumes that the reuse model is given. However, although there are a large number of models in real tasks, it is often difficult to know which models are helpful for the current task. If the models are inferred and tried one by one, it will cause a lot of resource consumption. In this regard, in the embodiment of the present application, when the user needs it, the first reuse model that matches the target data set can be directly screened out from the learning library through the model specification, avoiding the need to infer each reuse model in the learning library one by one, which greatly saves computing resources. For example: the target specification corresponding to the target data set can be used to determine the model specification that best matches it among the model specifications of all the learning materials in the learning library, and then determine that the reuse model corresponding to the best matching model specification is the first reuse model. Moreover, the model specification includes the model parameter vector and text information corresponding to the reuse model, which can better indicate the functional characteristics of the reuse model, and can make the selected reuse model better match the target task corresponding to the target data set, thereby improving the reuse performance of the reuse model, improving the accuracy, and saving computing power and data volume.

[0010] In a possible implementation, the first reuse model matching the target data set is determined from the learning library based on the target specification corresponding to the target data set, including: matching the target specification with the model specifications of all reuse models in the learning library respectively, and determining the cosine similarity between each of the model specifications and the target specification; based on the cosine similarity between each of the model specifications and the target specification, determining that the reuse model corresponding to the model specification with the highest cosine similarity with the target specification is the first reuse model.

[0011] In an embodiment of the present application, the cosine similarity between the target specification and each model specification is calculated, and the reuse model corresponding to the model specification with the highest cosine similarity to the target specification is the first reuse model. The cosine similarity can quickly and accurately locate the model specification most similar to the target specification from a large number of model specifications, and then determine the first reuse model that is most suitable for the target data set, which significantly improves the efficiency of model reuse.

[0012] In a possible implementation, the method further includes: determining the model specification corresponding to each of the reused models in the learning library based on a preset training model and a preset training data set corresponding to each of the reused models, wherein the preset training model includes a preset proxy model and the preset linear model.

[0013] In the embodiment of the present application, each reused model needs to pass the model specification corresponding to the preset training model determiner, so that the user can quickly filter out the first reused model required by the target data set from multiple reused models. In addition, both the target specification and the model specification are determined by the same preset linear model, which can greatly improve the matching accuracy and improve the model reuse efficiency.

[0014] In a possible implementation, the model specification corresponding to each of the reused models in the learning library is determined based on the preset training model and the preset training data set corresponding to each of the reused models, including: performing prediction on the preset training data set corresponding to each of the reused models based on the preset proxy model to obtain a training prediction result corresponding to each of the reused models, wherein the training prediction result includes pseudo-label information corresponding to the preset training data set; performing fitting training on the preset linear model based on the training prediction result corresponding to each of the reused models to obtain a trained preset linear model corresponding to each of the reused models; and determining the model specification corresponding to the reused model based on the model parameter vector corresponding to the trained preset linear model.

[0015] In an embodiment of the present application, a model specification construction method based on functional approximation of a secondary learning model is used, so that the model specification of a determined reused model can accurately indicate the functional characteristics of the corresponding reused model, and can better characterize the characteristics of the corresponding reused model, so that users can quickly and accurately filter out the model specification that is most similar to the target specification from a large number of model specifications, and then quickly locate the first reused model, avoiding the selection of reused models based on one-by-one matching of the target data set, and significantly improving the efficiency of model reuse.

[0016] In a possible implementation, the first reuse model is contracted and adjusted based on the target data set to obtain the second reuse model, including: performing multiple predictions on the target data set based on the first reuse model to obtain a first prediction result, the first prediction result including prediction values ​​corresponding to the multiple target data each time, wherein the first reuse model includes T subtrees, N subtrees of the T subtrees are used for each prediction, and the number of subtrees N used for each prediction is different, and T and N are both positive integers; the first reuse model is contracted and adjusted based on the first prediction result to obtain the second reuse model.

[0017] In an embodiment of the present application, after searching for a reusable first reuse model based on the specification, multiple rounds of inference and prediction are performed on the target data set through the first reuse model, so that the structure of the first reuse model is contracted and adjusted according to the results of the multiple rounds of prediction to obtain a second reuse model, which can be more suitable for the target data set.

[0018] In a possible implementation, each of the target data corresponds to label information, and the first reuse model is contracted and adjusted based on the first prediction result to obtain the second reuse model, including: determining the loss vector corresponding to each prediction based on the first prediction result and the label information corresponding to each of the target data, the loss vector is used to indicate the loss value corresponding to the multiple target data at the time of the corresponding prediction; determining the number of subtrees included in the first reuse model corresponding to the K predictions with the smallest loss vector from the loss vectors corresponding to the multiple predictions, where K is a positive integer; performing multiple contraction adjustments on the first reuse model according to the number of subtrees included in the first reuse model corresponding to the K predictions with the smallest loss value to obtain K sub-models; and determining the second reuse model based on the K sub-models.

[0019] In an embodiment of the present application, based on the first prediction result, the loss vectors of the first reuse model on the target data set under multiple rounds of prediction are calculated respectively, and the K predictions with the smallest loss vectors and the number of subtrees included in the K predicted first reuse model are determined, so as to retain the K sub-models corresponding to the K predictions with the smallest loss vectors, and then obtain the corresponding contraction model, that is, the second reuse model, which includes the above-mentioned K sub-models.

[0020] In a possible implementation, each of the target data has corresponding label information, and the model is expanded based on the target data set and the second reuse model to obtain a third reuse model, including: making a prediction on the target data set based on the second reuse model to obtain a second prediction result, the second prediction result including a prediction value corresponding to each of the target data; determining the residual information corresponding to the second reuse model based on the second prediction result and the label information corresponding to each of the target data; and expanding the model based on the target data set and the residual information to obtain the third reuse model.

[0021] In the embodiment of the present application, the second reuse model after shrinkage adjustment can be further expanded based on the target data set, and the residual between the predicted label information and the real label information corresponding to the target data set is used to expand the model to obtain a third reuse model, so that the adjusted third reuse model is adapted to the target data set. Moreover, using the residual information to expand the model can make the learned model more accurate and have better reuse performance.

[0022] In a possible implementation, the preset training data set corresponding to the first reuse model is not associated with the target data set.

[0023] In an embodiment of the present application, multiple reuse models in the learning library are all trained models, and the models can be reused directly or after a small amount of data adjustment. Therefore, there is no correlation between the preset training data set corresponding to the first reuse model and the target data set, for example: they are different data for similar tasks or the data sources are different.

[0024] In the second aspect, an embodiment of the present application provides a model reuse device, including: a matching unit, used to determine a first reuse model that matches a target data set from a learning library, the learning library including multiple reuse models, the first reuse model is one of the multiple reuse models, and the target data set includes multiple target data, and the multiple target data are tabular data; a contraction unit, used to shrink and adjust the first reuse model based on the target data set to obtain a second reuse model; an expansion unit, used to expand the model based on the target data set and the second reuse model to obtain a third reuse model; an integration unit, used to integrate the second reuse model and the third reuse model to obtain a target reuse model corresponding to the target data set.

[0025] In one possible implementation, the learning component library includes multiple learning components, each of which includes a reuse model and a model specification corresponding to the reuse model, the model specification includes a model parameter vector and text information corresponding to the reuse model, and the text information is used to indicate one or more of the model task, model input, model output, and model operating environment of the corresponding reuse model; the matching unit is specifically used to: based on the target specification corresponding to the target data set, determine the first reuse model that matches the target data set from the learning component library, and the model specification corresponding to the first reuse model is most similar to the target specification; wherein the target specification includes a model parameter vector and target text information corresponding to a trained preset training model, and the target text information is used to indicate the target task information of the target data set, and the trained preset training model is a model obtained after a preset linear model is trained based on the target data set.

[0026] In a possible implementation, the matching unit is specifically used to: match the target specification with the model specifications of all reuse models in the learning material library respectively, and determine the cosine similarity between each of the model specifications and the target specification; based on the cosine similarity between each of the model specifications and the target specification, determine that the reuse model corresponding to the model specification with the highest cosine similarity between the target specifications is the first reuse model.

[0027] In a possible implementation, the device also includes: a reduction unit, which is used to determine the model specification corresponding to each of the reused models in the learning library based on a preset training model and a preset training data set corresponding to each of the reused models, wherein the preset training model includes a preset proxy model and the preset linear model.

[0028] In one possible implementation, the reduction unit is specifically used to: perform prediction on the preset training data set corresponding to each of the reused models based on the preset proxy model to obtain a training prediction result corresponding to each of the reused models, wherein the training prediction result includes pseudo-label information corresponding to the preset training data set; perform fitting training on the preset linear model based on the training prediction result corresponding to each of the reused models to obtain a trained preset linear model corresponding to each of the reused models; and determine the model reduction corresponding to the reused model based on the model parameter vector corresponding to the trained preset linear model.

[0029] In one possible implementation, the shrinkage unit is specifically used to: perform multiple predictions on the target data set based on the first reuse model to obtain a first prediction result, the first prediction result including prediction values ​​corresponding to the multiple target data respectively predicted each time, wherein the first reuse model includes T subtrees, and N subtrees of the T subtrees are used for each prediction, and the number of subtrees N used for each prediction is different, and T and N are both positive integers; shrink and adjust the first reuse model based on the first prediction result to obtain the second reuse model.

[0030] In a possible implementation, each of the target data corresponds to label information; the shrinking unit is specifically used to: determine the loss vector corresponding to each prediction based on the first prediction result and the label information corresponding to each of the target data, and the loss vector is used to indicate the loss value corresponding to the multiple target data during the corresponding prediction; determine the number of subtrees included in the first reuse model corresponding to the K predictions with the smallest loss vector from the loss vectors corresponding to the multiple predictions, and K is a positive integer; perform multiple shrinkage adjustments on the first reuse model according to the number of subtrees included in the first reuse model corresponding to the K predictions with the smallest loss value to obtain K sub-models; and determine the second reuse model based on the K sub-models.

[0031] In a possible implementation, each of the target data corresponds to label information, and the expansion unit is specifically used to: perform prediction on the target data set based on the second reuse model to obtain a second prediction result, wherein the second prediction result includes a prediction value corresponding to each of the target data; determine the residual information corresponding to the second reuse model based on the second prediction result and the label information corresponding to each of the target data; perform model expansion based on the target data set and the residual information to obtain the third reuse model.

[0032] In a third aspect, an embodiment of the present application provides a computer-readable storage medium for storing computer software instructions used for a model reuse device provided in the second aspect, which includes a program for executing a model reuse method provided in the first aspect.

[0033] In a fourth aspect, an embodiment of the present application provides a computer program, which includes instructions. When the computer program is executed by a computer, the computer can execute the process executed by a model reuse device provided in the second aspect above.

[0034] It should be understood that the model reuse device provided in the second aspect of this application, the computer-readable storage medium provided in the third aspect, and the computer program provided in the fourth aspect are consistent with the technical solution of the first aspect of this application. Their specific contents and beneficial effects can be referred to the model reuse method provided in the above-mentioned first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0036] Figure 1 It is a schematic diagram of a model reuse system architecture provided in an embodiment of the present application.

[0037] Figure 2 This is another model reuse system architecture provided in an embodiment of the present application.

[0038] Figure 3 It is a flow chart of a model reuse method provided in an embodiment of the present application.

[0039] Figure 4 It is a schematic diagram of a scenario for searching a first multiplexing model provided in an embodiment of the present application.

[0040] Figure 5 It is a flowchart of a construction model specification provided in an embodiment of the present application.

[0041] Figure 6It is a flow chart of a multiplexing model shrinkage adjustment provided in an embodiment of the present application.

[0042] Figure 7 A schematic diagram of a reuse model adjustment scenario provided in an embodiment of the present application.

[0043] Figure 8 It is a structural schematic diagram of a model reuse device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0045] The terms "first", "second", "third", etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0046] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0047] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0048] The terms "component", "module", "system", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program and / or a computer. By way of illustration, both applications running on a computing device and a computing device can be components. One or more components may reside in a process and / or an execution thread, and a component may be located on a computer and / or distributed between two or more computers. In addition, these components may be executed from various computer-readable media having various data structures stored thereon. Components may, for example, communicate through local and / or remote processes according to signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system and / or a network, such as the Internet interacting with other systems through signals).

[0049] First of all, in order to facilitate understanding of the embodiments of the present application, the technical problems that need to be solved by the embodiments of the present application and the applicable application scenarios are analyzed in detail below.

[0050] With the continuous advancement of technology, artificial intelligence technology has also gradually developed. At present, machine learning technology has achieved great success, but to learn a high-quality model, it is often necessary to use a large amount of labeled high-quality data for training, and the training process consumes a lot of resources and time. When the target task changes slightly, the model needs to be retrained, resulting in a lot of duplication of work and waste of resources. Therefore, people are studying how to reuse the trained models for different target tasks without starting from scratch, thereby saving a lot of time and resource consumption, and reducing the amount of data used.

[0051] Existing model reuse solutions generally determine the initial reusable model based on the distribution of the input data of the target task. For structured data such as images and texts, the determined reusable model (usually a deep neural network) is fine-tuned and adapted to the target task. Representative methods of fine-tuning include fine-tuning and knowledge distillation. For unstructured tabular data, there are some transfer learning technologies related to model reuse, such as the iterative algorithm TradaBoost.

[0052] However, the existing model reuse methods have the following disadvantages:

[0053] 1. Unstructured data models are difficult to reuse: Existing relatively mature model reuse technologies are mainly targeted at structured data, such as images and text, and are difficult to apply to unstructured tabular data. In terms of unstructured tabular data, since the iterative algorithm TradaBoost needs to use new data to assist old data (i.e., training data), in many scenarios of model reuse, it is impossible or difficult to obtain the original training data of the reused model, resulting in this method not being well suited for scenarios of unstructured data model reuse.

[0054] 2. It is difficult to select reusable models: Existing model reuse technologies usually assume that the reusable model is already given. However, in real tasks, there are usually a large number of models, and it is often difficult to know which models are helpful for the current task. If you perform reasoning and trial and error on the models one by one, it will cause a lot of resource consumption.

[0055] 3. Data is difficult to obtain: Many model reuse technologies cannot be directly applied to the target task and require further adjustment, which also requires a large amount of data. However, in some fields or tasks, the target task data is often scarce or difficult to obtain.

[0056] In this regard, an embodiment of the present application provides a model reuse method and related devices, which can realize efficient model reuse of unstructured tabular data. The model reuse method can determine a first reuse model that matches a target data set from a learning library, the learning library includes multiple reuse models, the first reuse model is one of the multiple reuse models, the target data set includes multiple target data, and the multiple target data belong to a tabular data set;

[0057] Performing shrinkage adjustment on the first reuse model based on the target data set to obtain a second reuse model;

[0058] Performing model expansion based on the target data set and the second reuse model to obtain a third reuse model;

[0059] The second reuse model and the third reuse model are integrated to obtain a target reuse model corresponding to the target data set. The specific implementation method may refer to the following related embodiments, and the embodiments of the present application are not described in detail here.

[0060] In addition, it should be noted that the model reuse method for unstructured data provided in the embodiment of the present application can be applied to scenarios such as vector prediction and financial detection in different regions, and the embodiment of the present application does not make specific limitations on this.

[0061] Based on the technical issues raised above and to facilitate understanding of the embodiments of the present application, the following first describes one of the interpretable system architectures based on model dynamic behavior on which the embodiments of the present application are based.

[0062] See also Figure 1 , Figure 1 This is a schematic diagram of a model reuse system architecture provided in an embodiment of the present application. The model reuse system architecture in the embodiment of the present application may include Figure 1 The learning library 001 and the client 002 in the.

[0063] like Figure 1 As shown, the learning library 001 can be used to store the trained reused models, which can be reused by users in various scenarios where corresponding models are required. For example: search the learning library 001 for the first reused model that best matches the target data set, and then use the reused model to achieve the target task corresponding to the target data set.

[0064] In other embodiments, the learning component library 001 can also be used to store multiple learning components, each of which includes a reuse model and a model specification corresponding to the reuse model, that is, each learning component is composed of a reuse model and a model specification. The model specification is used to indicate the functional characteristics of the corresponding reuse model, and the model specification includes a model parameter vector of the corresponding reuse model. The model specification can also include text information of the corresponding reuse model, and the text information is used to describe one or more of the model tasks, model inputs, model outputs, and model operating environments of the corresponding reuse model in natural language. Exemplarily, when a user uploads a trained reuse model to the learning component library, the model specification corresponding to each reuse model in the learning component library can be obtained based on the preset training model and the preset training data set corresponding to each reuse model, and then the reuse model and the model specification corresponding to the reuse model are packaged together into a learning component and uploaded to the learning component library 001. For example, the learning library 001 stores multiple learning pieces, which allows users to use the model specifications in the learning pieces to find the reuse model that best matches the target task, and then use the reuse model to reuse the target task to solve the target task. Among them, the generation method of the model specifications in the specific learning pieces and the model reuse method can also refer to the relevant description in the following embodiments, and the embodiments of this application will not be repeated here.

[0065] It should be noted that the learning library 001 can be set in a server, cloud computing node, distributed server, computing device, or other electronic device that can acquire, process, analyze and extract data and perform related machine learning. The electronic device can communicate with one or more clients 002 via the Internet or a communication bus.

[0066] The client 002 can be used to upload one or more reused models, or can also be used to upload one or more learning pieces. Exemplarily, the client 002 can be an electronic device such as a communication terminal, a portable terminal, a mobile device, a user terminal, a mobile terminal, a wireless communication device, a user agent, a user device, a service device, or a user equipment (UE). In addition, in some embodiments, the client 002 can be set in the same electronic device as the learning piece library 001, or can be set in a different electronic device, which is not specifically limited in the embodiments of the present application.

[0067] In some embodiments, when a user wants to use a matching reuse model in the learning library 001 to perform reasoning-related target tasks, the user can input a target data set corresponding to the target task through the client 002, and search for a reuse model that matches the target data set in the learning library 001 based on the target data set. Among them, the target data set can be part or all of the data of the target task, and the data type in the target data set is unstructured tabular data. Then, based on the model adjustment method of contraction and expansion of the reuse model, the reuse model is adjusted to a target reuse model suitable for the target data set. Finally, the target data set is reasoned based on the adjusted target reuse model to obtain the task result corresponding to the target task. Among them, the specific model reuse method can also refer to the following related embodiments, and the embodiments of the present application will not be repeated here.

[0068] It should be noted that the client 002 can interact with the user through input devices such as keyboards, virtual keyboards, touch panels, touch screens, and voice control devices, such as projectors, smart phones, displays, etc. This application does not specifically limit the specific functions performed by the client 002.

[0069] Please see attached Figure 2 , Figure 2 This is another model reuse system architecture provided by the embodiment of the present application. Figure 2 As shown: The model reuse system architecture in the embodiment of the present application may include Figure 2 The protocol module 210, the learning library 220, the execution device 230 and the client device 240.

[0070] The specification module 210 can be used to obtain the model specification of the reuse model, and upload the model specification and the reuse model to the learning library 220. For example, when a user uploads a trained reuse model to the learning library, the model specification corresponding to the uploaded reuse model is obtained based on the preset training model and the preset training data set originally corresponding to the reuse model.

[0071] In other embodiments, the specification module 210 can also be used to obtain a target specification corresponding to a target task or a target data set. For example, when a user needs to reuse a reuse model in a learning library, the target specification corresponding to the target task or the target data set is determined based on a preset training model and a target data set.

[0072] Learning library 220 (equivalent to the above Figure 1 The learning library shown in the figure can be used to store trained reusable models, which can be reused by users in various scenarios that require corresponding models.

[0073] The execution device 230 can simply and efficiently implement model reuse for unstructured tabular data. For example, based on the model adjustment method of contraction and expansion of the reuse model, the reuse model is adjusted to a target reuse model suitable for the target data set. Finally, the target data set is inferred based on the adjusted target reuse model to obtain the task result corresponding to the target task.

[0074] The execution device 230 includes a processing module 211 , an I / O interface 212 , a contraction module 213 and an expansion module 214 .

[0075] The I / O interface 212 can be used to transmit relevant data, for example, to receive data transmitted by a user through the client device 240 (equivalent to the above Figure 1 The target dataset of the target task uploaded by the client (shown in FIG. 1 ) includes multiple target data, and the multiple target data are all unstructured or non-homogeneous tabular data. For example, the target dataset is sales data of multiple products in a certain region.

[0076] After acquiring the target data set based on the I / O interface 212, the processing module 211 can determine the first reuse model that matches the target data set from multiple reuse models in the learning material library 220. The screened out first reuse model is the reusable model in the learning material library that is most suitable for processing the task corresponding to the target data set.

[0077] The shrinking module 213 is used to shrink and adjust the reuse model. For example, shrink and adjust the first reuse model based on the target data set to obtain a second reuse model.

[0078] The expansion module 214 is used to expand and adjust the reuse model, for example, to expand the model based on the target data set and the second reuse model to obtain a third reuse model.

[0079] The processing module 211 can also integrate the second reuse model obtained from the contraction module 213 and the second reuse model obtained from the expansion module 214 to obtain a final target reuse model. The target reuse model can be inferred on the target data set or all data of the target task corresponding to the target data set to obtain the task result of the target task.

[0080] Finally, the I / O interface 212 returns the task result to the client device 240 to provide it to the user.

[0081] In addition, in the attached Figure 2 In the case shown in , the user can manually specify the data to be input into the execution device 230, for example, by operating in the interface provided by the I / O interface 212. In another case, the client device 240 can automatically input data into the I / O interface 212 and obtain the result. If the client device 240 needs to obtain the user's authorization to automatically input data, the user can set the corresponding authority in the client device 240. The user can view the results output by the execution device 230 on the client device 240, and the specific presentation form can be a specific method such as display, sound, action, etc. The client device 240 can also serve as a data acquisition terminal to store the acquired data of the target task into a database.

[0082] It should be noted that the above Figure 1 and Figure 2 These are merely several exemplary system architecture diagrams provided in the embodiments of the present application. The positional relationships between the devices, components, modules, etc. shown in the diagrams do not constitute any limitation.

[0083] It should also be noted that the specific implementation methods of the equipment, devices, modules, etc. shown in the above figures can also refer to the following related embodiments, and the embodiments of the present application will not be repeated here.

[0084] It is understandable that the above Figure 1 and Figure 2 The model reuse system architecture is only a partial exemplary implementation in the embodiments of the present application. The model reuse system architecture in the embodiments of the present application includes but is not limited to the above model reuse system architecture.

[0085] Secondly, based on the above Figure 1 and Figure 2 The model reuse system architecture provided, combined with the model reuse method provided in this application, specifically analyzes and solves the technical problems raised in this application.

[0086] Please refer to the attached Figure 3 , Figure 3 is a flow chart of a model reuse method provided in an embodiment of the present application, which can be applied to the above Figure 1 and Figure 2In the model reuse system architecture described in, the method may include the following steps S301-S304.

[0087] Step S301: Determine a first reuse model that matches the target data set from the learning library.

[0088] Specifically, the learning library includes multiple reuse models, each of which is a trained and transferable machine learning model, and the first reuse model is one of the multiple reuse models in the learning library. When the user obtains the target data set of the target task, the user can filter out the first reuse model that matches the target data set from the multiple reuse models based on the target data set. Among them, the learning library may only include multiple reuse models, and may also include directories, indexes, or model specifications corresponding to multiple reuse models, which are not specifically limited in the embodiments of the present application. In addition, the learning library can also be referred to as a model library, which is not specifically limited in the embodiments of the present application.

[0089] It is understandable that the target data set of the target task includes multiple target data, and the multiple target data belong to tabular data. The multiple target data can be all the task data of the target task, or part of the task data of the target task, which is not specifically limited in the embodiments of the present application. Exemplarily, the target data set can be any tabular data set such as a sales forecast data set or a medical diagnosis data set. In this data set, each row represents a sample (i.e., target data), and each column represents a feature, wherein there is generally no spatial position relationship between feature columns, i.e., they are not related, and the last column of each row can be the label information to be predicted corresponding to the target data.

[0090] In some embodiments, the learning component library includes multiple learning components, each of which includes a reuse model and a model specification corresponding to the reuse model, the model specification includes a model parameter vector and text information corresponding to the reuse model, and the text information is used to indicate one or more of the model task, model input, model output, and model operating environment of the corresponding reuse model; determining the first reuse model matching the target data set from the learning component library includes: based on the target specification corresponding to the target data set, determining the first reuse model matching the target data set from the learning component library, the model specification corresponding to the first reuse model is most similar to the target specification; wherein the target specification includes a model parameter vector and target text information corresponding to a trained preset training model, and the target text information is used to indicate the target task information of the target data set, and the trained preset training model is a model obtained after a preset linear model is trained based on the target data set.

[0091] Please refer to the attached Figure 4 , Figure 4 It is a scene diagram of searching the first reuse model provided by an embodiment of the present application. It can be understood that each of the reuse models corresponds to a model specification, a reuse model and its corresponding model specification constitute a learning piece, and the learning piece library includes the above-mentioned multiple learning pieces. Among them, the model specification includes a model parameter vector and text information corresponding to the reuse model, and the text information is used to indicate one or more of the model task, model input, model output, and model operating environment of the corresponding reuse model. Exemplarily, the text information can be a natural language description used to describe the functional characteristics of the model. Through the model specification, the functional characteristics of the reuse model in the learning piece can be most easily understood, so that when the user needs it, the first reuse model matching the target data set can be directly screened out from the learning piece library based on the model specification in the learning piece, avoiding the reasoning of each reuse model in the learning piece library one by one, greatly saving computing resources. Exemplarily, a huge learning piece library can be constructed, and a large number of learning pieces can be stored in the learning piece library. Each learning piece includes a reusable model and a model specification corresponding to the reuse model, and each model is fully trained by the model developer using his own data. In addition, before uploading the model, the developer needs to construct a model specification in the form of secondary training, package it together with the model into a learning material and upload it to the learning material library so that the model can be searched.

[0092] like Figure 4 As shown, among the model specifications corresponding to multiple reused models in the learning library, the model specification that best matches the target specification corresponding to the target data set is determined, and then the reused model corresponding to the best matching model specification is determined to be the first reused model. For example: when a user has a need, the user can use a small amount of his own data to construct a specification, and then the learning library uses the specification uploaded by the user to calculate the similarity with the existing model specifications in the learning library, and obtains the model with the highest specification match and returns it to the user. This search for reused models through model specifications can quickly and conveniently filter out matching reused models, improve screening efficiency, and save computing power and data volume.

[0093] In other embodiments, the learning material library may also directly store multiple reuse models and the model specification corresponding to each reuse model, that is, the reuse model and the model specification corresponding to the reuse model do not need to be packaged into one learning material and stored in the learning material library.

[0094] In some embodiments, based on the target specification corresponding to the target data set, determining the first reuse model matching the target data set from the learning library includes: matching the target specification with the model specifications of all reuse models in the learning library respectively, and determining the cosine similarity between each of the model specifications and the target specification; based on the cosine similarity between each of the model specifications and the target specification, determining that the reuse model corresponding to the model specification with the highest cosine similarity with the target specification is the first reuse model.

[0095] It should be noted that the target specification is matched one by one with the model specifications corresponding to the reuse models in all the learning materials in the learning material library, the specification similarity is calculated, and the learning material with the most similar specifications is returned, so as to determine that the reuse model in the learning material is the reuse model that best matches the target task. Exemplarily, in the embodiment of the present application, the similarity between specifications can be represented by cosine similarity, that is, the cosine similarity between the target specification and each model specification is calculated, and the reuse model corresponding to the model specification with the highest cosine similarity to the target specification is the first reuse model. Cosine similarity can be used to quickly and accurately locate the model specification that is most similar to the target specification from a large number of model specifications, and then the first reuse model that is most suitable for the target data set can be determined, which significantly improves the efficiency of model reuse.

[0096] In some embodiments, the method further includes: determining the model specification corresponding to each of the reused models in the learning library based on a preset training model and a preset training data set corresponding to each of the reused models, wherein the preset training model includes a preset proxy model and the preset linear model.

[0097] It should be noted that the preset training data set corresponding to each of the reused models can be understood as the initial training data set for training the reused model, and can be provided by the provider of the reused model. Each reused model needs to pass the model specification corresponding to the preset training model determiner, so that the user can quickly filter out the first reused model required by the target data set from multiple reused models. In addition, the target specification and the model specification are both determined by the same preset linear model, which can greatly improve the matching accuracy and improve the model reuse efficiency. Moreover, the embodiment of the present application is a model specification construction based on a model specification construction method based on the approximation of the function of the secondary learning model, that is, the preset training model includes a preset proxy model and the preset linear model, and the model function can be learned twice, which greatly improves the accuracy of the model specification, thereby improving the performance of model reuse.

[0098] In some embodiments, the model specification corresponding to each of the reused models in the learning library is determined based on the preset training model and the preset training data set corresponding to each of the reused models, including: performing prediction on the preset training data set corresponding to each of the reused models based on the preset proxy model to obtain a training prediction result corresponding to each of the reused models, wherein the training prediction result includes pseudo-label information corresponding to the preset training data set; performing fitting training on the preset linear model based on the training prediction result corresponding to each of the reused models to obtain a trained preset linear model corresponding to each of the reused models; and determining the model specification corresponding to the reused model based on the model parameter vector corresponding to the trained preset linear model.

[0099] Please refer to the attached Figure 5 , Figure 5 is a flow chart of a construction model specification provided in an embodiment of the present application, such as Figure 5 As shown, a preset proxy model is used to make inferences on the original training data corresponding to the reused model to obtain a prediction result as a pseudo-label; a preset linear model is trained to fit the pseudo-label to obtain a preset linear model trained twice on the preset proxy model. The model parameter vector corresponding to the trained preset linear model can be determined as a partial model specification corresponding to the reused model. Using a model specification construction method based on the functional approximation of a quadratic learning model, the model specification of the determined reused model can accurately indicate the functional characteristics of the corresponding reused model, and can better characterize the characteristics of the corresponding reused model, so that the user can quickly and accurately filter out the model specification that is most similar to the target specification from a large number of model specifications, and then quickly locate the first reused model, avoiding the selection of reused models based on one-by-one matching of the target data set, and significantly improving the efficiency of model reuse.

[0100] In other embodiments, after determining the first reuse model that matches the target data set from the learning material library, the first reuse model is assigned or marked as a model to be reused, and the first reuse model assigned or marked as the model to be reused is evaluated to obtain an evaluation result, which is used to indicate the performance of the model to be reused on the target task. When the model to be reused reaches the performance threshold, it can be reused directly on the target task. When the model to be reused does not reach the performance threshold, the model to be reused can be adjusted to meet the needs of the target task, and the adjusted model can be reused on the target task. Among them, the specific adjustment method can be referred to the following related embodiments, and the embodiments of the present application will not be repeated here.

[0101] In other embodiments, the preset training data set corresponding to the first reuse model is not associated with the target data set. It is understandable that the multiple reuse models in the learning library are all trained models, that is, the existing pre-trained models can be reused directly or after a small amount of data adjustment. Therefore, the preset training data set corresponding to the first reuse model is not associated with the target data set, for example: different data for similar tasks or different data sources, etc.

[0102] Step S302: shrink and adjust the first multiplexing model based on the target data set to obtain a second multiplexing model.

[0103] Specifically, the first reuse model is shrunk and adjusted based on the target data set to obtain a second reuse model. It is understandable that the embodiment of the present application performs a shrinkage adjustment on the first reuse model in order to make the adjusted model more suitable for the target data set of the target task. Exemplarily, after searching for a reusable model based on the specification, the loss value of the model on the target task data is calculated, and the k sub-models with the smallest loss value are retained to obtain a shrunk model.

[0104] In some embodiments, the shrinking and adjusting the first reuse model based on the target data set to obtain the second reuse model includes: performing multiple predictions on the target data set based on the first reuse model to obtain a first prediction result, the first prediction result including prediction values ​​corresponding to the multiple target data each time, wherein the first reuse model includes T subtrees, N subtrees of the T subtrees are used for each prediction, and the number N of subtrees used for each prediction is different, and T and N are both positive integers; shrinking and adjusting the first reuse model based on the first prediction result to obtain the second reuse model.

[0105] It should be noted that the target data set can be used to evaluate the first reuse model, and the structure of the existing model can be adjusted according to the evaluation results to adapt it to the target data. It should also be noted that the number of subtrees corresponding to each reuse model can be set by the model provider or based on the performance of the model itself, and the embodiments of the present application do not impose specific restrictions on this. It should be noted that the embodiments of the present application do not impose specific restrictions on the rules for multiple predictions. Exemplarily, when the first reuse model is used to make multiple predictions of the target data in the target data set, the rule that N=1 is used for the first prediction, and each prediction adds one subtree compared to the previous prediction is used for prediction. Exemplarily, a prediction matrix Q can also be established, in which each row and column of Q represents the predicted value of the target data using the N subtrees in the first reuse model for inference, and then for each column of the matrix Q, the loss vector can be calculated according to the loss function based on the true label (i.e., label information) corresponding to the target data. Assuming that the original model has T subtrees, a loss vector L∈R can be obtained. T .

[0106] In some embodiments, each of the target data corresponds to label information, and the first reuse model is contracted and adjusted based on the first prediction result to obtain the second reuse model, including: determining the loss vector corresponding to each prediction based on the first prediction result and the label information corresponding to each of the target data, and the loss vector is used to indicate the loss value corresponding to the multiple target data at the time of the corresponding prediction; determining the number of subtrees included in the first reuse model corresponding to the K predictions with the smallest loss vector from the loss vectors corresponding to the multiple predictions, where K is a positive integer; performing multiple contraction adjustments on the first reuse model according to the number of subtrees included in the first reuse model corresponding to the K predictions with the smallest loss value to obtain K sub-models; and determining the second reuse model based on the K sub-models.

[0107] Please refer to the attached Figure 6 , Figure 6 1 is a flow chart of a multiplexing model shrinkage adjustment process provided by an embodiment of the present application. Figure 6 As shown, the number of subtrees in each round of prediction can be counted by a counter, wherein, based on the above-mentioned multiple prediction rules, it is possible to determine whether N is less than or equal to T in the i-th prediction, obtain the predicted value of each subtree, and after searching for a reusable first reuse model based on the specification, perform multiple rounds of reasoning and prediction on the target data set through the first reuse model, so as to shrink and adjust the structure of the first reuse model according to the multiple rounds of prediction results, and obtain a second reuse model, which can be more suitable for the target data set. Wherein, i is greater than or equal to K.

[0108] Based on the first prediction result and the label information corresponding to each of the target data, determine the loss vector corresponding to each prediction, the loss vector is used to indicate the loss value corresponding to the multiple target data when the prediction is made; determine the number of subtrees included in the first reuse model corresponding to the K predictions with the smallest loss vector from the loss vectors corresponding to the multiple predictions; perform multiple contraction adjustments on the first reuse model according to the number of subtrees included in the first reuse model corresponding to the K predictions with the smallest loss value, and obtain K submodels; determine the second reuse model based on the K submodels. Exemplarily, according to the loss vector L, sort the k results with the smallest loss to obtain l1, l2, ..., l k , and the number of subtrees corresponding to these loss vectors is obtained N = t1, t2, ..., t k According to the number of these subtrees, the original model is retained N = t1, t2, ..., t k subtrees, and get the corresponding K submodels after adjustment At the same time, the weights of the K sub-models can be calculated based on the K loss values. The embodiments of the present application will not be described in detail. According to the K models and the K weights, the adjusted second multiplexing model can be obtained, wherein: the second multiplexing model is:

[0109] In an embodiment of the present application, based on the first prediction result, the loss vectors of the first reuse model on the target data set under multiple rounds of prediction are calculated respectively, and the K predictions with the smallest loss vectors and the number of subtrees included in the K predicted first reuse model are determined, so as to retain the K sub-models corresponding to the K predictions with the smallest loss vectors, and then obtain the corresponding contraction model, that is, the second reuse model, which includes the above-mentioned K sub-models.

[0110] Step S303: Perform model expansion based on the target data set and the second reuse model to obtain a third reuse model.

[0111] Specifically, the model is expanded based on the target data set and the second reuse model to obtain the third reuse model. Figure 7 , Figure 7This is a schematic diagram of a reuse model adjustment scenario provided by an embodiment of the present application. When a user has a reusable first reuse model and a small amount of target data, the first reuse model can be cropped (i.e., shrunk and adjusted) with this part of the target data, and then the cropped model can be continued to be trained with this part of the target data, and the model can be expanded to obtain a third reuse model, and finally the target model after the first reuse model is reused on the user task is obtained. Compared with other adjustment methods, this model adjustment method of first shrinking and then expanding can provide a hot start when the user has only a small amount of data, reduce the demand for the number of target data in the target data set, and the target reuse model adjusted in this way is more generally applicable to the target data set, which can improve the model reuse performance and the accuracy of completing the task.

[0112] In some embodiments, each of the target data corresponds to label information, and the model expansion is performed based on the target data set and the second reuse model to obtain a third reuse model, including: performing prediction on the target data set based on the second reuse model to obtain a second prediction result, and the second prediction result includes a prediction value corresponding to each of the target data; determining the residual information corresponding to the second reuse model based on the second prediction result and the label information corresponding to each of the target data; and performing model expansion based on the target data set and the residual information to obtain the third reuse model.

[0113] Exemplarily, the second multiplexing model M completed based on the above adjustment F Perform prediction on the target data set to obtain a second prediction result, which includes a prediction value corresponding to each target data. Based on the second prediction result and the label information corresponding to each target data, determine the residual information corresponding to the second reuse model. For example, use the actual label value of the target data minus the predicted value to obtain the residual label y R Based on the target data set and the residual information (i.e., the residual label y R ) to perform machine learning (e.g. incremental learning) and train n new sub-models, for example: The third multiplexing model is obtained, and the third multiplexing model includes n trained sub-models, for example, That is, based on the target data set, the second reuse model after shrinkage adjustment is further expanded and adjusted, and the residual between the predicted label information and the real label information corresponding to the target data set is used for incremental learning (i.e., model expansion) to obtain a third reuse model, so that the adjusted third reuse model is adapted to the target data set. Moreover, using the residual information for model expansion can make the learned model more accurate and have better reuse performance. Predictions are made on the target task data based on the shrinkage model, and the residual between the predicted result and the real result is used to fit the residual to obtain an expanded model, and the expanded model is integrated with the shrinkage model to obtain the final model.

[0114] In other embodiments, the third reuse model can be understood as a new model retrained based on the second prediction result of the second reuse model and the target data set, rather than being adjusted directly on the basis of the second reuse model.

[0115] Step S304: Integrate the second multiplexing model and the third multiplexing model to obtain a target multiplexing model corresponding to the target data set.

[0116] Specifically, the second reuse model and the third reuse model are integrated to obtain a target reuse model corresponding to the target data set. For example, the target reuse model This method of directly integrating the second reuse model with the second reuse model can reduce the amount of calculation and improve the reuse efficiency without affecting the model reuse performance. In addition, the trained model in the related task can be used for new tasks or fields, thereby avoiding collecting data and training models from scratch, reducing the dependence on high-quality training data while saving model training time and computing resource overhead.

[0117] In some embodiments, after obtaining the target reuse model corresponding to the target data set, reasoning can be performed on all or part of the data of the target task corresponding to the target data set to complete the target task.

[0118] The model reuse method in the prior art is not suitable for unstructured tabular data, and the difficulty of model reuse is relatively high. In this regard, the embodiment of the present application provides a model reuse method, which can simply and efficiently reuse the model for unstructured tabular data. Specifically, first, a first reuse model matching the target data set is determined from multiple reuse models in the learning library. The first reuse model selected is the most suitable reusable model for processing the task corresponding to the target data set in the learning library. The target data set includes multiple target data, and the multiple target data belong to tabular data. Then, the user can directly use the first reuse model searched from the learning library or continue to train or adjust on the target data set, so that the user does not have to collect a large amount of data to train the model from scratch, which greatly saves computing power and the amount of data used for training. When the first reuse model needs to be further adjusted, the first reuse model is simply adjusted and trained based on the target data set to obtain the target reuse model corresponding to the target data set. The target reuse model can perform reasoning or decision-making on the target data set to complete the task corresponding to the target data set. For example: statistics or classification of tabular data can be performed. In addition, in the process of adjusting the first reuse model, the embodiment of the present application first shrinks the first reuse model based on the target data set to obtain a second reuse model; then, based on the target data set and the second reuse model, the model is expanded, such as incremental learning, to obtain a third reuse model; finally, the shrunk second reuse model and the expanded third reuse model are integrated to obtain the above-mentioned target reuse model.

[0119] The method of the embodiment of the present application is described in detail above, and the related device of the embodiment of the present application is provided below.

[0120] See also Figure 8 , Figure 8 4 is a schematic diagram of the structure of a model reuse device provided in an embodiment of the present application. The model reuse device 10 may include: a matching unit 401, a contraction unit 402, an expansion unit 403, an integration unit 404, and may also include: a reduction unit 405. Among them:

[0121] The matching unit 401 is used to determine a first reuse model that matches the target data set from the learning library, the learning library includes multiple reuse models, the first reuse model is one of the multiple reuse models, and the target data set includes multiple target data, and the multiple target data are tabular data.

[0122] The shrinking unit 402 is used to shrink and adjust the first reuse model based on the target data set to obtain a second reuse model.

[0123] The expansion unit 403 is used to perform model expansion based on the target data set and the second reuse model to obtain a third reuse model.

[0124] The integration unit 404 is used to integrate the second reuse model and the third reuse model to obtain a target reuse model corresponding to the target data set.

[0125] In some embodiments, the learning component library includes multiple learning components, each of which includes a reuse model and a model specification corresponding to the reuse model, the model specification includes a model parameter vector and text information corresponding to the reuse model, and the text information is used to indicate one or more of the model task, model input, model output, and model operating environment of the corresponding reuse model; the matching unit 401 is specifically used to: based on the target specification corresponding to the target data set, determine the first reuse model that matches the target data set from the learning component library, and the model specification corresponding to the first reuse model is most similar to the target specification; wherein the target specification includes a model parameter vector and target text information corresponding to a trained preset training model, and the target text information is used to indicate the target task information of the target data set, and the trained preset training model is a model obtained after a preset linear model is trained based on the target data set.

[0126] In some embodiments, the matching unit 401 is specifically used to: match the target specification with the model specifications of all reused models in the learning library respectively, and determine the cosine similarity between each of the model specifications and the target specification; based on the cosine similarity between each of the model specifications and the target specification, determine that the reuse model corresponding to the model specification with the highest cosine similarity between the target specifications is the first reuse model.

[0127] In some embodiments, the device also includes: a reduction unit 405, which is used to determine the model specification corresponding to each of the reused models in the learning library based on a preset training model and a preset training data set corresponding to each of the reused models, wherein the preset training model includes a preset proxy model and the preset linear model.

[0128] In some embodiments, the reduction unit 405 is specifically used to: perform prediction on the preset training data set corresponding to each of the reused models based on the preset proxy model to obtain a training prediction result corresponding to each of the reused models, wherein the training prediction result includes pseudo-label information corresponding to the preset training data set; perform fitting training on the preset linear model based on the training prediction result corresponding to each of the reused models to obtain a trained preset linear model corresponding to each of the reused models; and determine the model reduction corresponding to the reused model based on the model parameter vector corresponding to the trained preset linear model.

[0129] In some embodiments, the shrinkage unit 402 is specifically used to: perform multiple predictions on the target data set based on the first reuse model to obtain a first prediction result, the first prediction result including prediction values ​​corresponding to the multiple target data respectively predicted each time, wherein the first reuse model includes T subtrees, and N subtrees of the T subtrees are used for each prediction, and the number of subtrees N used for each prediction is different, and T and N are both positive integers; shrink and adjust the first reuse model based on the first prediction result to obtain the second reuse model.

[0130] In some embodiments, each of the target data corresponds to label information; the shrinking unit 402 is specifically used to: determine the loss vector corresponding to each prediction based on the first prediction result and the label information corresponding to each of the target data, and the loss vector is used to indicate the loss value corresponding to the multiple target data during the corresponding prediction; determine the number of subtrees included in the first reuse model corresponding to the K predictions with the smallest loss vector from the loss vectors corresponding to the multiple predictions, and K is a positive integer; perform multiple shrinkage adjustments on the first reuse model according to the number of subtrees included in the first reuse model corresponding to the K predictions with the smallest loss value to obtain K sub-models; and determine the second reuse model based on the K sub-models.

[0131] In some embodiments, each of the target data corresponds to label information, and the expansion unit 403 is specifically used to: perform prediction on the target data set based on the second reuse model to obtain a second prediction result, wherein the second prediction result includes a prediction value corresponding to each of the target data; determine the residual information corresponding to the second reuse model based on the second prediction result and the label information corresponding to each of the target data; perform model expansion based on the target data set and the residual information to obtain the third reuse model.

[0132] It should be noted that the functions of the various functional units in the model reuse device 10 described in the embodiment of the present application can be referred to in the above Figure 3 The descriptions of steps S301 to S304 in the method embodiment are not repeated here.

[0133] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program code is stored. When the above-mentioned processor executes the computer program code, the computer executes the method in any of the aforementioned embodiments.

[0134] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer executes the method in any of the aforementioned embodiments.

[0135] 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.

[0136] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps may 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 present application.

[0137] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0138] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0139] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0140] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform all or part of the steps of the above-mentioned methods of each embodiment of the present application. Among them, the aforementioned storage medium may include: U disk, mobile hard disk, magnetic disk, optical disk, read-only memory (Read-Only Memory, abbreviated: ROM) or random access memory (Random Access Memory, abbreviated: RAM) and other media that can store program codes.

[0141] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A model reuse method, characterized in that: include: Determine a first reuse model matching a target data set from a learning library, the learning library including a plurality of reuse models, the first reuse model being one of the plurality of reuse models, the target data set including a plurality of target data, and the plurality of target data being tabular data; Performing shrinkage adjustment on the first reuse model based on the target data set to obtain a second reuse model; Performing model expansion based on the target data set and the second reuse model to obtain a third reuse model; The second reuse model and the third reuse model are integrated to obtain a target reuse model corresponding to the target data set.

2. The method according to claim 1, characterized in that: The learning component library includes a plurality of learning components, each of which includes a reuse model and a model specification corresponding to the reuse model, the model specification includes a model parameter vector and text information corresponding to the reuse model, and the text information is used to indicate one or more of a model task, a model input, a model output, and a model operating environment of the corresponding reuse model; The determining of a first reuse model matching the target data set from the learning library includes: Based on the target specification corresponding to the target data set, determining the first reuse model matching the target data set from the learning library, wherein the model specification corresponding to the first reuse model is most similar to the target specification; Among them, the target specification includes a model parameter vector and target text information corresponding to the trained preset training model, the target text information is used to indicate the target task information of the target data set, and the trained preset training model is a model obtained after training the preset linear model based on the target data set.

3. The method according to claim 2, characterized in that: The determining, based on the target specification corresponding to the target data set, from the learning library the first reuse model matching the target data set comprises: Matching the target specification with the model specifications of all reused models in the learning library respectively, and determining the cosine similarity between each of the model specifications and the target specification; Based on the cosine similarity between each of the model specifications and the target specifications, a reuse model corresponding to the model specification with the highest cosine similarity between the target specifications is determined as the first reuse model.

4. The method according to claim 2 or 3, characterized in that: The method further comprises: Based on a preset training model and a preset training data set corresponding to each of the reused models, a model specification corresponding to each of the reused models in the learning library is determined, wherein the preset training model includes a preset proxy model and the preset linear model.

5. The method according to claim 4, characterized in that: The determining, based on the preset training model and the preset training data set corresponding to each of the reused models, the model specification corresponding to each of the reused models in the learning library comprises: Based on the preset proxy model, prediction is performed on the preset training data set corresponding to each of the reused models to obtain a training prediction result corresponding to each of the reused models, wherein the training prediction result includes pseudo label information corresponding to the preset training data set; Perform fitting training on the preset linear model based on the training prediction result corresponding to each of the reused models to obtain a trained preset linear model corresponding to each of the reused models; Based on the model parameter vector corresponding to the trained preset linear model, a model specification corresponding to the reused model is determined.

6. The method according to any one of claims 1 to 5, characterized in that: The step of shrinking and adjusting the first reuse model based on the target data set to obtain a second reuse model includes: Perform multiple predictions on the target data set based on the first reuse model to obtain a first prediction result, wherein the first prediction result includes prediction values ​​corresponding to the multiple target data respectively each time the prediction is made, wherein the first reuse model includes T subtrees, and N subtrees of the T subtrees are used in each prediction, and the number of subtrees N used in each prediction is different, and T and N are both positive integers; The first multiplexing model is contracted and adjusted based on the first prediction result to obtain the second multiplexing model.

7. The method according to claim 6, characterized in that: Each of the target data corresponds to label information, and the shrinking and adjusting the first reuse model based on the first prediction result to obtain the second reuse model includes: Determine a loss vector corresponding to each prediction based on the first prediction result and the label information corresponding to each target data, wherein the loss vector is used to indicate the loss values ​​corresponding to the multiple target data during the corresponding prediction; Determine the number of subtrees included in the first multiplexing model corresponding to K predictions with the smallest loss vector from the loss vectors corresponding to the multiple predictions, where K is a positive integer; According to the number of subtrees included in the first reuse model corresponding to the K predictions with the smallest loss value, the first reuse model is subjected to multiple contraction adjustments to obtain K submodels; Based on the K sub-models, the second multiplexing model is determined.

8. The method according to any one of claims 1 to 7, characterized in that: Each of the target data corresponds to label information, and the model expansion is performed based on the target data set and the second reuse model to obtain a third reuse model, including: Perform prediction on the target data set based on the second multiplexing model to obtain a second prediction result, where the second prediction result includes a prediction value corresponding to each of the target data; Determine residual information corresponding to the second multiplexing model based on the second prediction result and label information corresponding to each of the target data; Model expansion is performed based on the target data set and the residual information to obtain the third reuse model.

9. A model reuse device, characterized in that: include: a matching unit, configured to determine a first reuse model matching a target data set from a learning library, wherein the learning library includes a plurality of reuse models, the first reuse model is one of the plurality of reuse models, and the target data set includes a plurality of target data, and the plurality of target data are tabular data; A shrinking unit, configured to shrink and adjust the first reuse model based on the target data set to obtain a second reuse model; An expansion unit, configured to perform model expansion based on the target data set and the second reuse model to obtain a third reuse model; An integration unit is used to integrate the second reuse model and the third reuse model to obtain a target reuse model corresponding to the target data set.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a computer or a processor, the computer or the processor executes the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer or a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Model multiplexing method and related apparatus

    EP4749529A1

  • Model multiplexing method and related apparatus

    WO2025039950A1