Digital copy generation method, system, device and equipment and medium
By loading the pre-trained large model base and user-fine-tuning model weight parameters, the problem that large language models cannot meet the needs of multiple users at the same time is solved, personalized generation and quick switching of digital clones are realized, and the reality of digital clones is improved. Sex and efficiency.
Patent Information
- Application Number
- CN202410141615.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-31
- Publication Date
- 2025-01-10
AI Technical Summary
The existing large language model cannot meet the different needs of multiple users at the same time when generating digital clones, resulting in the inability to truly restore the user's personality attributes and habit characteristics.
By loading the pre-trained large model pedestal, obtain the user's fine-tuned model weight parameters and fuse it with the base weight parameters, generate the user-specific digital clone, and quickly switch and isolate the fine-tuned model weight parameters when needed to ensure the number of each user Independence of the clone.
It realizes the rapid generation and personalized digital clones based on user needs, improves the authenticity and efficiency of digital clones, and avoids the problem of feature loss after multi-user integration.
Smart Images

Figure CN119293714A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of Internet technology, and in particular to a method, system, device, equipment and medium for generating a digital avatar. Background Art
[0002] With the development of artificial intelligence technology, it is gradually being applied to more and more scenarios. Among them, digital twins are one of the application scenarios of artificial intelligence technology.
[0003] In the prior art, in order to achieve better technical effects for digital avatars, large language models are often used. However, since the digital avatars of different users have different knowledge ranges, different personality attributes, and different habits, in practical applications, targeted training is required for different users to obtain different digital avatars. However, during the application process, the large language model can only load the weight parameters of one user at a time, which cannot meet the needs of multiple users. Although some large language models support simultaneous multi-user applications, the various features of the digital avatar obtained by fusing the weight parameters of multiple different users are fused, resulting in the digital avatar being unable to truly restore the user's personality attributes, different habits and other unique features. Therefore, a solution that can meet the application needs of digital avatars of different users is needed. Summary of the invention
[0004] The embodiments of the present invention provide a method, system, device and medium for generating a digital avatar, so as to meet the needs of different users for quickly generating a digital avatar.
[0005] In a first aspect, an embodiment of the present invention provides a method for generating a digital avatar, the method comprising:
[0006] Load the pre-trained large model base;
[0007] In response to a call request from a first user, obtaining a first fine-tuning model weight parameter corresponding to the call request from the first user from a plurality of groups of fine-tuning model weight parameters;
[0008] Fusing the first fine-tuning model weight parameter with the base weight parameter carried by the large model base to obtain a first fused parameter;
[0009] A first digital avatar corresponding to the calling request of the first user is generated based on the first fused large model after parameter fusion.
[0010] Optionally, the method further includes: in response to a call request from a second user, removing a first fine-tuning model weight parameter in a fusion parameter in the first fusion large model, and restoring the base weight parameter in the large model base;
[0011] Obtain a second fine-tuning model weight parameter of a second user;
[0012] The second fine-tuning model weight parameters are merged with the base weight parameters to obtain a second digital avatar corresponding to the call request of the second user.
[0013] Optionally, removing the first fine-tuning model weight parameter in the fusion parameter in the large model base and restoring the base weight parameter in the large model base includes:
[0014] Determine the adaptation layer in the first fusion large model where the weight parameter of the first fine-tuning model to be removed is located;
[0015] The first fine-tuning model weight parameters in the adaptation layer are reset, or the adaptation layer is initialized to restore the base weight parameters in the large model base.
[0016] Optionally, the method further includes: in response to a call request from a second user, obtaining a second fine-tuning model weight parameter of the second user;
[0017] Acquire the pre-stored base weight parameter from a preset storage space;
[0018] Fusing the second fine-tuning model weight parameter with the base weight parameter to obtain a second fused parameter;
[0019] The first fusion parameter is replaced by the second fusion parameter to obtain a second digital avatar corresponding to the second user call request.
[0020] Optionally, the fusing the first fine-tuning model weight parameter with the base weight parameter carried by the large model base includes:
[0021] Determining whether the parameter attributes of the first fine-tuning weight parameter match the parameter attributes of the base weight parameter;
[0022] If they match, the first fine-tuning weight parameter is input into the adaptation layer in the large model base;
[0023] In the adaptation layer, the first fine-tuning weight parameter is fused with the base weight parameter.
[0024] Optionally, the fusing the first fine-tuning weight parameter with the base weight parameter comprises:
[0025] The weight parameters of the first fine-tuning model and the base weight parameters are weighted averaged or linearly summed to obtain fusion parameters of the first fusion large model.
[0026] Optionally, the training method of the fine-tuning model is:
[0027] Determine a model to be trained that freezes at least a portion of the network structure;
[0028] Inputting training sample groups for different digital avatars into the model to be trained to obtain a model including fine-tuning model weight parameters matching the base weight parameters;
[0029] The fine-tuned model weight parameters corresponding to different digital avatars are separated from the model.
[0030] Optionally, the method further includes: in response to a call request from a second user, determining a weight parameter of the second fine-tuning model corresponding to the call request from the second user;
[0031] Determining whether the first fine-tuning model weight parameter is the same as the second fine-tuning model weight parameter;
[0032] If so, a second digital avatar corresponding to the calling request of the second user is generated using the first fusion parameter.
[0033] In a second aspect, an embodiment of the present invention provides a system comprising:
[0034] The server includes: at least one large model base, base weight parameters, and multiple groups of fine-tuning model weight parameters corresponding to multiple fine-tuning models trained by the same large model base in the at least one large model base;
[0035] A first user terminal sends a first call request to the server terminal;
[0036] The server, based on the first call request, obtains the first fine-tuning model weight parameters of the first user from multiple groups of fine-tuning model weight parameters; merges the first fine-tuning model weight parameters with the base weight parameters carried by the same large model base; and generates a first digital avatar corresponding to the call request of the first user based on the first fused large model after parameter fusion.
[0037] In a third aspect, an embodiment of the present invention provides a device for generating a digital avatar, the device comprising:
[0038] Loading module, used to load the pre-trained large model base;
[0039] An acquisition module, configured to, in response to a call request from a first user, acquire a first fine-tuning model weight parameter corresponding to the call request from the first user from a plurality of groups of fine-tuning model weight parameters;
[0040] A fusion module, used for fusing the first fine-tuning model weight parameter with the base weight parameter carried by the large model base to obtain a first fusion parameter;
[0041] A generation module is used to generate a first digital avatar corresponding to the call request of the first user based on the first fusion model after parameter fusion.
[0042] In a fourth aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the method for generating a digital avatar according to the first aspect.
[0043] In a fifth aspect, an embodiment of the present invention further provides a computer-readable medium on which is stored at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by a processor to implement the method for generating a digital avatar according to the first aspect.
[0044] In an embodiment of the present invention, a pre-trained large model base is loaded; in response to a call request from a first user, a first fine-tuning model weight parameter corresponding to the call request of the first user is obtained from multiple sets of fine-tuning model weight parameters; the first fine-tuning model weight parameter is fused with the base weight parameter carried by the large model base to obtain a first fusion parameter; based on the first fused large model after parameter fusion, a first digital avatar corresponding to the call request of the first user is generated. Through the above scheme, a fine-tuning model that meets the different call request requirements of users can be trained based on the pre-trained large model base. When the user has a need to establish a digital avatar, the appropriate fine-tuning model weight parameter is selected according to the user's specific call request, and then the fine-tuning model weight parameter is quickly fused with the base weight parameter, and the fine-tuning model is flexibly loaded to generate a digital avatar that meets the user's call requirements. The implementation method is simpler and more efficient, and can meet the digital avatar generation needs of different users. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A schematic diagram of a flow chart of a method for generating a digital avatar provided in an embodiment of the present application;
[0047] Figure 2a , 2b A schematic diagram of a system for generating a digital avatar provided in an embodiment of the present application;
[0048] Figure 3 A schematic diagram of a digital avatar generation process for illustrating an embodiment of the present application;
[0049] Figure 4 A schematic diagram of the structure of a device for generating a digital avatar provided in an embodiment of the present application;
[0050] Figure 5 For Figure 4 A schematic diagram of the structure of an electronic device corresponding to the device for generating a digital avatar provided in the embodiment. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.
[0053] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0054] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0055] Large Language Model: A large language model (LLM) is a deep learning model trained with a large amount of text data that can generate natural language text or understand the meaning of language text. It is called a large language model because of its large model size and training corpus size.
[0056] Digital avatar: By training a person’s knowledge, experience, opinions, speaking style and other corpora into a large model, the large model can express a person’s knowledge, experience and opinions according to his speaking style.
[0057] In order to achieve better technical effects for digital avatars, large language models are often used. However, since the digital avatars of different users have different knowledge ranges, different personality attributes, and different habits, in practical applications, targeted training is required for different users to obtain different digital avatars. However, during the application process, the large language model can only load the weight parameters of one user at a time, which cannot meet the needs of multiple users. Although some large language models support simultaneous multi-user applications, the various features of the digital avatar obtained by fusing the weight parameters of multiple different users are fused, resulting in the digital avatar being unable to truly restore the user's personality attributes, different habits and other unique features. Therefore, a solution that can meet the application needs of digital avatars of different users is needed.
[0058] To facilitate understanding, specific embodiments will be used as examples below.
[0059] like Figure 1 A schematic diagram of a process for generating a digital avatar provided in an embodiment of the present application. Figure 1 As you can see, the specific steps include the following:
[0060] Step 101: Load the pre-trained large model base.
[0061] Step 102: In response to a call request from a first user, a first fine-tuning model weight parameter corresponding to the call request from the first user is obtained from multiple groups of fine-tuning model weight parameters.
[0062] Step 103: Fusing the first fine-tuning model weight parameter with the base weight parameter carried by the large model base to obtain a first fused parameter.
[0063] Step 104: Generate a first digital avatar corresponding to the calling request of the first user based on the first fused large model after parameter fusion.
[0064] The large model base mentioned here refers to the overall architecture of a large language model, including the number of layers of the model, neural network structure, parameter settings, etc. These architectures determine the capabilities and performance of the model. The LLM large model base provides the framework and tools required to train large language models. This includes data preprocessing, model training algorithms, optimizers, distributed training, etc. The large model base is the core component for building large language models. It provides functions such as the model architecture, training framework, model parameters, and inference engine. With the LLM large model base, you can build and run large language models of various sizes and capabilities for tasks such as natural language processing, text generation, and question-answering systems.
[0065] It should be noted here that different users have different calling requirements. Each user has at least one set of fine-tuning model weight parameters. For example, the first user can set up a variety of different digital twins, including: work digital twin, parental digital twin, expert digital twin, etc. Different digital twins focus on different application fields. In order to make the fused model have better and more professional application effects, it is necessary to correspond to different fine-tuning model weight parameters.
[0066] During use, the required fine-tuning model weight parameters can be integrated into the large model base as needed, so that the integrated large model can meet the application requirements of different scenarios. For example, if the first user has a calling requirement, the first fine-tuning model weight parameters that meet the first user's digital avatar usage requirements can be selected from multiple groups of fine-tuning model weight parameters based on the first user's first user identifier and / or type identifier. The fine-tuning model weight parameters mentioned here can be marked with corresponding user identifiers and / or type identifiers to meet the application requirements of different users, and can also meet the application requirements of different avatar types of the same user. Through the precise division of the fine-tuning model weight parameters, the diverse needs of users can be met more accurately.
[0067] After selecting the first fine-tuning model weight parameters that meet the actual application needs of the user, the first fine-tuning model weight parameters are merged with the base weight parameters carried in the large model base to obtain the first fusion parameters. It should be noted that at each fusion, the base weight parameters are the most original weight parameters, and will not contain or fuse other fine-tuning model weight parameters, which can ensure that the fused large model obtained after each user fuses his own fine-tuning model weight parameters to the large model base will not be affected by other users or other factors. Furthermore, the first fused large model after the parameter fusion is completed can be used as the first digital avatar corresponding to the current call request of the first user. In actual applications, if the first user sends another call request, another digital avatar can be created for it, but at least part of the fine-tuning model weight parameters need to be replaced.
[0068] The multiple sets of fine-tuning model weight parameters and base weight parameters mentioned here can be stored separately in the video memory. If the video memory space is limited, the base model weight parameters can be stored in the video memory, and the fine-tuning model weight parameters of each user can be stored in other storage spaces. Of course, in order to improve the response speed, the fine-tuning model weight parameters of some commonly used users can be stored in the video memory. Alternatively, some parameters in each set of fine-tuning model weight parameters can also be stored in the video memory.
[0069] In an optional solution, after receiving the call request from the first user, it is necessary to first determine whether other weight parameters have been integrated into the large model base. If integrated, it is necessary to first eliminate the previously integrated weight parameters, or wait until the previous user has finished using them before eliminating the previously integrated weight parameters. Only after elimination can the first user's first fine-tuning model weight parameters be integrated into the base weight parameters. Anyway, if it is determined that no fine-tuning model weight parameters have been integrated into the large model base, the first fine-tuning model weight parameters can be directly integrated into the large model base.
[0070] In one or more embodiments of the present application, it also includes: in response to a call request from a second user, removing the first fine-tuning model weight parameter in the fusion parameter in the first fusion large model, and restoring the base weight parameter in the large model base; obtaining the second fine-tuning model weight parameter of the second user; fusing the second fine-tuning model weight parameter with the base weight parameter to obtain a second digital avatar corresponding to the call request from the second user.
[0071] In actual applications, when the first user occupies the large model base, if the second user also wants to use the large model base at this time, further analysis is required before taking corresponding measures. Specifically, after the second user initiates a call request, it is necessary to first determine whether the first user has finished using it, and whether the large model base can be released for the second user to use. If the first user does not need to use it temporarily or has finished using it, then after receiving the call request from the second user, the first fine-tuning model weight parameters fused in the first fused large model can be directly removed, and the base weight parameters in the large model base can be restored. At this time, the base weight parameters are not affected by any fine-tuning model weight parameters. After removal, the second user's second fine-tuning model weight parameters can be further fused with the base weight parameters that have just been restored.
[0072] If the first user is still using it and the large model base cannot be released temporarily, the second user needs to be notified to wait. The second user can also be told how long to wait. After the waiting period is over, the first fine-tuning model weight parameters are automatically removed, and the second model weight parameters are merged with the restored base weight parameters. If the second user is unwilling to wait (for example, the waiting time is too long), other available (for example, idle) large model bases can be recommended to the second user. This can meet the needs of the second user while ensuring that the first user can use the digital avatar normally.
[0073] After the second fine-tuning model weight parameter is merged with the base weight parameter, the second digital twin that satisfies the second user is obtained. It should be noted that in this embodiment, when selecting the second fine-tuning model weight parameter of the second user, if the second user has multiple groups of different types of fine-tuning model weight parameters, it is necessary to determine which group to select based on the call request of the second user. If the call request sent by the second user refers to unclear content, it can be fed back to the second user and request the second user to provide a clearer and more detailed call request. Through the above scheme, the pre-prepared large model base is used to simultaneously meet the implementation requirements of the digital twins of different users, without the need to prepare multiple large model bases or to undergo cumbersome training replacement every time. When there is a need to switch the digital twin of the user, fast switching can be achieved by replacing the fine-tuning model weight parameters. In addition, by replacing the fine-tuning model weight parameters, it can also effectively avoid the fine-tuning model weight parameters of other users included in the fusion model, resulting in the fusion model being unable to accurately realize the digital twin role required by a certain user.
[0074] In one or more embodiments of the present application, the removing of the first fine-tuning model weight parameter in the fusion parameter in the large model base and the restoring of the base weight parameter in the large model base include: determining the adaptation layer in the first fused large model where the first fine-tuning model weight parameter to be removed is located; resetting the first fine-tuning model weight parameter in the adaptation layer, or initializing the adaptation layer to restore the base weight parameter in the large model base.
[0075] In practical applications, at least one specific layer is designated as an adaptation layer for parameter fusion in the large model base. Therefore, when removing parameters, it is necessary to find the corresponding adaptation layer from the large model. The base weight parameters in this adaptation layer are in a fusion state with the first fine-tuning model weight parameters. The first fine-tuning model weight parameters can be reset (for example, set to zero), deleted, or set to a fixed value that does not affect the subsequent weight parameter fusion.
[0076] In addition to resetting the base weight parameters in the model adaptation layer, the adaptation layer can also be initialized as a whole, that is, the entire adaptation layer is restored to the initialization state. It should be noted that the adaptation layer initialization state only contains valid base weight parameters, and does not contain valid fine-tuning model weight parameters (generally speaking, invalid fine-tuning model weight parameters after initialization can be zero or empty).
[0077] Through the above processing method, the base weight parameters in the large model base can be quickly restored, the influence of the previous user using the large model base on the subsequent user can be eliminated, and the complete isolation of fine-tuning model weight parameters between different users is achieved.
[0078] For example, to identify the fine-tuning model weight parameters: First, you need to understand the location and name of the fine-tuning model weight parameters in the LLM large model. This may require looking at the structure of the model and the naming conventions of the weight parameters. Generally speaking, the weight parameters of the fine-tuning model should be stored in a specific layer or submodule of the model. In order to avoid affecting the original LLM large model, it is recommended to create a copy of the large model first to avoid damage to the large model due to removal failure. In the copy of the large model, locate the layer or submodule that stores the fine-tuning model weight parameters, and reset or initialize its corresponding weight parameters. In this way, the weight parameters of the fine-tuning model are removed.
[0079] In one or more embodiments of the present application, it also includes: in response to a call request from a second user, obtaining a second fine-tuning model weight parameter of the second user; obtaining the pre-stored base weight parameter from a preset storage space; fusing the second fine-tuning model weight parameter with the base weight parameter to obtain a second fusion parameter; replacing the first fusion parameter with the second fusion parameter to obtain a second digital avatar corresponding to the call request from the second user.
[0080] As mentioned above, the first fine-tuning model weight parameters of the first user are fused with the base weight parameters to obtain the first fusion parameters, and the first fusion parameters are retained as a whole in the adaptation layer of the large model. The base weight parameters of the large model are stored separately in a preset storage space. When needed, the base weight parameters can be obtained from the preset storage space without affecting the base weight parameters in the preset storage space (for example, tampering with or modifying the base weight parameters). In other words, the base weight parameters in the preset storage space can be used repeatedly. If it is found that the base weight parameters are not very accurate during use, the base weight parameters can be retrained and optimized.
[0081] After receiving the call request from the second user, without removing the first fine-tuning model weight parameter in the fusion parameter, the second fine-tuning model weight parameter can be fused with the base weight parameter to obtain the second fusion parameter. Then, the first fusion parameter is replaced as a whole by the second fusion parameter, and there is no need to initialize or reset the parameters in the adaptation layer. This can effectively shorten the switching time between digital avatars of different users and improve the switching efficiency.
[0082] Through the above solution, there is no need to set the fine-tuning model weight parameters in the first fusion parameter to zero or initialize the settings. Instead, the overall replacement method is adopted to directly use the second fusion parameter to replace the first fusion parameter in the large model, which is simpler and more efficient.
[0083] In one or more embodiments of the present application, the fusion of the first fine-tuning model weight parameters with the base weight parameters carried by the large model base includes: determining whether the parameter properties of the first fine-tuning weight parameters and the base weight parameters match; if they match, inputting the first fine-tuning weight parameters into the adaptation layer in the large model base; in the adaptation layer, fusing the first fine-tuning weight parameters with the base weight parameters.
[0084] In order to make parameter fusion smoother, it is necessary to make the fusion parameters have matching parameter properties, such as the network adaptation layer, low-rank vector dimension size and other parameters are consistent. When the parameters match, input the first fine-tuning model weight parameters into the large model base
[0085] Specifically, the Adaptation Layer is an additional layer or component added to the model to fuse the weight parameters of the fine-tuned model with the corresponding weight parameters in the LLM model. The purpose of the Adaptation Layer is to make the weights of the fine-tuned model consistent with the structure and function of the LLM model. The Adaptation Layer is designed to fuse the weight parameters of the fine-tuned model into the LLM model so that the overall model can work properly when performing digital twin tasks without destroying the original LLM model structure and function.
[0086] Maintaining a consistent approach can be achieved in several ways:
[0087] Parameter dimension matching: The weight parameters of the LLM model and the fine-tuned model usually have different dimensions. To maintain consistency, the adaptation layer can linearly transform or resize the weight parameters of the fine-tuned model to make them have the same dimensions as the corresponding weight parameters of the LLM model.
[0088] Unified semantic interpretation: The LLM model and the fine-tuned model can have different internal representations and encoding methods. The adaptation layer can provide a unified semantic interpretation bridge to convert the weight parameters of the fine-tuned model into a semantic representation compatible with the LLM model.
[0089] Fusion strategy: The adaptation layer needs to define a suitable fusion strategy to combine the weight parameters of the fine-tuned model with the weight parameters of the LLM model. This can include weighted averaging, linear combination, or other combination techniques to ensure that the weights of the fine-tuned model are appropriately applied in the overall model.
[0090] In summary, keeping consistency means fusing the weight parameters of the fine-tuned model with the structure and functionality of the LLM model so that the overall model can benefit from both the learning ability of the fine-tuned model and the complexity of the LLM model. The design and implementation of the adaptation layer is to achieve this consistency and ensure that the overall model performs better in the digital twin task.
[0091] When injecting into the adaptation layer, the two weight parameters can be fused by some linear combination. A common method is to use a weighted average of the weight parameters, in which the two parameters are weighted and summed and normalized as needed. For example, a fusion factor can be defined to control the influence of the fine-tuned model weight parameters in the overall model. Once the weight parameters of the fine-tuned model are fused with the weight parameters in the adaptation layer, the overall model can use these fused parameters for the digital twin task. The adaptation layer converts the received input data into a format suitable for the LLM model and generates the output of speech and action by applying the fused weight parameters. If you want to remove the weight parameters of the fine-tuned model, you need to modify the adaptation layer accordingly. The weight parameters related to fine-tuning in the adaptation layer can be set to zero or randomly initialized so that the influence of the fine-tuned model is no longer considered. In this way, the fine-tuned weight parameters can be removed from the overall model.
[0092] In one or more embodiments of the present application, the fusing of the first fine-tuning weight parameters with the base weight parameters includes: performing weighted average fusion or linear summation of the first fine-tuning model weight parameters and the base weight parameters to obtain fusion parameters of the first fusion large model.
[0093] For example, there are many ways to perform parameter fusion, such as weighted averaging: weight the weight parameters of model A and model B in a certain proportion. You can assign a weight coefficient to each model, such as 0.5 and 0.5, to evenly fuse the parameters of the two models. If you think a model performs better, you can also assign it a higher weight.
[0094] Linear interpolation: Use linear interpolation to interpolate the weight parameters between the fine-tuning model weight parameters and the base weight parameters. You can perform smooth interpolation between the two models as needed, such as 0.2*fine-tuning model weight parameters+0.8*base weight parameters.
[0095] Alternating Fusion: During training, the fine-tuning model weight parameters and the base weight parameters are used alternately. For example, in each training iteration, you can choose to update the fine-tuning model weight parameters once, then update the base weight parameters once, and so on. This approach can try to combine the advantages of the two models.
[0096] Of course, when removing parameters, you also need to consider what fusion method is used, and then choose the corresponding method to remove them.
[0097] In one or more embodiments of the present application, the training method of the fine-tuning model: determine the model to be trained that freezes at least part of the network structure; input the training sample group for different digital avatars into the model to be trained to obtain a model containing fine-tuning model weight parameters that match the base weight parameters; separate the fine-tuning model weight parameters corresponding to different digital avatars from the model.
[0098] In actual applications, both the fine-tuning model and the large model are pre-trained before use, and the large model used during training is the same as the large model used in later applications. In order to facilitate rapid switching during subsequent use and reduce the complexity of model training, some network structures in the model can be frozen.
[0099] The model to be trained is usually fine-tuned based on a pre-trained base model (such as LLM). During the fine-tuning process, you can choose to freeze at least part of the network structure, that is, keep some or all of the weight parameters of the base model from being updated. This ensures that the feature representation ability of the base model is preserved while only fine-tuning is performed for a specific task.
[0100] According to different digital avatars (or tasks), the corresponding training sample groups are input into the model to be trained for training. Each digital avatar may correspond to a different training data set, so that it can be fine-tuned according to the needs of different tasks. It should be noted that when establishing a training sample group, it is necessary to establish it according to different user call requests. Different call requests represent digital avatars of different role types or different functions required by the user, such as a work assistant digital avatar, a parent role digital avatar, and so on. In other words, a user may have multiple digital avatars, each of which has some of its own abilities and performs some tasks.
[0101] Through the training process, the model to be trained will gradually adjust its weight parameters according to the input training sample set. These weight parameters will gradually match the weight parameters of the base model, so that the fine-tuned model can better adapt to the specific task.
[0102] After fine-tuning is completed, the fine-tuned model weight parameters corresponding to different digital avatars can be separated from the overall model. This allows the fine-tuned model to be applied to actual tasks, such as prediction or inference.
[0103] It is important to note that the training process of the fine-tuned model can be adjusted and modified according to the characteristics of the specific task and dataset. For example, different optimization algorithms, learning rate scheduling strategies, regularization methods, etc. can be used to optimize the performance of the fine-tuned model. In addition, model evaluation and tuning can also be performed to improve the performance of the fine-tuned model on specific tasks.
[0104] In one or more embodiments of the present application, it also includes: in response to a call request from a second user, determining the second fine-tuning model weight parameter corresponding to the call request from the second user; judging whether the first fine-tuning model weight parameter is the same as the second fine-tuning model weight parameter; and if so, generating a second digital avatar corresponding to the call request from the second user using the first fusion parameter.
[0105] In actual applications, after receiving the call request from the second user, it is necessary to first determine the second fine-tuning model weight parameter corresponding to the call request, and calculate the similarity between the first fine-tuning model weight parameter and the second fine-tuning model weight parameter. For example, the first user and the second user need to establish a digital avatar of the role of an elementary school math teacher. When comparing the first fine-tuning model weight parameter and the second fine-tuning model weight parameter, if the comparison result is the same, it means that there is no need to replace the fine-tuning model weight parameter, and the control authority of the digital avatar used by the first user can be directly handed over to the second user for direct use.
[0106] If after calculating the similarity between the first fine-tuning model weight parameters and the second fine-tuning model weight parameters, it is found that the two sets of parameters are different (that is, the similarity is lower than a certain threshold), the first fine-tuning model weight parameters are removed, and then the second fine-tuning model weight parameters are merged with the base weight parameters in the adaptation layer to obtain a second digital avatar that meets the calling request of the second user.
[0107] Based on the same idea, Figure 2a , 2b A schematic diagram of a system for generating a digital avatar provided in an embodiment of the present application. The present application also provides a system for generating a digital avatar, the system comprising:
[0108] The server 1 comprises: at least one large model base 11, base weight parameters, and multiple groups of fine-tuning model weight parameters respectively corresponding to multiple fine-tuning models 12 trained by the same large model base in the at least one large model base;
[0109] The first user terminal 2 sends a first call request to the server terminal 1;
[0110] The server 1, according to the first call request, obtains the first fine-tuning model weight parameters of the first user from multiple groups of fine-tuning model weight parameters; merges the first fine-tuning model weight parameters with the base weight parameters carried by the same large model base; and generates a first digital avatar corresponding to the call request of the first user based on the first fused large model after parameter fusion.
[0111] In practical applications, the digital avatar generation system can be a system in which the user end and the server end are on the same device (e.g. Figure 2b), or on different devices (such as Figure 2a As shown). For example, a user-side application software may be installed on a local computer, and the computer may also serve as a server. Of course, the user-side and the server may also be different devices. For example, the user-side is the application software installed on the user's mobile phone terminal. The server is a cloud server or a computer device.
[0112] In the system, at least one trained large model base and multiple fine-tuning models are included. Among them, the at least one large model base is exactly the same. These fine-tuning models are all trained based on the same large model base, so that the weight parameters of the trained fine-tuning models can be better switched according to needs.
[0113] In one or more embodiments of the present application, it also includes: a second user end sends a second call request to the server end; the server end, after receiving the second call request, removes the first fine-tuning model weight parameter in the fusion parameter in the first fusion large model, and restores the base weight parameter in the same large model base; obtains the second fine-tuning model weight parameter of the second user; and fuses the second fine-tuning model weight parameter with the base weight parameter to generate a second digital avatar.
[0114] After receiving the call request from the second user terminal 3, the task of establishing the second digital twin can be further executed. In an optional solution, if there are multiple large model bases, the idle large model base can be preferentially selected for parameter fusion. Since these large model bases are exactly the same, the digital twin generation and use requirements of multiple different users can be met at the same time.
[0115] For ease of understanding, the implementation process of this solution will be described below by way of specific embodiments. Figure 3 A schematic diagram of the digital avatar generation process for illustrating an embodiment of the present application.
[0116] This solution is to load the LLM weight parameters (i.e., base weight parameters) and the fine-tuning model weight parameters of each user at the same time, and keep them separately in the video memory, and the LLM weight parameters and the fine-tuning model weight parameters can be quickly fused and removed. When user A needs to call, the LLM weight parameters are fused with the fine-tuning model parameters (parameter A) corresponding to user A to provide services; when user B needs to call, the fine-tuning model parameters (parameter A) corresponding to user A are removed from LLM and restored to the original LLM, and then LLM is fused with the fine-tuning model parameters (parameter B) corresponding to user B, and then services can be provided to user B. The fine-tuning model parameters (parameter C) corresponding to user C and the fine-tuning model parameters (parameter X) corresponding to user X are similar.
[0117] The following is a detailed step-by-step explanation:
[0118] Step 1. Load the base LLM model parameters and network structure
[0119] Load the base LLM used for model training into the video memory. Note that all users should use the same base LLM for model fine-tuning. In other words, different users have the same model base (and the base parameters remain unchanged during training), but they correspond to different fine-tuning model weights. Therefore, each different user can share the same base LLM, so that the base LLM is loaded only once, reducing video memory usage and switching time for different users.
[0120] Step 2. Load the fine-tuned model weights and network structure for multiple users who need to provide services
[0121] The fine-tuning model weight size of a user is about 50M, and the video memory of an A100 card is about 80G. After loading the base LLM, there is still a lot of video memory left, which can simultaneously load and save the fine-tuning model weights of up to hundreds of users. Note that when each user fine-tunes the model, the model configuration used, such as the network adaptation layer, low-rank vector dimension size and other parameters are consistent. Different users have different results in the fine-tuning model weight parameter training simply because of different training data, but the structure and size of all user model networks are the same, so as to ensure that the same model network structure can be shared during subsequent switching.
[0122] In the above description, it is mentioned that the fine-tuning model weights of different users are about 50M, and the fine-tuning model weights of up to hundreds of users can be loaded and saved simultaneously in the video memory of an A100 card. At the same time, it is pointed out that the structure and size of the fine-tuning model network of different users are the same to ensure that the same model network structure can be shared during subsequent switching.
[0123] Here, the structure of the model network refers to the overall architecture and components of the fine-tuning model, including its layers, connections, etc. Specifically, the model network can be considered as a neural network composed of different layers or modules. For example, the model network may include a speech encoder layer, an action generator layer, an adaptation layer, etc.
[0124] The size of the model network refers to the number and size of parameters in the network, and is usually used to measure the complexity and resource consumption of the model. Here, the size of the model network is the same between different users, meaning that they have the same number and size of weight parameters. Therefore, the model network structure and number of parameters of different users remain consistent so that they can share the same model network structure when switching later.
[0125] Specifically, assume that the model network includes a speech encoder layer and an action generator layer. Regardless of user A or user B, in the model network, the structure of the speech encoder layer and the action generator layer are the same, and they are composed of the same type and number of neurons. For example, the speech encoder layer may be composed of a set of convolutional neural network layers and fully connected layers, and the action generator layer may be composed of some recurrent neural network units. Moreover, the number and size of parameters in these two layers are also the same.
[0126] By ensuring that the model network structure and size are the same for different users, it is convenient to share the same model network model when switching users, so as to quickly adapt and generate the speech and action features of specific users.
[0127] Step 3. When user A requests model service, dynamic plug-in and adaptation are performed based on whether the model has loaded the fine-tuning model weight parameters (parameter X) of other user X.
[0128] 3.1 If the current model has not loaded any other user's fine-tuning model weight parameters, that is, the model is in the state of initializing the base LLM, then the fine-tuning model weight parameters corresponding to user A in the video memory are directly taken out for weight parameter fusion. The fused model is user A's fusion model and can provide services for user A.
[0129] 3.2 If the model currently has the fine-tuning model weight parameters (parameters X) of user X loaded, first remove the fine-tuning model weight parameters (parameters X), restore the model to the initial state of the base model LLM, and then take out the fine-tuning model weight parameters (parameters A) of user A in the video memory for weight parameter fusion. The fused model is the fusion model of user A, which can provide services for user A.
[0130] This application provides an implementation method for dynamically pluggable switching of multiple digital avatars based on fine-tuning model weight parameters, which can support digital avatars of different users at the same time through a base LLM and fine-tuning model weights fine-tuned by multiple users. The entire switching process is completed in about 1.5 seconds. Usually, a conversation service can meet user needs within 3-5 seconds of reply. Therefore, this dynamic switching also has good operability in the actual production process.
[0131] Based on the same idea, the embodiment of the present application also provides a device for generating a digital avatar. Figure 4 A schematic diagram of the structure of a device for generating a digital avatar provided in an embodiment of the present application. Figure 4 As can be seen, the device includes:
[0132] The loading module 41 is used to load the pre-trained large model base.
[0133] The acquisition module 42 is used to respond to the call request of the first user and acquire the first fine-tuning model weight parameter corresponding to the call request of the first user from multiple groups of fine-tuning model weight parameters.
[0134] The fusion module 43 is used to fuse the first fine-tuning model weight parameters with the base weight parameters carried by the large model base to obtain first fusion parameters.
[0135] The generation module 44 is used to generate a first digital avatar corresponding to the call request of the first user based on the first fusion model after parameter fusion.
[0136] Optionally, it further includes a removal module 45, which is used to remove the first fine-tuning model weight parameter in the fusion parameter in the first fusion large model in response to a call request from the second user, and restore the base weight parameter in the large model base;
[0137] Obtain a second fine-tuning model weight parameter of a second user;
[0138] The second fine-tuning model weight parameters are merged with the base weight parameters to obtain a second digital avatar corresponding to the call request of the second user.
[0139] Optionally, the removal module 45 is further used to determine the adaptation layer in the first fusion large model where the weight parameter of the first fine-tuning model to be removed is located;
[0140] The first fine-tuning model weight parameters in the adaptation layer are reset, or the adaptation layer is initialized to restore the base weight parameters in the large model base.
[0141] An acquisition module 42, configured to acquire a second fine-tuning model weight parameter of the second user in response to a call request of the second user;
[0142] Acquire the pre-stored base weight parameter from a preset storage space;
[0143] Fusing the second fine-tuning model weight parameter with the base weight parameter to obtain a second fused parameter;
[0144] The first fusion parameter is replaced by the second fusion parameter to obtain a second digital avatar corresponding to the second user call request.
[0145] Optionally, a fusion module 43 is used to determine whether the parameter attributes of the first fine-tuning weight parameter and the base weight parameter match;
[0146] If they match, the first fine-tuning weight parameter is input into the adaptation layer in the large model base;
[0147] In the adaptation layer, the first fine-tuning weight parameter is fused with the base weight parameter.
[0148] Optionally, the fusion module 43 is used to perform weighted average fusion or linear summation on the first fine-tuning model weight parameters and the base weight parameters to obtain fusion parameters of the first fusion large model.
[0149] Optionally, a training module 46 for fine-tuning the model is also included;
[0150] Determine a model to be trained that freezes at least a portion of the network structure;
[0151] Inputting training sample groups for different digital avatars into the model to be trained to obtain a model including fine-tuning model weight parameters matching the base weight parameters;
[0152] The fine-tuned model weight parameters corresponding to different digital avatars are separated from the model.
[0153] Optionally, the generating module 44 is configured to determine, in response to a call request from a second user, a weight parameter of the second fine-tuning model corresponding to the call request from the second user;
[0154] Determining whether the first fine-tuning model weight parameter is the same as the second fine-tuning model weight parameter;
[0155] If so, a second digital avatar corresponding to the calling request of the second user is generated using the first fusion parameter.
[0156] Based on the above embodiment, the pre-trained large model base is loaded; in response to the call request of the first user, the first fine-tuning model weight parameter corresponding to the call request of the first user is obtained from multiple groups of fine-tuning model weight parameters; the first fine-tuning model weight parameter is merged with the base weight parameter carried by the large model base to obtain the first fusion parameter; based on the first fused large model after parameter fusion, the first digital avatar corresponding to the call request of the first user is generated. Through the above scheme, the large model base and the fine-tuning model that meets the different call request requirements of the user are pre-trained. When the user has the need to establish a digital avatar, the appropriate fine-tuning model weight parameter is selected according to the user's specific call request, and then the fine-tuning model weight parameter is quickly merged with the base weight parameter to generate a digital avatar that meets the user's call requirements. No training is required during use, and since the large model base is a universal base, any user who has the need to generate a digital avatar can use it, and the generation of a digital avatar is simpler and more efficient, which can meet the digital avatar generation needs of different users.
[0157] In one possible design, the above Figure 4The structure of the visual effect enhancement device shown can be implemented as an electronic device. Figure 5 As shown, the electronic device may include: a processor 51 and a memory 52. The memory 52 stores executable code, and when the executable code is executed by the processor 51, the processor 51 can at least implement the visual effect enhancement method provided in the above embodiment. The structure of the electronic device may also include a communication interface 53 for communicating with other devices or communication networks.
[0158] In addition, an embodiment of the present invention provides a non-transitory machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor in a server or a computer, the processor executes the operations provided in the above embodiments. Figure 1 Corresponding visual effect enhancement method.
[0159] The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.
[0160] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution can essentially or contribute to the part in the form of a computer product, and the present invention can be implemented in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a digital avatar, characterized in that: The method comprises: Load the pre-trained large model base; In response to a call request from a first user, obtaining a first fine-tuning model weight parameter corresponding to the call request from the first user from a plurality of groups of fine-tuning model weight parameters; Fusing the first fine-tuning model weight parameter with the base weight parameter carried by the large model base to obtain a first fused parameter; A first digital avatar corresponding to the calling request of the first user is generated based on the first fused large model after parameter fusion.
2. The method according to claim 1, characterized in that Also includes: In response to a call request from a second user, removing the first fine-tuning model weight parameter in the fusion parameter in the first fusion large model, and restoring the base weight parameter in the large model base; Obtain a second fine-tuning model weight parameter of a second user; The second fine-tuning model weight parameters are merged with the base weight parameters to obtain a second digital avatar corresponding to the call request of the second user.
3. The method according to claim 2, characterized in that The removing the first fine-tuning model weight parameter in the fusion parameter in the large model base and restoring the base weight parameter in the large model base includes: Determine the adaptation layer in the first fusion large model where the weight parameter of the first fine-tuning model to be removed is located; The first fine-tuning model weight parameters in the adaptation layer are reset, or the adaptation layer is initialized to restore the base weight parameters in the large model base.
4. The method according to claim 1, characterized in that Also includes: In response to a call request from a second user, obtaining a second fine-tuning model weight parameter of the second user; Acquire the pre-stored base weight parameter from a preset storage space; Fusing the second fine-tuning model weight parameter with the base weight parameter to obtain a second fused parameter; The first fusion parameter is replaced by the second fusion parameter to obtain a second digital avatar corresponding to the second user call request.
5. The method according to claim 1, characterized in that The step of fusing the first fine-tuning model weight parameter with the base weight parameter carried by the large model base includes: Determining whether the parameter attributes of the first fine-tuning weight parameter match the parameter attributes of the base weight parameter; If they match, the first fine-tuning weight parameter is input into the adaptation layer in the large model base; In the adaptation layer, the first fine-tuning weight parameter is fused with the base weight parameter.
6. The method according to claim 5, characterized in that The fusing the first fine-tuning weight parameter with the base weight parameter comprises: The weight parameters of the first fine-tuning model and the base weight parameters are weighted averaged or linearly summed to obtain fusion parameters of the first fusion large model.
7. The method according to claim 2, characterized in that The training method of the fine-tuning model is: Determine a model to be trained that freezes at least a portion of the network structure; Inputting training sample groups for different digital avatars into the model to be trained to obtain a model including fine-tuning model weight parameters matching the base weight parameters; The fine-tuned model weight parameters corresponding to different digital avatars are separated from the model.
8. The method according to claim 2, characterized in that: Also includes: In response to a call request from a second user, determining a weight parameter of the second fine-tuning model corresponding to the call request from the second user; Determining whether the first fine-tuning model weight parameter is the same as the second fine-tuning model weight parameter; If so, a second digital avatar corresponding to the calling request of the second user is generated using the first fusion parameter.
9. A system for generating a digital avatar, characterized in that: The system comprises: The server includes: at least one large model base, base weight parameters, and multiple groups of fine-tuning model weight parameters corresponding to multiple fine-tuning models trained by the same large model base in the at least one large model base; A first user terminal sends a first call request to the server terminal; The server, based on the first call request, obtains the first fine-tuning model weight parameters of the first user from multiple groups of fine-tuning model weight parameters; merges the first fine-tuning model weight parameters with the base weight parameters carried by the same large model base; and generates a first digital avatar corresponding to the call request of the first user based on the first fused large model after parameter fusion.
10. The system according to claim 9, characterized in that Also includes: The second user terminal sends a second call request to the server terminal; The server, after receiving the second call request, removes the first fine-tuning model weight parameter in the fusion parameter in the first fusion large model, and restores the base weight parameter in the base of the same large model; Obtain a second fine-tuning model weight parameter of a second user; and fuse the second fine-tuning model weight parameter with the base weight parameter to generate a second digital avatar.
11. A device for generating a digital avatar, characterized in that: The device comprises: Loading module, used to load the pre-trained large model base; An acquisition module, configured to, in response to a call request from a first user, acquire a first fine-tuning model weight parameter corresponding to the call request from the first user from a plurality of groups of fine-tuning model weight parameters; A fusion module, used for fusing the first fine-tuning model weight parameter with the base weight parameter carried by the large model base to obtain a first fusion parameter; A generation module is used to generate a first digital avatar corresponding to the call request of the first user based on the first fusion model after parameter fusion.
12. An electronic device comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 8.
13. A computer-readable medium having stored thereon at least one instruction, at least one program, code set or instruction set, wherein the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the method according to any one of claims 1 to 8.