Generative model optimization method and device, electronic equipment and storage medium

By grouping and weighting the weight data of multiple checkpoints of the generated model, the image quality and training efficiency of the generated model are optimized, and the problem of poor image quality caused by the high variance nature of existing model training is solved.

CN118709746APending Publication Date: 2024-09-27TSINGHUA UNIVERSITY

Patent Information

Application Number
CN202410741602.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

Existing generative models, such as diffusion models and consistency models, suffer from high variance properties during the training process, resulting in poor quality of generated images and long training times.

Method used

By obtaining the weight data of multiple checkpoints, dividing it into multiple weight groups, searching for the target coefficient combination that optimizes image quality from the specified coefficient search space, and performing weighted summation to optimize the generation model.

Benefits of technology

It improves the image quality and training efficiency of the generated model, reduces the memory overhead, and achieves performance equivalent to high batch size training, and is suitable for the optimization of diffusion models and consistency models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709746A
    Figure CN118709746A
Patent Text Reader

Abstract

The invention relates to a generative model optimization method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a plurality of pieces of weight data stored by a to-be-optimized generative model at a plurality of check points, the weight data stored at each check point comprising all weights of the generative model at each check point; dividing the weight data of each check point into a plurality of weight groups to obtain a plurality of weight groups corresponding to each check point; searching a target coefficient combination which enables the quality of the image generated by the generation model to be optimal from a specified coefficient search space; and on the basis of the target coefficient combination, performing weighted summation on each weight group divided by the plurality of weight data of the plurality of check points to obtain target weight data of the generative model, so that the generative model with the target weight data is utilized to execute a text graph or text video task. Therefore, the model performance of the generation model is effectively improved, and the image quality of the image or video generated by the generation model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a generation model optimization method and device, an electronic device, and a storage medium. Background Art

[0002] Generative models are a type of machine learning model used to generate samples that obey the target data distribution. Diffusion Model (DM) is a generative model that maps a given data distribution at t = 0 to a Gaussian distribution at t = T through a stochastic differential equation (SDE); the stochastic differential equation has a corresponding inverse time ordinary differential equation (ODE) that can start from the Gaussian distribution at time t = T, and the marginal probability distribution at any time t given by the ODE is equal to the marginal probability distribution given by the SDE. Therefore, the process of generating images by the diffusion model can be regarded as the process of first sampling initial noise from a standard Gaussian, and then numerically solving the corresponding ODE with the noise as the starting point. Numerically solving differential equations requires dividing the continuous time axis into several discrete time steps, and iterating between adjacent time steps according to the given iterative formula to calculate the data value at the time step, and then using the pre-trained neural network to predict the noise or data based on the data value, so as to solve the diffusion model based on the noise and data predicted by the neural network to obtain the generated image. Therefore, for numerically solving differential equations, a good image generation quality can only be achieved when the number of time steps used is large enough and the step length is small enough. Since each step requires the inference of the neural network, the generation of the diffusion model often takes a long time.

[0003] Another generation model, the consistency model (CM), has been proposed to reduce generation time. The consistency model uses the consistency of ODE. When the ODE form and the initial value of the iteration are given, the iteration trajectory will be completely determined, and all time steps on this ODE trajectory will correspond to the same trajectory endpoint. Based on this property, the consistency model randomly samples time steps on the ODE time axis and samples samples from the marginal distribution corresponding to the time step. The sample must be located on a certain ODE trajectory. Using numerical methods to solve one step on the current trajectory, a trajectory value at a smaller time can be obtained, and then the network output at the larger time on the training trajectory can be approximated to the output at the smaller time. The training method of the consistency model can be divided into two types according to whether a pre-trained diffusion model is used to solve the ODE. Consistency Distillation (CD) and Consistency Training (CT) are used. The consistency distillation method requires the use of a pre-trained diffusion model to complete the solution from the point with a larger time on the ODE to the point with a smaller time. The consistency training method relies on Monte Carlo estimation to provide the solution direction and bring it into the consistency model to be trained to calculate the loss function, backpropagate the gradient, and update the model weights. The trained consistency model has the ability to generate the final image from the initial noise in one step, and can also obtain samples with better quality through 2-4 steps of sampling.

[0004] However, the training of diffusion model and consistency model has the property of high variance, which may be due to: 1. Diffusion model and consistency model training need to find the final expected value by training a large number of samples; 2. Diffusion model and consistency model need to train the same model at different time steps t, and the learning of tasks at different time steps may have a negative effect on each other; 3. In the training of consistency model, each time step on the training trajectory needs to learn the model output of the previous time step on the trajectory, which causes the error of model training to be amplified along the training trajectory. The above high variance property will lead to suboptimal performance of the trained model, that is, the image quality generated by the trained model is poor. Summary of the invention

[0005] In view of this, the present disclosure proposes a generative model optimization method and device, an electronic device and a storage medium, which can effectively improve the model performance of the generative model and improve the image quality of images or videos generated by the generative model.

[0006] According to one aspect of the present disclosure, a generative model optimization method is provided, comprising: obtaining a plurality of weight data stored at a plurality of checkpoints of a generative model to be optimized; dividing the weight data of each checkpoint into a plurality of weight groups to obtain a plurality of weight groups corresponding to each checkpoint, wherein each weight group includes a portion of the weights in the weight data; searching for a target coefficient combination that optimizes the quality of an image generated by the generative model from a specified coefficient search space, wherein the target coefficient combination includes the weight coefficient of each weight group in the plurality of weight groups corresponding to each checkpoint in the plurality of checkpoints, and the same weight group shares the same weight coefficient; based on the target coefficient combination, performing weighted summation on the respective weight groups divided from the plurality of weight data of the plurality of checkpoints to obtain the target weight data of the generative model, so as to perform a Vincent image or Vincent video task using the generative model having the target weight data.

