A model aggregation method, system and related device for integrating generative large models
By carefully evaluating and optimizing the generated large model at levels and sub-layers, combining the multimodal feature data set and Transformer architecture, the problem of excessive pruning in the existing technology is solved, and more efficient model optimization and performance improvement is achieved.
Patent Information
- Application Number
- CN202510104047.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-01-23
AI Technical Summary
When the prior art is fused with generative large models, the weight-based pruning method has the risk of excessive pruning, which damages the overall performance and generation quality of the model, and is particularly poor in the face of complex and diverse data sets.
By collecting data sets of multimodal eigenvectors, an initially generated large model is constructed and divided into multiple levels and sub-layers. Calculate the complex value, memory occupancy value and contribution value of each sublayer, calculate the impact value based on the preset weights required by the user, determine whether it exceeds the pruning threshold, and perform pruning and converging to obtain the target generation large model.
The risk of excessive pruning is effectively avoided, the overall performance and generation quality of the model are ensured, the characteristics and contributions of each sublayer can be more accurately evaluated, the model structure is optimized, and the operation efficiency and generalization capabilities are improved.
Smart Images

Figure CN119538197B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of deep learning technology, and in particular to a model aggregation method, system and related devices for integrating a generative large model. Background Art
[0002] With the rapid development of deep learning technology, generative models have been widely used in a variety of multimodal tasks such as image generation, text generation, and audio synthesis. For example, in the field of image generation, generative adversarial networks are widely used in tasks such as artistic creation, image restoration, and super-resolution reconstruction. Through adversarial training between generators and discriminators, high-quality images are generated. Generally speaking, generative models have complex structures and a large number of parameters, which causes generative models to consume a lot of computing resources and memory during training and inference. Therefore, how to effectively reduce the model size while ensuring the performance of the generative model has become a difficulty in the development of technology.
[0003] In the prior art, in the process of integrating generative large models, the pruning technology therein mainly relies on the evaluation of model weights. By calculating the weight value of each level in the generative large model, its impact on the overall model performance is judged, and the model's hierarchical pruning is performed. The weight-based pruning method is simple to implement, can optimize the model structure to a certain extent, and has a relatively low computational cost, which can quickly reduce the number of model parameters.
[0004] However, when faced with complex and diverse data sets, weight-based pruning methods have significant limitations. Since weight-based pruning methods mainly focus on the overall evaluation of each level, they fail to fully consider the individual characteristics and specific contributions within each level, which can easily lead to over-pruning during the pruning process, thereby damaging the overall performance and generation quality of the generative model. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a model aggregation method, system and related devices for integrating generative large models.
[0006] The technical solution provided in this application is described below:
[0007] In a first aspect, the present application provides a model aggregation method for integrating a generative large model, the method comprising:
[0008] Collect a data set of multimodal feature vectors, use the data set to train a pre-trained model to obtain a sub-model, and build an initial generative large model based on the sub-model and the multimodal feature vectors using a Transformer architecture;
[0009] According to the functional modules of the initial generative large model, the initial generative large model is divided into a plurality of levels, each of which includes a plurality of sub-layers;
[0010] Determine the type of the sublayer, and calculate a complexity value of each sublayer based on the type of the sublayer, wherein the complexity value is used to evaluate the computational complexity of each sublayer during reasoning;
[0011] Obtain the memory occupied by trainable parameters and the memory occupied by intermediate results of the sublayer during inference, and calculate the memory occupied value of each sublayer by using the memory occupied by trainable parameters and the memory occupied by intermediate results, wherein the memory occupied value is used to evaluate the memory resources of each sublayer during inference;
[0012] Obtaining the gain impact and the generation index improvement value of the sublayer during reasoning, and calculating the contribution value of each sublayer through the gain impact and the generation index improvement value, wherein the contribution value is used to evaluate the contribution degree of each sublayer during reasoning;
[0013] Based on user needs, preset weights of the complexity value, the memory usage value, and the contribution value are obtained, and the influence value of each sub-layer is calculated in combination with the preset weights, where the influence value is used to evaluate the quality influence of each sub-layer on the inference result;
[0014] Determine whether the influence value of each sublayer exceeds a pruning threshold;
[0015] If not, pruning the sublayers that do not exceed the pruning threshold is performed, and multiple target sublayers are obtained after pruning;
[0016] The target sub-layers are aggregated to obtain a target generative large model.
[0017] Optionally, determining the type of the sublayer and calculating the complex value of each sublayer based on the type of the sublayer includes:
[0018] Constructing a kTree data structure based on the initial generative large model;
[0019] Determine the type of the sublayer according to the kTree data structure, the type of the sublayer includes a base layer and a dependent layer, the leaf nodes in the kTree data structure correspond to the base layer, and the non-leaf nodes in the kTree data structure correspond to the dependent layer;
[0020] A complex value is calculated for each sub-layer based on the type of the sub-layer.
[0021] Optionally, when the type of the sublayer is a base layer, calculating the complex value of each sublayer based on the type of the sublayer includes:
[0022] The input and output dimensions and convolution kernel parameters of the base layer are obtained through the kTree data structure, and the complex value of the base layer is calculated based on the input and output dimensions and the convolution kernel parameters;
[0023] When the type of the sublayer is a dependent layer, the calculating of the complex value of each sublayer based on the type of the sublayer includes:
[0024] The sequence length, embedding dimension and number of neurons are obtained through the kTree data structure, and the complex value of the dependency layer is calculated based on the sequence length, embedding dimension and number of neurons.
[0025] Optionally, the complex value of the base layer is expressed by the following formula:
[0026] ;
[0027] in, a complex value representing the base layer, represents the output channel in the input-output dimension, represents the input channels in the input-output dimension, represents the convolution kernel size in the convolution kernel parameters, represents the fast Fourier transform algorithm, Indicates feature maps of the input channels, Represents the convolution kernel matrix corresponding to the output channel and the input channel;
[0028] The complex value of the dependency layer is expressed by the following formula:
[0029] ;
[0030] in, A complex value representing the dependency layer, represents the head of the embedding dimension, Indicates The number of neurons in the head, Indicates the key of the header, No. a vector of values of the head, represents the length of the sequence, The weight matrix representing the number of neurons, represents the weight matrix of the key, represents the weight matrix of the value vector, Represents the normalization algorithm.
[0031] Optionally, the influence value of the sublayer can be expressed by the following formula:
[0032] ;
[0033] in, represents the influence value of the sublayer, represents the preset weights for the complexity value and the contribution value, represents the preset weights for the memory usage value and the contribution value, represents the contribution value of the sublayer, said complex value representing said sublayer, Represents the memory usage value of the sublayer.
[0034] Optionally, after aggregating the target sub-layers to obtain a target generative large model, the method further includes:
[0035] Obtain a test set, input the test set into the target generative large model for testing, and evaluate the test results after the test is completed to obtain performance indicators of the target generative large model;
[0036] The target generative large model is adjusted based on the performance indicator, and a fused generative large model is obtained after the adjustment.
[0037] Optionally, adjusting the target generative big model based on the performance indicator to obtain a fused generative big model after the adjustment includes:
[0038] Determining whether the target generative large model reaches the target performance indicator based on the performance indicator;
[0039] If not, recalculate the complexity value, memory usage value and contribution value of each sub-layer, and increase the pruning threshold in an iterative process until the target performance indicator is reached;
[0040] When it is determined that the performance indicator of the target generative large model reaches the target performance indicator, a fused generative large model is obtained.
[0041] A second aspect of the present application provides a model aggregation system for integrating a generative large model, the system comprising:
[0042] A construction unit, configured to collect a data set of multimodal feature vectors, use the data set to train a pre-trained model to obtain a sub-model, and construct an initial generative large model based on the sub-model and the multimodal feature vectors using a Transformer architecture;
[0043] A division unit, configured to divide the initial generative large model into a plurality of levels according to the functional modules of the initial generative large model, each of the levels including a plurality of sub-layers;
[0044] A first calculation unit, used to determine the type of the sublayer, and calculate a complexity value of each sublayer based on the type of the sublayer, wherein the complexity value is used to evaluate the computational complexity of each sublayer during reasoning;
[0045] A second computing unit is used to obtain the memory occupied by the trainable parameters and the memory occupied by the intermediate results of the sub-layer during inference, and calculate the memory occupied value of each sub-layer by the memory occupied by the trainable parameters and the memory occupied by the intermediate results, and the memory occupied value is used to evaluate the memory resources of each sub-layer during inference;
[0046] A third calculation unit is used to obtain the gain influence and the generation index improvement value of the sub-layer during reasoning, and calculate the contribution value of each sub-layer through the gain influence and the generation index improvement value, and the contribution value is used to evaluate the contribution degree of each sub-layer during reasoning;
[0047] A fourth calculation unit, configured to obtain preset weights of the complexity value, the memory usage value, and the contribution value based on user requirements, and calculate an influence value of each sublayer in combination with the preset weights, wherein the influence value is used to evaluate the quality influence of each sublayer on the inference result;
[0048] A first judging unit, configured to judge whether the influence value of each sub-layer exceeds a pruning threshold;
[0049] A pruning unit, configured to prune the sublayers that do not exceed the pruning threshold if no, to obtain multiple target sublayers after pruning;
[0050] The aggregation unit is used to aggregate the target sub-layers to obtain a target generative large model.
[0051] A third aspect of the present application provides a model aggregation device for integrating a generative large model, the device comprising:
[0052] Processor, memory, input-output unit, and bus;
[0053] The processor is connected to the memory, the input and output unit, and the bus;
[0054] The memory stores a program, and the processor calls the program to execute any of the above methods.
[0055] A fourth aspect of the present application provides a computer-readable storage medium, on which a program is stored. When the program is executed on a computer, the program executes the first aspect and any optional method in the first aspect.
[0056] It can be seen from the above technical solutions that this application has the following advantages:
[0057] By calculating the complexity value, memory usage value and contribution value of each sublayer in each level, the present application can comprehensively reflect the impact of each sublayer on the generation result of the fused generative large model, ensuring an in-depth analysis of the characteristics of each sublayer in each level, rather than just an overall evaluation of the level. In addition, the application independently evaluates each sublayer based on the impact value and sets a reasonable threshold for judgment. This can more accurately determine whether the sublayer is redundant or unnecessary, and can promptly retain or prune the sublayer, effectively avoiding the risk of over-pruning, thereby ensuring the overall performance and generation quality of the fused generative model. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0059] Figure 1 A schematic diagram of an embodiment of a model aggregation method for a fusion generative large model provided in this application;
[0060] Figure 2 A schematic flow chart of another embodiment of the model aggregation method for the fusion generative large model provided in the present application;
[0061] Figure 3 A schematic diagram of the structure of an embodiment of a model aggregation system for integrating generative large models provided in this application;
[0062] Figure 4 A schematic structural diagram of an embodiment of a model aggregation device for a fused generative large model provided in this application. DETAILED DESCRIPTION
[0063] The present application provides a model aggregation method for integrating a large generative model, which can improve the overall performance and generation quality of the generative model. It should be noted that the model aggregation method for integrating a large generative model of the present application is applied to a terminal.
[0064] See also Figure 1 The present application first provides an embodiment of a model aggregation method for integrating a generative large model, the embodiment comprising:
[0065] S101, collect a data set of multimodal feature vectors, use the data set to train the pre-trained model to obtain a sub-model, and build an initial generative large model based on the sub-model and the multimodal feature vectors using the Transformer architecture;
[0066] The Transformer architecture is an innovative deep learning architecture designed to process sequence data using the Attention Mechanism. It is mainly composed of an Encoder and a Decoder. The Encoder can process each element in the input sequence in parallel, capture the relationship between sequence elements through a multi-head attention mechanism, and perform feature extraction and conversion on the data in combination with a feedforward neural network; the Decoder uses the attention mechanism to process the generation process of the output sequence, and can dynamically assign weights according to the importance of different parts of the source language input.
[0067] It should be noted that the advantage of using the Transformer architecture in this embodiment is that the Transformer architecture can effectively process long sequence data, avoiding the problem of vanishing or exploding gradients of long sequences in traditional RNNs, and the parallel computing capability of the Transformer architecture can greatly improve the speed of training and reasoning.
[0068] In this embodiment, the data set of the collected multimodal feature vectors includes image data, text data, and audio data, and the pre-trained model is trained using the data set of the multimodal feature vectors. During the training of the pre-trained model, the pre-trained model can adjust parameters by learning the characteristic patterns of different modal data in the data set of the modal feature vectors, thereby obtaining sub-models of multiple different modal data, combining the obtained sub-models with the multimodal feature vectors in the collected data set, and using the Transformer architecture to build an initial generative large model.
[0069] Collecting data sets of multimodal feature vectors enables the trained sub-models to learn the characteristics of different types of data, improves the generalization ability of the model, and provides a data foundation for the subsequent construction of the initial generative large model. When constructing the initial generative large model, the Transformer architecture is used to better capture the long-distance dependencies in the multimodal feature vectors, improve the initial generative large model's ability to understand complex semantic information, and help enhance the performance and practicality of the initial generative large model in a variety of application scenarios.
[0070] S102, dividing the initial generative large model into multiple levels according to the functional modules of the initial generative large model, each level including multiple sub-layers;
[0071] In this embodiment, it is necessary to conduct a comprehensive functional analysis of the constructed initial generative model, clarify the different functional modules of the initial generative model, and then divide the initial generative model into multiple levels according to the logical relationship and functional characteristics of different functional modules, for example, according to the order of data processing, the abstract level of functions, or the degree of coupling between modules. Within each level, multiple sub-layers are further subdivided, and each sub-layer in each level corresponds to a different computing unit in the model.
[0072] This embodiment divides the initial generative big model into multiple levels according to functional modules, which helps to improve the comprehensibility and maintainability of the model. The hierarchical structure in the levels can make the architecture of the initial generative big model clearer, facilitate debugging, optimization and improvement of the initial generative big model, and different levels can focus on tasks at different levels. For example, the lower levels can handle basic data feature extraction, and the higher levels can perform more complex semantic analysis.
[0073] When actually optimizing the initial generative large model, specific layers and sublayers can be optimized, which helps to improve the flexibility of the initial generative large model. When the initial generative large model is large in scale, the allocation of computing resources can be effectively controlled to improve the training and reasoning efficiency of the initial generative large model.
[0074] S103, determining the type of the sublayer, and calculating the complexity value of each sublayer based on the type of the sublayer, where the complexity value is used to evaluate the computational complexity of each sublayer during reasoning;
[0075] In this embodiment, it is first necessary to determine the type of each sublayer according to the structural characteristics and functional characteristics of the sublayer. For example, if the calculation of the sublayer involves processing sequence data according to the time step, the type of the sublayer is a recurrent neural network layer. After the type of the sublayer is determined, the complexity is calculated according to the different sublayer types determined. For example, the complexity of the recurrent neural network layer is calculated. The complexity value of each sublayer is usually calculated by the input dimension, hidden layer dimension and time step. The obtained complexity value is used to evaluate the computational complexity of each sublayer during reasoning.
[0076] This embodiment helps to gain an in-depth understanding of the computational complexity of each sublayer in the initial generative large model during reasoning by determining the type of the sublayer and calculating the complexity value based on the type of the sublayer. It can also accurately calculate the complexity value and find out the sublayers with higher computational complexity in the initial generative large model. The sublayers with higher computational complexity consume a lot of computing resources during the reasoning process, which is beneficial for taking reasonable optimization strategies, such as pruning and quantization, for the sublayers with higher computational complexity in the subsequent optimization process.
[0077] S104, obtaining the memory occupied by the trainable parameters and the memory occupied by the intermediate results of the sub-layer during inference, and calculating the memory occupied by the trainable parameters and the intermediate results to obtain the memory occupied value of each sub-layer, and the memory occupied value is used to evaluate the memory resources of each sub-layer during inference;
[0078] In this embodiment, the memory size occupied by the trainable parameters of each sub-layer during reasoning can be determined by analyzing the structural parameters of the sub-layer, and then combined with the data type and memory space calculation rules, the memory occupied by the trainable parameters can be obtained. At the same time, during the reasoning process, the memory occupied by the intermediate results generated by the sub-layer during the reasoning process can be determined, where the intermediate results generated include matrices and vectors of intermediate calculations. When obtaining the memory occupied by the intermediate results generated by the sub-layer during the reasoning process, the memory occupied by the intermediate results can be calculated by analyzing the calculation process and data flow of the sub-layer, combined with the scale and data type of the intermediate results. The memory occupied by each sub-layer can be obtained by adding the memory occupied by the trainable parameters and the memory occupied by the intermediate results. The obtained memory occupancy value is used to evaluate the memory resources of each sub-layer during reasoning.
[0079] In practical applications, calculating the memory usage of each sub-layer helps to gain a deeper understanding of the model's memory resource consumption during inference. During the model optimization process, if it is found that the memory usage of a sub-layer is too high, the entire model will not run properly on devices with limited memory resources, which helps to optimize the sub-layer in a timely and targeted manner.
[0080] S105, obtaining the gain influence and generation index improvement value of the sub-layer during reasoning, and calculating the contribution value of each sub-layer through the gain influence and generation index improvement value, and the contribution value is used to evaluate the contribution degree of each sub-layer during reasoning;
[0081] In this embodiment, the gain impact of a single sub-layer during reasoning is determined by comparing the changes in the evaluation indicators of the initial generative large model when a single sub-layer is included and when a single sub-layer is not included. For example, in an image classification task, the accuracy improvement of the initial generative large model when the sub-layer is included and not included is compared. At the same time, in a specific reasoning task, the generation index improvement value of the sub-layer is obtained. For example, in a text generation task, the obtained generation index improvement value is the degree of improvement of indicators such as coherence and richness of the generated text. After the gain impact and the generation index improvement value are obtained, the gain impact and the generation index improvement value are comprehensively calculated according to a pre-set calculation method to obtain the contribution value of each sub-layer. The obtained contribution value is used to evaluate the degree of contribution of each sub-layer during reasoning.
[0082] In practical applications, calculating the contribution value of each sub-layer can intuitively understand the contribution of each sub-layer to the performance improvement of the initial generative large model during the reasoning process, which helps to deeply understand the relationship between the internal structure and performance of the initial generative large model, and provide a basis for further innovation and improvement of the initial generative large model.
[0083] S106, based on user needs, obtain preset weights of complexity value, memory usage value and contribution value, and calculate the influence value of each sub-layer in combination with the preset weights, where the influence value is used to evaluate the quality impact of each sub-layer on the reasoning result;
[0084] In this embodiment, it is necessary to first obtain user needs, analyze the user needs, and determine the preset weights of complexity value, memory usage value and contribution value based on the results of analyzing user needs. For example, if the user is more concerned about the running speed and resource usage of the initial generative large model in user needs, then the complexity value and memory usage value will be given a higher weight; if the user is more concerned about the performance improvement of the model in user needs, then the contribution value will be given a higher weight.
[0085] The influence value of the sublayer is expressed by the following formula:
[0086] ;
[0087] in, represents the influence value of the sublayer, Indicates the preset weights for complexity and contribution values. Indicates the preset weights for memory usage and contribution. represents the contribution value of the sublayer, A complex value representing a sublayer, Indicates the memory usage of the sublayer.
[0088] After determining the weights of complexity value, memory usage value and contribution value, the complexity value, memory usage value and contribution value of each sub-layer are calculated respectively in combination with the preset weights to obtain the influence value of each sub-layer. The obtained influence value is used to evaluate the impact of each sub-layer on the quality of the inference result.
[0089] In practical applications, different users have different needs in different tasks. For example, in autonomous driving, target detection has high real-time requirements, so it is more inclined to reduce computational complexity and memory usage; in scientific research tasks with high requirements for result accuracy, the contribution value of the sub-layer is more important.
[0090] By setting different preset weights based on user needs to calculate the impact value of each sub-layer, the evaluation of the initial generative large model can be made more in line with the actual application scenario. It can comprehensively evaluate the impact of each sub-layer on the quality of reasoning results according to the specific needs of users, and can make targeted adjustments to different sub-layers according to the size of the impact value, so as to achieve the goal of optimizing the model structure, improving model performance and reducing resource consumption while meeting user needs.
[0091] S107, judging whether the influence value of each sub-layer exceeds the pruning threshold;
[0092] In this embodiment, the influence value of each sub-layer that has been calculated is obtained, and a pruning threshold is determined at the same time. The determined pruning threshold is determined comprehensively based on multiple factors such as user requirements, task requirements, and hardware resources of the initial generative large model. After obtaining the influence value of each sub-layer and determining the pruning threshold, the influence value of each sub-layer is compared with the pruning threshold one by one to determine whether the influence value of each sub-layer exceeds the pruning threshold.
[0093] When it is determined that the influence value of a single sublayer exceeds the pruning threshold, the single sublayer is retained and the next sublayer is determined until the end; when it is determined that the influence value of a single sublayer does not exceed the pruning threshold, step 108 is executed.
[0094] By comparing the influence value of each sub-layer with the pruning threshold, the sub-layers with less impact on the quality of the initial generative large model inference results can be screened out. This helps to avoid overly complex structures and reduce unnecessary computing and storage costs.
[0095] In practical applications, large-scale generative models contain many sub-layers, and some sub-layers do not contribute much to the final performance of the generative model, but consume a lot of computing resources and memory. By judging the influence value of each sub-layer, a clear basis can be provided for subsequent pruning operations, thereby improving the operating efficiency of the initial generative model, reducing the resource consumption of the initial generative model during the reasoning process, and helping to improve the generalization ability of the initial generative model.
[0096] S108, pruning the sub-layers that do not exceed the pruning threshold, and obtaining multiple target sub-layers after pruning;
[0097] In this embodiment, when it is determined that the influence value of a single sub-layer does not exceed the pruning threshold, the sub-layer that does not exceed the pruning threshold is pruned. For different types of sub-layers, the pruning method needs to be changed in time. For example, if the sub-layer type is a convolutional layer, the convolutional layer with less impact on the output result can be removed.
[0098] It should be noted that during the pruning process, the structure of the initial generative large model needs to be adjusted in a timely manner to ensure that the pruned sub-layers can still maintain a certain functional integrity. At the same time, continuous testing and verification should be performed to ensure that the pruning operation does not have a negative impact on the key performance indicators of the initial generative large model.
[0099] Pruning sub-layers that do not exceed the pruning threshold can reduce the redundancy in the initial generative large model, thereby reducing the computational complexity of the initial generative large model and avoiding over-pruning. During the reasoning process, the pruned initial generative large model needs to perform fewer computational operations, which can significantly improve the reasoning speed of the initial generative large model. At the same time, it can make the initial generative large model more focused on key structures and parameters, which helps to improve the generalization ability of the initial generative large model and avoid overfitting.
[0100] S109: Aggregate the target sub-layers to obtain a target generative large model.
[0101] In this embodiment, multiple target sub-layers obtained after pruning are aggregated. During the aggregation process, the connection parameters need to be adjusted and optimized in real time to ensure that the target generative large model can run normally and maintain good performance.
[0102] It should be noted that during aggregation, the connection relationship and data flow between sub-layers need to correspond to each other to ensure that the target generative model structure after aggregation conforms to the model structure. For example, if there is a specific sequential connection or data interaction relationship between sub-layers before pruning, then they must be combined according to the original specific sequential connection or data interaction relationship during aggregation.
[0103] Aggregating the target sub-layers to obtain the target generative large model can build an efficient model. Since the pruning operation has been completed and unnecessary sub-layers have been removed, the aggregated target generative large model is more compact in structure, reducing unnecessary computing and storage overhead, allowing the target generative large model to process data faster during reasoning, thereby improving the operating efficiency of the target generative large model.
[0104] See also Figure 2 , Figure 2 Another embodiment of a model aggregation method for a fusion generative large model provided in the present application includes:
[0105] S201, collecting a data set of multimodal feature vectors, using the data set to train the pre-trained model to obtain a sub-model, and based on the sub-model and the multimodal feature vectors, using the Transformer architecture to build an initial generative large model;
[0106] S202, dividing the initial generative large model into multiple levels according to the functional modules of the initial generative large model, each level including multiple sub-layers;
[0107] In this embodiment, steps S201 to S202 are similar to steps S101 to S102 in the aforementioned embodiment, and are not described again here.
[0108] S203, constructing a kTree data structure based on the initial generative large model;
[0109] The kTree data structure is a tree structure used to represent large models. It mainly sets the levels of the large model as branch nodes, and the sub-levels as child nodes, and reflects the hierarchical dependency through the parent-child relationship of nodes. The kTree data structure can accurately reflect the model structure and logical relationship, and can build a complete framework for large model analysis, optimization and other operations, which is helpful for in-depth understanding and processing of large models.
[0110] In this embodiment, to construct a kTree data structure, it is necessary to first determine each element in the initial generative model, each element including each level and sub-level and the connection relationship between each level and each sub-level. After the elements are determined, the kTree data structure can be constructed using the rules of hierarchical nesting and dependency representation, for example, each level is used as a branch node in the kTree data structure, each sub-level is used as a child node under the branch node, and the dependency relationship between the levels is represented by the parent-child relationship of the nodes in the kTree data structure, where the parent-child relationship can be that the level corresponding to the parent node provides input or control information for the level corresponding to the child node.
[0111] It should be noted that during the construction process, it is necessary to ensure that the kTree data structure can accurately reflect the structure and logical relationship of the initial generative large model, including the flow direction of data in the initial generative large model, the calling order between each sub-layer, etc.
[0112] The kTree data structure of this embodiment can clearly display the hierarchical structure of the initial generative large model and the relationship between elements. Constructing the kTree data structure based on the initial generative large model provides an intuitive and effective data structure representation method for the analysis and processing of the initial generative large model, which facilitates the extraction and analysis of subsequent calculation steps.
[0113] S204, determining the type of the sublayer according to the kTree data structure, the sublayer types include a base layer and a dependent layer, the leaf nodes in the kTree data structure correspond to the base layer, and the non-leaf nodes in the kTree data structure correspond to the dependent layer;
[0114] In this embodiment, after the kTree data structure is constructed, each node in the kTree data structure is traversed. The kTree data structure includes leaf nodes and non-leaf nodes. Leaf nodes are the bottom-level nodes in the kTree data structure, representing the most basic operation unit in the model, directly processing input data or intermediate data with less conversion; non-leaf nodes are in the middle level in the kTree data structure, relying on the output of the sub-layer as input, and have a certain influence or control on the operation of the sub-layer.
[0115] The types of sublayers include base layer and dependent layer. After traversing each node in the kTree data structure, the type of the sublayer corresponding to the leaf node is determined as the base layer, and the type of the sublayer corresponding to the non-leaf node is determined as the dependent layer.
[0116] The base layer is the underlying operation unit of the initial generative large model. Subsequent analysis and optimization of the base layer can fundamentally improve the performance of the initial generative large model. For example, optimizing the computational efficiency of the base layer can directly affect the running speed of the entire initial generative large model. The dependency layer reflects the dependencies and interactions between the various parts of the initial generative large model, which can help optimize the overall architecture of the initial generative large model and improve the stability and reliability of the initial generative large model.
[0117] Determining the type of sublayer through the kTree data structure provides a basis for subsequent processing of different types of sublayers, and further distinguishing the type of sublayer as the basic layer or the dependent layer helps to deeply understand the internal logical structure of the initial generative large model and improve the efficiency of the development and optimization of the initial generative large model.
[0118] S205. When the type of the sublayer is the base layer, the input and output dimensions and convolution kernel parameters of the base layer are obtained through the kTree data structure, and the complexity value of the base layer is calculated based on the input and output dimensions and the convolution kernel parameters. The complexity value is used to evaluate the computational complexity of each sublayer during reasoning.
[0119] In this embodiment, when it is determined that the sublayer is the base layer, the input and output dimension information of the base layer is obtained through the kTree data structure. The input dimension can be the height, width and number of channels of the image, and the output dimension can be the height, width and number of channels of the feature map after the convolution operation. While obtaining the input and output dimension information, the convolution kernel parameters are obtained from the kTree data structure. The convolution kernel parameters include the size of the convolution kernel, the step size, etc. After the input and output dimensions and convolution kernel parameters are obtained, according to the formula for calculating the complexity of the base layer, the input and output dimensions and the convolution kernel parameters are substituted into the formula for calculation, and the result of the calculation is the complexity value of the base layer.
[0120] The complex value of the base layer is expressed by the following formula:
[0121] ;
[0122] in, represents a complex value at the base layer, represents the output channel in the input-output dimension, represents the input channels in the input-output dimension, Represents the convolution kernel size in the convolution kernel parameters, represents the fast Fourier transform algorithm, Indicates The feature map of the input channels, Represents the convolution kernel matrix corresponding to the output channel and the input channel.
[0123] Calculating the complexity of the dependent layer helps to comprehensively evaluate the computational complexity of the initial generative large model during inference. By calculating the complexity based on the input and output dimensions and convolution kernel parameters, the computational cost of the base layer in the initial generative large model operation can be quantified, which is conducive to taking corresponding optimization measures in a timely manner to improve the overall operating efficiency of the initial generative large model and reduce resource consumption, while providing a data basis for subsequent calculations of impact values.
[0124] S206. When the sublayer type is a dependent layer, the sequence length, embedding dimension and number of neurons are obtained through the kTree data structure, and the complexity value of the dependent layer is calculated based on the sequence length, embedding dimension and number of neurons. The complexity value is used to evaluate the computational complexity of each sublayer during reasoning.
[0125] In this embodiment, when it is determined that the sublayer is a dependent layer, the sequence length information is obtained from the kTree data structure, and the sequence length represents the number of elements in the input sequence. While obtaining the sequence length information, the embedding dimension and the number of neurons are obtained. The embedding dimension reflects the dimensional size after the original data is mapped to the low-dimensional space, and the number of neurons reflects the scale of the computing unit of the dependent layer when processing data. After the sequence length, embedding dimension and number of neurons are obtained, according to the formula for calculating the complexity of the dependent layer, the sequence length, embedding dimension and number of neurons are substituted into the formula for calculation, and the result of the calculation is the complexity value of the dependent layer.
[0126] The complex value of the dependency layer is expressed by the following formula:
[0127] ;
[0128] in, Represents a complex value of a dependent layer, The head represents the embedding dimension, Indicates The number of neurons in a head, Indicates The key of the head, Indicates The value vector of the head, represents the sequence length, The weight matrix representing the number of neurons, represents the weight matrix of the key, represents the weight matrix of the value vector, Represents the normalization algorithm.
[0129] Calculating the complexity of the dependency layer helps to comprehensively evaluate the computational complexity of the initial generative large model during inference. By calculating the factors of sequence length, embedding dimension, and number of neurons, the computational cost of the dependency layer in the initial generative large model can be accurately quantified, which is conducive to taking corresponding optimization measures in a timely manner to improve the overall operating efficiency of the initial generative large model and reduce resource consumption, while providing a data basis for subsequent calculation of impact values.
[0130] S207, obtaining the memory occupied by the trainable parameters and the memory occupied by the intermediate results of the sub-layer during inference, and calculating the memory occupied by the trainable parameters and the intermediate results to obtain the memory occupied value of each sub-layer, and the memory occupied value is used to evaluate the memory resources of each sub-layer during inference;
[0131] S208, obtaining the gain influence and generation index improvement value of the sub-layer during reasoning, and calculating the contribution value of each sub-layer through the gain influence and generation index improvement value, and the contribution value is used to evaluate the contribution degree of each sub-layer during reasoning;
[0132] S209, based on user needs, obtain preset weights of complexity value, memory usage value and contribution value, and calculate the influence value of each sub-layer in combination with the preset weights, where the influence value is used to evaluate the quality impact of each sub-layer on the reasoning result;
[0133] S210, determining whether the influence value of each sub-layer exceeds the pruning threshold;
[0134] S211, pruning the sub-layers that do not exceed the pruning threshold, and obtaining multiple target sub-layers after pruning;
[0135] S212, converge the target sub-layers to obtain a target generative large model.
[0136] In this embodiment, steps S207 to S212 are similar to steps S104 to S109 in the above embodiment, and are not described again here.
[0137] S213, obtaining a test set, inputting the test set into the target generative large model for testing, and evaluating the test results after the test is completed to obtain performance indicators of the target generative large model;
[0138] In this embodiment, when obtaining a test set, a representative data sample is selected from a preset test data set as the test set, and the test set needs to cover all processing situations of the target generative large model. After obtaining the test set, the test set is input into the target generative large model, and the target generative large model tests the input data.
[0139] During the test, the output results of the target generative model need to be recorded, including the predicted value, generated content, etc. After the test is completed, the output results are evaluated. The evaluation indicators can be based on accuracy, recall rate, rationality and diversity of generated content, etc. After the evaluation is completed, the performance indicators of the target generative model can be obtained.
[0140] By selecting representative test sets, we can comprehensively test the performance of the target generative large model and discover the pros and cons of the target generative large model in different situations. The evaluation of the test results can provide a clear direction for the improvement of the target generative large model, which will help improve the generalization ability of the target generative large model and enable the target generative large model to better cope with various input data in actual application scenarios, thereby improving the practicality and credibility of the target generative large model. At the same time, it also provides a data basis for the judgment of subsequent target performance indicators.
[0141] S214, judging whether the target generative large model reaches the target performance indicator based on the performance indicator;
[0142] In this embodiment, the performance indicators obtained by evaluation are obtained, and then the specific values or ranges of the target performance indicators are set according to actual needs. After the performance indicators are obtained and the target performance indicators are determined, it is judged whether the target generative large model reaches the target performance indicators based on the performance indicators. For example, for the generative large model, the target performance indicators are set to 90% according to actual needs, and the performance indicators and the target performance indicators are judged one by one. If the performance indicators are within the required range of the target performance indicators, then it is judged that the target generative large model reaches the target performance indicators; if the performance indicators are not within the required range of the target performance indicators, then it is judged that the target generative large model does not reach the target performance indicators. When the performance indicators of the target generative large model reach the target performance indicators, step 216 is executed; when the performance indicators of the target generative large model do not reach the target performance indicators, step 215 is executed.
[0143] By judging the performance indicators, we can objectively evaluate whether the target generative large model meets the actual needs and clearly understand the current performance status of the target generative large model. If the performance indicators of the target generative large model reach the target performance indicators, the target generative large model has the conditions for practical application, saving unnecessary optimization resources; if the performance indicators of the target generative large model do not reach the target performance indicators, problems can be discovered in time to avoid the risks of putting the target generative large model that does not meet the standards into use.
[0144] S215, recalculating the complexity value, memory usage value, and contribution value of each sub-layer, and increasing the pruning threshold in the iterative process until the target performance indicator is reached;
[0145] In this embodiment, when the performance index of the target generative large model does not reach the target performance index, return to step 205, recalculate the complexity value, memory usage value and contribution value of each sub-layer in turn, and update the influence value in combination with the preset weight. In the iterative process, the pruning threshold is continuously increased, the target generative large model is rebuilt and tested until the performance index of the target generative large model reaches the target performance index.
[0146] Recalculating the complexity, memory usage, and contribution values of the sub-layers can more accurately locate the impact of each sub-layer on the performance of the current target generative large model, so as to make targeted adjustments. At the same time, timely increasing the pruning threshold during the iteration process helps to more strictly screen the sub-layers and prevent low-quality sub-layers from entering the target generative large model.
[0147] The target generative large model is continuously optimized through iteration, so that the target generative large model gradually approaches the target performance index, improves the overall performance of the target generative large model, and ensures that the final target generative large model can meet the needs of practical applications.
[0148] S216. When it is determined that the performance index of the target generative large model reaches the target performance index, a fused generative large model is obtained.
[0149] In this embodiment, when it is determined that the performance indicators of the target generative big model reach the target performance indicators, the target generative big model at this time is the fused generative big model, and the obtained fused generative big model can meet user needs in many aspects such as accuracy, efficiency, and resource utilization.
[0150] The target-generation large model has undergone rigorous testing and optimization, and can play a good role in practical applications. It integrates the advantages of each sub-layer, has high performance indicators, and can meet specific task requirements.
[0151] In practical applications, users can directly apply the fused generative large model to corresponding fields, such as natural language processing, image recognition, etc., to improve work efficiency and accuracy.
[0152] The following is a detailed description of the model aggregation of the fusion generative large model provided by this application. Figure 3 , Figure 3 Another embodiment of the model aggregation of the fused generative large model provided by the present application, the system includes:
[0153] A construction unit 301 is used to collect a data set of multimodal feature vectors, use the data set to train the pre-trained model to obtain a sub-model, and build an initial generative large model based on the sub-model and the multimodal feature vectors using a Transformer architecture;
[0154] A division unit 302 is used to divide the initial generative large model into multiple levels according to the functional modules of the initial generative large model, each level including multiple sub-layers;
[0155] A first calculation unit 303, used to determine the type of the sublayer, and calculate the complexity value of each sublayer based on the type of the sublayer, where the complexity value is used to evaluate the computational complexity of each sublayer during reasoning;
[0156] The second calculation unit 304 is used to obtain the memory occupied by the trainable parameters and the memory occupied by the intermediate results of the sub-layer during inference, and calculate the memory occupied by the trainable parameters and the intermediate results to obtain the memory occupied value of each sub-layer, and the memory occupied value is used to evaluate the memory resources of each sub-layer during inference;
[0157] The third calculation unit 305 is used to obtain the gain influence and the generation index improvement value of the sub-layer during reasoning, and calculate the contribution value of each sub-layer through the gain influence and the generation index improvement value. The contribution value is used to evaluate the contribution degree of each sub-layer during reasoning;
[0158] A fourth calculation unit 306 is used to obtain preset weights of the complexity value, the memory usage value, and the contribution value based on user requirements, and calculate the influence value of each sub-layer in combination with the preset weights, where the influence value is used to evaluate the quality influence of each sub-layer on the reasoning result;
[0159] A first judging unit 307, configured to judge whether the influence value of each sub-layer exceeds a pruning threshold;
[0160] A pruning unit 308, configured to prune the sublayers that do not exceed the pruning threshold if no, and obtain multiple target sublayers after pruning;
[0161] The convergence unit 309 is used to converge the target sub-layers to obtain a target generative large model.
[0162] Optionally, the first calculating unit 303 is further configured to:
[0163] Construct a kTree data structure based on the initial generative large model;
[0164] Determine the type of sublayer according to the kTree data structure. The sublayer types include base layer and dependent layer. The leaf nodes in the kTree data structure correspond to the base layer, and the non-leaf nodes in the kTree data structure correspond to the dependent layer.
[0165] Computes a complex value for each sublayer based on its type.
[0166] Optionally, the first calculating unit 303 is further configured to:
[0167] When the sublayer type is the base layer, the complex value of each sublayer is calculated based on the sublayer type, including:
[0168] The input and output dimensions and convolution kernel parameters of the base layer are obtained through the kTree data structure, and the complex value of the base layer is calculated based on the input and output dimensions and convolution kernel parameters;
[0169] When the sublayer type is a dependent layer, the complex value of each sublayer is calculated based on the sublayer type, including:
[0170] The sequence length, embedding dimension and number of neurons are obtained through the kTree data structure, and the complex value of the dependency layer is calculated based on the sequence length, embedding dimension and number of neurons.
[0171] Optionally, the complex value of the base layer is expressed by the following formula:
[0172] ;
[0173] in, represents a complex value at the base layer, represents the output channel in the input-output dimension, represents the input channels in the input-output dimension, Represents the convolution kernel size in the convolution kernel parameters, represents the fast Fourier transform algorithm, Indicates The feature map of the input channels, Represents the convolution kernel matrix corresponding to the output channel and the input channel;
[0174] The complex value of the dependency layer is expressed by the following formula:
[0175] ;
[0176] in, Represents a complex value of a dependent layer, The head represents the embedding dimension, Indicates The number of neurons in a head, Indicates The key of the head, Indicates The value vector of the head, represents the sequence length, The weight matrix representing the number of neurons, represents the weight matrix of the key, represents the weight matrix of the value vector, Represents the normalization algorithm.
[0177] Optionally, the influence value of a sublayer is expressed as follows:
[0178] ;
[0179] in, represents the influence value of the sublayer, Indicates the preset weights for complexity and contribution values. Indicates the preset weights for memory usage and contribution. represents the contribution value of the sublayer, A complex value representing a sublayer, Indicates the memory usage of the sublayer.
[0180] Optionally, a testing unit 310 is further included, which is specifically used for:
[0181] Obtain a test set, input the test set into the target generative large model for testing, and evaluate the test results after the test is completed to obtain the performance indicators of the target generative large model;
[0182] The target generative big model is adjusted based on the performance indicators, and after the adjustment, a fused generative big model is obtained.
[0183] Optionally, the testing unit 310 is further configured to:
[0184] Based on the performance indicators, determine whether the target generative large model has achieved the target performance indicators;
[0185] If not, recalculate the complexity, memory usage, and contribution of each sub-layer, and increase the pruning threshold in the iterative process until the target performance indicator is reached;
[0186] When it is determined that the performance index of the target generative large model reaches the target performance index, a fused generative large model is obtained.
[0187] This application also provides a model aggregation device for integrating generative large models, see Figure 4 , Figure 4 An embodiment of a model aggregation device for a fusion generative large model provided in the present application includes:
[0188] Processor 401, memory 402, input and output unit 403, bus 404;
[0189] The processor 401 is connected to the memory 402, the input and output unit 403 and the bus 404;
[0190] The memory 402 stores a program, and the processor 401 calls the program to execute any of the above methods.
[0191] The present application also relates to a computer-readable storage medium on which a program is stored, wherein when the program is run on a computer, the computer is caused to execute any of the above methods.
[0192] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0193] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0194] The units described 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.
[0195] 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.
[0196] If the 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. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A model aggregation method for integrating a large generative model, characterized in that: The method comprises: Collect a data set of multimodal feature vectors, use the data set to train a pre-trained model to obtain a sub-model, and build an initial generative large model based on the sub-model and the multimodal feature vectors using a Transformer architecture; According to the functional modules of the initial generative large model, the initial generative large model is divided into a plurality of levels, each of which includes a plurality of sub-layers; Determine the type of the sublayer, and calculate a complexity value of each sublayer based on the type of the sublayer, wherein the complexity value is used to evaluate the computational complexity of each sublayer during reasoning; Obtain the memory occupied by trainable parameters and the memory occupied by intermediate results of the sublayer during inference, and calculate the memory occupied value of each sublayer by using the memory occupied by trainable parameters and the memory occupied by intermediate results, wherein the memory occupied value is used to evaluate the memory resources of each sublayer during inference; Obtaining the gain impact and the generation index improvement value of the sublayer during reasoning, and calculating the contribution value of each sublayer through the gain impact and the generation index improvement value, wherein the contribution value is used to evaluate the contribution degree of each sublayer during reasoning; Based on user needs, preset weights of the complexity value, the memory usage value, and the contribution value are obtained, and the influence value of each sub-layer is calculated in combination with the preset weights, where the influence value is used to evaluate the quality influence of each sub-layer on the inference result; Determine whether the influence value of each sublayer exceeds a pruning threshold; If not, pruning the sublayers that do not exceed the pruning threshold is performed, and multiple target sublayers are obtained after pruning; The target sub-layers are aggregated to obtain a target generative large model.
2. The method according to claim 1, characterized in that The determining the type of the sublayer and calculating the complex value of each sublayer based on the type of the sublayer includes: Constructing a kTree data structure based on the initial generative large model; Determine the type of the sublayer according to the kTree data structure, the type of the sublayer includes a base layer and a dependent layer, the leaf nodes in the kTree data structure correspond to the base layer, and the non-leaf nodes in the kTree data structure correspond to the dependent layer; A complex value is calculated for each sub-layer based on the type of the sub-layer.
3. The method according to claim 2, characterized in that When the type of the sublayer is a base layer, calculating the complex value of each sublayer based on the type of the sublayer includes: The input and output dimensions and convolution kernel parameters of the base layer are obtained through the kTree data structure, and the complex value of the base layer is calculated based on the input and output dimensions and the convolution kernel parameters; When the type of the sublayer is a dependent layer, the calculating of the complex value of each sublayer based on the type of the sublayer includes: The sequence length, embedding dimension and number of neurons are obtained through the kTree data structure, and the complex value of the dependency layer is calculated based on the sequence length, embedding dimension and number of neurons.
4. The method according to claim 3, characterized in that The complex value of the base layer is expressed by the following formula: ; in, a complex value representing the base layer, represents the output channel in the input-output dimension, represents the input channels in the input-output dimension, represents the convolution kernel size in the convolution kernel parameters, represents the fast Fourier transform algorithm, Indicates feature maps of the input channels, Represents the convolution kernel matrix corresponding to the output channel and the input channel; The complex value of the dependency layer is expressed by the following formula: ; in, A complex value representing the dependency layer, represents the head of the embedding dimension, Indicates The number of neurons in the head, Indicates the key of the header, No. a vector of values of the head, represents the length of the sequence, The weight matrix representing the number of neurons, represents the weight matrix of the key, represents the weight matrix of the value vector, Represents the normalization algorithm.
5. The method according to claim 1, characterized in that The influence value of the sublayer is expressed by the following formula: ; in, represents the influence value of the sublayer, represents the preset weights for the complexity value and the contribution value, represents the preset weights for the memory usage value and the contribution value, represents the contribution value of the sublayer, said complex value representing said sublayer, Represents the memory usage value of the sublayer.
6. The method according to claim 1, characterized in that After the target sub-layers are aggregated to obtain a target generative large model, the method further includes: Obtain a test set, input the test set into the target generative large model for testing, and evaluate the test results after the test is completed to obtain performance indicators of the target generative large model; The target generative large model is adjusted based on the performance indicator, and a fused generative large model is obtained after the adjustment.
7. The method according to claim 6, characterized in that The target generative big model is adjusted based on the performance indicator to obtain a fused generative big model after the adjustment, comprising: Determining whether the target generative large model reaches the target performance indicator based on the performance indicator; If not, recalculate the complexity value, memory usage value and contribution value of each sub-layer, and increase the pruning threshold in an iterative process until the target performance indicator is reached; When it is determined that the performance indicator of the target generative large model reaches the target performance indicator, a fused generative large model is obtained.
8. A model aggregation system integrating generative large models, characterized in that: include: A construction unit, configured to collect a data set of multimodal feature vectors, use the data set to train a pre-trained model to obtain a sub-model, and construct an initial generative large model based on the sub-model and the multimodal feature vectors using a Transformer architecture; A division unit, configured to divide the initial generative large model into a plurality of levels according to the functional modules of the initial generative large model, each of the levels including a plurality of sub-layers; A first calculation unit, used to determine the type of the sublayer, and calculate a complexity value of each sublayer based on the type of the sublayer, wherein the complexity value is used to evaluate the computational complexity of each sublayer during reasoning; A second computing unit is used to obtain the memory occupied by the trainable parameters and the memory occupied by the intermediate results of the sub-layer during inference, and calculate the memory occupied value of each sub-layer by the memory occupied by the trainable parameters and the memory occupied by the intermediate results, and the memory occupied value is used to evaluate the memory resources of each sub-layer during inference; A third calculation unit is used to obtain the gain influence and the generation index improvement value of the sub-layer during reasoning, and calculate the contribution value of each sub-layer through the gain influence and the generation index improvement value, and the contribution value is used to evaluate the contribution degree of each sub-layer during reasoning; A fourth calculation unit, configured to obtain preset weights of the complexity value, the memory usage value, and the contribution value based on user requirements, and calculate an influence value of each sublayer in combination with the preset weights, wherein the influence value is used to evaluate the quality influence of each sublayer on the inference result; A first judging unit, configured to judge whether the influence value of each sub-layer exceeds a pruning threshold; A pruning unit, configured to prune the sublayers that do not exceed the pruning threshold if no, to obtain multiple target sublayers after pruning; The aggregation unit is used to aggregate the target sub-layers to obtain a target generative large model.
9. A model aggregation device for integrating a large generative model, characterized in that: The device comprises: Processor, memory, input-output unit, and bus; The processor is connected to the memory, the input and output unit, and the bus; The memory stores a program, and the processor calls the program to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a program stored thereon, wherein the program, when executed on a computer, performs the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Neural network model training method and device, neural network model data processing method and device and medium
CN117114074A
Model pruning method, face recognition model training method and face recognition method
CN117474070A