A hybrid expert model construction method, device, equipment and storage medium
Through the hybrid expert model construction method, multiple domain expert models are dynamically selected and combined, which solves the performance bottleneck and catastrophic forgetting problem of a single model in complex problem processing, achieves more efficient and accurate solutions, and enhances the model's Adaptability.
Patent Information
- Application Number
- CN202410780437.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-18
AI Technical Summary
A single model faces performance bottlenecks and catastrophic forgetting problems when dealing with complex problems, especially when multiple types of data and knowledge need to be integrated, resulting in insufficient model performance in specific fields and difficulty in adapting to new tasks.
A hybrid expert model construction method is adopted to pre-train vertical expert models, use gating mechanisms to activate and fine-tune, form an integrated framework and perform format conversion, and dynamically select and combine multiple domain expert models to handle complex problems.
It improves the accuracy and efficiency of problem solving, avoids catastrophic forgetting, enhances the adaptability and long-term application value of the model, and can provide more accurate and efficient solutions to complex problems.
Smart Images

Figure CN118350412B
Abstract
Description
Technical Field
[0001] The present invention discloses a hybrid expert model construction method, device, equipment and storage medium, and relates to the technical field of artificial intelligence and machine learning. Background Art
[0002] With the improvement of big data and computing power, artificial intelligence technology has been widely used in many fields. Traditional single-model machine learning methods face significant challenges when dealing with complex problems. These challenges mainly stem from the fact that a single model may encounter performance bottlenecks when trying to integrate multiple types of data and knowledge, especially the catastrophic forgetting problem. This phenomenon occurs when a model forgets previously learned tasks or knowledge when faced with a new task, resulting in insufficient performance of the model in a specific field.
[0003] In addition, a single model may not achieve optimal performance when handling diverse tasks, because different tasks may require different data representation and processing strategies. For example, in the financial field, a model may need to have multiple capabilities such as financial market analysis, corporate financial report interpretation, and macroeconomic indicator forecasting. Existing technologies usually rely on extensive training of a single model, but this can lead to insufficient performance of the model in specific areas and the risk of forgetting old tasks when facing new tasks.
[0004] To address these issues, a new hybrid model architecture is needed that can combine the advantages of different expert models while avoiding catastrophic forgetting. Summary of the invention
[0005] In view of the problems of the prior art, the present invention provides a hybrid expert model construction method, device, equipment and storage medium, and the technical solution adopted is:
[0006] In a first aspect, a hybrid expert model construction method includes:
[0007] S1, based on each vertical expert model, professional capabilities in the corresponding field are learned through pre-training;
[0008] S2, according to the gating mechanism, activating by selecting the corresponding vertical expert model;
[0009] S3, using the activated vertical expert model as an integration framework, and obtaining the output weight of each vertical expert model through a gating mechanism analysis;
[0010] S4, according to the input of the complex problem, format conversion is performed through the integrated framework to obtain a hybrid expert model;
[0011] S5, according to the hybrid expert model, fine-tuning is performed using Formula 4:
[0012] Formula 4
[0013] in, represents the fine-tuned model parameters, Represents a training dataset for complex problems in the corresponding field.
[0014] In some implementations, S1 specifically includes:
[0015] S11, based on the general large model, use the data of the corresponding field to make fine adjustments according to Formula 1;
[0016] Formula 1
[0017] in, represents the parameters of the vertical expert model, represents the loss function, Represents the training dataset of the corresponding field;
[0018] S12, forming an expert model of user interaction and tool calling through pre-training according to Formula 2;
[0019] Formula 2
[0020] in, represents the parameters of the user interaction expert model, A training dataset representing user interaction and tool usage;
[0021] The expert model of user interaction and tool calling is used to call the networking tool and parse the formatted file returned by the networking.
[0022] In some implementations, S2 specifically includes:
[0023] S21, setting a gating network, receiving vectorized input through the gating network, and performing feature analysis to output a probability distribution, wherein the probability distribution represents the confidence of each vertical expert model;
[0024] Wherein, the gating network is expressed as Formula 3:
[0025] Formula 3
[0026] in, and are the weight matrix and bias vector of the gating network respectively, is the softmax function, which is used to normalize the output into a probability distribution;
[0027] S22, selecting the top k vertical category expert models with the highest confidence levels for activation.
[0028] In some implementations, S4 specifically includes:
[0029] S41, according to the input of the complex question received, weightedly merging the output results of each of the vertical expert models;
[0030] S42, repeat step S41 to form a unified hybrid expert model.
[0031] In a second aspect, an embodiment of the present invention provides a hybrid expert model construction device, comprising:
[0032] The vertical category learning module is used to learn professional capabilities in the corresponding field through pre-training based on each vertical category expert model;
[0033] A model activation module, used for activating the corresponding vertical expert model by selecting it according to the gating mechanism;
[0034] A weight setting module, used to use the activated vertical expert model as an integration framework and obtain the output weight of each vertical expert model through a gating mechanism analysis;
[0035] A model mixing module, used for receiving input of complex problems and converting the format through the integrated framework to obtain a mixed expert model;
[0036] The model optimization module is used to perform fine-tuning processing according to the hybrid expert model through Formula 4:
[0037] Formula 4
[0038] in, represents the fine-tuned model parameters, Represents a training dataset for complex problems in the corresponding field.
[0039] In some implementations, the vertical learning module specifically includes:
[0040] A model fine-tuning unit, used to perform fine-tuning according to Formula 1 based on the general large model using data from the corresponding field;
[0041] Formula 1
[0042] in, represents the parameters of the vertical expert model, represents the loss function, Represents the training dataset of the corresponding field;
[0043] The output unit is optimized to form an expert model of user interaction and tool calling according to Formula 2 through pre-training;
[0044] Formula 2
[0045] in, represents the parameters of the user interaction expert model, A training dataset representing user interaction and tool usage;
[0046] The expert model of user interaction and tool calling is used to call the networking tool and parse the formatted file returned by the networking.
[0047] In some implementations, the model activation module specifically includes:
[0048] A gate generation unit, used to set a gate network, accept vectorized input through the gate network, and perform feature analysis to output a probability distribution, wherein the probability distribution represents the confidence of each vertical expert model;
[0049] Wherein, the gating network is expressed as Formula 3:
[0050] Formula 3
[0051] in, and are the weight matrix and bias vector of the gating network respectively, is the softmax function, which is used to normalize the output into a probability distribution;
[0052] The model activation unit is used to select the top k vertical category expert models with the highest confidence for activation. At the same time, the confidence can also be called the expert's weight. The weight values of the top k vertical category experts with the highest confidence are normalized by softmax to obtain the corresponding weight of the expert.
[0053] In some implementations, the model mixing module specifically includes:
[0054] A weighted fusion unit, used for weighted merging of the output results of each vertical expert model according to the input of the complex problem received;
[0055] The fusion output unit is used to repeat the weighted fusion unit operation to form a unified hybrid expert model.
[0056] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein when the one or more computer instructions are executed by the processor, the method described in the first aspect above is implemented.
[0057] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the method described in the first aspect.
[0058] One or more embodiments of the present invention can bring at least the following beneficial effects:
[0059] Improve the accuracy of problem solving: Through expert models specifically targeting different fields, the present invention can provide more accurate and professional solutions.
[0060] Avoiding catastrophic forgetting: The gating mechanism and the integration framework work together to ensure that the model does not forget the knowledge of old tasks when tackling new tasks.
[0061] Improve efficiency: By dynamically calling the most appropriate expert model, the present invention can handle complex problems more efficiently and reduce unnecessary consumption of computing resources.
[0062] Enhanced adaptability: The feedback loop mechanism enables the system to continuously learn and adapt to new data and problems, improving the long-term application value of the model.
[0063] The present invention can provide more accurate and efficient solutions to complex problems by dynamically selecting and combining multiple domain expert models. At the same time, the feedback loop mechanism enables the system to continuously learn and adapt to new data and problems, enhancing the long-term application value of the model. The hybrid expert model construction method, device, equipment and storage medium have broad application prospects in complex problem situations such as financial analysis, market research, and medical diagnosis that require processing and analysis of large amounts of heterogeneous data. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] 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 labor.
[0065] Figure 1 is a flow chart of a hybrid expert model construction method provided by an embodiment of the present invention;
[0066] Figure 2 It is a block diagram of a hybrid expert model construction device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0067] The technical solutions 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 only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0068] Embodiment 1:
[0069] Figure 1 A flow chart of a hybrid expert model construction method is shown in FIG. Figure 1 As shown, the hybrid expert model construction method provided in this embodiment includes:
[0070] S1, based on each vertical expert model, professional capabilities in the corresponding field are learned through pre-training;
[0071] S2, according to the gating mechanism, activating by selecting the corresponding vertical expert model;
[0072] S3, using the activated vertical expert model as an integration framework, and obtaining the output weight of each vertical expert model through a gating mechanism analysis;
[0073] S4, according to the input of the complex problem, format conversion is performed through the integrated framework to obtain a hybrid expert model;
[0074] S5, according to the hybrid expert model, fine-tuning is performed using Formula 4:
[0075] Formula 4
[0076] in, represents the fine-tuned model parameters, Represents a training dataset for complex problems in the corresponding field.
[0077] In view of the complex problems in the financial field, when using the method of the present invention, firstly according to S1, a droop-type expert model is designed and trained:
[0078] Financial Knowledge Expert Model: Based on the general large model, it is fine-tuned using financial market data to enable it to process and analyze financial market data, corporate financial reports, and macroeconomic indicators. The fine-tuning process can be expressed as:
[0079] Formula 1
[0080] in, represents the parameters of the vertical expert model, represents the loss function, Represents the training dataset of the corresponding field.
[0081] User interaction expert model: Pre-train an expert model that focuses on user interaction and tool calls, so that it can skillfully understand under what circumstances to call online tools and analyze the formatted text returned by the network. The pre-training process can be expressed as:
[0082] Formula 2
[0083] in, represents the parameters of the user interaction expert model, A training dataset representing user interaction and tool usage.
[0084] Next, according to S2, develop an evaluation network (i.e., a gating network) that can receive vectorized input , analyze its characteristics, and output a probability distribution , indicating the confidence of selecting each candidate vertical category expert model. The gating network can be expressed as:
[0085] Formula 3
[0086] in, and are the weight matrix and bias vector of the gating network respectively, is the softmax function, which is used to normalize the output into a probability distribution.
[0087] According to the output of the gating network, the top k vertical category expert models with the highest confidence are selected for activation.
[0088] Next, according to S3, a hybrid expert module is designed and implemented, which includes a vertical expert model, a gating network, and a fusion module.
[0089] The gating network is responsible for determining and activating the vertical expert model suitable for processing the current input, that is, according to the formula in step 2 , and select the expert models corresponding to the first k maximum values.
[0090] Activated vertical expert model For input data Perform analysis and output analysis results . Each expert model can be expressed as:
[0091]
[0092] Then, the fusion module receives the outputs of all activated vertical expert models and performs weighted integration to form a unified output :
[0093] in, Output weight of the gating network corresponding to the i-th expert model.
[0094] Next, according to S4, the integration framework, as the core of the system, is responsible for receiving the input of complex problems and converting them into a format suitable for processing.
[0095] The input data first passes through the vectorization layer Convert to vector representation:
[0096]
[0097] Then through the causal scaling dot product attention network Perform feature extraction:
[0098]
[0099] Normalization layer Used to ensure that the outputs of different modules are standardized for effective integration:
[0100]
[0101] S44 Hybrid Expert Module In this framework, vertical expert models are selected, data is processed, and results are integrated:
[0102]
[0103] The attention layer, normalization layer, and hybrid expert module are combined into a composite module and replicated 31 times. Then, these 32 composite modules are connected in sequence to form a deep neural network. The output of each composite module is used as the input of the next composite module, and data processing is performed in turn. In this way, the model can gradually extract and analyze the high-level features of the input data, thereby improving the ability to handle complex problems.
[0104] The mathematical representation is as follows:
[0105] make Represents a composite module, including an attention layer , Normalization layer and hybrid expert modules . Then the composite module can be expressed as:
[0106] in, and Represent the input and output of the i-th composite module respectively.
[0107] Connect 32 composite modules in sequence to form a deep neural network:
[0108]
[0109] in, represents the input of the entire neural network, represents the output of the entire neural network, Represents the i-th composite module.
[0110] This sequential connection method allows the model to gradually extract and analyze high-level features of the input data, thereby improving its ability to handle complex problems.
[0111] Finally, the linear layer Map the output of a compound module to a final textual or other form of solution:
[0112]
[0113] By integrating all layers and expert models, a unified hybrid expert model architecture is formed.
[0114] Finally, according to S5, after the system is assembled, efficient fine-tuning methods such as LoRA (Low-Rank Adaptation) are applied, and the expert layer and non-expert layer are frozen respectively using the data samples of complex problems in the financial field that are manually labeled, and the model is fine-tuned to enhance the system's ability to handle complex financial problems. The fine-tuning process can be expressed as:
[0115] Formula 4
[0116] in, represents the fine-tuned model parameters, A training dataset representing complex problems in the financial domain.
[0117] Through the above steps, the hybrid expert model complex problem solution of the present invention can provide efficient and accurate solutions in multiple fields, and has good adaptability and scalability. This implementation not only solves the performance bottleneck and catastrophic forgetting problem of a single model when processing multiple tasks, but also improves the overall efficiency and accuracy of problem solving.
[0118] The method embodiment of the present invention combines multiple vertical domain expert models that have undergone specific pre-training or fine-tuning steps, each model focusing on different capabilities, thereby forming a powerful hybrid expert model system. For example, expert model No. 1 focuses on learning financial knowledge to make it an expert in the financial field; expert model No. 2 focuses on training tool calling capabilities and general Chinese and English communication capabilities to improve the efficiency of interaction with users. The hybrid expert model of the present invention can dynamically call corresponding expert models for different problems, provide customized solutions, and significantly improve the accuracy and efficiency of complex problem handling.
[0119] Embodiment 2:
[0120] Figure 2 A block diagram of a hybrid expert model building device is shown, Figure 2 As shown, the hybrid expert model building device provided in this embodiment includes:
[0121] The vertical category learning module is used to learn professional capabilities in the corresponding field through pre-training based on each vertical category expert model;
[0122] A model activation module, used for activating the corresponding vertical expert model by selecting it according to the gating mechanism;
[0123] A weight setting module, used to use the activated vertical expert model as an integration framework and obtain the output weight of each vertical expert model through a gating mechanism analysis;
[0124] A model mixing module, used for receiving input of complex problems and converting the format through the integrated framework to obtain a mixed expert model;
[0125] The model optimization module is used to perform fine-tuning processing according to the hybrid expert model through Formula 4:
[0126] Formula 4
[0127] in, represents the fine-tuned model parameters, Represents a training dataset for complex problems in the corresponding field.
[0128] Furthermore, the vertical learning module specifically includes:
[0129] A model fine-tuning unit, used to perform fine-tuning according to Formula 1 based on the general large model using data from the corresponding field;
[0130] Formula 1
[0131] in, represents the parameters of the vertical expert model, represents the loss function, Represents the training dataset of the corresponding field;
[0132] The output unit is optimized to form an expert model of user interaction and tool calling according to Formula 2 through pre-training;
[0133] Formula 2
[0134] in, represents the parameters of the user interaction expert model, A training dataset representing user interaction and tool usage;
[0135] The expert model of user interaction and tool calling is used to call the networking tool and parse the formatted file returned by the networking.
[0136] Furthermore, the model activation module specifically includes:
[0137] A gate generation unit, used to set a gate network, accept vectorized input through the gate network, and perform feature analysis to output a probability distribution, wherein the probability distribution represents the confidence of each vertical expert model;
[0138] Wherein, the gating network is expressed as Formula 3:
[0139] Formula 3
[0140] in, and are the weight matrix and bias vector of the gating network respectively, is the softmax function, which is used to normalize the output into a probability distribution;
[0141] The model activation unit is used to select the top k vertical category expert models with the highest confidence for activation.
[0142] Furthermore, the model mixing module specifically includes:
[0143] A weighted fusion unit, used for weighted merging of the output results of each vertical expert model according to the input of the complex problem received;
[0144] The fusion output unit is used to repeat the weighted fusion unit operation to form a unified hybrid expert model.
[0145] Embodiment three:
[0146] This embodiment further provides an electronic device, including a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions implement the method of embodiment 1 when executed by the processor;
[0147] In practical applications, the processor can be an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a controller, a microcontroller unit (MCU), a microprocessor or other electronic components to execute the methods in the above embodiments.
[0148] The method implemented in this embodiment is as described in Embodiment 1.
[0149] Embodiment 4:
[0150] This embodiment further provides a computer storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, the method of the first embodiment is implemented;
[0151] Among them, the computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0152] The method implemented in this embodiment includes:
[0153] The method implemented in this embodiment is as described in Embodiment 1.
[0154] In the several embodiments provided in the embodiments of the present invention, it should be understood that the disclosed system and method can also be implemented in other ways. The system and method embodiments described above are merely illustrative.
[0155] It should be noted that, in this article, the terms "first", "second", etc. in the specification of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. The terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0156] Although the embodiments disclosed in the present invention are as above, the contents described are only embodiments adopted for facilitating the understanding of the present invention and are not intended to limit the present invention. Any person skilled in the art of the present invention may make any modification and change in the form and details of the implementation without departing from the spirit and scope disclosed in the present invention, but the patent protection of the present invention shall still be subject to the attached specification.
Claims
1. A method for constructing a hybrid expert model, characterized in that: include: S1, based on each vertical expert model, professional capabilities in the corresponding field are learned through pre-training; S2, according to the gating mechanism, activating by selecting the corresponding vertical expert model; S3, using the activated vertical expert model as an integration framework, and obtaining the output weight of each vertical expert model through a gating mechanism analysis; S4, according to the input of the complex problem, format conversion is performed through the integrated framework to obtain a hybrid expert model; S5, according to the hybrid expert model, fine-tuning is performed using the following formula 4: Formula 4 in, represents the fine-tuned model parameters, Represents a training dataset of complex problems in the corresponding field; S1, specifically includes: S11, fine-tuning according to Formula 1 using data from the corresponding field based on the general large model; Formula 1 in, represents the parameters of the vertical expert model, represents the loss function, Represents the training dataset of the corresponding field; S12, forming an expert model of user interaction and tool calling through pre-training according to Formula 2; Formula 2 in, represents the parameters of the user interaction expert model, A training dataset representing user interaction and tool usage; The user interaction and tool calling expert model is used to call the networking tool and parse the formatted text returned by the networking; S2, specifically includes: S21, setting a gating network, accepting vectorized input through the gating network, and performing feature analysis to output probability distribution, wherein the probability distribution represents the confidence of each vertical category expert model; Wherein, the gating network is expressed as Formula 3: Formula 3 in, and are the weight matrix and bias vector of the gating network respectively, is the softmax function, which is used to normalize the output into a probability distribution; S22, selecting the top k vertical category expert models with the highest confidence levels for activation; According to S3, a hybrid expert module is designed and implemented, including a vertical expert model, a gating network, and a fusion module; the gating network is responsible for determining and activating the vertical expert model suitable for processing the current input; Activated vertical expert model For input data Perform analysis and output analysis results ; Each expert model is represented as: Then, the fusion module receives the outputs of all activated vertical expert models and performs weighted integration to form a unified output : in, Output weight of the gating network corresponding to the i-th expert model; According to S4, the integration framework, as the core of the system, is responsible for receiving inputs of complex problems and converting them into a format suitable for processing; The input data first passes through the vectorization layer Convert to vector representation: Then through the causal scaling dot product attention network Perform feature extraction: Normalization layer Used to ensure that the outputs of different modules are standardized for effective integration: S44 Hybrid Expert Module In this framework, vertical expert models are selected, data is processed, and results are integrated: The attention layer, normalization layer, and hybrid expert module are combined into a composite module, which is replicated 31 times. Then, these 32 composite modules are connected in sequence to form a deep neural network. The output of each composite module is used as the input of the next composite module, and data processing is performed in sequence. In this way, the model gradually extracts and analyzes high-level features of the input data. The mathematical representation is as follows: make Represents a composite module, including an attention layer , Normalization layer and hybrid expert modules ; Then the composite module can be expressed as: in, and Respectively represent the input and output of the i-th composite module; Connect 32 composite modules in sequence to form a deep neural network: in, represents the input of the entire neural network, represents the output of the entire neural network, represents the i-th composite module; This sequential connection method allows the model to gradually extract and analyze high-level features of the input data, thereby improving the ability to handle complex problems; Finally, the linear layer Map the output of a compound module to a final textual or other form of solution: By integrating all layers and expert models, a unified hybrid expert model architecture is formed.
2. The method according to claim 1, characterized in that: S4, specifically includes: S41, according to the input of the complex question received, weightedly merging the output results of each of the vertical expert models; S42, repeat step S41 to form a unified hybrid expert model.
3. A hybrid expert model construction device, characterized in that: include: The vertical category learning module is used to learn professional capabilities in the corresponding field through pre-training based on each vertical category expert model; A model activation module, used for activating the corresponding vertical expert model by selecting it according to the gating mechanism; A weight setting module, used to use the activated vertical expert model as an integration framework and obtain the output weight of each vertical expert model through a gating mechanism analysis; A model mixing module, used for receiving input of complex problems and converting the format through the integrated framework to obtain a mixed expert model; The model optimization module is used to perform fine-tuning processing according to the hybrid expert model through Formula 4: Formula 4 in, represents the fine-tuned model parameters, A training dataset representing complex problems in the corresponding field; The vertical learning modules specifically include: A model fine-tuning unit, used to perform fine-tuning according to Formula 1 based on the general large model using data from the corresponding field; Formula 1 in, represents the parameters of the vertical expert model, represents the loss function, Represents the training dataset of the corresponding field; The output unit is optimized to form an expert model of user interaction and tool calling according to Formula 2 through pre-training; Formula 2 in, represents the parameters of the user interaction expert model, A training dataset representing user interaction and tool usage; The user interaction and tool calling expert model is used to call the networking tool and parse the formatted text returned by the networking; The model activation module specifically includes: A gate generation unit, used to set a gate network, accept vectorized input through the gate network, and perform feature analysis to output a probability distribution, wherein the probability distribution represents the confidence of each vertical expert model; Wherein, the gating network is expressed as Formula 3: Formula 3 in, and are the weight matrix and bias vector of the gating network respectively, is the softmax function, which is used to normalize the output into a probability distribution; A model activation unit, used to select the top k vertical category expert models with the highest confidence for activation; According to S3, a hybrid expert module is designed and implemented, including a vertical expert model, a gating network, and a fusion module; the gating network is responsible for determining and activating the vertical expert model suitable for processing the current input; Activated vertical expert model For input data Perform analysis and output analysis results ; Each expert model is represented as: Then, the fusion module receives the outputs of all activated vertical expert models and performs weighted integration to form a unified output : in, Output weight of the gating network corresponding to the i-th expert model; According to S4, the integration framework, as the core of the system, is responsible for receiving inputs of complex problems and converting them into a format suitable for processing; The input data first passes through the vectorization layer Convert to vector representation: Then through the causal scaling dot product attention network Perform feature extraction: Normalization layer Used to ensure that the outputs of different modules are standardized for effective integration: S44 Hybrid Expert Module In this framework, vertical expert models are selected, data is processed, and results are integrated: The attention layer, normalization layer, and hybrid expert module are combined into a composite module, which is replicated 31 times. Then, these 32 composite modules are connected in sequence to form a deep neural network. The output of each composite module is used as the input of the next composite module, and data processing is performed in sequence. In this way, the model gradually extracts and analyzes high-level features of the input data. The mathematical representation is as follows: make Represents a composite module, including an attention layer , Normalization layer and hybrid expert modules ; Then the composite module can be expressed as: in, and Respectively represent the input and output of the i-th composite module; Connect 32 composite modules in sequence to form a deep neural network: in, represents the input of the entire neural network, represents the output of the entire neural network, represents the i-th composite module; This sequential connection method allows the model to gradually extract and analyze high-level features of the input data, thereby improving the ability to handle complex problems; Finally, the linear layer Map the output of a compound module to a final textual or other form of solution: By integrating all layers and expert models, a unified hybrid expert model architecture is formed.
4. The device according to claim 3, characterized in that The model mixing module specifically includes: A weighted fusion unit, used for weighted merging of the output results of each vertical expert model according to the input of the complex problem received; The fusion output unit is used to repeat the weighted fusion unit operation to form a unified hybrid expert model.
5. An electronic device, characterized in that: It comprises a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein when the one or more computer instructions are executed by the processor, the hybrid expert model construction method as described in any one of claims 1-2 is implemented.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the hybrid expert model construction method as described in any one of claims 1 to 2.
Citation Information
Patent Citations
Multi-task NL2SQL method based on double-layer multi-gating expert hybrid model (MMOE)
CN115809314A
Transfer learning architecture and method, electronic equipment and storage medium
CN116245141A
Big data transaction and quality evaluation method and system taking big language model as medium
CN117332247A
Method and system for improving structure of language model based on hybrid expert model
CN118194917A
Recommendation method and apparatus, and training method and apparatus
WO2023221928A1