[0007] In one possible implementation, the generation model has multiple layers, and the weight data of each checkpoint is divided into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint, including: based on the resolution corresponding to each layer in the generation model, the weights of layers with the same resolution in the weight data of each checkpoint are divided into the same weight group to obtain multiple weight groups corresponding to each checkpoint.

[0008] In one possible implementation, the generation model includes an encoder and a decoder, wherein the weight data of each checkpoint is divided into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint, including: dividing the weights belonging to the encoder in the weight data of each checkpoint into the same weight group, and dividing the weights belonging to the decoder in the weight data of each checkpoint into the same weight group to obtain two weight groups corresponding to each checkpoint.

[0009] In one possible implementation, the weight data of each checkpoint includes the weight corresponding to each time step of the generation model in multiple time steps; wherein, dividing the weight data of each checkpoint into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint includes: dividing the weights belonging to the same time step in the weight data of each checkpoint into the same weight group to obtain multiple weight groups corresponding to each checkpoint, so that the weights belonging to the same time step in the target coefficient combination share the same weighting coefficient.

[0010] In one possible implementation, the weight data of each checkpoint includes the weight adjusted by the generation model at each time step in multiple time steps; wherein, dividing the weight data of each checkpoint into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint includes: dividing the multiple time steps corresponding to each checkpoint into at least two time periods; dividing the weights adjusted in the weight data of each checkpoint and belonging to the same time period into the same weight group to obtain multiple weight groups corresponding to each checkpoint, so that the weights belonging to the same time period in the target coefficient combination share the same weighting coefficient.

[0011] In a possible implementation, searching for a target coefficient combination that optimizes the image quality generated by the generative model from a specified coefficient search space includes: performing the following N rounds of evolutionary search based on the specified coefficient search space, where N is a positive integer: in the nth round of evolutionary search, sampling a candidate coefficient combination from an nth generation population, the candidate coefficient combination including candidate weighting coefficients of each weight group in a plurality of weight groups corresponding to each of the plurality of checkpoints, wherein the first generation population is obtained by initialization, n∈[1,N]; based on the candidate coefficient combination, sampling a plurality of weight data of the plurality of checkpoints for each candidate coefficient combination; Perform a weighted summation on the separated weight groups to obtain candidate weight data; evaluate the image quality generated by the generation model with the candidate weight data to obtain the image quality evaluation result corresponding to the candidate coefficient combination; based on the image quality evaluation result corresponding to the candidate coefficient combination and the coefficient search space, perform an evolutionary operation on the candidate weighting coefficients in the candidate coefficient combination to obtain offspring weighting coefficients, and add the offspring weighting coefficients to the nth generation population to obtain the n+1th generation population; determine the candidate coefficient combination with the best image quality evaluation result in the N rounds of evolutionary search as the target coefficient combination.

[0012] In one possible implementation, the weight data saved at each checkpoint includes the global model weight or low-rank adaptation weight of the generative model at each checkpoint, wherein the global model weight of each checkpoint is the global weight of the generative model itself, and the low-rank adaptation weight of each checkpoint is the weight obtained by fine-tuning the low-rank adaptation weight inserted into the trained and converged generative model; the coefficient search space constrains the sum of the weighted coefficients of all weight groups corresponding to the multiple checkpoints to be 1.

[0013] According to another aspect of the present disclosure, a generative model optimization device is provided, comprising: an acquisition module for acquiring a plurality of weight data stored at a plurality of checkpoints of a generative model to be optimized; a grouping module for dividing the weight data of each checkpoint into a plurality of weight groups, and obtaining a plurality of weight groups corresponding to each checkpoint, wherein each weight group includes a portion of weights in the weight data; a search module for searching for a target coefficient combination that optimizes the quality of an image generated by the generative model from a specified coefficient search space, wherein the target coefficient combination includes a weight coefficient of each weight group in a plurality of weight groups corresponding to each checkpoint in the plurality of checkpoints, and the same weight group shares the same weight coefficient; a generation module for performing weighted summation on each weight group divided from a plurality of weight data of the plurality of checkpoints based on the target coefficient combination, and obtaining the target weight data of the generative model, so as to perform a Vincent image or Vincent video task using the generative model having the target weight data.

[0014] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0015] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.

[0016] According to another aspect of the present disclosure, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0017] According to various aspects of the present disclosure, by grouping multiple weight data saved by multiple checkpoints, and then searching for weight coefficients for each weight group, a more accurate coefficient search can be achieved, so that the searched target coefficient combination is better, and then based on the target coefficient combination, the multiple weight data of multiple checkpoints are weighted and summed to obtain target weight data with better performance, which is equivalent to obtaining a generation model with better performance, which is beneficial to improving the quality of images generated by the generation model with target weight data when performing Vincent image or Vincent video tasks.

[0018] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0020] Figure 1 A flowchart of a generative model optimization method according to an embodiment of the present disclosure is shown.

[0021] Figure 2 A block diagram of a generative model optimization device according to an embodiment of the present disclosure is shown.

