Model multiplexing method and related apparatus
By filtering, shrinking, and expanding models in the learning materials library and adjusting them, combined with model reduction and cosine similarity calculation, the problem of reusing unstructured tabular data models is solved, achieving efficient and accurate model reuse and reducing resource consumption.
Patent Information
- Application Number
- PCT/CN2024/112022
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-24
- Filing Date
- 2024-08-14
- Publication Date
- 2025-02-27
AI Technical Summary
Existing model reuse techniques are difficult to apply to unstructured tabular data, and require a large amount of training data when reusing models, resulting in resource waste and high reuse difficulty.
By selecting the first reusable model that matches the target dataset from the learning materials library, performing shrinkage and expansion adjustments, and combining model reduction and cosine similarity calculation, the appropriate model is quickly located and integrated to achieve efficient model reuse of unstructured tabular data.
It reduces the need for training data, improves model reuse efficiency and accuracy, saves computing resources and data volume, and is suitable for model reuse of unstructured tabular data.
Smart Images

Figure CN2024112022_27022025_PF_FP_ABST
Abstract
Description
A model reuse method and related device
[0001] This application claims priority to the Chinese patent application with application number 202311075747.9 filed with the State Intellectual Property Office of China on August 24, 2023, and priority to the Chinese patent application with the invention name “A model reuse method and related device”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of artificial intelligence technology, and in particular to a model reuse method and related devices. Background Art
[0003] With the continuous advancement of technology, artificial intelligence has also gradually developed. Machine learning has achieved great success. However, learning a high-quality model often requires training with a large amount of labeled, high-quality data, which consumes a lot of resources and time. Even slight changes in the target task require retraining the model, resulting in a large amount of duplication of effort and wasted resources. Therefore, researchers are studying how to reuse existing trained models for different target tasks, eliminating the need to start from scratch. This can save significant time and resources and reduce data usage.
[0004] However, existing model reuse technologies primarily target structured data, such as images and text, and are difficult to apply to unstructured tabular data. Furthermore, existing model reuse technologies often require the model's initial training data, which is difficult to obtain when the model is reused, greatly increasing the difficulty of model reuse.
[0005] Therefore, how to achieve simple and efficient model reuse of unstructured tabular data is a technical problem that needs to be solved urgently.
[0006] Summary of the Invention
[0007] 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.
[0008] 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 including multiple reuse models, the first reuse model being one of the multiple reuse models, the target data set including 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.
[0009] The model reuse method in the prior art is not suitable for unstructured tabular data, and model reuse is difficult. To this end, an embodiment of the present application provides a model reuse method that can simply and efficiently reuse models for unstructured tabular data. Specifically, first, a first reuse model that matches the target dataset is determined from multiple reuse models in the learning library. The first reuse model selected is the reusable model in the learning library that is most suitable for processing the task corresponding to the target dataset. The target dataset includes multiple target data, and the multiple target data are tabular data. Then, the user can directly use the first reuse model searched from the learning library or continue training or adjusting it on the target dataset, so that the user does not need 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 further adjustment of the first reuse model is required, the first reuse model is simply adjusted and trained based on the target dataset to obtain a target reuse model corresponding to the target dataset. The target reuse model can perform reasoning or decision-making on the target dataset to complete the task corresponding to the target dataset. For example, statistics or classification can be performed on tabular data. In addition, in the process of adjusting the first reuse model, the embodiment of the present application first shrinks and adjusts 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 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, can improve the model reuse performance, and also improve the accuracy of completing the task.
[0010] 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; 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 the model parameter vector and target text information corresponding to the 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 the preset linear model is trained based on the target data set.
[0011] Existing model reuse technologies usually assume that the reuse model is already given. However, in real tasks, although there are a large number of models, 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, the embodiment of the present application can directly filter out the first reuse model that matches the target data set from the learning library through the model specification when the user needs it, avoiding the need to reason one by one for each reuse model in the learning library, 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 filtered 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.
[0012] In one possible implementation, the first reuse model that matches 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 model specification and the target specification; based on the cosine similarity between each model specification 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.
[0013] In this 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 designated as the first reuse model. Cosine similarity can be used to quickly and accurately locate the model specification most similar to the target specification from a large number of model specifications, thereby determining the first reuse model that is most suitable for the target dataset, significantly improving model reuse efficiency.
[0014] In one 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.
[0015] In this embodiment of the present application, each reused model is required 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 for the target dataset 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 enhance the efficiency of model reuse.
[0016] In one possible implementation, the model specification corresponding to each reuse model in the learning library is determined based on the preset training model and the preset training data set corresponding to each reuse model, including: performing prediction on the preset training data set corresponding to each reuse model based on the preset proxy model to obtain a training prediction result corresponding to each reuse model, and 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 reuse model to obtain a trained preset linear model corresponding to each reuse model; and determining the model specification corresponding to the reuse model based on the model parameter vector corresponding to the trained preset linear model.
[0017] 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 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.
[0018] In one possible implementation, the shrinking adjustment of 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 adjustment of the first reuse model based on the first prediction result to obtain the second reuse model.
[0019] 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 adaptable to the target data set.
[0020] In one possible implementation, each target data corresponds to label information, and the first reuse model is shrunk 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 target data, the loss vector being 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 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 determining the second reuse model based on the K sub-models.
[0021] In an embodiment of the present application, based on the first prediction result, the loss vector of the first reuse model on the target data set under multiple rounds of prediction is calculated respectively, and the K predictions with the smallest loss vector and the number of subtrees included in the K predictions of the first reuse model are determined, so as to retain the K sub-models corresponding to the K predictions with the smallest loss vector, and then obtain the corresponding contraction model, that is, the second reuse model, which includes the above-mentioned K sub-models.
[0022] In one possible implementation, each target data has corresponding 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, the second prediction result including a prediction value corresponding to each 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 target data; and performing model expansion based on the target data set and the residual information to obtain the third reuse model.
[0023] In an embodiment of the present application, the second reuse model, after contraction adjustment, can be further expanded based on the target dataset. The model expansion is performed using the residual between the predicted label information and the true label information corresponding to the target dataset to obtain a third reuse model, so that the adjusted third reuse model is adapted to the target dataset. Furthermore, using the residual information for model expansion can make the learned model more accurate and have better reuse performance.
[0024] In a possible implementation, the preset training data set corresponding to the first reuse model is not associated with the target data set.
[0025] In an embodiment of the present application, the 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.
[0026] 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 being one of the multiple reuse models, the target data set including multiple target data, and the multiple target data being tabular data; a shrinking 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 a 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.
[0027] 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 the model parameter vector and target text information corresponding to the 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 the preset linear model is trained based on the target data set.
[0028] In one possible implementation, the matching unit 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 model specification and the target specification; based on the cosine similarity between each model specification and the target specification, determine that the reuse model corresponding to the model specification with the highest cosine similarity between the target specification is the first reuse model.
[0029] In one possible implementation, the device also includes: a specification unit, which is used to determine the model specification corresponding to each of the reused models in the learning library based on the preset training model and the 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.
[0030] 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, and 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.
[0031] 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, wherein the first prediction result includes prediction values corresponding to the multiple target data 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; based on the first prediction result, the first reuse model is shrunk and adjusted to obtain the second reuse model.
[0032] In one possible implementation, each target data corresponds to label information; the shrinkage 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 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 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.
[0033] In one possible implementation, each 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, where the second prediction result includes a prediction value corresponding to each 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 target data; and perform model expansion based on the target data set and the residual information to obtain the third reuse model.
[0034] 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 above, which includes a program for executing a model reuse method provided in the first aspect above.
[0035] 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.
[0036] 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 content 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
[0037] 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.
[0038] FIG1 is a schematic diagram of a model reuse system architecture provided in an embodiment of the present application.
[0039] FIG2 is another model reuse system architecture provided in an embodiment of the present application.
[0040] FIG3 is a flow chart of a model reuse method provided in an embodiment of the present application.
[0041] FIG4 is a schematic diagram of a scenario for searching a first multiplexing model provided in an embodiment of the present application.
[0042] FIG5 is a flow chart of a construction model specification provided in an embodiment of the present application.
[0043] FIG6 is a schematic diagram of a process of shrinkage adjustment of a reuse model provided in an embodiment of the present application.
[0044] FIG7 is a schematic diagram of a reuse model adjustment scenario provided in an embodiment of the present application.
[0045] FIG8 is a schematic structural diagram of a model reuse device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0047] The terms "first," "second," and "third," etc. in the specification, claims, and drawings of this application are used to distinguish between different objects, not to describe a particular order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0048] It should be understood that in this 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 previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items 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.
[0049] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0050] As used in this specification, the terms "component," "module," "system," and the like 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 an application running on a computing device and a computing device can be a component. One or more components can reside in a process and / or an execution thread, and a component can be located on a computer and / or distributed between two or more computers. In addition, these components can be executed from various computer-readable media having various data structures stored thereon. Components can communicate, for example, via local and / or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component on a local system, a distributed system, and / or a network, such as the Internet interacting with other systems via signals).
[0051] First, in order to facilitate understanding of the embodiments of the present application, the technical problems that need to be solved and the applicable application scenarios of the embodiments of the present application are analyzed in detail below.
[0052] With the continuous advancement of technology, artificial intelligence has also gradually developed. Machine learning has achieved great success. However, learning a high-quality model often requires training with a large amount of labeled, high-quality data, which consumes a lot of resources and time. Even slight changes in the target task require retraining the model, resulting in a large amount of duplication of effort and wasted resources. Therefore, researchers are studying how to reuse existing trained models for different target tasks, eliminating the need to start from scratch. This can save significant time and resources and reduce data usage.
[0053] Existing model reuse solutions generally determine an initial reusable model based on the distribution of the target task's input data. For structured data such as images and text, the identified reusable model (typically a deep neural network) is fine-tuned and adapted to the target task. Representative fine-tuning methods include fine-tuning and knowledge distillation. For unstructured tabular data, there are some transfer learning techniques related to model reuse, such as the iterative algorithm TradaBoost.
[0054] However, existing model reuse methods have the following disadvantages:
[0055] 1. Difficulty reusing unstructured data models: Existing, mature model reuse technologies primarily target structured data, such as images and text, and are difficult to apply to unstructured tabular data. In the case of unstructured tabular data, the iterative algorithm TradaBoost requires new data to supplement old data (i.e., training data). In many model reuse scenarios, obtaining the original training data for the reused model is often impossible or difficult, making this method unsuitable for reuse of unstructured data models.
[0056] 2. Difficulty in selecting reusable models: Existing model reuse technologies usually assume that the reusable model is already given. However, in real-world 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 the models are inferred one by one through trial and error, it will result in a large amount of resource consumption.
[0057] 3. Data is difficult to obtain: Many model reuse technologies cannot be directly applied to the target task and require further adjustment. This adjustment process also requires a large amount of data. However, in some fields or tasks, the target task data is often scarce or difficult to obtain.
[0058] In this regard, embodiments of the present application provide a model reuse method and related apparatus that can achieve efficient model reuse of unstructured tabular data. The model reuse method can determine a first reuse model that matches a target dataset from a learning library, wherein the learning library includes multiple reuse models, the first reuse model is one of the multiple reuse models, and the target dataset includes multiple target data, each of which is a tabular dataset.
[0059] performing shrinkage adjustment on the first multiplexing model based on the target data set to obtain a second multiplexing model;
[0060] Performing model expansion based on the target data set and the second reuse model to obtain a third reuse model;
[0061] The second multiplexing model and the third multiplexing model are integrated to obtain a target multiplexing model corresponding to the target data set. Specific implementation methods may refer to the following related embodiments, and the embodiments of this application are not described in detail here.
[0062] 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.
[0063] 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.
[0064] Please refer to Figure 1, which is a schematic diagram of a model reuse system architecture provided by an embodiment of the present application. The model reuse system architecture in the embodiment of the present application may include the learning library 001 and the client 002 in Figure 1.
[0065] As shown in Figure 1, Learningware Library 001 can be used to store pre-trained reusable models, which can be reused by users in various scenarios requiring a corresponding model. For example, the first reusable model that best matches the target dataset can be found in Learningware Library 001, and then used to implement the target task corresponding to the target dataset.
[0066] 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 consists 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 may 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, model operating environments, etc. 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, if the learning library 001 stores multiple learning items, users can use the model specifications in the learning items to find the reused model that best matches the target task. This reused model can then be reused on the target task to solve the target task. The generation method of the model specifications in the specific learning items and the model reuse method can also be referred to the relevant description in the following embodiments, and the embodiments of this application are not further described here.
[0067] 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.
[0068] The client 002 can be used to upload one or more reused models, or can also be used to upload one or more learning materials. 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 material library 001, or can be set in different electronic devices, and this is not specifically limited in the embodiments of the present application.
[0069] In some embodiments, when a user wants to use the matching reuse model in the learning library 001 to perform reasoning-related target tasks, the user can input the target data set corresponding to the target task through the client 002, and search for the 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.
[0070] It should be noted that the client 002 can interact with the user through input devices such as a keyboard, virtual keyboard, touchpad, touch screen, and voice control device, such as a projector, smart phone, display, etc. This application does not specifically limit the specific functions performed by the client 002.
[0071] Please refer to Figure 2, which shows another model reuse system architecture provided by an embodiment of the present application. As shown in Figure 2, the model reuse system architecture in the embodiment of the present application may include the protocol module 210, the learning library 220, the execution device 230, and the client device 240 shown in Figure 2.
[0072] 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 dataset originally corresponding to the reuse model.
[0073] In other embodiments, the specification module 210 can also be used to obtain a target specification corresponding to a target task or target dataset. For example, when a user needs to reuse a reuse model in a learning library, the target specification corresponding to the target task or target dataset is determined based on a preset training model and target dataset.
[0074] The learning library 220 (equivalent to the learning library shown in FIG1 ) can be used to store trained reuse models, which can be reused by users in various scenarios requiring corresponding models.
[0075] The execution device 230 can simply and efficiently implement model reuse for unstructured tabular data. For example, based on a model adjustment method of contracting and expanding the reuse model, the reuse model is adjusted to a target reuse model suitable for the target dataset. Finally, based on the adjusted target reuse model, inference is performed on the target dataset to obtain a task result corresponding to the target task.
[0076] The execution device 230 includes a processing module 211 , an I / O interface 212 , a contraction module 213 and an expansion module 214 .
[0077] I / O interface 212 can be used to transmit relevant data, for example, receiving a target dataset for a target task uploaded by a user via client device 240 (equivalent to the client shown in FIG. 1 ). The target dataset includes multiple target data, each of which is unstructured or non-homogeneous tabular data. For example, the target dataset may include sales data for multiple products in a particular region.
[0078] After obtaining 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.
[0079] The shrinking module 213 is used to shrink and adjust the reuse model. For example, shrinking and adjusting the first reuse model based on the target data set to obtain a second reuse model.
[0080] 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.
[0081] The processing module 211 can also integrate the second reuse model obtained from the contraction module 213 with 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 dataset or all data of the target task corresponding to the target dataset to obtain the task result of the target task.
[0082] Finally, the I / O interface 212 returns the task result to the client device 240 and provides it to the user.
[0083] In addition, in the scenario shown in FIG. 2 , the user can manually specify data to be input into execution device 230, for example, by operating within the interface provided by I / O interface 212. Alternatively, client device 240 can automatically input data into I / O interface 212 and obtain results. If automatic data input by client device 240 requires user authorization, the user can set the corresponding permissions within client device 240. The user can view the results output by execution device 230 on client device 240, which can be presented in a display, sound, action, or other specific form. Client device 240 can also serve as a data acquisition terminal, storing the acquired target task data in a database.
[0084] It should be noted that the above Figures 1 and 2 are only several exemplary system architecture diagrams provided in the embodiments of the present application, and the positional relationship between the equipment, devices, modules, etc. shown in the figures does not constitute any limitation.
[0085] 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 relevant embodiments, and the embodiments of this application will not be repeated here.
[0086] It can be understood that the model reuse system architectures of Figures 1 and 2 above are only some exemplary implementations in the embodiments of the present application. The model reuse system architectures in the embodiments of the present application include but are not limited to the above model reuse system architectures.
[0087] Secondly, based on the model reuse system architecture provided in Figures 1 and 2 above, combined with the model reuse method provided in this application, the technical problems raised in this application are specifically analyzed and solved.
[0088] Please refer to Figure 3, which is a flow chart of a model reuse method provided in an embodiment of the present application. The method can be applied to the model reuse system architecture described in Figures 1 and 2 above, wherein the method can include the following steps S301-S304.
[0089] Step S301: Determine a first reuse model that matches the target dataset from the learning library.
[0090] 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 include only multiple reuse models, and may also include directories, indexes, or model specifications corresponding to multiple reuse models, etc., and this embodiment of the present application does not make specific limitations on this. In addition, the learning library can also be called a model library, and this embodiment of the present application does not make specific limitations on this.
[0091] 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 embodiment 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.
[0092] 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 the model parameter vector and target text information corresponding to the 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 the preset linear model is trained based on the target data set.
[0093] Please refer to Figure 4, which is a schematic diagram of a scenario for 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 for describing the functional characteristics of the model. The functional characteristics of the reuse model in the learning piece can be most easily understood through the model specification, so that when the user needs it, the first reuse model that matches the target data set can be directly filtered out from the learning piece library based on the model specification in the learning piece, avoiding the need to infer each reuse model in the learning piece library one by one, which greatly saves computing resources. For example, a massive learning library can be built to store numerous learning pieces. Each learning piece includes a reusable model and its corresponding model specification. Each model is fully trained by the model developer using their own data. Furthermore, before uploading a model, the developer needs to construct a model specification using secondary training. This specification, along with the model, is then packaged into a learning piece and uploaded to the learning library for easy search.
[0094] As shown in Figure 4, among the model specifications corresponding to multiple reuse 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 reuse model corresponding to the best-matched model specification is determined as the first reuse 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 matching and returns it to the user. This search for reuse models through model specifications can quickly and conveniently filter out matching reuse models, improve screening efficiency, and save computing power and data volume.
[0095] In other embodiments, the learning material library may also directly store multiple reuse models and the model specifications corresponding to each reuse model, that is, the reuse models and the model specifications corresponding to the reuse models do not need to be packaged into one learning material and stored in the learning material library.
[0096] In some embodiments, based on the target specification corresponding to the target data set, determining the first reuse model that matches 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 model specification and the target specification; based on the cosine similarity between each model specification and the target specification, determining that the reuse model corresponding to the model specification with the highest cosine similarity between the target specification is the first reuse model.
[0097] 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 specification is returned, and then the reuse model in the learning material is determined to be 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.
[0098] 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.
[0099] It should be noted that the preset training data set corresponding to each of the reuse models can be understood as the initial training data set for training the reuse model, and can be provided by the provider of the reuse model. Each reuse model needs to pass the model specification corresponding to the preset training model determiner, so that the user can quickly filter out the first reuse model required by the target data set from multiple reuse 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 secondary learning model function, that is, the preset training model includes a preset proxy model and the preset linear model, which can learn the model function twice, greatly improving the accuracy of the model specification, thereby improving the performance of model reuse.
[0100] 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 predictions on the preset training data set corresponding to each of the reused models based on the preset proxy model to obtain training prediction results corresponding to each of the reused models, and the training prediction results include pseudo-label information corresponding to the preset training data set; performing fitting training on the preset linear model based on the training prediction results corresponding to each of the reused models to obtain the 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.
[0101] Please refer to Figure 5, which is a flow chart of a model specification construction provided by an embodiment of the present application. As shown in Figure 5, a preset proxy model is used to make inferences on the original training data corresponding to the reuse model to obtain a prediction result as a pseudo-label; the 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 reuse model. Using a model specification construction method based on the functional approximation of a secondary learning model, the model specification of the determined reuse model can accurately indicate the functional characteristics of the corresponding reuse model, and can better characterize the characteristics of the corresponding reuse 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 reuse model, avoiding the selection of reuse models based on one-by-one matching of the target data set, and significantly improving the efficiency of model reuse.
[0102] 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 a 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 requirements of the target task, and the adjusted model can be reused on the target task. Among them, the specific adjustment method can refer to the following related embodiments, and the embodiments of the present application will not be repeated here.
[0103] In other embodiments, the preset training dataset corresponding to the first reuse model is not associated with the target dataset. It is understood that the multiple reuse models in the learning library are all trained models, that is, existing pre-trained models that can be reused directly or after a small amount of data adjustment. Therefore, the preset training dataset corresponding to the first reuse model is not associated with the target dataset, for example, they are different data for similar tasks or the data comes from different sources.
[0104] Step S302: performing shrinkage adjustment on the first multiplexing model based on the target data set to obtain a second multiplexing model.
[0105] 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 shrunk 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.
[0106] In some embodiments, the shrinking adjustment of 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, and 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 adjustment of the first reuse model based on the first prediction result to obtain the second reuse model.
[0107] 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 it can be set based on the performance of the model itself, and the embodiment of the present application does not impose any specific restrictions on this. It should be noted that the embodiment of the present application does not impose any specific restrictions on the rules for multiple predictions. For example, when the first reuse model is used to make multiple predictions of the target data in the target data set, the prediction is made according to the rule that N=1 in the first prediction, and each prediction adds one subtree compared to the previous prediction. For example, 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, its loss vector can be calculated according to the loss function based on the true label corresponding to the target data (i.e., label information). Assuming that the original model has T subtrees, a loss vector L∈R can be obtained T .
[0108] In some embodiments, each 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 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.
[0109] Please refer to Figure 6, which is a flow chart of a multiplexing model shrinkage adjustment provided by an embodiment of the present application. As shown in Figure 6, 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 during the i-th prediction, obtain the predicted value of each subtree, and after searching for the reusable first multiplexing model based on the specification, perform multiple rounds of reasoning and prediction on the target data set through the first multiplexing model, so as to shrink and adjust the structure of the first multiplexing model according to the results of the multiple predictions, and obtain a second multiplexing model, which can be more suitable for the target data set. Wherein, i is greater than or equal to K.
[0110] Based on the first prediction result and the label information corresponding to each 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 get the number of subtrees corresponding to these loss vectors N = t1, t2, ..., t k , according to the number of these subtrees, the original model is retained N=t1,t2,…,t k subtrees, and obtain 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 embodiment of the present application will not be described in detail. Based on these K models and K weights, the adjusted second multiplexing model can be obtained, wherein: the second multiplexing model is:
[0111] In an embodiment of the present application, based on the first prediction result, the loss vector of the first reuse model on the target data set under multiple rounds of prediction is calculated respectively, and the K predictions with the smallest loss vector and the number of subtrees included in the K predictions of the first reuse model are determined, so as to retain the K sub-models corresponding to the K predictions with the smallest loss vector, and then obtain the corresponding contraction model, that is, the second reuse model, which includes the above-mentioned K sub-models.
[0112] Step S303: Perform model expansion based on the target data set and the second reuse model to obtain a third reuse model.
[0113] Specifically, the model is expanded based on the target data set and the second reuse model to obtain a third reuse model. Please refer to Figure 7, which 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, this part of the target data can be used to crop the first reuse model (i.e., shrink and adjust), and then use this part of the target data to continue training the cropped model, expand the model, obtain the third reuse model, and finally obtain the target model after the first reuse model is reused on the user task. 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, 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, can improve the model reuse performance, and also improve the accuracy of completing the task.
[0114] In some embodiments, each target data corresponds to label information, and the model expansion based on the target data set and the second reuse model to obtain a third reuse model includes: 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 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 target data; and performing model expansion based on the target data set and the residual information to obtain the third reuse model.
[0115] Exemplarily, the second multiplexing model M based on the above adjustment is F Perform prediction on the target data set to obtain a second prediction result, which includes the predicted 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 (ie, the residual label y R ) performs machine learning (e.g., incremental learning) and trains n new sub-models, for example: Obtain the third multiplexing model, which 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.
[0116] 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.
[0117] Step S304: Integrate the second multiplexing model and the third multiplexing model to obtain a target multiplexing model corresponding to the target data set.
[0118] Specifically, the second reuse model and the third reuse model are integrated to obtain the target reuse model corresponding to the target data set. For example, the target reuse model This direct integration of the second reuse model reduces computational effort and improves reuse efficiency without compromising model reuse performance. Furthermore, by leveraging models trained in related tasks for new tasks or domains, it avoids collecting data and training models from scratch, reducing reliance on high-quality training data while saving model training time and computational resources.
[0119] 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.
[0120] The model reuse method in the prior art is not suitable for unstructured tabular data, and model reuse is difficult. To this end, an embodiment of the present application provides a model reuse method that can simply and efficiently reuse models for unstructured tabular data. Specifically, first, a first reuse model that matches the target dataset is determined from multiple reuse models in the learning library. The first reuse model selected is the reusable model in the learning library that is most suitable for processing the task corresponding to the target dataset. The target dataset includes multiple target data, and the multiple target data are tabular data. Then, the user can directly use the first reuse model searched from the learning library or continue training or adjusting it on the target dataset, so that the user does not need 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 further adjustment of the first reuse model is required, the first reuse model is simply adjusted and trained based on the target dataset to obtain a target reuse model corresponding to the target dataset. The target reuse model can perform reasoning or decision-making on the target dataset to complete the task corresponding to the target dataset. For example, statistics or classification can be performed on tabular data. 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 shrunken second reuse model and the expanded third reuse model are integrated to obtain the above-mentioned target reuse model.
[0121] The above describes in detail the method of the embodiment of the present application, and the following provides the relevant device of the embodiment of the present application.
[0122] Please refer to FIG8 , which 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 . In particular:
[0123] 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.
[0124] The shrinking unit 402 is configured to shrink and adjust the first reuse model based on the target data set to obtain a second reuse model.
[0125] 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.
[0126] The integration unit 404 is configured to integrate the second reuse model and the third reuse model to obtain a target reuse model corresponding to the target data set.
[0127] 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 the model parameter vector and target text information corresponding to the 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 the preset linear model is trained based on the target data set.
[0128] 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 model specification and the target specification; based on the cosine similarity between each model specification and the target specification, determine that the reuse model corresponding to the model specification with the highest cosine similarity between the target specification is the first reuse model.
[0129] In some embodiments, the device also includes: a specification unit 405, which is used to determine the model specification corresponding to each of the reused models in the learning library based on the preset training model and the 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.
[0130] 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, and 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.
[0131] 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 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.
[0132] In some embodiments, each target data corresponds to label information; the shrinkage 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 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; 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 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.
[0133] 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, and the second prediction result includes a prediction value corresponding to each of the target data; based on the second prediction result and the label information corresponding to each of the target data, determine the residual information corresponding to the second reuse model; perform model expansion based on the target data set and the residual information to obtain the third reuse model.
[0134] It should be noted that the functions of each functional unit in the model reuse device 10 described in the embodiment of the present application can be found in the relevant descriptions of steps S301 to S304 in the method embodiment described in Figure 3 above, and will not be repeated here.
[0135] In addition, an embodiment of the present application further provides a computer-readable storage medium, which stores computer program code. When the above-mentioned processor executes the computer program code, the computer executes the method in any of the aforementioned embodiments.
[0136] An embodiment of the present application further provides a computer program product, which, when executed on a computer, enables the computer to execute the method in any of the aforementioned embodiments.
[0137] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0138] It should be noted that for the aforementioned 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 this application is not limited by the order of the actions described, because according to this application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0139] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, 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.
[0140] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0141] In addition, the functional units in the embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0142] 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 for enabling a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to execute 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.
[0143] 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 above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above 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 K predictions with the smallest loss vector from the loss vectors corresponding to the multiple predictions respectively, corresponding to the subtree included in the first reuse model Number, 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
Patent Citations
Model multiplexing method and related device
CN119512535A
Mmethod, device and equipment for determining network model pruning strategy and storage medium
CN112149829A
Incremental learning method of multi-mode multi-label prediction model
CN112580797A
Universal learning document searching and multiplexing method and device
CN116542136A
Image coding with scalable context quantization
US20070120712A1