Method for training hybrid expert model, related device and computer program product
By determining the base affinity and adjusting the affinity regulation parameters in the hybrid expert model, and rationally allocating lexical units for training, the problems of training efficiency and quality of the hybrid expert model are solved, and more efficient model training and data processing are achieved.
Patent Information
- Application Number
- CN202610090352.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-22
- Publication Date
- 2026-05-12
AI Technical Summary
The training efficiency and quality of hybrid expert models in existing technologies need to be improved, especially in the allocation and training of expert sub-models, where there are issues of inefficiency and unreasonableness.
By determining the base affinity of each expert sub-model to be assigned to a word, and adjusting the affinity adjustment parameter based on the current model capability value of the expert sub-model, words are reasonably assigned for training, resulting in a trained hybrid expert model.
This improves the training efficiency and quality of hybrid expert models, enabling them to process target scene data more efficiently and effectively.
Smart Images

Figure CN122021804A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, specifically to artificial intelligence technologies such as deep learning, gating mechanisms, and lexical allocation, and particularly to methods, apparatuses, electronic devices, computer-readable storage media, and computer program products for training hybrid expert models. Background Technology
[0002] With the rapid development of artificial intelligence and deep learning technologies, hybrid expert models (MOEs) based on neural networks have gradually become an important choice for handling complex tasks.
[0003] Because MOE itself is a model composed of multiple distributions, it is often used to model different categories, groups or patterns of data. Therefore, MOE can accomplish tasks through individual expert submodels that are divided within it.
[0004] In MOE (Model-Oriented Evidence), an expert sub-model can be considered a kind of "expert" used to process specific patterns or regions in the data to obtain a representation of the corresponding group or component in the dataset. Consequently, due to this processing method, MOE offers greater flexibility and accuracy compared to traditional models across different tasks or data patterns.
[0005] Therefore, to utilize MOE more effectively, it is worthwhile and urgently needed to train MOE more efficiently and with higher quality, especially to train its expert subnetworks and expert submodels. Summary of the Invention
[0006] This disclosure provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for training hybrid expert models.
[0007] In a first aspect, embodiments of this disclosure propose a method for training a hybrid expert model, comprising: determining the basic affinity of each expert sub-model in the hybrid expert model for the lexical unit to be assigned; determining the affinity adjustment parameter corresponding to each expert sub-model based on the current model capability value of the expert sub-model; assigning the lexical unit to be assigned to the corresponding expert sub-model based on the basic affinity and the affinity adjustment parameter; and training the expert sub-model accordingly using the lexical unit assigned to the expert sub-model to obtain a trained hybrid expert model, so as to process target scene data through the trained hybrid expert model.
[0008] Secondly, embodiments of this disclosure propose an apparatus for training a hybrid expert model, comprising: a basic affinity determination unit configured to determine the basic affinity of each expert sub-model in the hybrid expert model for a lexical unit to be assigned; an adjustment parameter determination unit configured to determine an affinity adjustment parameter corresponding to each expert sub-model based on the current model capability value of the expert sub-model; a lexical allocation unit configured to allocate the lexical unit to be assigned to the corresponding expert sub-model based on the basic affinity and the affinity adjustment parameter; and a model training unit configured to train the expert sub-models using the lexical units allocated to them, thereby obtaining a trained hybrid expert model for processing target scene data.
[0009] Thirdly, embodiments of this disclosure propose a hybrid expert model, including multiple expert sub-models, wherein the multiple expert sub-models are trained via a method for training the hybrid expert model described in any implementation of the first aspect.
[0010] Fourthly, embodiments of this disclosure provide an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to implement a method for training a hybrid expert model as described in any implementation of the first aspect.
[0011] Fifthly, embodiments of this disclosure provide a non-transitory computer-readable storage medium storing computer instructions for enabling a computer to implement, when executed, a method for training a hybrid expert model as described in any of the implementations in the first aspect.
[0012] In a sixth aspect, embodiments of this disclosure provide a computer program product including a computer program that, when executed by a processor, enables a method for training a hybrid expert model as described in any of the implementations of the first aspect.
[0013] The method, apparatus, electronic device, computer-readable storage medium, and computer program product for training a hybrid expert model provided in this disclosure first determine the basic affinity of each expert sub-model in the hybrid expert model for the lexical unit to be assigned. Then, based on the current model capability value of each expert sub-model, an affinity adjustment parameter corresponding to each expert sub-model is determined. Next, based on the basic affinity and the affinity adjustment parameter, the lexical unit to be assigned is assigned to the corresponding expert sub-model. Finally, the expert sub-models are trained using the lexical units assigned to them to obtain a trained hybrid expert model, which is then used to process target scene data.
[0014] This disclosure enables more efficient and reasonable allocation of lexical units for training to expert sub-models in a hybrid expert model, thereby allowing the hybrid expert model as a whole to be trained more efficiently and with higher quality.
[0015] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0016] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is an exemplary system architecture to which this disclosure can be applied; Figure 2 A flowchart illustrating a process for training a hybrid expert model, as provided in this embodiment of the disclosure; Figure 3 A flowchart illustrating a process for determining affinity adjustment parameters provided in this embodiment of the disclosure; Figure 4 A flowchart illustrating another process for determining affinity adjustment parameters provided in this disclosure embodiment; Figure 5 A flowchart illustrating the process of training a hybrid expert model in an application scenario, as provided in an embodiment of this disclosure; Figure 6 A structural block diagram of an apparatus for training a hybrid expert model provided in an embodiment of this disclosure; Figure 7 This is a schematic diagram of the structure of an electronic device suitable for performing a method for training a hybrid expert model, as provided in an embodiment of this disclosure. Detailed Implementation
[0017] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding; these should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0018] Furthermore, the acquisition, storage, use, processing, transportation, provision, and disclosure of user personal information (such as the terms mentioned later in this disclosure that may be extracted based on user personal information) in the technical solutions disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0019] Figure 1 An exemplary system architecture 100 is shown, illustrating embodiments of methods, apparatuses, electronic devices, and computer-readable storage media for training hybrid expert models to which the present disclosure can be applied.
[0020] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0021] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various applications for enabling information communication between the terminal devices 101, 102, and 103 and server 105 can be installed. These applications include MOE training applications, MOE calling applications, and instant messaging applications.
[0022] Terminal devices 101, 102, and 103 and server 105 can be either hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with displays, including but not limited to smartphones, tablets, laptops, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the aforementioned electronic devices, and can be implemented as multiple software programs or software modules, or as a single software program or software module; no specific limitation is made here. When server 105 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server. When server 105 is software, it can be implemented as multiple software programs or software modules, or as a single software program or software module; no specific limitation is made here.
[0023] Server 105 can provide various services through its built-in applications. For example, it can provide online training for the MOE (Multi-Object Array) to obtain the desired MOE. When running this MOE training application, server 105 can achieve the following: First, it can obtain the unassigned lexical units (LEUs) for training expert sub-models in the MOE from terminal devices 101, 102, and 103 via network 104. Then, server 105 determines the base affinity of each expert sub-model in the hybrid expert model for the LEU. Next, server 105 determines the affinity adjustment parameters corresponding to each expert sub-model based on its current model capability value. Then, server 105 assigns the LEUs to the corresponding expert sub-models based on the base affinity and affinity adjustment parameters. Finally, server 105 trains the expert sub-models using the LEUs assigned to them, obtaining a trained hybrid expert model for processing target scene data.
[0024] It should be noted that, in addition to being obtained from terminal devices 101, 102, and 103 via network 104, the terms to be assigned can also be pre-stored locally on server 105 through various means. Therefore, when server 105 detects that this data is already stored locally (for example, when starting to process previously retained training tasks for MOE), it can choose to directly obtain this data from locally. In this case, the exemplary system architecture 100 may also exclude terminal devices 101, 102, and 103 and network 104.
[0025] Since determining the basic affinity, deploying, and training MOEs often require significant computing resources and capabilities, the methods for training hybrid expert models provided in subsequent embodiments of this disclosure are generally executed by a server 105 with strong computing power and abundant resources. Correspondingly, the apparatus for training hybrid expert models is also generally located within server 105. However, it should also be noted that when terminal devices 101, 102, and 103 also possess sufficient computing power and resources, they can also perform the aforementioned calculations performed by server 105 through their installed MOE training applications, thus outputting the same results as server 105. Especially when multiple terminal devices with different computing capabilities exist simultaneously, but the MOE training application determines that its terminal device has strong computing power and abundant remaining computing resources, it can allow the terminal device to perform the aforementioned calculations, thereby appropriately reducing the computing pressure on server 105. Accordingly, the apparatus for training hybrid expert models can also be located within terminal devices 101, 102, and 103. In this case, the exemplary system architecture 100 may also exclude the server 105 and the network 104.
[0026] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0027] Please refer to Figure 2 , Figure 2 A flowchart of a process for training a hybrid expert model provided for embodiments of this disclosure, including process 200.
[0028] Process 200 specifically includes the following steps: Step 201: Determine the basic affinity of each expert sub-model in the hybrid expert model for the lexical unit to be assigned; In embodiments of this disclosure, this step is intended to be performed by the execution entity of the method for training the hybrid expert model (e.g., Figure 1 After obtaining the term to be assigned (or token to be assigned), the server 105 shown determines the basic affinity of each expert sub-model in the MOE for the term to be assigned.
[0029] Affinity refers to the degree of affinity, closeness, and relevance of the expert sub-model to the word to be assigned. Typically, it can be based on the similarity between the domain / region involved in and corresponding to the expert sub-model and the domain / region where the word to be assigned is located. For example, for a word to be assigned, if expert sub-model 1 focuses on processing nouns, especially nouns of objects, places, and people, while expert sub-model 2 focuses on processing verbs, especially verbs describing actions or states, then for word to be assigned that is, for example, a verb, expert sub-model 2 may have a higher affinity.
[0030] For example, for a specific token A to be assigned, after obtaining the token A, the executing entity can determine the basic affinity of each of the expert sub-models 1, 2, ..., N (where N is a positive integer) used to form the MOE with respect to the token A.
[0031] Typically, tokens to be assigned can take different forms depending on the training objective and the specific MOE (Machine Learning Environment). For example, in an MOE for natural language processing, a token can be a word, subword, or character that can be used as the smallest processing unit by the expert sub-models within the MOE. In an MOE for computer vision tasks, a token can be the most basic image unit, such as a patch. In an MOE for speech recognition and processing, a token can be an audio frame, and so on.
[0032] Accordingly, the token to be assigned can be a sample token used to train MOE in these scenarios, such as words, characters, etc., used as training samples for the model.
[0033] After obtaining the token to be assigned, the executing entity can determine the basic affinity of each expert sub-model for that token based on a capability matrix. For example, the executing entity can first extract features of the token to be assigned using a convolutional neural network, for example. Then, the executing entity can determine the basic affinity of the corresponding expert sub-model for that token by performing an inner product operation between the features and the capability matrix of the expert sub-model.
[0034] It should be understood that if the executing entity uses multiple tokens to be assigned, the executing entity can similarly determine the basic affinity of the expert sub-model for each token to be assigned in this way, so as to determine which specific expert sub-model to assign the token to for use and training based on the basic affinity.
[0035] It should be noted that, as discussed above, the token to be allocated can be obtained directly from the local storage device by the aforementioned executing entity, or it can be obtained from a non-local storage device (e.g., Figure 1 The token to be allocated can be obtained from the terminal devices 101, 102, and 103 shown. The local storage device can be a data storage module set within the aforementioned execution entity, such as a server hard drive. In this case, the token to be allocated can be quickly read locally. The non-local storage device can also be any other electronic device set up to store data, such as some user terminals. In this case, the aforementioned execution entity can obtain the required token to be allocated by sending an acquisition command to the electronic device.
[0036] Step 202: Based on the current model capability value of the expert sub-model, determine the affinity adjustment parameters corresponding to each expert sub-model; In the embodiments of this disclosure, since the MOE is a whole composed of multiple expert sub-models, it is often desirable that the various expert sub-models be trained more evenly during the training process of the MOE so that the MOE has better overall capabilities.
[0037] In this context, the executing entity can determine the corresponding affinity tuning parameters based on the current model capabilities of the expert sub-model (for ease of description, it is described as "current model capability value"). This allows the executing entity to be more inclined to allocate tokens to expert sub-models with weaker current model capabilities during the process of determining, allocating, or routing tokens to be allocated, so as to train them.
[0038] That is, after determining the basic affinity of each expert sub-model to the token to be assigned based on the above steps, in this step, the executing entity can determine the affinity adjustment parameter corresponding to each expert sub-model based on the current model capability value of the expert sub-model. The basic affinity of the expert sub-model to the token to be assigned determined in step 201 can be adjusted using the affinity adjustment parameter, so that the executing entity can allocate the token to be assigned more reasonably.
[0039] To facilitate understanding, we can start by discussing the process of allocating a single token. Correspondingly, in scenarios where there are at least two tokens to be allocated, this process can be reused to complete the allocation of each token, thereby achieving the goal of allocating multiple tokens.
[0040] Typically, the implementing entity can determine the current model capability of each expert sub-model based on indicators such as the size and completeness of its parameters, and the degree of matching between the model parameters and the expert sub-model. For example, a larger parameter size in an expert sub-model can be understood as indicating stronger model capability. Similarly, for a given word segment, the closer the processed result is to the target, the stronger the model's capability. Correspondingly, the model's capability can be quantified and determined by the similarity between the processing result and the target.
[0041] In practice, for example, expert sub-models whose processing results for the same (to be processed) word element E are far from the target (e.g., similarity less than or equal to a predetermined similarity threshold) can be considered "weak in ability." Correspondingly, as the similarity decreases, the "model ability" of the expert sub-model can be considered even weaker. For instance, for expert sub-models A and B, if for the same (to be processed) word element E, the similarity between the processing results of both is lower than the aforementioned similarity threshold, then both expert sub-models A and B can be considered "weak in ability."
[0042] Similarly, for example, if the similarity of expert sub-model A to word E is lower than that of expert sub-model B, then expert sub-model A can be considered to have weaker model capability than B. Accordingly, the quantized model capability value corresponding to expert sub-model A will be numerically lower than the quantized model capability value corresponding to expert sub-model B.
[0043] Accordingly, the executing entity can determine the corresponding affinity adjustment parameters based on the quantification results of the current model capability value, so as to allocate tokens to expert sub-models with weaker model capabilities, thereby increasing their likelihood of being allocated tokens.
[0044] In some embodiments, the executing entity may also directly choose to characterize and reflect the model capability value based on the basic affinity of the expert sub-model to the token to be assigned. For example, for a token to be assigned, as the basic affinity of the expert sub-model to that token increases, it can be characterized that the expert sub-model may currently have better and higher model capability.
[0045] Accordingly, for a specific token to be allocated, the executing entity can determine whether to favor or bias the expert sub-model in the process of allocating the token based on the comparison between the expert sub-model's current model capability value and the overall model capability value.
[0046] For example, given a token to be assigned, the executing agent can sum the base affinity of each expert sub-model to obtain the total base affinity. Then, based on the ratio of this total base affinity to the number of expert sub-models, the executing agent calculates the average model capability value.
[0047] Then, for each expert sub-model, the executing entity can determine the basic affinity of the unassigned lexical unit of that expert sub-model as the current model capability value of the expert sub-model, and compare it with the average model capability value.
[0048] If the current model capability value of an expert sub-model is greater than the average model capability value, it indicates that the expert sub-model is currently relatively excellent. Therefore, the executing entity can determine an affinity adjustment parameter to reduce or lower the base affinity, so that the token to be assigned is more likely to be assigned to other expert sub-models with weaker current model capabilities (e.g., expert sub-models with low base affinity due to insufficient model capability, less training, etc.).
[0049] It should be understood that if there are multiple tokens to be assigned, the executing agent can sum up all the base affinities of all the tokens to be assigned and use the sum to determine the average model capability value. Then, the executing agent can determine the affinity adjustment parameter by comparing the sum of the base affinities of all the tokens to be assigned by an expert sub-model with the average model capability value.
[0050] In some embodiments, the executing entity may also choose to directly use the capability difference between the average model capability value and the current model capability value to determine the affinity adjustment parameter corresponding to the expert submodel. For example, the executing entity may directly use the capability difference obtained by subtracting the current capability value of the expert submodel from the average model capability value as the affinity adjustment parameter corresponding to the expert submodel.
[0051] This allows the affinity adjustment parameter to dynamically compensate the expert sub-model based on the difference between its model capability and the average, even when the model capability of the expert sub-model is lower than the overall average. This makes the expert sub-model more likely to be assigned tokens for training.
[0052] In the embodiments of this disclosure, in hybrid expert models such as the MOE model, the expert sub-networks and expert sub-models included in the model are all applicable to the method of training hybrid expert models in this disclosure. For ease of understanding, they are all referred to as expert sub-models in this disclosure.
[0053] When adjusting the model architecture and training the MOE model, especially when allocating tokens at each layer and step, the interaction between the current capabilities of the "expert sub-model" (or, it can also be simply referred to as "expert") and the token size is used to make the decision-making allocation.
[0054] As described in the embodiments of this disclosure, the expert sub-model may include or be any one or more layers of the MOE model, where any one or more layers are the smallest independent structures that need to be assigned tokens according to scenario requirements. For example, in some MOE models, the expert sub-model may be the part of the MOE model that acts as an "expert," which can be understood as the smallest independent part or structure of an independent "expert." Accordingly, in such a scenario, if a model layer (hereinafter referred to as a "layer") of the MOE includes one or more "experts," then that layer of the MOE can be understood as including multiple expert sub-models.
[0055] In some embodiments, a layer of the MOE can also be used entirely to configure and deploy a minimal, independent structure of "experts." That is, in some scenarios, the MOE may include an independent MOE expert decision-making layer, rather than simply using "experts" as part of a layer. In such cases, the expert sub-model can refer to such a layer, or be implemented by such a layer.
[0056] In some MOE models, multiple layers can be combined to deploy and provide the "expert" and "expert sub-model". In such scenarios, the "expert" and "expert sub-model" can also be considered as multiple layers.
[0057] It should be understood that in different MOEs, the above deployment modes may be used individually or in combination to configure experts in the MOE. In such cases, the part of the MOE that is considered an "expert" or "expert sub-model" (e.g., a part of a layer, a complete layer, or multiple layers) can be adaptively determined by referring to the minimum independent structure that needs to be assigned a token.
[0058] Accordingly, under different scenarios and training requirements, expert sub-models that can be assigned the above-mentioned unassigned lexical units can be determined in advance based on the scope (e.g., global or local) of the MOE to be trained and adjusted, and the unassigned lexical units can be assigned in the manner discussed in this disclosure, and the unassigned lexical units can be used to train accordingly to achieve the training objective.
[0059] In some embodiments, when compensation is provided based on "capability difference," the implementing entity may also employ different compensation strategies depending on the specific capability difference. For ease of understanding, this can also be referenced simultaneously. Figure 3 . Figure 3 A flowchart of a process for determining an affinity adjustment parameter provided for an embodiment of this disclosure includes process 300. For example, process 300 may be implemented as an alternative to or alternative to step 202.
[0060] Process 300 includes the following steps: Step 301: Sum the individual basic affinities to obtain the total basic affinity; Step 302: Calculate the average model capability value based on the total basic affinity and the number of expert sub-models; Step 303: For each expert sub-model, determine the basic affinity of the unassigned lexical unit in the expert sub-model as the current model capability value of the expert sub-model; Step 304: For each expert sub-model, calculate the difference between the average model capability value and the current model capability value to obtain the capability difference value; The implementation process of steps 301-304 above is similar to the implementation method discussed above. For relevant content, please refer to the content discussed above. It will not be repeated here.
[0061] Next, for each expert sub-model, if its corresponding capability difference is greater than or equal to 0, the executing entity can respond to this and further select to execute the next step 305 to determine the affinity adjustment parameter corresponding to the expert sub-model.
[0062] Step 305: Determine the affinity adjustment parameter corresponding to the expert sub-model based on the product of the capability difference and the preset first coefficient.
[0063] Specifically, as discussed above, if the capability difference obtained by subtracting the current model capability value from the average model capability value is greater than or equal to 0, the executing entity can determine the affinity adjustment parameter based on this capability difference. In this implementation, the executing entity can further use the product of the capability difference and a (preset) first coefficient as the affinity adjustment parameter, instead of directly using the capability difference itself as the affinity adjustment parameter.
[0064] The first coefficient can be a non-zero number preset by combining the reference metric and the expected reference range. For example, if it is desired that the affinity adjustment parameter can have a greater impact on the base affinity, the first coefficient can be increased accordingly, for example, it can be a number greater than 1, so that the adjustment effect of the affinity adjustment parameter is significantly enhanced.
[0065] For example, if you want to focus primarily on the basic affinity, you can choose a smaller number, such as less than 1, as the first coefficient to reduce the adjustment strength of the affinity adjustment parameter.
[0066] Therefore, through this first coefficient, the affinity adjustment parameter can be dynamically adjusted with adaptive reference weights and "steps" in combination with different needs, so as to make the allocation strategy of the tokens to be allocated more rich and diverse.
[0067] In some embodiments, if the capability difference corresponding to the expert sub-model is less than 0, the executing entity can also choose to directly use it as the affinity adjustment parameter, so that the executing entity can subsequently "lower" the base affinity by using such a negative affinity adjustment parameter.
[0068] In some embodiments, when the corresponding capability difference is less than 0, the executing entity may also choose to set the affinity adjustment parameter corresponding to the expert sub-model to zero to avoid expert sub-models with excellent current model capabilities and excessively large differences in capability value compared to the average model being unable to be assigned tokens for a long time. For example, in the case of multiple tokens to be assigned, some expert sub-models may have excessively large capability differences due to their strong processing capability and affinity for tokens in certain domains. In such cases, if the "capability difference" is continuously reduced by the base affinity, it may cause such expert sub-models to be unable to be assigned tokens for a long time, resulting in the inability of such expert sub-models to be trained in other potentially related domains.
[0069] Accordingly, the above process 300 may also include process step 306, which may be selected by the executing entity to be executed after the above step 304, provided that the capability difference is less than 0.
[0070] Step 306: Determine that the affinity adjustment parameter corresponding to the expert sub-model is 0.
[0071] Next, let's return to process 200 and continue the discussion.
[0072] Step 203: Based on the basic affinity and affinity adjustment parameters, assign the lexical units to be assigned to the corresponding expert sub-models; In the embodiments of this disclosure, based on step 202 above, the executing entity can simultaneously refer to the basic affinity determined in step 201 and the affinity adjustment parameter determined in step 202 to determine which specific expert sub-model the token to be assigned to.
[0073] For example, the executing entity can directly add the base affinity and the affinity adjustment parameter corresponding to the expert sub-model to obtain the "combined result". Then, the executing entity can sort each expert sub-model according to the numerical value, and select the combined result with the highest value as the expert sub-model to be assigned and can use the token to be assigned.
[0074] Similarly, in the case of multiple tokens to be assigned, the executing entity can similarly determine the expert sub-model corresponding to each token to be assigned, which will not be repeated here.
[0075] Step 204: Train the expert sub-models using the corresponding lexical units assigned to them to obtain the trained hybrid expert model.
[0076] In the embodiments of this disclosure, after the matching and correspondence between the token to be allocated and the expert sub-model is completed based on the above step 203, the execution entity can use the allocated token to train the expert sub-model accordingly based on such matching and correspondence relationship, so as to complete the training of MOE and obtain the trained MOE.
[0077] The trained MOE can be used to process target scene data. The target scene data can correspond to scenarios such as medical settings, object recommendation, and online question answering. Accordingly, this target scene data can be combined with different scenario requirements, and can be text data, image data, audio data, etc., specific to the corresponding scenario.
[0078] For example, in scenarios where the goal is to search for relevant answers based on data provided by the user (i.e., the online question-and-answer scenario mentioned above), the user can provide question information in voice or text form as the aforementioned "target scenario data" to be processed by the trained MOE to provide corresponding answers.
[0079] For example, in a more specific online question-and-answer scenario targeting the need for medical knowledge, the question could be about a particular disease. Accordingly, upon receiving the question, the executing entity can invoke the trained MOE to process the question and obtain answer information such as detailed information about the disease.
[0080] For example, in a recommendation scenario, the corresponding target scenario data could be the user's preference information. Then, the executing entity can process this preference information by calling the trained MOE to determine the recommended objects that the user might like from the candidate recommended objects, and complete the corresponding recommendation (that is, the recommended object can be provided to the user as recommendation information to complete the "recommendation").
[0081] The method for training a hybrid expert model provided in this disclosure involves: determining the basic affinity of each expert sub-model in the hybrid expert model for the lexical units to be assigned; determining affinity adjustment parameters corresponding to each expert sub-model based on its current model capability value; assigning the lexical units to be assigned to the corresponding expert sub-models based on the basic affinity and affinity adjustment parameters; and training the expert sub-models using the lexical units assigned to them to obtain a trained hybrid expert model, which is then used to process target scene data. This method enables more efficient and reasonable allocation of lexical units for training to the expert sub-models in the hybrid expert model, resulting in more efficient and high-quality training of the overall hybrid expert model.
[0082] That is, in the method for training a hybrid expert model provided in this embodiment, the basic affinity of the expert sub-model for the word to be assigned is no longer simply referenced. Instead, based on the basic affinity, the current capability value of the expert sub-model is further referenced to determine the affinity adjustment parameter. In this approach, the word to be assigned is assigned to the expert sub-model by simultaneously referencing both the basic affinity of the expert sub-model for the word to be assigned and the "whole" of the affinity adjustment parameter.
[0083] By using this "whole" allocation method, expert sub-models that may be weak or have insufficient model capabilities can be more easily assigned to unassigned lexical units.
[0084] For example, for expert sub-models with low base affinity, affinity adjustment parameters can be used to "supplement" them, so that they are given more "attention" and "care" during the assignment of lexical units. This allows them to outperform expert sub-models with high base affinity, which may be due to their strong current model capabilities, when referenced to the "whole" (i.e., the "whole" of base affinity and affinity adjustment parameters). This makes it more likely that these weaker expert sub-models will be assigned the lexical unit for training.
[0085] In some embodiments, training of the MOE can be completed in multiple training rounds. Accordingly, in each training round, the executing agent can obtain a set of tokens to be assigned for completing that training round, and assign the tokens to the corresponding expert sub-models in the manner discussed above, thereby completing the training of the MOE for that round.
[0086] In this scenario, for each training round, the executing entity can select the corresponding round affinity adjustment parameter and combine it with the base affinity to allocate and determine the distribution of tokens within that training round. Thus, by adjusting the round affinity parameter, the "preference" can be dynamically and in real-time adjusted for each training round, ensuring that tokens are allocated better and more rationally in each training round, as provided in this embodiment. This "allocation optimization" in each training round improves the overall allocation and training quality of each training round.
[0087] In some embodiments, if the training of the hybrid expert model includes at least two training rounds, and the current training round is not the first training round, i.e., there is at least one previous training round before the current training round, then the executing agent may also refer to the lexical load value of the expert sub-model in the previous training round when determining the affinity adjustment parameters corresponding to each expert sub-model.
[0088] Specifically, in the case of at least two or more training rounds, if the current training round is not the first training round, then in the current training round, the executing agent, in the process of determining the affinity adjustment parameters corresponding to each expert sub-model based on the capability difference, may, alternatively or as a substitute, determine the round affinity adjustment parameters corresponding to the expert sub-model in the current training round based on the capability difference of the expert sub-model in the current training round (e.g., the capability difference determined based on the basic affinity and average model capability value for the current training round) and the historical lexical load value in the previous training round.
[0089] The historical lexical load value of the expert sub-model in the previous training round can be determined based on the load of each token actually assigned to it in the previous training round. For example, the historical lexical load value of the expert sub-model in the previous training round can be obtained by summing the load values of each actual token assigned to the expert sub-model in the previous training round (i.e., the historical lexical load value can be the sum of the loads corresponding to each token).
[0090] Then, the executing agent can, while determining the epoch affinity adjustment parameters to use in the current training epoch, simultaneously consider information from the historical token load of the expert sub-models to more intelligently and effectively allocate the tokens to be assigned in the current training epoch. For example, for expert sub-models that may have a lower overall and historical cumulative load during training due to their stronger model capabilities, the executing agent can determine smaller affinity adjustment parameters for them, or parameters used to reduce the base affinity, to reduce the likelihood of them being assigned tokens. This would allow these tokens to be more likely to be allocated to and flow to weaker expert sub-models, as discussed above.
[0091] In some embodiments, the adjustment direction can also be determined based on the relationship between the historical lexical load value corresponding to the expert sub-model and the overall average. For example, if the historical lexical load value corresponding to the expert sub-model is greater than the average, the adjustment can be made by reducing the likelihood of allocating tokens to that expert sub-model.
[0092] For easier understanding, you can also refer to... Figure 4 . Figure 4 A flowchart of another process for determining affinity adjustment parameters provided in an embodiment of this disclosure, including process 400.
[0093] Process 400 includes the following steps: Step 401: Sum the historical lexical load values of each expert sub-model in the previous training round to obtain the total historical lexical load value; Specifically, as discussed above, the implementing entity can sum the historical lexical load values of each expert sub-model in the previous training round to obtain the total historical lexical load value used to determine the average value.
[0094] Step 402: Calculate the average historical lexical load value based on the total historical lexical load value and the number of expert sub-models; Specifically, based on step 401 above, the executing entity can divide the number of expert sub-models by the total historical lexical load value determined in step 401 to calculate the average historical lexical load value.
[0095] Next, if the expert sub-model has a historical lexical load value greater than the average historical lexical load value in the previous training round, the execution entity can respond by selecting to execute step 403.
[0096] Step 403: Based on the product of the ability difference of the expert sub-model in the current training round and the preset second coefficient, determine the round affinity adjustment parameter corresponding to the expert sub-model in the current training round.
[0097] Specifically, as discussed above, the implementing entity can use a coefficient related to historical lexical load values, or more specifically, to a comparison between historical lexical load values and average historical lexical load values, to determine the adjustment direction, enabling the use, introduction, and referencing of historical lexical loads through "adjustment direction." For example, in this step, the implementing entity can provide the adjustment direction using a second coefficient less than 0.
[0098] Therefore, by using the second coefficient which is less than 0, the affinity adjustment parameter can be adjusted in the direction of reducing the base affinity, making the "whole" composed of the affinity adjustment parameter and the base affinity smaller. This allows expert sub-models that had high or excessive loads in the previous round to be adjusted in the direction of reducing their probability of being assigned tokens, thereby increasing the token's value.
[0099] Correspondingly, this also allows expert sub-models to be adjusted in a way that increases the likelihood of being assigned when the historical lexical load and model capability are low in the previous training round.
[0100] Then, in this step, the executing entity can determine the product of the capability difference of the current training round and the preset second coefficient as the round affinity adjustment parameter of the expert sub-model in the current training round.
[0101] Therefore, while balancing the overall load, it also allows for adjustments to the token allocation strategy in this training round based on historical load data, thereby improving the quality of token allocation.
[0102] In some optional implementations of this embodiment, as discussed above, process 400 may also include step 404.
[0103] If the historical lexical load value of the expert sub-model in the previous training round is less than or equal to the average historical lexical load value, the execution subject can choose to execute step 404 instead of step 403.
[0104] Step 404: Based on the product of the ability difference of the expert sub-model in the current training round and the preset third coefficient, determine the round affinity adjustment parameter of the expert sub-model in the current training round.
[0105] Specifically, as discussed above, based on the same approach, if the historical lexical load value is less than or equal to the average historical lexical load value, the executing entity can choose to multiply a third coefficient (the opposite of the second coefficient) with the capability difference of the current training epoch to determine the affinity adjustment parameter for the expert sub-model in the current training epoch. Thus, by using a third coefficient (the opposite of the second coefficient), when adjusting expert sub-models with low loads and insufficient capabilities (potentially undertrained), the adjustment direction is towards increasing the "whole" of the affinity adjustment parameter and the base affinity. This makes it more likely that expert sub-models with low loads and insufficient capabilities (potentially undertrained) will be assigned tokens for training, increasing the token's value. Similarly, the specific value of the third coefficient can be chosen to be greater than or less than 1 based on different scenario requirements of "amplification" or "reduction," and determined based on its importance during reference.
[0106] Typically, the absolute values of the second and third coefficients are equivalent, so that they share the same reference standard.
[0107] In some embodiments, if the training of the MOE includes at least two training epochs, during the process of determining the affinity adjustment parameters corresponding to each expert sub-model based on the current model capability value, or more specifically, during the process of determining the affinity adjustment parameters corresponding to the expert sub-model based on the capability difference, the executing entity may also choose to simultaneously refer to the historical affinity adjustment parameters used in the previous training epoch to determine the epoch affinity adjustment parameters corresponding to the expert sub-model in the current training epoch. Thus, based on the current model capability value, it further simultaneously refers to the historical affinity adjustment parameters used in previous training epochs, so that while utilizing and determining the affinity adjustment parameters based on the current model capability value, it can also simultaneously refer to the global situation of the (historical) affinity adjustment parameters used in previous training epochs, thereby more reasonably and accurately determining the epoch affinity adjustment parameters for the current training epoch.
[0108] For ease of understanding, in the embodiment that uses "ability difference" to determine affinity adjustment parameters, for the current training round i The "affinity adjustment parameter" can be expressed as: .
[0109] Accordingly, in this situation, for the current training round Then it can be expressed as the following formula (1): = (1) in, For the expert sub-model in the current training round i The current model capabilities it possesses For the expert sub-model in the current training round i The difference in ability.
[0110] This allows the implementing entity to accumulate affinity adjustment parameters and pass them on to subsequent training rounds by referring to the historical affinity adjustment parameters from the previous training round. In each round, the implementing entity can refer to the global situation of the (historical) affinity adjustment parameters used in previous training rounds when determining affinity adjustment parameters, so as to more reasonably determine whether it is necessary to allocate tokens to the expert sub-model to a greater extent.
[0111] In some embodiments, the reference weights and reference step sizes can be adjusted by configuring corresponding coefficients for the historical affinity adjustment parameters to adapt to different scenario requirements. That is, when using the historical affinity adjustment parameters from the previous training round, the executing entity can also choose to first calculate the product of the historical affinity adjustment parameters of the expert sub-model from the previous training round and a preset fourth coefficient to obtain the product result. Similarly, this fourth coefficient is not zero.
[0112] In some embodiments, the fourth coefficient can have different values based on different scenario strategies. For example, when the influence of historical rounds is expected to gradually decrease, the value of the fourth coefficient can be less than 1 and greater than 0. Conversely, when the influence of historical rounds is expected to gradually increase, the value of the fourth coefficient can be greater than 1.
[0113] Then, based on the current model capability value of the expert sub-model in the current training round and the product result, the round affinity adjustment parameter of the expert sub-model in the current training round is determined.
[0114] In this situation, for the current training round It can be further expressed as the following formula (2): = (2) in, This is the result of the product operation of the historical affinity adjustment parameter corresponding to the expert sub-model in the previous training round and the preset fourth coefficient.
[0115] In some embodiments, if the training of the MOE includes at least two training epochs and simultaneously utilizes And the first coefficient mentioned above, in this case, the first coefficient can be based on the ability difference. Adjustment parameters based on historical affinity The dimensional differences were determined. Therefore, using this first coefficient, not only can the reference level for affinity adjustment parameters be dynamically adjusted, but the normalization between the capability difference and historical affinity adjustment parameters can also be achieved.
[0116] Accordingly, It can be further expressed as the following formula (3): = (3) in, It can be the first coefficient mentioned above.
[0117] In some embodiments, in the case of multiple training rounds, for the current training round which is not the first training round, the executing entity may also simultaneously select to use the current model capability value, the historical affinity adjustment parameter corresponding to the previous training round, and the historical lexical load value of the previous training round to determine the round affinity adjustment parameter of the expert sub-model corresponding to the current training round.
[0118] For example, the executing entity can first determine the corresponding capability difference based on the current model capability value, and then multiply the capability difference by the first coefficient, and one of the second and third coefficients. or Combine them to obtain the current training round. i Round affinity adjustment parameters .
[0119] For example, it can be further expressed as the following formula (4): = (4) in, The second or third coefficient is selected based on a comparison between the historical lexical load value of the expert sub-model in the previous training epoch and the average historical lexical load value. For example, if the comparison result shows that the historical lexical load value in the previous training epoch is greater than the average historical lexical load value, then... It can be a preset second coefficient.
[0120] Therefore, the executing entity can combine the above three dimensions, taking into account the advantages of each dimension (for example, it can refer to the affinity adjustment parameters used in historical training rounds and the historical lexical load, in addition to the current capabilities of the reference model), to allocate tokens to be allocated more comprehensively, efficiently and reasonably.
[0121] In embodiments of this disclosure, a hybrid expert model, or MOE, is also provided. The MOE may include multiple expert sub-models. These expert sub-models can be trained based on the process discussed above, provided by this disclosure, for training hybrid expert models.
[0122] In embodiments of this disclosure, a data processing method is also provided. In this method, the executing entity first obtains the data to be processed by the desired Object of Experience (MOE). The MOE can be trained based on the process provided in this disclosure for training a hybrid expert model. Then, the executing entity processes the data to be processed by invoking the MOE to obtain the corresponding processing result.
[0123] The data to be processed can be, for example, text data, image data, audio data, etc. For instance, in a scenario where the goal is to search for relevant answers based on the data to be processed, the user can provide questions in voice or text format, which can then be processed by the MOE to provide corresponding answers. For example, in a medical scenario, the questions could be inquiries about specific diseases. Accordingly, after receiving the questions, the executing entity can invoke the MOE to process them and obtain answers such as detailed information about the disease.
[0124] For example, in a recommendation scenario, the data to be processed could be the user's preference information. Then, the executing entity can process this preference information by calling MOE to determine the recommended objects that the user might like from the candidate recommended objects, and complete the corresponding recommendation (that is, the recommended object can be provided to the user as recommendation information to complete the "recommendation").
[0125] To enhance understanding, this disclosure also provides an implementation scheme for training a hybrid expert model in a specific application scenario. For further details, please refer to... Figure 5 The process shown is 500.
[0126] In process 500, for a specific token 510, the executing entity (e.g., server 105 mentioned above)... Figure 5 (Not shown in detail here) can be assigned to one of the expert sub-models 521, 522, and 523 used to compose the MOE (not shown in the figure) (it should be understood that the number of examples here is only for illustrative purposes and is not intended to limit the number of expert sub-models included in the MOE) to train the corresponding expert sub-model for the purpose of training the MOE.
[0127] In process 500, after obtaining token 510, the executing entity can first execute S501 to determine the basic affinity of each expert sub-model to token 510. For example, expert sub-model 521 has a basic affinity 531 to token 510, expert sub-model 522 has a basic affinity 532 to token 510, and expert sub-model 523 has a basic affinity 533 to token 510.
[0128] After obtaining the basic affinities, the executing entity can further execute S502 to calculate the average basic affinity. For example, the executing entity can obtain the average basic affinity 540 by summing the basic affinities 531, 532, and 533 and then dividing by "3".
[0129] Next, the implementing entity can determine the capability difference between the average basic affinity 540 and the basic affinity 531, 532, and 533 based on S504. For example, the average basic affinity 540 has a capability difference of 551 compared to the basic affinity 531, the average basic affinity 540 has a capability difference of 552 compared to the basic affinity 532, and the average basic affinity 540 has a capability difference of 553 compared to the basic affinity 533.
[0130] After obtaining the capability difference, the executing entity can determine the "combined result" corresponding to each expert sub-model by executing S501. For example, if the capability difference is greater than or equal to 0, the executing entity can choose to directly refer to the base affinity and the capability difference, or use the product of the capability difference and the first coefficient and the base affinity together as a reference to determine which expert sub-model to assign token 510.
[0131] For ease of understanding, the "whole" referenced when referencing both can be described as the combined result. For example, for expert sub-model 521, the "whole" used to determine whether to allocate token 510, i.e., the "combined result" described in the example, can be called combined result 571. Similarly, for expert sub-model 522, it corresponds to combined result 572; and for expert sub-model 523, it corresponds to combined result 573.
[0132] Then, if, for example, the combination result is determined and presented in numerical form, the executing entity can select the combination result with the largest value among the combination results 571, 572 and 573, and assign token 510 to the expert sub-model corresponding to the combination result with the largest value for training.
[0133] Further reference Figure 6 As an implementation of the methods shown in the above figures, this disclosure provides an embodiment of an apparatus for training a hybrid expert model, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0134] like Figure 6As shown, the apparatus 600 for training a hybrid expert model in this embodiment may include: a basic affinity determination unit 601, an adjustment parameter determination unit 602, a word assignment unit 603, and a model training unit 604. The basic affinity determination unit 601 is configured to determine the basic affinity of each expert sub-model in the hybrid expert model for the word to be assigned; the adjustment parameter determination unit 602 is configured to determine the affinity adjustment parameters corresponding to each expert sub-model based on the current model capability value of the expert sub-model; the word assignment unit 603 is configured to assign the word to be assigned to the corresponding expert sub-model based on the basic affinity and the affinity adjustment parameters; and the model training unit 604 is configured to train the expert sub-models using the words assigned to them, thereby obtaining a trained hybrid expert model for processing target scene data.
[0135] In this embodiment, the specific processing of the basic affinity determination unit 601, the adjustment parameter determination unit 602, the lexical allocation unit 603, and the model training unit 604 in the apparatus 600 for training a hybrid expert model, and the resulting technical effects, can be found in reference to [reference needed]. Figure 2 The relevant descriptions of steps 201-204 in the corresponding embodiments will not be repeated here.
[0136] In some optional implementations of this embodiment, the adjustment parameter determination unit 602 includes: an affinity summing subunit, configured to sum each basic affinity to obtain a total basic affinity; an average capability value calculation subunit, configured to calculate an average model capability value based on the total basic affinity and the number of expert sub-models; a current capability value determination subunit, configured to determine the basic affinity of the unassigned lexical unit of each expert sub-model as the current model capability value of the expert sub-model; a capability difference calculation unit, configured to calculate the difference between the average model capability value and the current model capability value for each expert sub-model to obtain a capability difference value; and an adjustment parameter determination subunit, configured to determine the affinity adjustment parameter corresponding to each expert sub-model based on the capability difference value.
[0137] In some optional implementations of this embodiment, the adjustment parameter determination subunit is further configured to determine the affinity adjustment parameter corresponding to the expert submodel based on the product of the capability difference and a preset first coefficient in response to a capability difference greater than or equal to 0; wherein the first coefficient is not 0.
[0138] In some optional implementations of this embodiment, the adjustment parameter determination subunit is further configured to determine that, in response to a capability difference of less than 0, the value of the affinity adjustment parameter corresponding to the expert submodel is 0.
[0139] In some optional implementations of this embodiment, the adjustment parameter determination subunit is further configured to, in response to a capability difference greater than or equal to 0 and the training of the hybrid expert model including at least two training rounds, determine the round affinity adjustment parameter of the expert submodel in the current training round based on the product of the capability difference and a preset first coefficient, and the historical affinity adjustment parameter of the expert submodel in the previous training round; wherein the first coefficient is determined based on the dimensional difference between the capability difference and the historical affinity adjustment parameter, and there is at least one historical training round before the current training round.
[0140] In some optional implementations of this embodiment, the adjustment parameter determination subunit is further configured to determine the round affinity adjustment parameter of the expert submodel in the current training round based on the capability difference of the expert submodel in the current training round and the historical lexical load value in the previous training round, in response to the training of the hybrid expert model including at least two training rounds; wherein there is at least one historical training round before the current training round.
[0141] In some optional implementations of this embodiment, the device 600 further includes: a historical lexical load summing unit, configured to sum the historical lexical load values of each expert sub-model in the previous training round to obtain a total historical lexical load value; an average historical lexical load calculation unit, configured to calculate an average historical lexical load value based on the total historical lexical load value and the number of expert sub-models; correspondingly, the adjustment parameter determination unit 602 is further configured to, if the training of the hybrid expert model includes at least two training rounds, for each expert sub-model, in response to the historical lexical load value of the expert sub-model in the previous training round being greater than the average historical lexical load value, determine the round affinity adjustment parameter of the expert sub-model in the current training round based on the product of the capability difference of the current training round and a preset second coefficient; wherein, the second coefficient is not 0.
[0142] In some optional implementations of this embodiment, the adjustment parameter determination unit 602 may be further configured to, in response to the fact that the historical word load value of the expert sub-model in the previous training round is less than or equal to the average historical word load value, determine the round affinity adjustment parameter of the expert sub-model in the current training round based on the product of the capability difference of the current training round and the preset third coefficient; wherein, the third coefficient is the opposite of the second coefficient.
[0143] In some optional implementations of this embodiment, the adjustment parameter determination subunit is further configured to determine the epoch affinity adjustment parameter of the expert submodel in the current training epoch based on the capability difference of the expert submodel in the current training epoch and the historical affinity adjustment parameter corresponding to the previous training epoch, in response to the training of the hybrid expert model including at least two training epochs; wherein there is at least one historical training epoch before the current training epoch.
[0144] In some optional implementations of this embodiment, the adjustment parameter determination subunit includes: a historical adjustment parameter product calculation module, configured to calculate the product of the historical affinity adjustment parameter of the expert submodel in the previous training round and a preset fourth coefficient to obtain the product result; wherein the fourth coefficient is not 0; and an adjustment parameter determination module, configured to determine the round affinity adjustment parameter of the expert submodel in the current training round based on the capability difference of the expert submodel in the current training round and the product result.
[0145] In some optional implementations of this embodiment, the adjustment parameter determination subunit is further configured to determine the round affinity adjustment parameter of the expert submodel in the current training round based on the capability difference of the expert submodel in the current training round, the historical affinity adjustment parameter corresponding to the previous training round, and the historical lexical load value of the previous training round, in response to the training of the hybrid expert model including at least two training rounds; wherein there is at least one historical training round before the current training round.
[0146] In some optional implementations of this embodiment, the lexical allocation unit 603 is further configured to allocate the lexical to be allocated to the corresponding expert sub-model based on the base affinity and round affinity adjustment parameters.
[0147] This embodiment is a device embodiment corresponding to the method embodiment described above. The device provided in this embodiment for training a hybrid expert model determines the basic affinity of each expert sub-model in the hybrid expert model for the lexical units to be assigned; based on the current model capability value of the expert sub-model, it determines the affinity adjustment parameters corresponding to each expert sub-model; based on the basic affinity and the affinity adjustment parameters, it assigns the lexical units to be assigned to the corresponding expert sub-models; and it trains the expert sub-models accordingly using the lexical units assigned to them, obtaining a trained hybrid expert model, which is then used to process target scene data. Therefore, it is possible to allocate lexical units for training to the expert sub-models in the hybrid expert model more efficiently and reasonably, enabling the hybrid expert model as a whole to be trained more efficiently and with higher quality.
[0148] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0149] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0150] like Figure 7 As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded into random access memory (RAM) 703 from storage unit 708. The RAM 703 may also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.
[0151] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0152] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as methods for training hybrid expert models. For example, in some embodiments, the method for training a hybrid expert model can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the method for training a hybrid expert model described above can be performed. Alternatively, in other embodiments, the computing unit 701 can be configured to perform the method for training a hybrid expert model by any other suitable means (e.g., by means of firmware).
[0153] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0154] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0155] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0156] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0157] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0158] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is established by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, also known as cloud computing servers or cloud hosts, which are hosting products within the cloud computing service ecosystem to address the management difficulties and weak business scalability inherent in traditional physical hosts and Virtual Private Servers (VPS) services. Servers can also be categorized as distributed system servers or servers incorporating blockchain technology.
[0159] According to the technical solution of this disclosure, the basic affinity of each expert sub-model in the hybrid expert model to be assigned lexical units is determined; based on the current model capability value of the expert sub-model, the affinity adjustment parameters corresponding to each expert sub-model are determined; based on the basic affinity and the affinity adjustment parameters, the lexical units to be assigned are assigned to the corresponding expert sub-models; the expert sub-models are trained using the lexical units assigned to them to obtain the trained hybrid expert model, which is then used to process target scene data. Therefore, lexical units for training can be assigned to the expert sub-models in the hybrid expert model more efficiently and reasonably, enabling the hybrid expert model as a whole to be trained more efficiently and with higher quality.
[0160] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution provided in this disclosure can be achieved, and this is not limited herein.
[0161] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for training a hybrid expert model, characterized in that, include: Determine the basic affinity of each expert sub-model in the hybrid expert model for the lexical unit to be assigned; Based on the current model capability value of the expert sub-model, determine the affinity adjustment parameter corresponding to each expert sub-model; Based on the basic affinity and the affinity adjustment parameter, the lexical units to be assigned are assigned to the corresponding expert sub-models; The expert sub-model is trained using the lexical units assigned to it to obtain a trained hybrid expert model, which is then used to process the target scene data.
2. The method according to claim 1, characterized in that, The process of determining the affinity adjustment parameters corresponding to each expert sub-model based on the current model capability value of the expert sub-model includes: The total basic affinity is obtained by summing the individual basic affinity scores. Based on the total basic affinity and the number of expert sub-models, calculate the average model capability value; For each expert sub-model, the basic affinity of the expert sub-model to the word to be assigned is determined as the current model capability value of the expert sub-model; For each expert sub-model, the difference between the average model capability value and the current model capability value is calculated to obtain the capability difference value; Based on the capability difference, the affinity adjustment parameter corresponding to the expert sub-model is determined.
3. The method according to claim 2, characterized in that, The step of determining the affinity adjustment parameter corresponding to the expert sub-model based on the capability difference includes: In response to the capability difference being greater than or equal to 0, an affinity adjustment parameter corresponding to the expert sub-model is determined based on the product of the capability difference and a preset first coefficient; wherein the first coefficient is not 0.
4. The method according to claim 2, characterized in that, The step of determining the affinity adjustment parameter corresponding to the expert sub-model based on the capability difference includes: In response to the capability difference being less than 0, the value of the affinity adjustment parameter corresponding to the expert sub-model is determined to be 0.
5. The method according to claim 3, characterized in that, Based on the product of the capability difference and a preset first coefficient, the affinity adjustment parameter corresponding to the expert sub-model is determined, including: In response to training the hybrid expert model including at least two training rounds, the round affinity adjustment parameter of the expert sub-model in the current training round is determined based on the product of the capability difference and a preset first coefficient, and the historical affinity adjustment parameter of the expert sub-model in the previous training round; wherein, the first coefficient is determined based on the dimensional difference between the capability difference and the historical affinity adjustment parameter, and there is at least one historical training round before the current training round.
6. The method according to claim 2, characterized in that, The step of determining the affinity adjustment parameter corresponding to the expert sub-model based on the capability difference includes: In response to training the hybrid expert model, which includes at least two training rounds, the expert sub-model's round affinity adjustment parameter for the current training round is determined based on the capability difference of the expert sub-model in the current training round and the historical lexical load value in the previous training round; wherein, at least one historical training round exists before the current training round.
7. The method according to claim 6, characterized in that, Also includes: The total historical lexical load value is obtained by summing the historical lexical load values of each expert sub-model in the previous training round. The average historical lexical load value is calculated based on the total historical lexical load value and the number of expert sub-models. Correspondingly, based on the capability difference of the expert sub-model in the current training round and the historical lexical load value in the previous training round, the round affinity adjustment parameter of the expert sub-model in the current training round is determined, including: In response to the fact that the historical lexical load value of the expert sub-model in the previous training round is greater than the average historical lexical load value, the round affinity adjustment parameter of the expert sub-model in the current training round is determined based on the product of the capability difference in the current training round and a preset second coefficient; wherein, the second coefficient is not 0.
8. The method according to claim 6, characterized in that, Also includes: The total historical lexical load value is obtained by summing the historical lexical load values of each expert sub-model in the previous training round. The average historical lexical load value is calculated based on the total historical lexical load value and the number of expert sub-models. Correspondingly, based on the capability difference of the expert sub-model in the current training round and the historical lexical load value in the previous training round, the round affinity adjustment parameter of the expert sub-model in the current training round is determined, including: In response to the fact that the historical lexical load value of the expert sub-model in the previous training round is less than or equal to the average historical lexical load value, the round affinity adjustment parameter of the expert sub-model in the current training round is determined based on the product of the capability difference in the current training round and a preset third coefficient; wherein, the third coefficient is the negative of the second coefficient.
9. The method according to claim 2, characterized in that, The step of determining the affinity adjustment parameter corresponding to the expert sub-model based on the capability difference includes: In response to the training of the hybrid expert model comprising at least two training rounds, the affinity adjustment parameter of the expert sub-model in the current training round is determined based on the capability difference of the expert sub-model in the current training round and the historical affinity adjustment parameter corresponding to the previous training round; wherein, there is at least one historical training round prior to the current training round.
10. The method according to claim 9, characterized in that, Based on the capability difference of the expert sub-model in the current training round and the historical affinity adjustment parameter corresponding to the previous training round, the affinity adjustment parameter of the expert sub-model in the current training round is determined, including: The product of the historical affinity adjustment parameter of the expert sub-model corresponding to the previous training round and the preset fourth coefficient is calculated to obtain the product result; wherein, the fourth coefficient is not 0; Based on the capability difference of the expert sub-model in the current training round and the product result, the round affinity adjustment parameter of the expert sub-model corresponding to the current training round is determined.
11. The method according to claim 2, characterized in that, The step of determining the affinity adjustment parameter corresponding to the expert sub-model based on the capability difference includes: In response to training the hybrid expert model, which includes at least two training rounds, the expert sub-model's round affinity adjustment parameter in the current training round is determined based on the ability difference of the expert sub-model in the current training round, the historical affinity adjustment parameter corresponding to the previous training round, and the historical lexical load value of the previous training round; wherein, there is at least one historical training round before the current training round.
12. The method according to any one of claims 5-11, characterized in that, The step of assigning the unassigned lexical units to the corresponding expert sub-models based on the base affinity and the affinity adjustment parameters includes: Based on the basic affinity and the round affinity adjustment parameters, the lexical units to be assigned are assigned to the corresponding expert sub-models.
13. An apparatus for training a hybrid expert model, characterized in that, include: The base affinity determination unit is configured to determine the base affinity of each expert sub-model to be assigned in the hybrid expert model; The adjustment parameter determination unit is configured to determine the affinity adjustment parameters corresponding to each of the expert sub-models based on the current model capability value of the expert sub-model. The lexical allocation unit is configured to allocate the lexical to be allocated to the corresponding expert sub-model based on the basic affinity and the affinity adjustment parameter; The model training unit is configured to train the expert sub-model using the lexical units assigned to it, thereby obtaining a trained hybrid expert model for processing target scene data.
14. A hybrid expert model, comprising multiple expert sub-models, characterized in that, The plurality of expert sub-models are trained by the method described in any one of claims 1-12.
15. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method for training a hybrid expert model as described in any one of claims 1-12.
16. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method of training a hybrid expert model according to any one of claims 1-12.
17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for training a hybrid expert model according to any one of claims 1-12.