[0022] Figure 3 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0023] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0024] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0025] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0026] As mentioned above, the existing training of diffusion models and consistency models has high variance properties, resulting in suboptimal performance of the trained models. Through verification experiments, it is found that there are a large number of higher quality weight distributions near the training trajectories of the diffusion model and the consistency model, and these weight distributions can be achieved through the fusion of checkpoint weights. For example, assuming that θ0, θ1, and θ2 are the weight data saved by three checkpoints (checkpoints are save points in the model training process, which are used to record the current model status, including the model's structure, weights and other parameter values ​​and other related information) on a training trajectory, interpolation of the weight data saved by the three checkpoints can obtain better performance weight data, but these weight data cannot be obtained through the traditional stochastic gradient descent method. Although the Exponential Moving Average (EMA) method can be used to optimize the weight data to improve model performance, it is still impossible to make the model reach optimal performance.

[0027] In view of this, the embodiment of the present disclosure proposes a generative model optimization method, which can improve the performance of the generative model by linearly combining checkpoint weights, and can achieve better performance than the EMA method. In addition, when the method of the embodiment of the present disclosure is used to optimize the generative model, it has the advantage of not needing to calculate the gradient, and can optimize the model weights that are difficult or impossible to generate gradients, and has lower video memory overhead than the stochastic gradient descent method.

[0028] The generative model optimization method of the disclosed embodiment can be applied to various application scenarios. For example, it can be used in the early stage of model training or in low batch size training scenarios, and can improve the performance of the training model to achieve performance equivalent to that of complete training or high batch size training, thereby achieving the effect of accelerated training. It can also be used on trained converged models to further optimize the performance of the converged model. For diffusion models and consistency models, there is a trade-off between sampling quality and the number of inference steps, so optimizing the performance of diffusion models and consistency models can also achieve the effect of accelerated inference. It should be understood that the optimization method of the disclosed embodiment can be applied not only to the training process of the above-mentioned diffusion model and consistency model, but also to the training process of any other generative model or the further optimization of the model after training.

[0029] In practical applications, the generation model optimization method of the embodiment of the present disclosure can be deployed on various terminal devices through software or hardware modification. The terminal device involved in the present application can refer to a device with a wireless connection function. The function of wireless connection refers to the ability to connect to other terminal devices through wireless connection methods such as wifi and Bluetooth. The terminal device of the present application can also have the function of communicating through a wired connection. The terminal device of the present application can be a touch screen, a non-touch screen, or a screen-free device. The touch screen can control the terminal device by clicking and sliding on the display screen with fingers, stylus, etc. The non-touch screen device can be connected to an input device such as a mouse, keyboard, touch panel, etc., and the terminal device can be controlled by the input device. For example, the device without a screen can be a Bluetooth speaker without a screen. For example, the terminal device of the present disclosure can be a computer, a smart phone, a netbook, a tablet computer, a laptop computer, a wearable electronic device (such as a smart bracelet, a smart watch, etc.), a TV, a virtual reality device, etc.

[0030] The generation model optimization method of the embodiment of the present disclosure can also be deployed on a server, which can be located in the cloud or locally, and can be a physical device or a virtual device, such as a virtual machine, a container, etc., with a wireless communication function, wherein the wireless communication function can be set in the chip (system) or other parts or components of the server. It can refer to a device with a wireless connection function, and the function of wireless connection refers to the ability to connect to other servers or terminal devices through wireless connection methods such as Wi-Fi and Bluetooth. The server of the present disclosure may also have the function of communicating through a wired connection. For example, the server of the present disclosure can be located in the cloud, communicate with the terminal device, receive the generation model to be optimized sent by the terminal device, and use the optimization method deployed on the server to obtain the optimized target weight data and return it to the terminal device.

[0031] The following is a detailed introduction to the generation model optimization method proposed in the embodiment of the present disclosure.

[0032] Figure 1 FIG. 1 is a flow chart showing a method for optimizing a generation model according to an embodiment of the present disclosure. The method may be executed by an electronic device such as the terminal device or server. Figure 1 As shown, the method includes: step S11 to step S14.

[0033] In step S11, a plurality of weight data stored at a plurality of checkpoints of the generation model to be optimized is obtained.

[0034] In practical applications, the generative model to be optimized may be a model in the training process or a model that has been trained and converged, a model trained with a low batch size or a model trained with a high batch size, and the embodiments of the present disclosure do not limit this. Furthermore, the embodiments of the present disclosure do not limit the structure, type, etc. of the generative model to be optimized.

[0035] The weight data saved at each checkpoint may include the global model weight of the generative model at each checkpoint. The global model weight of each checkpoint can be understood as the global weight of the generative model itself, or the original global weight of the generative model. It should be understood that during the training process of the generative model, multiple checkpoints can be customized to save the global model weights of the generative model at different checkpoints. For example, assuming that the model has undergone K training rounds n1, n2, ..., n K The global model weights at the checkpoints saved at these training rounds can be expressed as in, Represents the nth i The global model weights in the checkpoint saved from the training round, i∈[1,K].

[0036] Considering that the number of parameters (that is, the number of weights) of the global model weights in the current generative model is generally high. Before optimizing the generative model, it is necessary to store the global model weights of more checkpoints. Therefore, when optimizing the generative model that has been trained and converged, it is necessary to occupy a large processor (such as a central processing unit CPU) memory overhead to load the global model weights of all checkpoints, which may reduce the processing efficiency of the processor. Therefore, in order to reduce the memory overhead occupied during the optimization of the generative model, in one possible implementation method, the low-rank adaptation (Low-Rank Adaptation) known in the art can be used. The invention discloses a method for optimizing the LoRA module and the method of optimizing the LoRA module. The method adopts a LoRA technology, in which a LoRA module with a low-rank adaptive LoRA weight is inserted into a trained and converged generative model, and only the LoRA weight is fine-tuned (finetune) trained. The original weight of the trained and converged generative model itself remains unchanged, and multiple checkpoints are set during the finetune training process to save the LoRA weights of the fine-tuning training process at different checkpoints. Thus, the weight data saved at each checkpoint can also include the low-rank adaptive weight of the generative model at each checkpoint, and the low-rank adaptive weight of each checkpoint is obtained by fine-tuning the low-rank adaptive weight inserted into the trained and converged generative model; in this way, the low-rank adaptive weights of the multiple checkpoints can be linearly combined (i.e., grouping, determining weighting coefficients and weighted summing, etc.) subsequently. Since the amount of data of the low-rank adaptive weight is small, this method can reduce the processor memory overhead occupied in the optimization process of the generative model, and can also help to increase the number of combinable checkpoints (i.e., to obtain weight data of more checkpoints) to improve the optimization efficiency and optimization accuracy of the generative model.

[0037] As described above, the embodiment of the present disclosure improves the performance of the generation model by linearly combining the checkpoint weights. In one possible implementation method, the weighting coefficient can be searched for the weight data of each checkpoint from the specified coefficient search space, and then the weight data of multiple checkpoints are weighted summed using the weighting coefficients of the searched weight data of each checkpoint to obtain the target weight data that makes the generation model performance better.

[0038] Considering that the checkpoint weights are combined for the weight data in the above manner, so that the weight data of each checkpoint uses a weighting coefficient, the search space of the weighting coefficient is small. Since the properties and functions of different weights in the generation model are different, selecting different weighting coefficients for different weights can make the performance of the generated target weight data better. Therefore, the embodiment of the present disclosure groups the weight data in step S12 to use different weighting coefficients for different weight groups, which increases the search space and is conducive to improving the performance of the target weight data obtained by the linear combination.

[0039] In step S12, the weight data of each checkpoint is divided into a plurality of weight groups, so as to obtain a plurality of weight groups corresponding to each checkpoint, wherein each weight group includes a part of the weights in the weight data.

[0040] In a possible implementation, considering that the model structure of the generated model (such as the U-NET structure) usually has multiple layers, and the resolutions of different layers are usually different, the layers can be grouped according to the resolution so that the weights at the same resolution share the same weight coefficient. Specifically, the weight data of each checkpoint is divided into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint, which may include:

[0041] Based on the resolutions corresponding to each layer in the generative model, the weights of the layers with the same resolution in the weight data of each checkpoint are divided into the same weight group, and multiple weight groups corresponding to each checkpoint are obtained. For example, if there are 4 resolutions in the generative model, the weight data of each checkpoint can be divided into 4 weight groups, and the weights in each weight group correspond to the same resolution.

[0042] In a possible implementation, considering that the generative model usually includes an encoder and a decoder, that is, a downsampling part and an upsampling part, the encoder and the decoder of the generative model may be grouped, that is, the downsampling part and the upsampling part share different weighting coefficients, respectively. Specifically, the weight data of each checkpoint is divided into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint, which may include:

[0043] The weights belonging to the encoder in the weight data of each checkpoint are divided into the same weight group, and the weights belonging to the decoder in the weight data of each checkpoint are divided into the same weight group, so as to obtain two weight groups corresponding to each checkpoint.

[0044] It can be known that, for the diffusion model and the consistency model, the input distribution at different time steps is different, and the requirements for the model weights are also different, or the weights adjusted at each time step are different. Therefore, the weight data of each checkpoint may include the weight adjusted by the generative model at each time step in multiple time steps. For example, a checkpoint may save the weights of multiple time steps from the checkpoint to the previous checkpoint, or it may save the weights of multiple time steps within a period of time before the checkpoint. The embodiments of the present disclosure are not limited to this. In this way, multi-step sampling evaluation can be used for the generative model, and different weighting coefficients can be used at different time steps of the generative model. Specifically, the above-mentioned division of the weight data of each checkpoint into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint may include:

[0045] The weights belonging to the same time step in the weight data of each checkpoint are divided into the same weight group, and multiple weight groups corresponding to each checkpoint are obtained, so that the weights belonging to the same time step in the target coefficient combination share the same weight coefficient. For example, if each checkpoint saves the weights of 3 time steps, the weight data of each checkpoint can be divided into 3 weight groups, and the weights in each weight group belong to the same time step.

[0046] Considering that for some generative models (such as diffusion models), sampling usually uses a large number of steps, and the number of weight groups divided by time steps should not be too large, otherwise the number of coefficients to be searched is large, which will make the subsequent coefficient search difficult to perform and the search efficiency is low. Therefore, the multiple time steps in the sampling can be divided into 2-4 time periods, and different weight coefficients are used in different time periods, which can reduce the number of coefficient searches. Therefore, in a possible implementation, the weight data of each checkpoint is divided into multiple weight groups, and the multiple weight groups corresponding to each checkpoint are obtained, which can include:

[0047] Divide the multiple time steps corresponding to each checkpoint into at least two time periods;

[0048] The weights adjusted for the same time period in the weight data of each checkpoint are divided into the same weight group to obtain multiple weight groups corresponding to each checkpoint, so that the weights belonging to the same time period in the target coefficient combination share the same weighting coefficient.

[0049] For example, the multiple time steps corresponding to each checkpoint can be divided into two time periods, and the weight data of each checkpoint can be divided into two weight groups, and the weights in each weight group belong to the same time period. This can reduce the search amount of weighted coefficients and improve search efficiency.

[0050] In step S13, a target coefficient combination that optimizes the image quality generated by the generation model is searched from the specified coefficient search space, wherein the target coefficient combination includes the weighting coefficient of each weight group in the multiple weight groups corresponding to each checkpoint in the multiple checkpoints, and the same weight group shares the same weighting coefficient.

[0051] Assume there are K checkpoints with K weight data The weight data of each checkpoint is divided into M weight groups through step S12, where the weight data of the i-th checkpoint The M weight groups divided can be expressed as in, Represents the jth weight group among the M weight groups corresponding to the i-th checkpoint, i∈[1,K], j∈[1,M], then searching for the target coefficient combination that optimizes the image quality generated by the generative model can be expressed as the solution formula (1):

[0052]

[0053] Among them, a i ={σ i,1 ,σ i,2 ,…,σ i,M},σ i,j represents the weight coefficient of the jth weight group of the ith checkpoint, then represents the specified coefficient search space. FID (Fréchet Inception Distance) is an image quality assessment index. Since the smaller the FID index is, the better the image quality is, the above formula (1) can be described as searching for a set of target coefficient combinations from the specified coefficient search space to perform weighted summation with the weight groups of each corresponding checkpoint, so that the FID index of the image generated by the generation model based on the weight data obtained after the weighted summation is minimized, that is, the target coefficient combination that makes the image quality generated by the generation model optimal is searched out.

[0054] In practical applications, those skilled in the art may use other image quality assessment indicators to evaluate image quality, such as IS (Inception Score) indicators, signal to noise ratio (SNR), structural similarity index (SSIM), etc., which are not limited to the embodiments of the present disclosure. It should be understood that if the image quality assessment indicator used is larger, it means that the image quality is better, and then the target coefficient combination that maximizes the image quality assessment indicator can be searched. For example, if the IS indicator is used, the target coefficient combination that searches for the best image quality generated by the generative model can be expressed as solving formula (2):

[0055]

[0056] The above formula (2) can be described as searching for a set of target coefficient combinations from the specified coefficient search space to perform weighted summation with the weight groups of each corresponding checkpoint, so that the IS index of the image generated by the generative model based on the weight data obtained after the weighted summation is maximized, that is, searching for the target coefficient combination that makes the image quality generated by the generative model optimal.

[0057] Optionally, in order to efficiently search for the target coefficient combination, the coefficient search space can constrain the sum of the weighted coefficients of all weight groups corresponding to multiple checkpoints to be 1, that is, it can be constrained Therefore, the above formula (1) can also be expressed as finding a set of target coefficient combinations with a sum of 1 to perform weighted summation with the weight groups of each corresponding checkpoint, so that the FID index of the image generated by the generation model based on the weight data obtained after the weighted summation is minimized. The above formula (2) can also be expressed as finding a set of target coefficient combinations with a sum of 1 to perform weighted summation with the weight groups of each corresponding checkpoint, so that the IS index of the image generated by the generation model based on the weight data obtained after the weighted summation is maximized.

[0058] In practical applications, an evolutionary search algorithm can be used to search for a target coefficient combination that optimizes the image quality generated by the generative model from a specified coefficient search space, that is, to solve the above formula (1). For example, a set of weighting coefficients can be initialized using an exponential moving average method and their performance can be evaluated using an image quality assessment index to form an initial population (that is, a first-generation population). In each round of multiple rounds of searching, weighting coefficients with better performance can be selected from the population for evolutionary operations such as crossover and mutation to generate new weighting coefficients and add the new weighting coefficients to the population. Finally, a set of weighting coefficients with the best performance (that is, the best image quality) can be found as the target coefficient combination. Specifically, the above-mentioned search for a target coefficient combination that optimizes the image quality generated by the generative model from a specified coefficient search space can include:

[0059] Based on the specified coefficient search space, perform the following N rounds of evolutionary search, where N is a positive integer:

[0060] In the nth round of evolutionary search, a candidate coefficient combination is sampled from the nth generation population, wherein the candidate coefficient combination includes a candidate weight coefficient of each weight group in a plurality of weight groups corresponding to each checkpoint in a plurality of checkpoints, wherein the first generation population is obtained by initialization, n∈[1,N];

[0061] Based on the candidate coefficient combination, weighted summation is performed on each weight group divided from the multiple weight data of the multiple checkpoints to obtain the candidate weight data;

[0062] Evaluate the quality of an image generated by a generation model having candidate weight data to obtain an image quality evaluation result corresponding to the candidate coefficient combination;

[0063] Based on the image quality assessment results corresponding to the candidate coefficient combinations and the coefficient search space, the candidate weighting coefficients in the candidate coefficient combinations are evolved to obtain offspring weighting coefficients, and the offspring weighting coefficients are added to the nth generation population to obtain the n+1th generation population;

[0064] The candidate coefficient combination with the best image quality evaluation result in N rounds of evolutionary search is determined as the target coefficient combination.

[0065] In practical applications, those skilled in the art can design the total number of evolutionary search rounds N according to actual needs, and the embodiments of the present disclosure do not limit this. As described above, image quality assessment indicators known in the art can be used to evaluate the quality of images generated by the generation model with candidate weight data, and the embodiments of the present disclosure do not limit the image quality assessment process.

[0066] Among them, the evolutionary operation may include but is not limited to operations such as crossover, recombination, and mutation. It should be understood that the offspring weighted coefficients obtained through the evolutionary operation should satisfy the constraints of the coefficient search space. If the offspring weighted coefficients do not satisfy the constraints of the coefficient search space, the offspring weighted coefficients can also be normalized and other processing is performed, which is not limited to this embodiment of the present disclosure.

[0067] It should be understood that each round of evolutionary search can search out a set of candidate coefficient combinations and obtain image quality assessment results corresponding to the candidate coefficient combinations. Therefore, the candidate coefficient combination with the best image quality assessment result (for example, the smallest FID index) can be selected from N rounds of evolutionary search as the target coefficient combination, thus obtaining the target coefficient combination that optimizes the image quality generated by the generation model.

[0068] It should be noted that the above-mentioned search for the target coefficient combination through the evolutionary search algorithm is a possible implementation method provided by the embodiment of the present disclosure. In fact, those skilled in the art can adopt any known search algorithm in the art, such as the simulated annealing algorithm, etc., and the embodiment of the present disclosure is not limited to this.

[0069] In step S14, based on the target coefficient combination, weighted summation is performed on each weight group divided from multiple weight data of multiple checkpoints to obtain target weight data of the generated model, so as to perform the Vincent graph or Vincent video task using the generated model with the target weight data.

[0070] For example, if the target coefficient combination is {a1, a2, ..., a K}, then the target weight data Linearly combining the weight data of each checkpoint through weighted summation can make the image quality generated by the generative model with target weight data higher than the individual weight data saved at the above-mentioned checkpoints, that is, the model performance of the generative model with target weight data is higher.

[0071] As described above, the weight data saved at each checkpoint includes the global model weight of the generative model at each checkpoint, so the target weight data includes the first weight data obtained by weighted summing up the various weight groups divided from the global model weights of multiple checkpoints, and the generative model with the target weight data can be understood as a generative model with the first weight data; alternatively, the weight data saved at each checkpoint can also include the low-rank adaptation weight of the generative model at each checkpoint, so the target weight data also includes the second weight data obtained by weighted summing up the various weight groups divided from the low-rank adaptation weights of multiple checkpoints, and the generative model with the target weight data can also be understood as a generative model with the original weights in the generative model itself and the above-mentioned second weight data.

[0072] Among them, as described above, an evolutionary search algorithm can be used to determine the target coefficient combination, and in the evolutionary search process, the candidate weight data corresponding to the target coefficient combination has actually been calculated, so the candidate weight data corresponding to the target coefficient combination can be directly used as the target weight data. Of course, the target weight data can also be recalculated based on the target coefficient combination. For example, each weight group divided by the weight data of each checkpoint can be quantized first, and then each weight group divided by the quantized multiple weight data can be weighted and summed to obtain the target weight data. This embodiment of the present disclosure is not limited to this.

[0073] According to the optimization method of the embodiment of the present disclosure, by grouping multiple weight data saved by multiple checkpoints, and then searching the weight coefficients for each weight group, a more accurate coefficient search can be achieved, so that the searched target coefficient combination is better, and then based on the target coefficient combination, the multiple weight data of multiple checkpoints are weighted and summed to obtain target weight data with better performance, which is equivalent to obtaining a generation model with better performance, which is beneficial to improving the image quality generated by the generation model with target weight data when performing Vincent map or Vincent video tasks, and compared with the traditional gradient descent method, it has lower video memory overhead and higher optimization efficiency, which is beneficial to realizing model accelerated training and reducing model training overhead.

[0074] According to the embodiments of the present disclosure, it is proposed to save checkpoints during the training of the generative model, and to improve the model performance by linearly combining the weights of these checkpoints. Specifically, it is proposed to use an evolutionary search algorithm to find the optimal linear coefficient combination, which can accelerate the training of the generative model and improve the training effect, and has broad prospects. It reveals the significant role of checkpoint linear combinations in improving the training effect of the generative model, and proposes an efficient optimization method that can accelerate the training of the generative model or improve the training effect, which can then be used in various types of text image or text video tasks.

[0075] The disclosed embodiment is also verified on two commonly used datasets, CIFAR-10 and ImageNet-64. Tables 1 and 2 show the test results of the consistency model on CIFAR-10 and ImageNet-64, respectively, and Table 3 shows the test results of the diffusion model on CIFAR-10 and ImageNet-64. Among them, LCSC represents the optimization method of the disclosed embodiment to optimize the consistency model, and EMA* represents the best result after grid search of the EMA coefficient (that is, the coefficient optimized by EMA).

[0076] Table 1 Test results of consistency model on CIFAR-10

[0077]

[0078] Table 2 Test results of consistency model on ImageNet-64

[0079]

[0080]

[0081] It can be seen from Tables 1 and 2 that, compared with EMA and EMA*, when the optimization method of the disclosed embodiment is applied to the consistency model, the training acceleration can be achieved by 7-23 times and 10-15 times on the CIFAR-10 and ImageNet-64 datasets, respectively, and the performance of the final converged model can be improved (that is, having a lower FID index and a higher IS index).

[0082] Table 3 Test results of diffusion model on CIFAR-10 and ImageNet-64

[0083]

[0084] It can be seen from Table 3 that, compared with EMA and EMA*, when the optimization method of the embodiment of the present disclosure is applied to the diffusion model, the performance of the final converged model can be improved on both the CIFAR-10 and ImageNet-64 datasets (that is, having a lower FID index and a higher IS index).

[0085] Figure 2 A block diagram of a generation model optimization device according to an embodiment of the present disclosure is shown as follows: Figure 2 As shown, the device comprises:

[0086] An acquisition module 201 is used to acquire a plurality of weight data stored at a plurality of checkpoints of a generation model to be optimized;

[0087] A grouping module 202, configured to divide the weight data of each checkpoint into a plurality of weight groups, to obtain a plurality of weight groups corresponding to each checkpoint, wherein each weight group includes a portion of the weights in the weight data;

[0088] A search module 203 is used to search for a target coefficient combination that optimizes the quality of the image generated by the generation model from a specified coefficient search space, wherein the target coefficient combination includes a weight coefficient of each weight group in a plurality of weight groups corresponding to each of the plurality of checkpoints, and the same weight group shares the same weight coefficient;

[0089] The generation module 204 is used to perform weighted summation on each weight group divided by the multiple weight data of the multiple checkpoints based on the target coefficient combination to obtain the target weight data of the generation model, so as to perform the Vincent graph or Vincent video task using the generation model with the target weight data.

[0090] In one possible implementation, the generation model has multiple layers, and the weight data of each checkpoint is divided into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint, including: based on the resolution corresponding to each layer in the generation model, the weights of layers with the same resolution in the weight data of each checkpoint are divided into the same weight group to obtain multiple weight groups corresponding to each checkpoint.

[0091] In one possible implementation, the generation model includes an encoder and a decoder, wherein the weight data of each checkpoint is divided into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint, including: dividing the weights belonging to the encoder in the weight data of each checkpoint into the same weight group, and dividing the weights belonging to the decoder in the weight data of each checkpoint into the same weight group to obtain two weight groups corresponding to each checkpoint.

[0092] In one possible implementation, the weight data of each checkpoint includes the weight corresponding to each time step of the generation model in multiple time steps; wherein, dividing the weight data of each checkpoint into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint includes: dividing the weights belonging to the same time step in the weight data of each checkpoint into the same weight group to obtain multiple weight groups corresponding to each checkpoint, so that the weights belonging to the same time step in the target coefficient combination share the same weighting coefficient.

[0093] In one possible implementation, the weight data of each checkpoint includes the weight adjusted by the generation model at each time step in multiple time steps; wherein, dividing the weight data of each checkpoint into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint includes: dividing the multiple time steps corresponding to each checkpoint into at least two time periods; dividing the weights adjusted in the weight data of each checkpoint and belonging to the same time period into the same weight group to obtain multiple weight groups corresponding to each checkpoint, so that the weights belonging to the same time period in the target coefficient combination share the same weighting coefficient.

[0094] In a possible implementation, searching for a target coefficient combination that optimizes the image quality generated by the generative model from a specified coefficient search space includes: performing the following N rounds of evolutionary search based on the specified coefficient search space, where N is a positive integer: in the nth round of evolutionary search, sampling a candidate coefficient combination from an nth generation population, the candidate coefficient combination including candidate weighting coefficients of each weight group in a plurality of weight groups corresponding to each of the plurality of checkpoints, wherein the first generation population is obtained by initialization, n∈[1,N]; based on the candidate coefficient combination, sampling a plurality of weight data of the plurality of checkpoints for each candidate coefficient combination; Perform a weighted summation on the separated weight groups to obtain candidate weight data; evaluate the image quality generated by the generation model with the candidate weight data to obtain the image quality evaluation result corresponding to the candidate coefficient combination; based on the image quality evaluation result corresponding to the candidate coefficient combination and the coefficient search space, perform an evolutionary operation on the candidate weighting coefficients in the candidate coefficient combination to obtain offspring weighting coefficients, and add the offspring weighting coefficients to the nth generation population to obtain the n+1th generation population; determine the candidate coefficient combination with the best image quality evaluation result in the N rounds of evolutionary search as the target coefficient combination.

[0095] In one possible implementation, the weight data saved at each checkpoint includes the global model weight or low-rank adaptation weight of the generative model at each checkpoint, wherein the global model weight of each checkpoint is the global weight of the generative model itself, and the low-rank adaptation weight of each checkpoint is the weight obtained by fine-tuning the low-rank adaptation weight inserted into the trained and converged generative model; the coefficient search space constrains the sum of the weighted coefficients of all weight groups corresponding to the multiple checkpoints to be 1.

[0096] According to the optimization device of the embodiment of the present disclosure, by grouping multiple weight data saved by multiple checkpoints, and then searching the weight coefficients for each weight group, a higher-precision coefficient search can be achieved, so that the searched target coefficient combination is better, and then based on the target coefficient combination, the weighted summation of multiple weight data of multiple checkpoints can be performed to obtain target weight data with better performance, which is equivalent to obtaining a generation model with better performance, which is beneficial to improving the image quality generated by the generation model with target weight data when performing Vincent map or Vincent video tasks, and compared with the traditional gradient descent method, it has lower video memory overhead and higher optimization efficiency, which is beneficial to realizing model accelerated training and reducing model training overhead.

[0097] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0098] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0099] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0100] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0101] Figure 3 1 is a block diagram of an electronic device 1900 according to an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server or a terminal device. Figure 3 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0102] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2003. TM , Mac OS X TM , Unix TM ,Linux TM , FreeBSD TM or similar.

[0103] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.

[0104] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0105] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0106] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0107] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0108] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0109] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0110] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0111] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0112] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A generative model optimization method, characterized in that: include: Obtain multiple weight data saved by the generation model to be optimized at multiple checkpoints; Dividing the weight data of each checkpoint into a plurality of weight groups, to obtain a plurality of weight groups corresponding to each checkpoint, wherein each weight group includes a portion of the weights in the weight data; Searching for a target coefficient combination that optimizes the quality of an image generated by the generation model from a specified coefficient search space, wherein the target coefficient combination includes a weight coefficient of each weight group in a plurality of weight groups corresponding to each of the plurality of checkpoints, and the same weight group shares the same weight coefficient; Based on the target coefficient combination, weighted summation is performed on each weight group divided from the multiple weight data of the multiple checkpoints to obtain the target weight data of the generation model, so as to perform a Vincent graph or Vincent video task using the generation model with the target weight data.

2. The method according to claim 1, characterized in that The generation model has multiple layers, and the weight data of each checkpoint is divided into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint, including: Based on the resolution corresponding to each layer in the generation model, the weights of the layers with the same resolution in the weight data of each checkpoint are divided into the same weight group to obtain multiple weight groups corresponding to each checkpoint.

3. The method according to claim 1, characterized in that The generation model includes an encoder and a decoder, wherein the weight data of each checkpoint is divided into multiple weight groups to obtain multiple weight groups corresponding to each checkpoint, including: The weights belonging to the encoder in the weight data of each checkpoint are divided into the same weight group, and the weights belonging to the decoder in the weight data of each checkpoint are divided into the same weight group, so as to obtain two weight groups corresponding to each checkpoint.

4. The method according to claim 1, characterized in that: The weight data of each checkpoint includes the weight corresponding to each time step of the generative model in a plurality of time steps; The step of dividing the weight data of each checkpoint into a plurality of weight groups to obtain a plurality of weight groups corresponding to each checkpoint includes: The weights belonging to the same time step in the weight data of each checkpoint are divided into the same weight group to obtain multiple weight groups corresponding to each checkpoint, so that the weights belonging to the same time step in the target coefficient combination share the same weighting coefficient.

5. The method according to claim 1, characterized in that The weight data of each checkpoint includes the weight adjusted by the generative model at each time step in a plurality of time steps; The step of dividing the weight data of each checkpoint into a plurality of weight groups to obtain a plurality of weight groups corresponding to each checkpoint includes: Divide the multiple time steps corresponding to each checkpoint into at least two time periods; The weights adjusted for the same time period in the weight data of each checkpoint are divided into the same weight group to obtain multiple weight groups corresponding to each checkpoint, so that the weights belonging to the same time period in the target coefficient combination share the same weighting coefficient.

6. The method according to claim 1, characterized in that The step of searching for a target coefficient combination that optimizes the quality of the image generated by the generation model from a specified coefficient search space comprises: Based on the specified coefficient search space, perform the following N rounds of evolutionary search, where N is a positive integer: In an nth round of evolutionary search, a candidate coefficient combination is sampled from an nth generation population, wherein the candidate coefficient combination includes a candidate weight coefficient of each weight group in a plurality of weight groups corresponding to each of the plurality of checkpoints, wherein the first generation population is obtained by initialization, n∈[1,N]; Based on the candidate coefficient combination, weighted summing is performed on each weight group divided from the plurality of weight data of the plurality of checkpoints to obtain candidate weight data; Evaluating the quality of an image generated by a generation model having the candidate weight data to obtain an image quality evaluation result corresponding to the candidate coefficient combination; Based on the image quality assessment result corresponding to the candidate coefficient combination and the coefficient search space, performing an evolution operation on the candidate weighting coefficients in the candidate coefficient combination to obtain offspring weighting coefficients, and adding the offspring weighting coefficients to the nth generation population to obtain an n+1th generation population; The candidate coefficient combination with the best image quality evaluation result in the N rounds of evolutionary search is determined as the target coefficient combination.

7. The method according to any one of claims 1 to 6, characterized in that: The weight data saved at each checkpoint includes the global model weight or low-rank adaptation weight of the generative model at each checkpoint, wherein the global model weight of each checkpoint is the global weight of the generative model itself, and the low-rank adaptation weight of each checkpoint is the weight obtained by fine-tuning the low-rank adaptation weight inserted into the trained converged generative model; The coefficient search space constrains the sum of weighted coefficients of all weight groups corresponding to the multiple checkpoints to be 1.

8. A generative model optimization device, characterized in that: include: An acquisition module, used to acquire a plurality of weight data stored at a plurality of checkpoints of the generation model to be optimized; A grouping module, used for dividing the weight data of each checkpoint into a plurality of weight groups, to obtain a plurality of weight groups corresponding to each checkpoint, wherein each weight group includes a part of the weights in the weight data; A search module, used for searching a target coefficient combination that optimizes the quality of an image generated by the generation model from a specified coefficient search space, wherein the target coefficient combination includes a weight coefficient of each weight group in a plurality of weight groups corresponding to each of the plurality of checkpoints, and the same weight group shares the same weight coefficient; A generation module is used to perform weighted summation on each weight group divided by the multiple weight data of the multiple checkpoints based on the target coefficient combination to obtain the target weight data of the generation model, so as to perform the Vincent graph or Vincent video task using the generation model with the target weight data.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method described in any one of claims 1 to 7 when executing the instructions stored in the memory.

10. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method, device and equipment for generating search space and storage medium

    CN112100466A

  • Lightweight method and device of diffusion model, electronic equipment and storage medium

    CN117634586A

  • Product appearance image generation method and device and similar image retrieval method and device

    CN118097374A

  • Modeling images as mixtures of image models

    US20100098343A1

  • Grouping nodes in a system

    WO2021249648A1

Cited By

  • Method and system for quickly slicing short videos with high complete playing rate in batches

    CN119629441A

  • A method and system for quickly batch generating short videos with a high completion rate

    CN119629441B